Skip to content

Commit 1603c9e

Browse files
authored
fix: Fix nightly ci again (#2939)
* Fix Signed-off-by: Kevin Zhang <[email protected]> * Fix Signed-off-by: Kevin Zhang <[email protected]> * Fix Signed-off-by: Kevin Zhang <[email protected]> * Fix Signed-off-by: Kevin Zhang <[email protected]> * Fix Signed-off-by: Kevin Zhang <[email protected]> * Fix Signed-off-by: Kevin Zhang <[email protected]> * Fix Signed-off-by: Kevin Zhang <[email protected]> * Fix Signed-off-by: Kevin Zhang <[email protected]> * Fix Signed-off-by: Kevin Zhang <[email protected]> * Fix Signed-off-by: Kevin Zhang <[email protected]>
1 parent 6f79069 commit 1603c9e

File tree

1 file changed

+59
-8
lines changed

1 file changed

+59
-8
lines changed

.github/workflows/nightly-ci.yml

Lines changed: 59 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,68 @@ jobs:
1818
steps:
1919
- uses: actions/checkout@v2
2020
with:
21-
ref: develop
21+
ref: master
2222
- id: check_date
2323
name: Check if there were commits in the last day
2424
if: ${{ github.event_name == 'schedule' }}
2525
run: echo '::set-output name=WAS_EDITED::'$(test -n "$(git log --format=%H --since='24 hours ago')" && echo 'true' || echo 'false')
26-
26+
build-docker-image:
27+
needs: [check_date]
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v3
31+
with:
32+
ref: master
33+
submodules: recursive
34+
- name: Set up QEMU
35+
uses: docker/setup-qemu-action@v1
36+
- name: Set up Docker Buildx
37+
uses: docker/setup-buildx-action@v2
38+
with:
39+
install: true
40+
- name: Set up AWS SDK
41+
uses: aws-actions/configure-aws-credentials@v1
42+
with:
43+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
44+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
45+
aws-region: us-west-2
46+
- name: Login to Amazon ECR
47+
id: login-ecr
48+
uses: aws-actions/amazon-ecr-login@v1
49+
- name: Set ECR image tag
50+
id: image-tag
51+
run: echo "::set-output name=DOCKER_IMAGE_TAG::`git rev-parse HEAD`"
52+
- name: Cache Public ECR Image
53+
id: lambda_python_3_9
54+
uses: actions/cache@v2
55+
with:
56+
path: ~/cache
57+
key: lambda_python_3_9
58+
- name: Handle Cache Miss (pull public ECR image & save it to tar file)
59+
if: steps.cache-primes.outputs.cache-hit != 'true'
60+
run: |
61+
mkdir -p ~/cache
62+
docker pull public.ecr.aws/lambda/python:3.9
63+
docker save public.ecr.aws/lambda/python:3.9 -o ~/cache/lambda_python_3_9.tar
64+
- name: Handle Cache Hit (load docker image from tar file)
65+
if: steps.cache-primes.outputs.cache-hit == 'true'
66+
run: |
67+
docker load -i ~/cache/lambda_python_3_9.tar
68+
- name: Build and push
69+
env:
70+
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
71+
ECR_REPOSITORY: feast-python-server
72+
run: |
73+
docker build \
74+
--file sdk/python/feast/infra/feature_servers/aws_lambda/Dockerfile \
75+
--tag $ECR_REGISTRY/$ECR_REPOSITORY:${{ steps.image-tag.outputs.DOCKER_IMAGE_TAG }} \
76+
--load \
77+
.
78+
docker push $ECR_REGISTRY/$ECR_REPOSITORY:${{ steps.image-tag.outputs.DOCKER_IMAGE_TAG }}
79+
outputs:
80+
DOCKER_IMAGE_TAG: ${{ steps.image-tag.outputs.DOCKER_IMAGE_TAG }}
2781
integration-test-python:
28-
needs: check_date
82+
needs: [check_date, build-docker-image]
2983
runs-on: ${{ matrix.os }}
3084
strategy:
3185
fail-fast: false
@@ -48,16 +102,13 @@ jobs:
48102
steps:
49103
- uses: actions/checkout@v2
50104
with:
51-
# pull_request_target runs the workflow in the context of the base repo
52-
# as such actions/checkout needs to be explicit configured to retrieve
53-
# code from the PR.
54-
ref: refs/pull/${{ github.event.pull_request.number }}/merge
105+
ref: master
55106
submodules: recursive
56107
- name: Setup Python
57108
uses: actions/setup-python@v2
58109
id: setup-python
59110
with:
60-
python-version: ${{ os.PYTHON }}
111+
python-version: ${{ matrix.python-version }}
61112
architecture: x64
62113
- name: Setup Go
63114
id: setup-go

0 commit comments

Comments
 (0)