@@ -18,14 +18,68 @@ jobs:
18
18
steps :
19
19
- uses : actions/checkout@v2
20
20
with :
21
- ref : develop
21
+ ref : master
22
22
- id : check_date
23
23
name : Check if there were commits in the last day
24
24
if : ${{ github.event_name == 'schedule' }}
25
25
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 }}
27
81
integration-test-python :
28
- needs : check_date
82
+ needs : [ check_date, build-docker-image]
29
83
runs-on : ${{ matrix.os }}
30
84
strategy :
31
85
fail-fast : false
@@ -48,16 +102,13 @@ jobs:
48
102
steps :
49
103
- uses : actions/checkout@v2
50
104
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
55
106
submodules : recursive
56
107
- name : Setup Python
57
108
uses : actions/setup-python@v2
58
109
id : setup-python
59
110
with :
60
- python-version : ${{ os.PYTHON }}
111
+ python-version : ${{ matrix.python-version }}
61
112
architecture : x64
62
113
- name : Setup Go
63
114
id : setup-go
0 commit comments