Skip to content

Latest commit

 

History

History
117 lines (80 loc) · 4.92 KB

MAINTENANCE.md

File metadata and controls

117 lines (80 loc) · 4.92 KB

Maintenance

Symptoms

Tasks

Update project dependencies

Motivation

Nearly all project dependencies are specified by using a fixed version. This protects our solution against breaking changes from any package updates. However, updating packages, in general, is a good idea, because relying on old packages a) impedes further development as new features in libraries cannot be used, b) can break the connection to external access points whose interface has changed, and c) may leave recently discovered security leaks unfixed. Thus, updates should be carried out on a regular schedule.

Update python (pip) & JavaScript (npm) dependencies

  1. Check out a new branch.

  2. Connect to the docker (make connect), and run make upgrade-requirements.

  3. Revise the changes in requirements.txt and package*.json.

  4. If pip check fails, you need to manually add the required dependencies to docker/requirements.txt. This is necessary because of pypa/pip#988.

    Remark: You may need to "touch" the Dockerfile manually by editing its first line to make sure that the previous docker cache is not reused, which would lead to the changes in requirements.txt are not checked at all!

  5. Create a merge request with your changes and make sure the CI passes.

  6. Once it passes, merge the branch.

Update docker installation

  1. Check your current version:

    docker -v
  2. Visit https://docs.docker.com/engine/release-notes/ to learn about open CVEs.

  3. Identify upgradable packages:

    apt list --installed | grep docker
  4. Upgrade relevant packages:

    apt upgrade <package name>

Update docker images

Each used docker image is specified either in docker/docker-compose.yml or in the linked Dockerfile. For more information about the docker containers, please refer to the documentation.

  1. First of all, search for breaking changes of an update, e.g., here for Postgresql. You can find all existing CVEs for Postgresql here.
  2. To update a docker image, edit the image key in the yaml file respectively the FROM command in the Dockerfile. Be careful to watch for any breaking changes in the updates.
  3. Restart the container by running make shutdown-<docker> startup-<docker>.
  4. Re-run the CI to preclude any regressions.

Hypothesis (not confirmed): For some major version upgrades, just rebuilding the container won't work because the database format might have changed. In this case, use make db-dump and make db-restore before and after rebuilding the container. As always, convince yourself afterward that the database is still intact and contains all data.

Update gomus version

Motivation

From time to time, Giant Monkey uses to publish a new version of go~mus. As we are scraping certain contents from the gomus web interface, each of these changes can possibly break our gomus tasks. The TestGomusVersion assertions will report any version change.

Action

  1. Check out the gomus changelog (barberini.gomus.de > Helpdesk > Changelog) and search for possible breaking changes (for example, the layout of the customer data could have changed).
  2. Make sure all other gomus tests pass.
  3. If there are any breaking changes, the gomus tasks need to be updated.
  4. Run make patch-gomus-version inside of the container.

Remarks

  • In the past, we have experienced a few changes in the gomus HTML format without the version number being incremented. In this case, the TestGomusConnection.test_version scraper needs to be updated. See !169.

Update gomus session ID

For accessing gomus, we use a session ID that was obtained from a manual browser session. While this session ID used to be valid for multiple months in past, it will expire at some time and need to be renewed.

Action

Steps to be done are described in the example of Chromium and related browsers. If you need to do this in Firefox/Safari/Netscape Navigator, you will need to improvise.

  1. Open the gomus website.
  2. (If logged in, log off first (to make sure you use the freshest possible session ID).)
  3. Log in.
  4. Open the developer console by pressing F12.
  5. Switch to tab Application.
  6. In the left bar, from the Storage section, choose Cookies > https://your-museum.gomus.de.
  7. From the cookies list, find _session_id and copy its value into the clipboard.
  8. Log in to the VM and open the keys.env file from the secrets folder.
  9. Patch GOMUS_SESS_ID with the copied value.