Skip to content

Commit

Permalink
feat: revert back to x86 from arm64 (#254)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxneuvians authored Sep 11, 2023
1 parent 865cd0e commit b618470
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 27 deletions.
21 changes: 9 additions & 12 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,21 @@ jobs:
id: login-ecr
uses: aws-actions/amazon-ecr-login@2fc7aceee09e9e4a7105c0d060c656fad0b4f63d # v1.7.0

- name: Set up QEMU
uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 # v2.2.0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@4c0219f9ac95b02789c1075625400b2acbff50b1 # v2.9.1

- name: Build container
working-directory: ./app
run: |
docker buildx build \
docker build \
--build-arg git_sha=$GITHUB_SHA \
--build-arg LICENSE_KEY=${{ secrets.MAXMIND_LICENSE }} \
--platform=linux/arm64 \
--push \
-t $REGISTRY/sre-bot:$GITHUB_SHA-`date '+%Y-%m-%d'` \
-t $REGISTRY/sre-bot:latest .
- name: Push containers to Amazon ECR
working-directory: ./app
run: |
docker push $REGISTRY/sre-bot:$GITHUB_SHA-`date '+%Y-%m-%d'`
docker push $REGISTRY/sre-bot:latest
- name: Restart ECS
run: |
aws ecs update-service --cluster sre-bot-cluster --service sre-bot-service --force-new-deployment > /dev/null 2>&1
Expand All @@ -69,10 +67,9 @@ jobs:
log_analytics_workspace_key: ${{ secrets.LOG_ANALYTICS_WORKSPACE_KEY }}

- name: Docker generate SBOM
uses: cds-snc/security-tools/.github/actions/generate-sbom@cfec0943e40dbb78cee115bbbe89dc17f07b7a0f # v2.1.3
uses: cds-snc/security-tools/.github/actions/generate-sbom@cfec0943e40dbb78cee115bbbe89dc17f07b7a0f # v2.1.3
with:
docker_image: "${{ env.REGISTRY }}/sre-bot:latest"
dockerfile_path: "app/Dockerfile"
platform: "linux/arm64"
sbom_name: "sre-bot"
token: "${{ secrets.GITHUB_TOKEN }}"
token: "${{ secrets.GITHUB_TOKEN }}"
11 changes: 2 additions & 9 deletions .github/workflows/ci_container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,15 @@ jobs:
DNS_PROXY_FORWARDTOSENTINEL: "true"
DNS_PROXY_LOGANALYTICSWORKSPACEID: ${{ secrets.LOG_ANALYTICS_WORKSPACE_ID }}
DNS_PROXY_LOGANALYTICSSHAREDKEY: ${{ secrets.LOG_ANALYTICS_WORKSPACE_KEY }}

- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3

- name: Set up QEMU
uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 # v2.2.0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@4c0219f9ac95b02789c1075625400b2acbff50b1 # v2.9.1

- name: Build container
working-directory: ./app
run: |
docker buildx build \
docker build \
--build-arg git_sha=$GITHUB_SHA \
--build-arg LICENSE_KEY=${{ secrets.MAXMIND_LICENSE }} \
--platform=linux/arm64 \
-t $REGISTRY/sre-bot:$GITHUB_SHA-`date '+%Y-%m-%d'` \
-t $REGISTRY/sre-bot:latest .
2 changes: 1 addition & 1 deletion app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM arm64v8/python:3.11.5-slim@sha256:f65b9b18c5752633d4975b14ef5bb6860b750e6b00dc9fd102542d9f84bf3d9c
FROM python:3.11.5-slim

RUN apt-get update \
&& apt-get install -y wget \
Expand Down
5 changes: 0 additions & 5 deletions terraform/ecs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ resource "aws_ecs_task_definition" "sre-bot" {
memory = var.fargate_memory
container_definitions = data.template_file.sre-bot.rendered
task_role_arn = aws_iam_role.sre-bot.arn

runtime_platform {
operating_system_family = "LINUX"
cpu_architecture = "ARM64"
}
}

resource "aws_ecs_service" "main" {
Expand Down

0 comments on commit b618470

Please sign in to comment.