Admin Tasks

General overview

_images/overview.png

When a commit is made to the main branch (e.g. merging in a pull request that targets the main branch) a build is trigged on Code Pipeline. Then a notification is sent (using SNS) to the #sampl-devops channel in the Mobley Lab Slack workspace. Once the build completes, the code is sent to the Elastic Beanstalk instance and the web service restarted.

Amazon Web Services infrastructure (AWS)

All services are hosted in US East (Ohio) us-east-2.

Update ever_given

You will need an account on PyPI. Starting from the root of the repository (after making changes to the code): ever_given version number must be incremented in setup.cfg for a new PyPI upload .. code-block:: bash

$ cd ever_given $ python -m pip install –upgrade build $ python -m build $ python3 -m twine upload dist/*

The new package should show up here.

Spin up worker

Generally:

  1. Provision an EC2 instance

  2. SSH onto instance and clone codebase

  3. Use pipenv to setup environment

  4. Ensure environmental variables are set

  5. Launch as many dask-workers as needed

Expand Local Storage On EC2 Instance

First, follow the guide “Modify an EBS volume using Elastic Volumes”. Then follow the steps below (adapted from “Extend a Linux file system after resizing a volume”).

$ df -hT # Check disk space, mount points, and file system type
$ lsblk # Check which device needs to be expanded
$ sudo growpart /dev/nvme0n1 1
$ df -hT # Confirm that nothing has changed on the file level
$ lsblk # Check to see that partition has grown
$ sudo xfs_growfs -d / # Be sure to use the correct tool to grow the file system
$ df -hT # Confirm that everything looks correct

While doing a backup first is not a bad idea, since the database is part of another service and S3 is used for storage, if a major crash occurs during this operation, the web server can be restarted and things should be fine.