|
13 | 13 | # cancel-in-progress: true |
14 | 14 |
|
15 | 15 | jobs: |
16 | | - build-docker-image: |
17 | | - # when using pull_request_target, all jobs MUST have this if check for 'ok-to-test' or 'approved' for security purposes. |
18 | | - if: |
19 | | - ((github.event.action == 'labeled' && (github.event.label.name == 'approved' || github.event.label.name == 'lgtm' || github.event.label.name == 'ok-to-test')) || |
20 | | - (github.event.action != 'labeled' && (contains(github.event.pull_request.labels.*.name, 'ok-to-test') || contains(github.event.pull_request.labels.*.name, 'approved') || contains(github.event.pull_request.labels.*.name, 'lgtm')))) && |
21 | | - github.repository == 'feast-dev/feast' |
22 | | - runs-on: ubuntu-latest |
23 | | - steps: |
24 | | - - uses: actions/checkout@v4 |
25 | | - with: |
26 | | - # pull_request_target runs the workflow in the context of the base repo |
27 | | - # as such actions/checkout needs to be explicit configured to retrieve |
28 | | - # code from the PR. |
29 | | - ref: refs/pull/${{ github.event.pull_request.number }}/merge |
30 | | - submodules: recursive |
31 | | - - name: Set up QEMU |
32 | | - uses: docker/setup-qemu-action@v1 |
33 | | - - name: Set up Docker Buildx |
34 | | - uses: docker/setup-buildx-action@v2 |
35 | | - with: |
36 | | - install: true |
37 | | - - name: Set up AWS SDK |
38 | | - uses: aws-actions/configure-aws-credentials@v1 |
39 | | - with: |
40 | | - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} |
41 | | - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
42 | | - aws-region: us-west-2 |
43 | | - - name: Login to Amazon ECR |
44 | | - id: login-ecr |
45 | | - uses: aws-actions/amazon-ecr-login@v1 |
46 | | - - name: Set ECR image tag |
47 | | - id: image-tag |
48 | | - run: echo "::set-output name=DOCKER_IMAGE_TAG::`git rev-parse HEAD`" |
49 | | - - name: Cache Public ECR Image |
50 | | - id: lambda_python_3_11 |
51 | | - uses: actions/cache@v2 |
52 | | - with: |
53 | | - path: ~/cache |
54 | | - key: lambda_python_3_11 |
55 | | - - name: Handle Cache Miss (pull public ECR image & save it to tar file) |
56 | | - if: steps.cache-primes.outputs.cache-hit != 'true' |
57 | | - run: | |
58 | | - mkdir -p ~/cache |
59 | | - docker pull public.ecr.aws/lambda/python:3.11 |
60 | | - docker save public.ecr.aws/lambda/python:3.11 -o ~/cache/lambda_python_3_11.tar |
61 | | - - name: Handle Cache Hit (load docker image from tar file) |
62 | | - if: steps.cache-primes.outputs.cache-hit == 'true' |
63 | | - run: | |
64 | | - docker load -i ~/cache/lambda_python_3_11.tar |
65 | | - - name: Build and push |
66 | | - env: |
67 | | - ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} |
68 | | - ECR_REPOSITORY: feast-python-server |
69 | | - run: | |
70 | | - docker build \ |
71 | | - --file sdk/python/feast/infra/feature_servers/aws_lambda/Dockerfile \ |
72 | | - --tag $ECR_REGISTRY/$ECR_REPOSITORY:${{ steps.image-tag.outputs.DOCKER_IMAGE_TAG }} \ |
73 | | - --load \ |
74 | | - . |
75 | | - docker push $ECR_REGISTRY/$ECR_REPOSITORY:${{ steps.image-tag.outputs.DOCKER_IMAGE_TAG }} |
76 | | - outputs: |
77 | | - DOCKER_IMAGE_TAG: ${{ steps.image-tag.outputs.DOCKER_IMAGE_TAG }} |
78 | 16 | integration-test-python: |
79 | 17 | # when using pull_request_target, all jobs MUST have this if check for 'ok-to-test' or 'approved' for security purposes. |
80 | 18 | if: |
81 | 19 | ((github.event.action == 'labeled' && (github.event.label.name == 'approved' || github.event.label.name == 'lgtm' || github.event.label.name == 'ok-to-test')) || |
82 | 20 | (github.event.action != 'labeled' && (contains(github.event.pull_request.labels.*.name, 'ok-to-test') || contains(github.event.pull_request.labels.*.name, 'approved') || contains(github.event.pull_request.labels.*.name, 'lgtm')))) && |
83 | 21 | github.repository == 'feast-dev/feast' |
84 | | - needs: build-docker-image |
85 | 22 | runs-on: ${{ matrix.os }} |
86 | 23 | strategy: |
87 | 24 | fail-fast: false |
|
0 commit comments