carlcaulkett
carlcaulkett
MModular
Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
No, there was no warning at all! I tweeted Oracle Cloud to point out the issue, and then I tweeted Larry Ellison himself. I doubt whether he will respond...
494 replies
MModular
Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
I've just been reading about Larry Ellison on Wikipedia; I don't think he's going to starve any time soon 😡
494 replies
MModular
Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
This was the email I received a few days ago...
Dear Customer,

This letter is to inform you that your Cloud Services described below were terminated on Monday, April 7, 2025 03:16 AM Coordinated Universal Time.

The termination stopped all running services and purged the data. All data was deleted and is non-recoverable.

For any further assistance, please contact Oracle Support.
Dear Customer,

This letter is to inform you that your Cloud Services described below were terminated on Monday, April 7, 2025 03:16 AM Coordinated Universal Time.

The termination stopped all running services and purged the data. All data was deleted and is non-recoverable.

For any further assistance, please contact Oracle Support.
Absolutely no warning, whatsoever 😡 As a piece of customer relations, it stinks to high heaven, and will ensure that I never have anything to do with Oracle again.
494 replies
MModular
Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
In any case it's all a bit immaterial because those scumbags at Oracle have just deleted the free tier account that I had foolishly and naively thought would continue indefinitely. @Owen Hilyard, do you know why Oracle would just delete my account with no warning or opportunity to extend it?
494 replies
MModular
Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
I tried it with...
[project]
authors = ["Carl Caulkett <[email protected]>"]
channels = [
"conda-forge",
"https://conda.modular.com/max-nightly",
"https://repo.prefix.dev/mojo-community",
"https://repo.prefix.dev/modular-community",
]

description = "Testing a2svior's lightbug_http web server package"
name = "ca_web"
platforms = ["osx-arm64"]
version = "0.2.0"

[tasks]
default = "magic run mojo client.mojo"

[dependencies]
max = "=25.2.0"
lightbug_http = "=0.1.17"
[project]
authors = ["Carl Caulkett <[email protected]>"]
channels = [
"conda-forge",
"https://conda.modular.com/max-nightly",
"https://repo.prefix.dev/mojo-community",
"https://repo.prefix.dev/modular-community",
]

description = "Testing a2svior's lightbug_http web server package"
name = "ca_web"
platforms = ["osx-arm64"]
version = "0.2.0"

[tasks]
default = "magic run mojo client.mojo"

[dependencies]
max = "=25.2.0"
lightbug_http = "=0.1.17"
but i get the same error...
/Users/carlcaulkett/Code/Mojo/ca_web/.magic/envs/default/lib/mojo/small_time.mojopkg:0:0: error: unknown attribute code: 36
/Users/carlcaulkett/Code/Mojo/ca_web/client.mojo:1:1: error: failed to materialize top-level module
from lightbug_http import HTTPService, HTTPRequest, HTTPResponse, OK, NotFound, Server
^
/Users/carlcaulkett/Code/Mojo/ca_web/.magic/envs/default/bin/mojo: error: failed to parse the provided Mojo source module
/Users/carlcaulkett/Code/Mojo/ca_web/.magic/envs/default/lib/mojo/small_time.mojopkg:0:0: error: unknown attribute code: 36
/Users/carlcaulkett/Code/Mojo/ca_web/client.mojo:1:1: error: failed to materialize top-level module
from lightbug_http import HTTPService, HTTPRequest, HTTPResponse, OK, NotFound, Server
^
/Users/carlcaulkett/Code/Mojo/ca_web/.magic/envs/default/bin/mojo: error: failed to parse the provided Mojo source module
494 replies
MModular
Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
I tried chaging to...
[dependencies]
max = "=25.2.0"
lightbug_http = "=0.1.17"
[dependencies]
max = "=25.2.0"
lightbug_http = "=0.1.17"
but that failed with...
/Users/carlcaulkett/Code/Mojo/ca_web/.magic/envs/default/lib/mojo/small_time.mojopkg:0:0: error: unknown attribute code: 36
/Users/carlcaulkett/Code/Mojo/ca_web/client.mojo:1:1: error: failed to materialize top-level module
from lightbug_http import HTTPService, HTTPRequest, HTTPResponse, OK, NotFound, Server
^
/Users/carlcaulkett/Code/Mojo/ca_web/.magic/envs/default/bin/mojo: error: failed to parse the provided Mojo source module
/Users/carlcaulkett/Code/Mojo/ca_web/.magic/envs/default/lib/mojo/small_time.mojopkg:0:0: error: unknown attribute code: 36
/Users/carlcaulkett/Code/Mojo/ca_web/client.mojo:1:1: error: failed to materialize top-level module
from lightbug_http import HTTPService, HTTPRequest, HTTPResponse, OK, NotFound, Server
^
/Users/carlcaulkett/Code/Mojo/ca_web/.magic/envs/default/bin/mojo: error: failed to parse the provided Mojo source module
Any ideas? Looks like it's back to...
[dependencies]
max = "=25.1.0"
lightbug_http = "=0.1.16"
[dependencies]
max = "=25.1.0"
lightbug_http = "=0.1.16"
For the time being. Thoughts, @a2svior?
494 replies
MModular
Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
Does this mean that Lightbug has moved to a 0.1.17 version which is not compatible?
494 replies
MModular
Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
Great! That worked 🙂
494 replies
MModular
Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
Here is my mojoproject.toml. Nothing has changed since halfway through March when we were celebrating many days of continuous live deployment at Oracle...
[project]
authors = ["Carl Caulkett <[email protected]>"]
channels = [
"conda-forge",
"https://conda.modular.com/max-nightly",
"https://repo.prefix.dev/mojo-community",
]

description = "Testing a2svior's lightbug_http web server package"
name = "ca_web"
platforms = ["osx-arm64"]
version = "0.2.0"

[tasks]
default = "magic run mojo client.mojo"

[dependencies]
max = "=25.1.0"
lightbug_http = ">=0.1.16"
[project]
authors = ["Carl Caulkett <[email protected]>"]
channels = [
"conda-forge",
"https://conda.modular.com/max-nightly",
"https://repo.prefix.dev/mojo-community",
]

description = "Testing a2svior's lightbug_http web server package"
name = "ca_web"
platforms = ["osx-arm64"]
version = "0.2.0"

[tasks]
default = "magic run mojo client.mojo"

[dependencies]
max = "=25.1.0"
lightbug_http = ">=0.1.16"
494 replies
MModular
Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
Yeah! I had a sneaking suspicion that it was somegthing similar to last time - the error messages didn't seem like standard programming error messages...
494 replies
MModular
Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
@a2svior I do't know if it's because of the new Mojo build, but my ca_web repo is suddenly not building, with...
/Users/carlcaulkett/Code/Mojo/ca_web/.magic/envs/default/lib/mojo/lightbug_http.mojopkg:0:0: error: unexpected trailing bytes after Attribute entry
/Users/carlcaulkett/Code/Mojo/ca_web/client.mojo:1:6: error: failed to materialize top-level module
from lightbug_http import HTTPService, HTTPRequest, HTTPResponse, OK, NotFound, Server
^
/Users/carlcaulkett/Code/Mojo/ca_web/.magic/envs/default/bin/mojo: error: failed to parse the provided Mojo source module
/Users/carlcaulkett/Code/Mojo/ca_web/.magic/envs/default/lib/mojo/lightbug_http.mojopkg:0:0: error: unexpected trailing bytes after Attribute entry
/Users/carlcaulkett/Code/Mojo/ca_web/client.mojo:1:6: error: failed to materialize top-level module
from lightbug_http import HTTPService, HTTPRequest, HTTPResponse, OK, NotFound, Server
^
/Users/carlcaulkett/Code/Mojo/ca_web/.magic/envs/default/bin/mojo: error: failed to parse the provided Mojo source module
Has anything changed in your side? Any chance of having a look? https://github.com/carlca/ca_web.git
494 replies
MModular
Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
Still running after 3 days 🎉🥳🍻
[opc@ca-web-arm ~]$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c49b65e8f80d ghcr.io/carlca/magic-image:latest "magic run default" 3 days ago Up 3 days 0.0.0.0:8080->8080/tcp, :::8080->8080/tcp ca-web-container
f2944de77a11 hello-world "/hello" 4 weeks ago Exited (0) 4 weeks ago objective_yonath
[opc@ca-web-arm ~]$
[opc@ca-web-arm ~]$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c49b65e8f80d ghcr.io/carlca/magic-image:latest "magic run default" 3 days ago Up 3 days 0.0.0.0:8080->8080/tcp, :::8080->8080/tcp ca-web-container
f2944de77a11 hello-world "/hello" 4 weeks ago Exited (0) 4 weeks ago objective_yonath
[opc@ca-web-arm ~]$
494 replies
MModular
Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
</html>[opc@ca-web-adocker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c49b65e8f80d ghcr.io/carlca/magic-image:latest "magic run default" 26 hours ago Up 26 hours 0.0.0.0:8080->8080/tcp, :::8080->8080/tcp ca-web-container
f2944de77a11 hello-world "/hello" 3 weeks ago Exited (0) 3 weeks ago objective_yonath
[opc@ca-web-arm ~]$
</html>[opc@ca-web-adocker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c49b65e8f80d ghcr.io/carlca/magic-image:latest "magic run default" 26 hours ago Up 26 hours 0.0.0.0:8080->8080/tcp, :::8080->8080/tcp ca-web-container
f2944de77a11 hello-world "/hello" 3 weeks ago Exited (0) 3 weeks ago objective_yonath
[opc@ca-web-arm ~]$
@a2svior It still has problems, occasionally, connecting to the web site, but I think this may be more to do with the fact that I'm using the free-tier service from Oracle (words that I thought I would never use in the same sentence 😉) rather than any software related issue.
494 replies
MModular
Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
Interesting! Looks like we have a Gemini 2.0 Flash vs Claude AI faceoff 😉 I agree about the redundent docker start command. Also, I've discovered that after running this script, it seems to take Oracle about a minute or so before it will star receiving web requests again. I like the addition of the --restart unless-stopped flag. I've just looked it up and it seems totally appropriate for my situation. Thanks for the heads up 🙏🏽
494 replies
MModular
Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
# 2. Remove the existing container (if it exists)
echo "- Removing existing container '$CONTAINER_NAME' (if it exists)..."
docker rm "$CONTAINER_NAME"
RM_EXIT_CODE=$? # Capture exit code of 'docker rm'

if [ $RM_EXIT_CODE -eq 0 ]; then
echo " ✓ Container '$CONTAINER_NAME' removed successfully (if it existed)."
else
echo " ⓘ Container '$CONTAINER_NAME' did not exist or remove command failed (exit code: $RM_EXIT_CODE). Proceeding with image pull."
fi
echo ""

# 3. Pull the latest Docker image from GHCR
echo "- Pulling latest Docker image '$IMAGE_NAME' from GHCR..."
docker pull "$IMAGE_NAME"
PULL_EXIT_CODE=$? # Capture exit code of 'docker pull'

if [ $PULL_EXIT_CODE -eq 0 ]; then
echo " ✓ Docker image '$IMAGE_NAME' pulled successfully."
else
echo " ✗ ERROR: Failed to pull Docker image '$IMAGE_NAME' (exit code: $PULL_EXIT_CODE). Aborting."
exit 1 # Exit script with error code
fi
echo ""

# 4. Run a new container from the pulled image
echo "- Running new container '$CONTAINER_NAME' from image '$IMAGE_NAME'..."
docker run -d -p 8080:8080 --name "$CONTAINER_NAME" "$IMAGE_NAME"
RUN_EXIT_CODE=$? # Capture exit code of 'docker run'

if [ $RUN_EXIT_CODE -eq 0 ]; then
echo " ✓ New container '$CONTAINER_NAME' started successfully."
else
echo " ✗ ERROR: Failed to run new container '$CONTAINER_NAME' (exit code: $RUN_EXIT_CODE). Please check for errors above."
exit 1 # Exit script with error code
fi
echo ""

echo "--- Docker Container Update Script Completed ---"
echo "Application should now be updated and running in container '$CONTAINER_NAME'."
echo "Access it at http://<your_instance_public_ip_address>:8080" # Remind user to use correct URL

docker start "$CONTAINER_NAME"

exit 0 # Exit script with success code
# 2. Remove the existing container (if it exists)
echo "- Removing existing container '$CONTAINER_NAME' (if it exists)..."
docker rm "$CONTAINER_NAME"
RM_EXIT_CODE=$? # Capture exit code of 'docker rm'

if [ $RM_EXIT_CODE -eq 0 ]; then
echo " ✓ Container '$CONTAINER_NAME' removed successfully (if it existed)."
else
echo " ⓘ Container '$CONTAINER_NAME' did not exist or remove command failed (exit code: $RM_EXIT_CODE). Proceeding with image pull."
fi
echo ""

# 3. Pull the latest Docker image from GHCR
echo "- Pulling latest Docker image '$IMAGE_NAME' from GHCR..."
docker pull "$IMAGE_NAME"
PULL_EXIT_CODE=$? # Capture exit code of 'docker pull'

if [ $PULL_EXIT_CODE -eq 0 ]; then
echo " ✓ Docker image '$IMAGE_NAME' pulled successfully."
else
echo " ✗ ERROR: Failed to pull Docker image '$IMAGE_NAME' (exit code: $PULL_EXIT_CODE). Aborting."
exit 1 # Exit script with error code
fi
echo ""

# 4. Run a new container from the pulled image
echo "- Running new container '$CONTAINER_NAME' from image '$IMAGE_NAME'..."
docker run -d -p 8080:8080 --name "$CONTAINER_NAME" "$IMAGE_NAME"
RUN_EXIT_CODE=$? # Capture exit code of 'docker run'

if [ $RUN_EXIT_CODE -eq 0 ]; then
echo " ✓ New container '$CONTAINER_NAME' started successfully."
else
echo " ✗ ERROR: Failed to run new container '$CONTAINER_NAME' (exit code: $RUN_EXIT_CODE). Please check for errors above."
exit 1 # Exit script with error code
fi
echo ""

echo "--- Docker Container Update Script Completed ---"
echo "Application should now be updated and running in container '$CONTAINER_NAME'."
echo "Access it at http://<your_instance_public_ip_address>:8080" # Remind user to use correct URL

docker start "$CONTAINER_NAME"

exit 0 # Exit script with success code
494 replies
MModular
Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
I use this convoluted script via ssh to pull in the latest docker image, build it, and restart it...
#!/bin/bash

# Script to update the ca-web Docker container on Oracle Cloud VM

CONTAINER_NAME="ca-web-container"
IMAGE_NAME="ghcr.io/carlca/magic-image:latest" # Replace with your actual GHCR image name if different

echo "--- Starting Docker Container Update Script ---"
echo "Container Name: $CONTAINER_NAME"
echo "Image Name: $IMAGE_NAME"
echo ""

# 1. Stop the existing container (if running)
echo "- Stopping existing container '$CONTAINER_NAME' (if running)..."
docker stop "$CONTAINER_NAME"
STOP_EXIT_CODE=$? # Capture exit code of 'docker stop'

if [ $STOP_EXIT_CODE -eq 0 ]; then
echo " ✓ Container '$CONTAINER_NAME' stopped successfully (if it was running)."
else
echo " ⓘ Container '$CONTAINER_NAME' was not running or stop command failed (exit code: $STOP_EXIT_CODE). Proceeding with removal."
fi
echo ""
#!/bin/bash

# Script to update the ca-web Docker container on Oracle Cloud VM

CONTAINER_NAME="ca-web-container"
IMAGE_NAME="ghcr.io/carlca/magic-image:latest" # Replace with your actual GHCR image name if different

echo "--- Starting Docker Container Update Script ---"
echo "Container Name: $CONTAINER_NAME"
echo "Image Name: $IMAGE_NAME"
echo ""

# 1. Stop the existing container (if running)
echo "- Stopping existing container '$CONTAINER_NAME' (if running)..."
docker stop "$CONTAINER_NAME"
STOP_EXIT_CODE=$? # Capture exit code of 'docker stop'

if [ $STOP_EXIT_CODE -eq 0 ]; then
echo " ✓ Container '$CONTAINER_NAME' stopped successfully (if it was running)."
else
echo " ⓘ Container '$CONTAINER_NAME' was not running or stop command failed (exit code: $STOP_EXIT_CODE). Proceeding with removal."
fi
echo ""
494 replies
MModular
Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
However, I think there is a slight problem. Okay, the docker ps -a shows that the instance has been running for 24 hours now! But I had to run docker start ca-web-container on two occasions now in order for me to be able to access the site at http://132.145.47.167:8080/.
494 replies
MModular
Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
Woohoo 🥳
[opc@ca-web-arm ~]$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
73ea2da5e470 ghcr.io/carlca/magic-image:latest "magic run default" 22 hours ago Up 22 hours 0.0.0.0:8080->8080/tcp, :::8080->8080/tcp ca-web-container
f2944de77a11 hello-world "/hello" 3 weeks ago Exited (0) 3 weeks ago objective_yonath
[opc@ca-web-arm ~]$
[opc@ca-web-arm ~]$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
73ea2da5e470 ghcr.io/carlca/magic-image:latest "magic run default" 22 hours ago Up 22 hours 0.0.0.0:8080->8080/tcp, :::8080->8080/tcp ca-web-container
f2944de77a11 hello-world "/hello" 3 weeks ago Exited (0) 3 weeks ago objective_yonath
[opc@ca-web-arm ~]$
494 replies
MModular
Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
The price being $0 or £0 or ¢0, of course 😍
494 replies
MModular
Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
False alarm! It's still up and running. Here's a virtual pint 🍺
494 replies