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 1 commit
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
28 changes: 27 additions & 1 deletion .github/workflows/push-ingestor-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ permissions:
contents: read

jobs:
deploy-to-staging:
push-ingestor-build:
name: build and push ingestor to remote
runs-on: ubuntu-latest
environment: staging
Expand All @@ -40,3 +40,29 @@ jobs:
tags: ${{ secrets.ECR_REPO }}:${{ github.head_ref || github.ref_name }}
push: true
provenance: false
push-ingestorv2-build:
jgadling marked this conversation as resolved.
Show resolved Hide resolved
name: build and push apiv2 ingestor to remote
runs-on: ubuntu-latest
environment: staging
if: github.repository == 'chanzuckerberg/cryoet-data-portal-backend'
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
mask-aws-account-id: true
aws-region: ${{ secrets.AWS_REGION }}
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
role-duration-seconds: 1200
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Checkout code
uses: actions/checkout@v3
- name: Docker build & Push
uses: docker/build-push-action@v4
with:
context: ./apiv2
file: ./apiv2/Dockerfile
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a blocker: It looks like, the only difference between the ingestion job and this one are these two values. What are your thoughts on having a composite action that can be used by both these jobs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated it to use a matrix build. check again?

tags: ${{ secrets.ECR_REPO_V2 }}:${{ 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