Skip to content

Commit 5acd905

Browse files
authored
Fix revision arg when building image (feast-dev#1154)
* Fix revision arg when building image Signed-off-by: Terence <terencelimxp@gmail.com> * Add revision arg to Dockerfiles Signed-off-by: Terence <terencelimxp@gmail.com> * Update git initialization Signed-off-by: Terence <terencelimxp@gmail.com>
1 parent e518773 commit 5acd905

File tree

6 files changed

+13
-9
lines changed

6 files changed

+13
-9
lines changed

.github/workflows/complete.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
--archive-uri ${MAVEN_CACHE} \
2626
--output-dir .
2727
- name: Build image
28-
run: make build-${{ matrix.component }}-docker REGISTRY=${REGISTRY} VERSION=${GITHUB_SHA}
28+
run: make build-${{ matrix.component }}-docker REGISTRY=${REGISTRY} VERSION=${GITHUB_SHA} REVISION=dev
2929
- name: Push image
3030
run: |
3131
docker push ${REGISTRY}/feast-${{ matrix.component }}:${GITHUB_SHA}

.github/workflows/master_only.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,18 @@ jobs:
2727
infra/scripts/download-maven-cache.sh \
2828
--archive-uri ${MAVEN_CACHE} \
2929
--output-dir .
30+
- name: Get version
31+
run: echo ::set-env name=RELEASE_VERSION::${GITHUB_REF#refs/*/}
3032
- name: Build image
31-
run: make build-${{ matrix.component }}-docker REGISTRY=gcr.io/kf-feast VERSION=${GITHUB_SHA}
33+
run: make build-${{ matrix.component }}-docker REGISTRY=gcr.io/kf-feast VERSION=${GITHUB_SHA} REVISION=${RELEASE_VERSION}
3234
- name: Push image
33-
run: make push-${{ matrix.component }}-docker REGISTRY=gcr.io/kf-feast VERSION=${GITHUB_SHA}
35+
run: make push-${{ matrix.component }}-docker REGISTRY=gcr.io/kf-feast VERSION=${GITHUB_SHA} REVISION=${RELEASE_VERSION}
3436
- name: Push development Docker image
3537
run: |
3638
if [ ${GITHUB_REF#refs/*/} == "master" ]; then
3739
docker tag gcr.io/kf-feast/feast-${{ matrix.component }}:${GITHUB_SHA} gcr.io/kf-feast/feast-${{ matrix.component }}:develop
3840
docker push gcr.io/kf-feast/feast-${{ matrix.component }}:develop
3941
fi
40-
- name: Get version
41-
run: echo ::set-env name=RELEASE_VERSION::${GITHUB_REF#refs/*/}
4242
- name: Push versioned Docker image
4343
run: |
4444
source infra/scripts/setup-common-functions.sh

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,13 @@ push-jupyter-docker:
141141
docker push $(REGISTRY)/feast-jupyter:$(VERSION)
142142

143143
build-core-docker:
144-
docker build -t $(REGISTRY)/feast-core:$(VERSION) -f infra/docker/core/Dockerfile .
144+
docker build --build-arg REVISION=$(REVISION) -t $(REGISTRY)/feast-core:$(VERSION) -f infra/docker/core/Dockerfile .
145145

146146
build-jobservice-docker:
147147
docker build -t $(REGISTRY)/feast-jobservice:$(VERSION) -f infra/docker/jobservice/Dockerfile .
148148

149149
build-serving-docker:
150-
docker build -t $(REGISTRY)/feast-serving:$(VERSION) -f infra/docker/serving/Dockerfile .
150+
docker build --build-arg REVISION=$(REVISION) -t $(REGISTRY)/feast-serving:$(VERSION) -f infra/docker/serving/Dockerfile .
151151

152152
build-ci-docker:
153153
docker build -t $(REGISTRY)/feast-ci:$(VERSION) -f infra/docker/ci/Dockerfile .

infra/docker/ci/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
FROM maven:3.6-jdk-11
22

3+
ARG REVISION
4+
35
# Install Google Cloud SDK
46
RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" \
57
| tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && \

infra/docker/jobservice/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
FROM jupyter/pyspark-notebook:ae5f7e104dd5
22

33
USER root
4+
ARG REVISION
45
WORKDIR /feast
56

67
COPY sdk/python sdk/python
@@ -14,7 +15,7 @@ RUN apt-get update && apt-get -y install make git wget
1415
RUN make compile-protos-python
1516

1617
# Install Feast SDK
17-
COPY .git .git
18+
RUN git init .
1819
COPY README.md README.md
1920
RUN pip install -U -e sdk/python
2021
RUN pip install "s3fs" "boto3" "urllib3>=1.25.4"

infra/docker/jupyter/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
FROM jupyter/pyspark-notebook:ae5f7e104dd5
22

33
USER root
4+
ARG REVISION
45
WORKDIR /feast
56

67
COPY sdk/python sdk/python
@@ -15,7 +16,7 @@ RUN make compile-protos-python
1516
RUN pip install -r sdk/python/requirements-ci.txt
1617

1718
# Install Feast SDK
18-
COPY .git .git
19+
RUN git init .
1920
COPY README.md README.md
2021
RUN pip install -e sdk/python -U
2122
RUN pip install "s3fs" "boto3" "urllib3>=1.25.4"

0 commit comments

Comments
 (0)