Updating customer sites to a newer release of our Open edX fork - Appsembler

Updating customer sites to a newer release of our Open edX fork

  1. SSH into the docker machine.
  2. Take a snaphost of a container to have a backup copy: docker commit -p [container-id] [backup-image-name]
  3. Make sure the site still works after taking the snapshot (in case pausing a container somehow breaks it)
  4. Launch a test site based on the backup image: docker run -i -t -P -d [backup-image-name] /sbin/my_init --enable-insecure-key and note its container ID ([test-site-container-id])
  5. Start a bash session inside the container docker exec -i -t [test-site-container-id] /bin/bash
  6. Update Open edX: /edx/bin/update edx-platform [git commit/tag/branch]
  7. Make sure everything works: /edx/bin/supervisorctl status
    • sometimes the forum app goes down, in which case run rm /edx/var/forum/forum.sock, then /edx/bin/supervisorctl start forum and then after a while make sure the forum is up and running: /edx/bin/supervisorctl status forum
  8. If you have to add new env vars for the Open edX site then:
    • if they are not set on the container itself you can add them in /etc/container_environment/(https://github.com/phusion/baseimage-docker#centrally-defining-your-own-environment-variables)
    • if the variables are set on the container level then they can’t be overriden in/etc/container_environment. The workaround is to add them in/etc/service/supervisor/run, right before the last command that starts supervisord. Add something like export VAR_NAME="some value" for each variable you want to add and then restart the supervisor: sv restart supervisor.
  9. After updating the variables exit the container and restart it: docker restart [test-site-container-id]. Note that docker changes the exposed ports so you have to refresh Hipache routes in the launcher’s admin (actually for a test site there is no route so this is mostly for updating production sites).
  10. Ssh into the container (docker inspect -f "{{ .NetworkSettings.IPAddress }}" <ID> followed byssh -i ~/insecure_key root@<IP address>) and type env to make sure the env vars are set correctly.
  11. Repeat the above for the live sites (containers).