diff --git a/.github/workflows/aws.yml b/.github/workflows/aws.yml index 6d0d95c..172bf60 100644 --- a/.github/workflows/aws.yml +++ b/.github/workflows/aws.yml @@ -36,8 +36,8 @@ on: env: AWS_REGION: us-east-1 # set this to your preferred AWS region, e.g. us-west-1 - ECR_REPOSITORY: whisper # set this to your Amazon ECR repository name - ECS_SERVICE: whisper-service # set this to your Amazon ECS service name + # ECR_REPOSITORY: whisper # set this to your Amazon ECR repository name + # ECS_SERVICE: whisper-service # set this to your Amazon ECS service name ECS_CLUSTER: genie # set this to your Amazon ECS cluster name ECS_TASK_DEFINITION: awstask.json # set this to the path to your Amazon ECS task definition # file, e.g. .aws/task-definition.json @@ -64,23 +64,23 @@ jobs: aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: ${{ env.AWS_REGION }} - - name: Login to Amazon ECR - id: login-ecr - uses: aws-actions/amazon-ecr-login@v1 + # - name: Login to Amazon ECR + # id: login-ecr + # uses: aws-actions/amazon-ecr-login@v1 - - name: Build, tag, and push image to Amazon ECR - id: build-image - env: - ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} - IMAGE_TAG: ${{ github.sha }} - run: | - # Build a docker container and - # push it to ECR so that it can - # be deployed to ECS. - echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT - docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG . - docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG - echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT + # - name: Build, tag, and push image to Amazon ECR + # id: build-image + # env: + # ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} + # IMAGE_TAG: ${{ github.sha }} + # run: | + # # Build a docker container and + # # push it to ECR so that it can + # # be deployed to ECS. + # echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT + # docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG . + # docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG + # echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT - name: Fill in the new image ID in the Amazon ECS task definition id: task-def diff --git a/awstask.json b/awstask.json index 01d2d07..74da725 100644 --- a/awstask.json +++ b/awstask.json @@ -1,70 +1,45 @@ { - "family": "genie-task", - "taskRoleArn": "ecsTaskExecutionRole", - "networkMode": "bridge", + "family": "genie", "containerDefinitions": [ { "name": "whisper", - "image": "whisper", - "cpu": 1024, - "memory": 2048, + "image": "pjgim/whisper", + "cpu": 0, "portMappings": [ { + "name": "whisper-8000-tcp", "containerPort": 8000, "hostPort": 8000, - "protocol": "tcp" + "protocol": "tcp", + "appProtocol": "http" } ], "essential": true, - "environment": [ - { - "name": "JULIA_DEPOT_PATH", - "value": "/home/genie/.julia" - }, - { - "name": "JULIA_REVISE", - "value": "off" - }, - { - "name": "GENIE_ENV", - "value": "prod" - }, - { - "name": "GENIE_HOST", - "value": "0.0.0.0" - }, - { - "name": "PORT", - "value": "8000" - }, - { - "name": "WSPORT", - "value": "8000" - } - ], + "environment": [], + "environmentFiles": [], + "mountPoints": [], + "volumesFrom": [], + "ulimits": [], "logConfiguration": { "logDriver": "awslogs", "options": { - "awslogs-group": "genie-logs", + "awslogs-create-group": "true", + "awslogs-group": "/ecs/genie", "awslogs-region": "us-east-1", - "awslogs-stream-prefix": "genie" + "awslogs-stream-prefix": "ecs" } - }, - "healthCheck": { - "command": [ - "CMD-SHELL", - "curl -f http://localhost:8000 || exit 1" - ], - "interval": 30, - "timeout": 5, - "retries": 3, - "startPeriod": 0 } } ], + "executionRoleArn": "arn:aws:iam::423888958564:role/ecsTaskExecutionRole", + "networkMode": "awsvpc", "requiresCompatibilities": [ - "EC2" + "FARGATE" ], - "cpu": "1024", - "memory": "2048" + "cpu": "512", + "memory": "1024", + "runtimePlatform": { + "cpuArchitecture": "X86_64", + "operatingSystemFamily": "LINUX" + } }