Skip to content

Commit

Permalink
Merge pull request #130 from mit-submit/feature/postgres-db
Browse files Browse the repository at this point in the history
Feature/postgres db
  • Loading branch information
mdr223 authored Nov 6, 2023
2 parents 2457ebc + 1744f4a commit 37bfd49
Show file tree
Hide file tree
Showing 29 changed files with 580 additions and 559 deletions.
17 changes: 7 additions & 10 deletions .github/workflows/dev-ci-cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ jobs:
touch ${{ github.workspace }}/deploy/dev/secrets/hf_token.txt
echo "${{ secrets.HF_TOKEN }}" >> ${{ github.workspace }}/deploy/dev/secrets/hf_token.txt
chmod 400 ${{ github.workspace }}/deploy/dev/secrets/hf_token.txt
touch ${{ github.workspace }}/deploy/dev/secrets/pg_password.txt
echo "${{ secrets.DEV_PG_PASSWORD }}" >> ${{ github.workspace }}/deploy/dev/secrets/pg_password.txt
chmod 400 ${{ github.workspace }}/deploy/dev/secrets/pg_password.txt
# create env file to set tag(s) for docker-compose
- name: Create Env File
Expand All @@ -87,31 +90,25 @@ jobs:
# stop any existing docker compose that's running
- name: Stop Docker Compose
run: |
ssh submit-t3desk 'bash -s' < ${{ github.workspace }}/deploy/dev/dev-stop.sh
ssh submit06 'bash -s' < ${{ github.workspace }}/deploy/dev/dev-stop.sh
# copy repository to machine
- name: Copy Repository
run: |
rsync -e ssh -r ${{ github.workspace}}/* --exclude .git/ --delete submit-t3desk:~/A2rchi-dev/
rsync -e ssh -r ${{ github.workspace}}/* --exclude .git/ --delete submit06:~/A2rchi-dev/
# run deploy script
- name: Run Deploy Script
run: |
export tag="${GITHUB_REF#refs/heads/}"
export tag="${tag//\//-}.${GITHUB_SHA}"
sed -i "s/BASE_TAG/${tag}/" ${{ github.workspace }}/deploy/dev/dev-install.sh
ssh submit-t3desk 'bash -s' < ${{ github.workspace }}/deploy/dev/dev-install.sh
ssh submit06 'bash -s' < ${{ github.workspace }}/deploy/dev/dev-install.sh
# clean up secret files
- name: Remove Secrets from Runner
run: |
rm ${{ github.workspace }}/deploy/dev/secrets/cleo_*.txt
rm ${{ github.workspace }}/deploy/dev/secrets/imap_*.txt
rm ${{ github.workspace }}/deploy/dev/secrets/sender_*.txt
rm ${{ github.workspace }}/deploy/dev/secrets/flask_uploader_app_secret_key.txt
rm ${{ github.workspace }}/deploy/dev/secrets/uploader_salt.txt
rm ${{ github.workspace }}/deploy/dev/secrets/openai_api_key.txt
rm ${{ github.workspace }}/deploy/dev/secrets/hf_token.txt
rm ${{ github.workspace }}/deploy/dev/secrets/*.txt
# print job status
- run: echo "🍏 This job's status is ${{ job.status }}."
8 changes: 4 additions & 4 deletions .github/workflows/prod-801-ci-cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ jobs:
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
touch ${{ github.workspace }}/deploy/prod-801/secrets/pg_password.txt
echo "${{ secrets.PROD_801_PG_PASSWORD }}" >> ${{ github.workspace }}/deploy/prod-801/secrets/pg_password.txt
chmod 400 ${{ github.workspace }}/deploy/prod-801/secrets/pg_password.txt
# create env file to set tag(s) for docker-compose
- name: Create Env File
Expand Down Expand Up @@ -72,10 +75,7 @@ jobs:
# 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
rm ${{ github.workspace }}/deploy/prod-801/secrets/*.txt
# print job status
- run: echo "🍏 This job's status is ${{ job.status }}."
11 changes: 4 additions & 7 deletions .github/workflows/prod-ci-cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ jobs:
touch ${{ github.workspace }}/deploy/prod/secrets/hf_token.txt
echo "${{ secrets.HF_TOKEN }}" >> ${{ github.workspace }}/deploy/prod/secrets/hf_token.txt
chmod 400 ${{ github.workspace }}/deploy/prod/secrets/hf_token.txt
touch ${{ github.workspace }}/deploy/prod/secrets/pg_password.txt
echo "${{ secrets.PROD_PG_PASSWORD }}" >> ${{ github.workspace }}/deploy/prod/secrets/pg_password.txt
chmod 400 ${{ github.workspace }}/deploy/prod/secrets/pg_password.txt
# create env file to set tag(s) for docker-compose
- name: Create Env File
Expand Down Expand Up @@ -105,13 +108,7 @@ jobs:
# clean up secret files
- name: Remove Secrets from Runner
run: |
rm ${{ github.workspace }}/deploy/prod/secrets/cleo_*.txt
rm ${{ github.workspace }}/deploy/prod/secrets/imap_*.txt
rm ${{ github.workspace }}/deploy/prod/secrets/sender_*.txt
rm ${{ github.workspace }}/deploy/prod/secrets/flask_uploader_app_secret_key.txt
rm ${{ github.workspace }}/deploy/prod/secrets/uploader_salt.txt
rm ${{ github.workspace }}/deploy/prod/secrets/openai_api_key.txt
rm ${{ github.workspace }}/deploy/prod/secrets/hf_token.txt
rm ${{ github.workspace }}/deploy/prod/secrets/*.txt
# print job status
- run: echo "🍏 This job's status is ${{ job.status }}."
8 changes: 4 additions & 4 deletions .github/workflows/prod-root-ci-cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ jobs:
touch ${{ github.workspace }}/deploy/prod-root/secrets/hf_token.txt
echo "${{ secrets.HF_TOKEN }}" >> ${{ github.workspace }}/deploy/prod-root/secrets/hf_token.txt
chmod 400 ${{ github.workspace }}/deploy/prod-root/secrets/hf_token.txt
touch ${{ github.workspace }}/deploy/prod-root/secrets/pg_password.txt
echo "${{ secrets.PROD_ROOT_PG_PASSWORD }}" >> ${{ github.workspace }}/deploy/prod-root/secrets/pg_password.txt
chmod 400 ${{ github.workspace }}/deploy/prod-root/secrets/pg_password.txt
# create env file to set tag(s) for docker-compose
- name: Create Env File
Expand Down Expand Up @@ -72,10 +75,7 @@ jobs:
# clean up secret files
- name: Remove Secrets from Runner
run: |
rm ${{ github.workspace }}/deploy/prod-root/secrets/flask_uploader_app_secret_key.txt
rm ${{ github.workspace }}/deploy/prod-root/secrets/uploader_salt.txt
rm ${{ github.workspace }}/deploy/prod-root/secrets/openai_api_key.txt
rm ${{ github.workspace }}/deploy/prod-root/secrets/hf_token.txt
rm ${{ github.workspace }}/deploy/prod-root/secrets/*.txt
# print job status
- run: echo "🍏 This job's status is ${{ job.status }}."
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ venv
*sqlite_db
.vscode
801-content/
logos/
Loading

0 comments on commit 37bfd49

Please sign in to comment.