Skip to content

Commit f21d27b

Browse files
author
Tsotne Tabidze
authored
Upload feature server docker image to ECR on approved PRs (#2014)
Signed-off-by: Tsotne Tabidze <tsotne@tecton.ai>
1 parent c50b398 commit f21d27b

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

.github/workflows/pr_integration_tests.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,42 @@ on:
88
- labeled
99

1010
jobs:
11+
build-docker-image:
12+
# all jobs MUST have this if check for 'ok-to-test' or 'approved' for security purposes.
13+
if: (github.event.action == 'labeled' && (github.event.label.name == 'approved' || github.event.label.name == 'ok-to-test'))
14+
|| (github.event.action != 'labeled' && (contains(github.event.pull_request.labels.*.name, 'ok-to-test') || contains(github.event.pull_request.labels.*.name, 'approved')))
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: Set up QEMU
19+
uses: docker/setup-qemu-action@v1
20+
- name: Set up Docker Buildx
21+
uses: docker/setup-buildx-action@v1
22+
- name: Set up AWS SDK
23+
uses: aws-actions/configure-aws-credentials@v1
24+
with:
25+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
26+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
27+
aws-region: us-west-2
28+
- name: Login to Amazon ECR
29+
id: login-ecr
30+
uses: aws-actions/amazon-ecr-login@v1
31+
- name: Build and push
32+
env:
33+
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
34+
ECR_REPOSITORY: feast-python-server
35+
IMAGE_TAG: ${{ github.sha }}
36+
run: |
37+
docker build \
38+
--file sdk/python/feast/infra/feature_servers/aws_lambda/Dockerfile \
39+
--tag $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG \
40+
.
41+
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
1142
integration-test-python:
1243
# all jobs MUST have this if check for 'ok-to-test' or 'approved' for security purposes.
1344
if: (github.event.action == 'labeled' && (github.event.label.name == 'approved' || github.event.label.name == 'ok-to-test'))
1445
|| (github.event.action != 'labeled' && (contains(github.event.pull_request.labels.*.name, 'ok-to-test') || contains(github.event.pull_request.labels.*.name, 'approved')))
46+
needs: build-docker-image
1547
runs-on: ${{ matrix.os }}
1648
strategy:
1749
fail-fast: false

0 commit comments

Comments
 (0)