Skip to content

Commit b60a3f7

Browse files
terryyylimpyalex
authored andcommitted
Ensure consistency of github workflow (#1157)
* Ensure consistency of github workflow Signed-off-by: Terence <terencelimxp@gmail.com> * Shift GCR latest tag workflow to release Signed-off-by: Terence <terencelimxp@gmail.com> * Fix production build arg Signed-off-by: Terence <terencelimxp@gmail.com> * Fix docker-compose test Signed-off-by: Terence <terencelimxp@gmail.com> * Use single step for dockerhub build and push Signed-off-by: Terence <terencelimxp@gmail.com> * Revert docker compose fix Signed-off-by: Terence <terencelimxp@gmail.com> * Simplify to single build push stage Signed-off-by: Terence <terencelimxp@gmail.com> * Remove build and just tag Signed-off-by: Terence <terencelimxp@gmail.com>
1 parent 89871f1 commit b60a3f7

8 files changed

Lines changed: 30 additions & 59 deletions

File tree

.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} REVISION=dev
28+
run: make build-${{ matrix.component }}-docker REGISTRY=${REGISTRY} VERSION=${GITHUB_SHA}
2929
- name: Push image
3030
run: |
3131
docker push ${REGISTRY}/feast-${{ matrix.component }}:${GITHUB_SHA}

.github/workflows/master_only.yml

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -30,38 +30,15 @@ jobs:
3030
- name: Get version
3131
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
3232
- name: Build image
33-
run: make build-${{ matrix.component }}-docker REGISTRY=gcr.io/kf-feast VERSION=${GITHUB_SHA} REVISION=${RELEASE_VERSION}
33+
run: make build-${{ matrix.component }}-docker REGISTRY=gcr.io/kf-feast VERSION=${GITHUB_SHA}
3434
- name: Push image
35-
run: make push-${{ matrix.component }}-docker REGISTRY=gcr.io/kf-feast VERSION=${GITHUB_SHA} REVISION=${RELEASE_VERSION}
35+
run: make push-${{ matrix.component }}-docker REGISTRY=gcr.io/kf-feast VERSION=${GITHUB_SHA}
3636
- name: Push development Docker image
3737
run: |
3838
if [ ${GITHUB_REF#refs/*/} == "master" ]; then
3939
docker tag gcr.io/kf-feast/feast-${{ matrix.component }}:${GITHUB_SHA} gcr.io/kf-feast/feast-${{ matrix.component }}:develop
4040
docker push gcr.io/kf-feast/feast-${{ matrix.component }}:develop
4141
fi
42-
- name: Push versioned Docker image
43-
run: |
44-
source infra/scripts/setup-common-functions.sh
45-
# Build and push semver tagged commits
46-
# Regular expression should match MAJOR.MINOR.PATCH[-PRERELEASE[.IDENTIFIER]]
47-
# eg. v0.7.1 v0.7.2-alpha v0.7.2-rc.1
48-
SEMVER_REGEX='^v[0-9]+\.[0-9]+\.[0-9]+(-([0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*))?$'
49-
if echo "${RELEASE_VERSION}" | grep -P "$SEMVER_REGEX" &>/dev/null ; then
50-
VERSION_WITHOUT_PREFIX=${RELEASE_VERSION:1}
51-
52-
docker tag gcr.io/kf-feast/feast-${{ matrix.component }}:${GITHUB_SHA} gcr.io/kf-feast/feast-${{ matrix.component }}:${VERSION_WITHOUT_PREFIX}
53-
docker push gcr.io/kf-feast/feast-${{ matrix.component }}:${VERSION_WITHOUT_PREFIX}
54-
55-
# Also update "latest" image if tagged commit is pushed to stable branch
56-
HIGHEST_SEMVER_TAG=$(get_tag_release -m)
57-
echo "Only push to latest tag if tag is the highest semver version $HIGHEST_SEMVER_TAG"
58-
59-
if [ "${VERSION_WITHOUT_PREFIX}" = "${HIGHEST_SEMVER_TAG:1}" ]
60-
then
61-
docker tag gcr.io/kf-feast/feast-${{ matrix.component }}:${GITHUB_SHA} gcr.io/kf-feast/feast-${{ matrix.component }}:latest
62-
docker push gcr.io/kf-feast/feast-${{ matrix.component }}:latest
63-
fi
64-
fi
6542
6643
publish-ingestion-jar:
6744
runs-on: [ self-hosted ]

.github/workflows/release.yml

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -69,36 +69,32 @@ jobs:
6969
export_default_credentials: true
7070
project_id: ${{ secrets.GCP_PROJECT_ID }}
7171
service_account_key: ${{ secrets.GCP_SA_KEY }}
72+
- run: gcloud auth configure-docker --quiet
7273
- name: Get m2 cache
7374
run: |
7475
infra/scripts/download-maven-cache.sh \
7576
--archive-uri ${MAVEN_CACHE} \
7677
--output-dir .
77-
- name: Build and push
78-
uses: docker/build-push-action@v2
79-
env:
80-
RELEASE_VERSION: ${{ needs.get-version.outputs.release_version }}
81-
with:
82-
push: true
83-
context: .
84-
file: ./infra/docker/${{ matrix.component }}/Dockerfile
85-
tags: feastdev/feast-${{ matrix.component }}:${{ needs.get-version.outputs.release_version }}
86-
build-args: |
87-
REVISION=$RELEASE_VERSION
88-
- name: Build and push latest
89-
uses: docker/build-push-action@v2
78+
- name: Build and push versioned images
9079
env:
9180
RELEASE_VERSION: ${{ needs.get-version.outputs.release_version }}
9281
VERSION_WITHOUT_PREFIX: ${{ needs.get-version.outputs.version_without_prefix }}
9382
HIGHEST_SEMVER_TAG: ${{ needs.get-version.outputs.highest_semver_tag }}
94-
with:
95-
if: ${VERSION_WITHOUT_PREFIX} == ${HIGHEST_SEMVER_TAG:1}
96-
push: true
97-
context: .
98-
file: ./infra/docker/${{ matrix.component }}/Dockerfile
99-
tags: feastdev/feast-${{ matrix.component }}:latest
100-
build-args: |
101-
REVISION=$RELEASE_VERSION
83+
run: |
84+
docker build --build-arg VERSION=$RELEASE_VERSION \
85+
-t gcr.io/kf-feast/feast-${{ matrix.component }}:${GITHUB_SHA} \
86+
-t gcr.io/kf-feast/feast-${{ matrix.component }}:${VERSION_WITHOUT_PREFIX} \
87+
-f infra/docker/${{ matrix.component }}/Dockerfile .
88+
docker push gcr.io/kf-feast/feast-${{ matrix.component }}:${VERSION_WITHOUT_PREFIX}
89+
90+
echo "Only push to latest tag if tag is the highest semver version $HIGHEST_SEMVER_TAG"
91+
if [ "${VERSION_WITHOUT_PREFIX}" = "${HIGHEST_SEMVER_TAG:1}" ]
92+
then
93+
docker tag feastdev/feast-${{ matrix.component }}:latest gcr.io/kf-feast/feast-${{ matrix.component }}:${VERSION_WITHOUT_PREFIX}
94+
docker tag gcr.io/kf-feast/feast-${{ matrix.component }}:latest gcr.io/kf-feast/feast-${{ matrix.component }}:${VERSION_WITHOUT_PREFIX}
95+
docker push feastdev/feast-${{ matrix.component }}:latest
96+
docker push gcr.io/kf-feast/feast-${{ matrix.component }}:latest
97+
fi
10298
10399
publish-helm-charts:
104100
runs-on: ubuntu-latest

Makefile

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

144144
build-core-docker:
145-
docker build $(if, $(REVISION),--build-arg REVISION=$(REVISION),) -t $(REGISTRY)/feast-core:$(VERSION) -f infra/docker/core/Dockerfile .
145+
docker build --build-arg VERSION=$(VERSION) -t $(REGISTRY)/feast-core:$(VERSION) -f infra/docker/core/Dockerfile .
146146

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

150150
build-serving-docker:
151-
docker build $(if, $(REVISION),--build-arg REVISION=$(REVISION),) -t $(REGISTRY)/feast-serving:$(VERSION) -f infra/docker/serving/Dockerfile .
151+
docker build --build-arg VERSION=$(VERSION) -t $(REGISTRY)/feast-serving:$(VERSION) -f infra/docker/serving/Dockerfile .
152152

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

infra/docker/core/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ RUN mvn dependency:go-offline -DexcludeGroupIds:dev.feast 2>/dev/null || true
2929

3030
COPY . .
3131

32-
ARG REVISION=dev
33-
RUN mvn --also-make --projects core -Drevision=$REVISION \
32+
ARG VERSION=dev
33+
RUN mvn --also-make --projects core -Drevision=$VERSION \
3434
-DskipUTs=true --batch-mode clean package
3535

3636
#
@@ -46,9 +46,9 @@ RUN wget -q https://github.com/grpc-ecosystem/grpc-health-probe/releases/downloa
4646
# ============================================================
4747

4848
FROM openjdk:11-jre as production
49-
ARG REVISION=dev
49+
ARG VERSION=dev
5050

51-
COPY --from=builder /build/core/target/feast-core-$REVISION-exec.jar /opt/feast/feast-core.jar
51+
COPY --from=builder /build/core/target/feast-core-$VERSION-exec.jar /opt/feast/feast-core.jar
5252
COPY --from=builder /usr/bin/grpc-health-probe /usr/bin/grpc-health-probe
5353

5454
CMD ["java",\

infra/docker/jobservice/Dockerfile

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

33
USER root
4-
ARG REVISION
54
WORKDIR /feast
65

76
COPY sdk/python sdk/python

infra/docker/jupyter/Dockerfile

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

33
USER root
4-
ARG REVISION
54
WORKDIR /feast
65

76
COPY sdk/python sdk/python

infra/docker/serving/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ RUN mvn dependency:go-offline -DexcludeGroupIds:dev.feast 2>/dev/null || true
2929

3030
COPY . .
3131

32-
ARG REVISION=dev
33-
RUN mvn --also-make --projects serving -Drevision=$REVISION \
32+
ARG VERSION=dev
33+
RUN mvn --also-make --projects serving -Drevision=$VERSION \
3434
-DskipUTs=true --batch-mode clean package
3535
#
3636
# Download grpc_health_probe to run health check for Feast Serving
@@ -45,8 +45,8 @@ RUN wget -q https://github.com/grpc-ecosystem/grpc-health-probe/releases/downloa
4545
# ============================================================
4646

4747
FROM openjdk:11-jre-slim as production
48-
ARG REVISION=dev
49-
COPY --from=builder /build/serving/target/feast-serving-$REVISION-exec.jar /opt/feast/feast-serving.jar
48+
ARG VERSION=dev
49+
COPY --from=builder /build/serving/target/feast-serving-$VERSION-exec.jar /opt/feast/feast-serving.jar
5050
COPY --from=builder /usr/bin/grpc-health-probe /usr/bin/grpc-health-probe
5151
CMD ["java",\
5252
"-Xms1024m",\

0 commit comments

Comments
 (0)