Copilot Deployment#
WARNING: THESE DOCS ARE SLIGHTLY OUT OF DATE. STAY TUNED FOR AN UPDATE!
First Time Setup#
Copilot is an official AWS tool used to quickly stand-up infrastructure in the cloud. For this project, it is responsible for setting up a backend service for running simulations (so no inbound internet-access, only outbound) and an S3 bucket. In the future, it will also include the distributed queuing system and the API which is used to submit tasks, however, for now those are expected to be running with managed hosting (for the queue) and locally (for the API, if needed).
Once the prereqs are installed, you can either run a single command macro to stand up the whole stack at once, or you can stand-up pieces incrementally.
Prereqs#
- Install Docker.
- Install AWS CLI & AWS Copilot.
- Create a Hatchet account.
- Generate a Hatchet API token. nb: in the future, Hatchet will be deployable as part of the Copilot specification.
- Configure an AWS CLI profile if you have not done so already:
aws configure --profile <your-profile-name>
- Clone the repository:
git clone https://github.com/szvsw/epengine
. - Move into the repository:
cd epengine
Command macro (whole stack at once)#
Running the following command will walk you through all the steps necessary to stand-up the application in AWS.
make create-copilot-app
You will be prompted to select a few things:
- A name for the application.
- The AWS profile to use.
- Any configuration necessary for the environment (e.g. security groups, VPCs, subnets etc), however you can use the defaults if desired (recommended for most users).
- The Hatchet Client Token
Once complete, if all is susccessful, you should see one worker in your Hatchet pool.
Manually running the commands#
copilot app init
- see
app init
help for more details like--permissions-boundary
if needed copilot env init --name prod
- (see
see init
help for more details, as well asinit
manifest help for specs for VPCs etc.) copilot env deploy --name prod
copilot secret init --name HATCHET_CLIENT_TOKEN
copilot deploy --init-wkld --env prod --all
Once complete, if all is susccessful, you should see one worker in your Hatchet pool.
Managing Worker Counts#
In copilot/worker/manifest.yml
, you can edit the worker count configuration to determine how many workers you would like, if scaling should be done based off of CPU utilization, etc.
After making changes, run copilot svc deploy
.
Cleanup#
- Empty your buckets if they have files in them.
copilot app delete