Admin Tasks
General overview
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.
Code Deployment: Code Pipeline
Container Registry: ECR
DNS: Route 53
Database: RDS
E-mail: SES
Elastic Beanstalk: Elastic Beanstalk
Monitoring & Alarms: Cloud Watch
Slack E-mail messages: SNS
Storage: S3
Web Server: EC2
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:
Provision an EC2 instance
SSH onto instance and clone codebase
Use pipenv to setup environment
Ensure environmental variables are set
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.