Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Build an x86 version of the apiv2 image to execute in aws batch. #347

Merged
merged 3 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions .github/workflows/push-ingestor-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- main
paths:
- "ingestion_tools/**"
- "apiv2/**"
- ".github/workflows/push-ingestor-build.yaml"

# https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-amazon-web-services
Expand All @@ -14,7 +15,14 @@ permissions:
contents: read

jobs:
deploy-to-staging:
push-images:
strategy:
matrix:
include:
- build_dir: ingestion_tools
repo: ${{ secrets.ECR_REPO }}
- build_dir: apiv2
repo: ${{ secrets.ECR_REPO_V2 }}
name: build and push ingestor to remote
runs-on: ubuntu-latest
environment: staging
Expand All @@ -35,8 +43,8 @@ jobs:
- name: Docker build & Push
uses: docker/build-push-action@v4
with:
context: ./ingestion_tools
file: ./ingestion_tools/Dockerfile
tags: ${{ secrets.ECR_REPO }}:${{ github.head_ref || github.ref_name }}
context: ./${{ build_dir }}
file: ./${{ build_dir }}/Dockerfile
tags: ${{ repo }}:${{ github.head_ref || github.ref_name }}
push: true
provenance: false
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,17 @@ push-local-ingestor-build:
aws_region=$$(aws configure get region); \
account_id=$$(aws sts get-caller-identity | jq -r ".Account"); \
ecr_repo=$$account_id.dkr.ecr.$$aws_region.amazonaws.com; \
$(MAKE) push-ingestor-build ecr_repo=$$ecr_repo/cryoet-staging tag=$(tag) aws_region=$$aws_region;
$(MAKE) push-ingestor-build ecr_repo=$$ecr_repo/cryoet-staging tag=$(tag) aws_region=$$aws_region; \
$(MAKE) push-ingestor-build-apiv2 ecr_repo=$$ecr_repo/apiv2-x86 tag=$(tag) aws_region=$$aws_region;

.PHONY: push-ingestor-build
push-ingestor-build:
cd ./ingestion_tools/; docker build . -t $(ecr_repo):$(tag) --platform linux/amd64;
aws ecr get-login-password --region $(aws_region) | docker login --username AWS --password-stdin $(ecr_repo); \
docker push $(ecr_repo):$(tag);

.PHONY: push-ingestor-build-apiv2
push-ingestor-build-apiv2:
cd ./apiv2/; docker build . -t $(ecr_repo):$(tag) --platform linux/amd64;
aws ecr get-login-password --region $(aws_region) | docker login --username AWS --password-stdin $(ecr_repo); \
docker push $(ecr_repo):$(tag);
Loading