- Deploying QA
- Reverting a Deployment
- Adding/Modifying Environment Variables
- SSH into a Preview Branch
- Troubleshooting Preview Branches
- SSH into the QA Branch
- Recording a session for future network debugging (HAR)
- Run the bump script (
./bump.sh patch) and create a PR - Merge the bump PR
- Manually validate functionality
- Verify CI has passed, including e2e tests
- Have at least 2 people involved: Ops and QA
- Merge
qaintomain, which will trigger the infrastructure deployment - Monitor the deployment within the Github Actions
- Manually validate the basic features are working: dashboard, grid, connections, multiplayer, files
- Merge
mainback intoqa
- git checkout qa
- git checkout -b "revert-to-v0.20.5"
- git revert --no-commit v0.20.5..HEAD
- git commit -m "Revert deployment to v0.20.5"
- git push --set-upstream origin revert-to-v0.20.5
- Modify environment variables
- For API variables, update env-vars.ts and use
ensureEnvVarExistsif the env is necessary for all builds - Modify the relevant variables in .env.example and .env.test as well
- Modify the environment variables in the self hosting repo.
- Create a PR, modify the environment variables in .env.aws, .env.aws-preview, .env.local
- Modify the variables in docker-compose.yml
- Merge PR into
mainas preview branches always pull from the main branch
- If this is an existing PR, close and open the PR to trigger a new infrastructure deployment
- Add a message to Slack in the
#engineeringchannel about the changes - For
preview:- Log into the
Quadratic DevelopmentAWS account (us-west-2) - Navigate to the
Parameter Storeservice - Create or locate the environment variable (e.g.
/quadratic-development/ANTHROPIC_API_KEY) - Set the value and save
- Update
infra/aws-cloudformation/quadratic-preview.ymlto fetch the variable from SSM Parameter Store in the UserData section:MY_VAR=$(aws ssm get-parameter --name "/quadratic-development/MY_VAR" --with-decryption --query "Parameter.Value" --output text) - Existing preview branches will need to be recreated (close and reopen PR) to pick up the CloudFormation changes
- Log into the
- For
qaandprod:- Log into Pulumi (likely through the Github SSO) (https://app.pulumi.com/quadratic)
- Click on the
Environmentslink in the left-hand sidebar - Click the appropriate environment (
*-developmentforqa,*-productionforprod) - Edit the values in the
environmentVariables:section on theEnvironment definitiontext area - Click on the
Savebutton - For QA, close and reopen the QA PR
- Locate the PR number in Github
- Log into the
Quadratic DevelopmentAWS account (us-west-2) - login is at https://d-9067937699.awsapps.com/start/#/?tab=accounts - Navigate to the
EC2service - Click on the
Instanceslink in the left-hand sidebar or in the middleResourcessection - Type in the PR number in the search interface
- Click on the
Instance IDlink for the matching instance - Click on the
Connectbutton in the upper right corner - Make sure the
Connect using a Public IPoption is selected and hit the orangeConnectbutton - Wait a few moments for the SSH UI to load
- Enter
docker psto see the running docker containers - There will be a container for every service, note the
CONTAINER IDfor each - Commands:
- View all logs: docker logs
CONTAINER ID - View live logs: docker logs -f
CONTAINER ID - View live tail logs: docker logs -f --tail 100
CONTAINER ID - Enter into the container: docker exec -it
CONTAINER IDbash
- View all logs: docker logs
- SSH into a Preview Branch
- Enter into the command line:
tail -100 /var/log/cloud-init-output.log - Ensure no errors
- SSH into a Preview Branch
- Enter into the command line:
docker images - All services should be listed. As of this writing, 11 containers should be running.
- Locate the PR number in Github
- Log into the
Quadratic DevelopmentAWS account (us-west-2) - Navigate to the
EC2service - Click on the
Instanceslink in the left-hand sidebar or in the middleResourcessection - Type in the PR number in the search interface
- Click on the
Instance IDlink for the matching instance to go to theInstance Summarypage - Click on the
Securitytab in the bottom navigation - Click on the link below the
Security Groupslabel - In the
Inbound Rulestab, click on theEdit Inbound Rulesbutton - Click on the
Add Rulebutton, enter inSSHforTypeandCustomfor source (accept the default 0.0.0.0/0) - Click on the
Save Rulesbutton - Hit the back button on the browser twice to go back to the
Instance Summarypage - Click on the
Connectbutton in the upper right corner - Make sure the
Connect using a Private IPoption is selected and hit the orangeConnectbutton - Wait a few moments for the SSH UI to load
- Enter
sudo docker psto see the running docker containers - There will be a container for every service, note the
CONTAINER IDfor each - Commands:
- View all logs: sudo docker logs
CONTAINER ID - View live logs: sudo docker logs -f
CONTAINER ID - View live tail logs: sudo docker logs -f --tail 100
CONTAINER ID - Enter into the container: sudo docker exec -it
CONTAINER IDbash
- View all logs: sudo docker logs
This should be used where production failed to deploy but you want to record the network activities before reverting.