-
I am looking to build a Netbox AMI and was wondering if there is any harm in running e.g. AMI is created with the binaries, and then the configuration settings are passed in user-data during the cloud-init stage of first boot. If something needs to change, a new AMI is created and new instance booted. We're using managed PostgreSQL, Redis and S3 storage from AWS for the stateful parts, so just the netbox app and web layers to host in the VMs. I've seen the docker approach uses a slightly modified script with a check before running e.g. Part of # Check if update is needed
if ! ./manage.py migrate --check >/dev/null 2>&1; then
echo "⚙️ Applying database migrations"
./manage.py migrate --no-input Similar part of Lines 64 to 67 in 86ada33 (For those that will no doubt ask - I would like to use the docker approach but don't have a k8s cluster to hand and don't want to learn ECS - immutable EC2 is a compromise but OK for now). |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
If you run the full Actually, there is a risk worth mentioning. Because Netbox doesn't "pip freeze" its dependencies, rebuilding the virtualenv may download a newer and incompatible version of one of Netbox's indirect dependencies. If you are running up-to-date Netbox then the risk is fairly low. The older the Netbox that you're running, the higher the chance that you will get bitten by this. |
Beta Was this translation helpful? Give feedback.
-
Many thanks @candlerb - that makes sense. I will share the repo here once it's done, but I suspect I'll use a modified version like the docker approach where the virtualenv is used if possible and only created if necessary. |
Beta Was this translation helpful? Give feedback.
If you run the full
./upgrade.sh
then it will destroy the existing virtualenv and recreate it. There's no particular harm, but it will delay your instance startup while it unpacks a whole load of python packages and recreates the virtualenv.Actually, there is a risk worth mentioning. Because Netbox doesn't "pip freeze" its dependencies, rebuilding the virtualenv may download a newer and incompatible version of one of Netbox's indirect dependencies. If you are running up-to-date Netbox then the risk is fairly low. The older the Netbox that you're running, the higher the chance that you will get bitten by this.