Skip to content

Commit

Permalink
prepping release for submit06
Browse files Browse the repository at this point in the history
  • Loading branch information
mdr223 committed Oct 26, 2023
1 parent 44243d8 commit 7d16154
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 1 deletion.
78 changes: 78 additions & 0 deletions .github/workflows/tmp-prod-801-ci-cd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Deploy A2rchi Prod for 8.01
run-name: ${{ github.actor }} deploys A2rchi for 8.01 to prod
on:
push:
branches:
- temp-release-8.01
jobs:
deploy-prod-system:
runs-on: ubuntu-latest
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
steps:
# boilerplate message and pull repository to CI runner
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- uses: actions/checkout@v3
- run: echo "The ${{ github.repository }} repository has been cloned to the runner."

# setup SSH
- name: Setup SSH
run: |
mkdir -p /home/runner/.ssh/
echo "${{ secrets.SSH_PRIVATE_KEY_MDRUSSO }}" > /home/runner/.ssh/id_rsa_submit
chmod 600 /home/runner/.ssh/id_rsa_submit
echo "${{ secrets.SSH_SUBMIT_KNOWN_HOSTS }}" > ~/.ssh/known_hosts
cp ${{ github.workspace }}/deploy/ssh_config /home/runner/.ssh/config
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
ssh-add /home/runner/.ssh/id_rsa_submit
# create secrets files for docker-compose
- name: Create Secrets Files
run: |
mkdir -p ${{ github.workspace }}/deploy/prod-801/secrets/
touch ${{ github.workspace }}/deploy/prod-801/secrets/flask_uploader_app_secret_key.txt
echo "${{ secrets.PROD_FLASK_UPLOADER_APP_SECRET_KEY }}" >> ${{ github.workspace }}/deploy/prod-801/secrets/flask_uploader_app_secret_key.txt
chmod 400 ${{ github.workspace }}/deploy/prod-801/secrets/flask_uploader_app_secret_key.txt
touch ${{ github.workspace }}/deploy/prod-801/secrets/uploader_salt.txt
echo "${{ secrets.PROD_UPLOADER_SALT }}" >> ${{ github.workspace }}/deploy/prod-801/secrets/uploader_salt.txt
chmod 400 ${{ github.workspace }}/deploy/prod-801/secrets/uploader_salt.txt
touch ${{ github.workspace }}/deploy/prod-801/secrets/openai_api_key.txt
echo "${{ secrets.OPENAI_API_KEY }}" >> ${{ github.workspace }}/deploy/prod-801/secrets/openai_api_key.txt
chmod 400 ${{ github.workspace }}/deploy/prod-801/secrets/openai_api_key.txt
touch ${{ github.workspace }}/deploy/prod-801/secrets/hf_token.txt
echo "${{ secrets.HF_TOKEN }}" >> ${{ github.workspace }}/deploy/prod-801/secrets/hf_token.txt
chmod 400 ${{ github.workspace }}/deploy/prod-801/secrets/hf_token.txt
# create env file to set tag(s) for docker-compose
- name: Create Env File
run: |
touch ${{ github.workspace }}/deploy/prod-801/.env
export tag="${GITHUB_REF#refs/heads/}"
export tag="${tag//\//-}.${GITHUB_SHA}"
echo "TAG=${tag}" >> ${{ github.workspace }}/deploy/prod-801/.env
# # stop any existing docker compose that's running
# - name: Stop Docker Compose
# run: |
# ssh submit06 'bash -s' < ${{ github.workspace }}/deploy/prod-801/prod-801-stop.sh

# copy repository to machine
- name: Copy Repository
run: |
rsync -e ssh -r ${{ github.workspace}}/* --exclude .git/ --delete submit06:~/A2rchi-prod-801/
# run deploy script
- name: Run Deploy Script
run: |
ssh submit06 'bash -s' < ${{ github.workspace }}/deploy/prod-801/prod-801-install.sh
# clean up secret files
- name: Remove Secrets from Runner
run: |
rm ${{ github.workspace }}/deploy/prod-801/secrets/flask_uploader_app_secret_key.txt
rm ${{ github.workspace }}/deploy/prod-801/secrets/uploader_salt.txt
rm ${{ github.workspace }}/deploy/prod-801/secrets/openai_api_key.txt
rm ${{ github.workspace }}/deploy/prod-801/secrets/hf_token.txt
# print job status
- run: echo "🍏 This job's status is ${{ job.status }}."
2 changes: 1 addition & 1 deletion config/prod-801-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interfaces:
PORT: 7861
EXTERNAL_PORT: 7683
HOST: "0.0.0.0" # either "0.0.0.0" (for public) or "127.0.0.1" (for internal)
HOSTNAME: "t3desk019.mit.edu" # careful, this is used for the chat service
HOSTNAME: "submit06.mit.edu" # careful, this is used for the chat service
template_folder: "/root/A2rchi/A2rchi/interfaces/chat_app/templates"
static_folder: "/root/A2rchi/A2rchi/interfaces/chat_app/static"
num_responses_until_feedback: 3 #the number of responses given by A2rchi until she asks for feedback.
Expand Down

0 comments on commit 7d16154

Please sign in to comment.