-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d080c4c
commit 9ebe806
Showing
18 changed files
with
1,207 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
name: Build Container Image | ||
|
||
on: | ||
push: | ||
branches: | ||
- "test/**" | ||
- "deploy" | ||
repository_dispatch: | ||
type: | ||
- deploy_project | ||
jobs: | ||
build: | ||
name: Build Docker Image and Push | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
path: arches-lingo | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: us-west-1 | ||
|
||
- name: Login to Amazon ECR | ||
id: login-ecr | ||
uses: aws-actions/amazon-ecr-login@v2 | ||
|
||
- name: Build, tag, and push image to Amazon ECR | ||
id: build-image | ||
env: | ||
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} | ||
ECR_REPOSITORY: lingo-repository | ||
IMAGE_TAG: ${{ github.sha }} | ||
run: | | ||
# Build a docker container and | ||
# push it to ECR so that it can | ||
# be deployed to ECS. | ||
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -f arches-lingo/docker/production/Dockerfile ./arches-lingo | ||
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG | ||
echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" | ||
- name: Fill in the new image ID in the Amazon ECS task definition for service | ||
id: task-def | ||
uses: aws-actions/amazon-ecs-render-task-definition@v1 | ||
with: | ||
task-definition: arches-lingo/docker/deploy/task-definition.json | ||
container-name: arches | ||
image: ${{ steps.build-image.outputs.image }} | ||
|
||
- name: Fill in the new image ID in the Amazon ECS task definition to reset db | ||
id: task-def-run-reset | ||
uses: aws-actions/amazon-ecs-render-task-definition@v1 | ||
with: | ||
task-definition: arches-lingo/docker/deploy/task-definition-reset-database.json | ||
container-name: arches | ||
image: ${{ steps.build-image.outputs.image }} | ||
|
||
- name: Deploy Reset Amazon ECS task definition to reset db | ||
uses: aws-actions/amazon-ecs-deploy-task-definition@v1 | ||
id: task-def-deploy-reset | ||
with: | ||
task-definition: ${{ steps.task-def-run-reset.outputs.task-definition }} | ||
cluster: lingo-cluster | ||
|
||
- name: Reset database | ||
id: run-reset-task | ||
run: | | ||
# Build a docker container and | ||
# push it to ECR so that it can | ||
# be deployed to ECS. | ||
aws ecs run-task --cluster lingo-cluster --task-definition ${{ steps.task-def-deploy-reset.outputs.task-definition-arn }} --count 1 --launch-type FARGATE --network-configuration "awsvpcConfiguration={subnets=['subnet-0d66c5e9e3c174519','subnet-0ad21fa3dbc479860'],securityGroups=['sg-04ca486cc6239259b']}" | ||
- name: Deploy Amazon ECS task definition to arches service | ||
uses: aws-actions/amazon-ecs-deploy-task-definition@v1 | ||
with: | ||
task-definition: ${{ steps.task-def.outputs.task-definition }} | ||
service: lingo-arches-service | ||
cluster: lingo-cluster |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[unix_http_server] | ||
file=/tmp/supervisor.sock ; path to your socket file | ||
chmod=7770 | ||
|
||
[supervisord] | ||
logfile=/var/log/supervisor/supervisord.log ; supervisord log file | ||
logfile_maxbytes=50MB ; maximum size of logfile before rotation | ||
logfile_backups=10 ; number of backed up logfiles | ||
loglevel=info ; info, debug, warn, trace | ||
pidfile=/var/run/supervisord.pid ; pidfile location | ||
nodaemon=false ; run supervisord as a daemon | ||
minfds=1024 ; number of startup file descriptors | ||
minprocs=200 ; number of process descriptors | ||
user=root ; defaults to whichever user is runs supervisor | ||
childlogdir=/var/log/supervisor/ ; where child log files will live | ||
|
||
[rpcinterface:supervisor] | ||
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface | ||
|
||
[supervisorctl] | ||
serverurl=unix:///tmp/supervisor.sock ; use unix:// schem for a unix sockets. | ||
|
||
[include] | ||
files=./conf.d/arches-lingo-celeryd.conf ./conf.d/arches-lingo-celerybeat.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
; ================================ | ||
; celery beat supervisor | ||
; ================================ | ||
|
||
[program:celerybeat] | ||
command=python3 -m celery -A arches_vgm.celery beat --loglevel=INFO | ||
directory=/web_root/arches-vgm | ||
|
||
user=root | ||
numprocs=1 | ||
stdout_logfile=/var/log/celery/beat.log | ||
stderr_logfile=/var/log/celery/beat.log | ||
autostart=true | ||
autorestart=true | ||
startsecs=10 | ||
|
||
; Causes supervisor to send the termination signal (SIGTERM) to the whole process group. | ||
stopasgroup=true | ||
|
||
; if rabbitmq is supervised, set its priority higher | ||
; so it starts first | ||
priority=999 |
Oops, something went wrong.