This README provides an overview of the deployment flow for the project generated from the Mephisto template.
You also need to install the following tools:
- Docker (Desktop)
Please read the below notes carefully before starting your work:
-
The practical deployment flow: local -> test -> prod
- Branch
deployment-testfor test/staging env - Branch
deployment-prodfor production env
- Branch
-
Refer to Mephisto Documentation for other configuration details.
-
Please ensure that you have changed the
tasknameinhydra_configintest.ymlandprod.yml.- Note that Heroku app names for each cannot be duplicated and cannot exceed 30 characters.
- We are now deploying to EC2 instead of Heroku.
- The
task_nameandsubdomainshould be similar to the repo name to make it easier to track.
-
There are some configs in
hydra_configthat are very sensitive and related to cost. Please discuss with your manager before changing them.units_per_assignment: number of units per assignmenttask_reward: reward per unit
- Create a new repo from
d-lab/mephistotemplate with thedeploymentbranch. - Clone the new repo to your local machine.
- Switch to the
deploymentbranch.
- Start from the
deploymentbranch. - Change directory to
appdirectory. - Run
make buildto freshly build the Docker image for the first time. - Run
make runto start the local server. - Run
make watchto build and watch the frontend. - Start implementing your task in
webapp/src.
Before deploying, you must set the following variables/secrets in your GitHub Actions environment:
AWS_ACCESS_KEY_ID(mephisto-ec2 access key)AWS_SECRET_ACCESS_KEY(mephisto-ec2 secret key)
- You must be the owner of the repo to configure the environment variables.
- Go to Settings -> Secrets and variables -> Actions.
- Add a new repository secret.
- Once you are happy with your local version.
- Make sure to configure the
hydra_configin test.yml and environment variables in GitHub Actions. - Create a new branch from your current
deploymentbranch and name itdeployment-test. - Push your changes to the
deployment-testbranch to remote. - View your deployment status in GitHub Actions.
- Make sure to configure the
hydra_configin prod.yml and environment variables in GitHub Actions. - Create a new branch from your current
deploymentbranch and name itdeployment-prod. - Push your changes to the
deployment-prodbranch to remote. - Check GitHub Actions log for the deployment status and the production path to access the task.
- We only have production deployment for Prolific.
- Example in
app/hydra_configs/conf/prod_prolific.yaml. - Prolific only uses EC2 architecture.
- Make sure to configure
PROLIFIC_API_KEY. - Edit
prolific_workspace_nameandprolific_project_nameto map with workspace and project in prolific account.- You have to configure finance in that target workspace before deployment.