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-test
for test/staging env - Branch
deployment-prod
for production env
- Branch
-
Refer to Mephisto Documentation for other configuration details.
-
Please ensure that you have changed the
taskname
inhydra_config
intest.yml
andprod.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_name
andsubdomain
should be similar to the repo name to make it easier to track.
-
There are some configs in
hydra_config
that 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/mephisto
template with thedeployment
branch. - Clone the new repo to your local machine.
- Switch to the
deployment
branch.
- Start from the
deployment
branch. - Change directory to
app
directory. - Run
make build
to freshly build the Docker image for the first time. - Run
make run
to start the local server. - Run
make watch
to 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_config
in test.yml and environment variables in GitHub Actions. - Create a new branch from your current
deployment
branch and name itdeployment-test
. - Push your changes to the
deployment-test
branch to remote. - View your deployment status in GitHub Actions.
- Make sure to configure the
hydra_config
in prod.yml and environment variables in GitHub Actions. - Create a new branch from your current
deployment
branch and name itdeployment-prod
. - Push your changes to the
deployment-prod
branch 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_name
andprolific_project_name
to map with workspace and project in prolific account.- You have to configure finance in that target workspace before deployment.