Skip to content

Commit 8f370a0

Browse files
authored
Fix docker build for java parts (feast-dev#2059)
Signed-off-by: pyalex <moskalenko.alexey@gmail.com>
1 parent 8426ca5 commit 8f370a0

File tree

7 files changed

+51
-144
lines changed

7 files changed

+51
-144
lines changed

.github/workflows/java_master_only.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ jobs:
1212
runs-on: ubuntu-latest
1313
strategy:
1414
matrix:
15-
component: [core, serving]
15+
component: [feature-server-java]
1616
env:
1717
MAVEN_CACHE: gs://feast-templocation-kf-feast/.m2.2020-08-19.tar
18+
REGISTRY: gcr.io/kf-feast
1819
steps:
1920
- uses: actions/checkout@v2
2021
with:
@@ -34,14 +35,14 @@ jobs:
3435
- name: Get version
3536
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
3637
- name: Build image
37-
run: make build-${{ matrix.component }}-docker REGISTRY=gcr.io/kf-feast VERSION=${GITHUB_SHA}
38+
run: make build-${{ matrix.component }}-docker REGISTRY=${REGISTRY} VERSION=${GITHUB_SHA}
3839
- name: Push image
39-
run: make push-${{ matrix.component }}-docker REGISTRY=gcr.io/kf-feast VERSION=${GITHUB_SHA}
40+
run: make push-${{ matrix.component }}-docker REGISTRY=${REGISTRY} VERSION=${GITHUB_SHA}
4041
- name: Push development Docker image
4142
run: |
4243
if [ ${GITHUB_REF#refs/*/} == "master" ]; then
43-
docker tag gcr.io/kf-feast/feast-${{ matrix.component }}:${GITHUB_SHA} gcr.io/kf-feast/feast-${{ matrix.component }}:develop
44-
docker push gcr.io/kf-feast/feast-${{ matrix.component }}:develop
44+
docker tag ${REGISTRY}/${{ matrix.component }}:${GITHUB_SHA} ${REGISTRY}/${{ matrix.component }}:develop
45+
docker push ${REGISTRY}/${{ matrix.component }}:develop
4546
fi
4647
4748
lint-java:

.github/workflows/java_release.yml

Lines changed: 11 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,14 @@ jobs:
4444
echo $HIGHEST_SEMVER_TAG
4545
4646
build-publish-docker-images:
47-
runs-on: [ubuntu-latest]
47+
runs-on: ubuntu-latest
4848
needs: get-version
4949
strategy:
5050
matrix:
51-
component: [core, serving]
51+
component: [feature-server]
5252
env:
5353
MAVEN_CACHE: gs://feast-templocation-kf-feast/.m2.2020-08-19.tar
54+
REGISTRY: feastdev
5455
steps:
5556
- uses: actions/checkout@v2
5657
with:
@@ -81,27 +82,21 @@ jobs:
8182
RELEASE_VERSION: ${{ needs.get-version.outputs.release_version }}
8283
VERSION_WITHOUT_PREFIX: ${{ needs.get-version.outputs.version_without_prefix }}
8384
HIGHEST_SEMVER_TAG: ${{ needs.get-version.outputs.highest_semver_tag }}
84-
run: |
85-
docker build --build-arg VERSION=$RELEASE_VERSION \
86-
-t gcr.io/kf-feast/feast-${{ matrix.component }}:${GITHUB_SHA} \
87-
-t gcr.io/kf-feast/feast-${{ matrix.component }}:${VERSION_WITHOUT_PREFIX} \
88-
-t feastdev/feast-${{ matrix.component }}:${VERSION_WITHOUT_PREFIX} \
89-
-f infra/docker/${{ matrix.component }}/Dockerfile .
90-
docker push gcr.io/kf-feast/feast-${{ matrix.component }}:${VERSION_WITHOUT_PREFIX}
91-
docker push feastdev/feast-${{ matrix.component }}:${VERSION_WITHOUT_PREFIX}
92-
85+
- name: Build image
86+
run: make build-${{ matrix.component }}-docker REGISTRY=${REGISTRY} VERSION=${RELEASE_VERSION}
87+
- name: Push image
88+
run: make push-${{ matrix.component }}-docker REGISTRY=${REGISTRY} VERSION=${RELEASE_VERSION}
89+
- run: |
9390
echo "Only push to latest tag if tag is the highest semver version $HIGHEST_SEMVER_TAG"
9491
if [ "${VERSION_WITHOUT_PREFIX}" = "${HIGHEST_SEMVER_TAG:1}" ]
9592
then
96-
docker tag feastdev/feast-${{ matrix.component }}:${VERSION_WITHOUT_PREFIX} feastdev/feast-${{ matrix.component }}:latest
97-
docker tag gcr.io/kf-feast/feast-${{ matrix.component }}:${VERSION_WITHOUT_PREFIX} gcr.io/kf-feast/feast-${{ matrix.component }}:latest
98-
docker push feastdev/feast-${{ matrix.component }}:latest
99-
docker push gcr.io/kf-feast/feast-${{ matrix.component }}:latest
93+
docker tag ${REGISTRY}/${{ matrix.component }}:${VERSION_WITHOUT_PREFIX} ${REGISTRY}/${{ matrix.component }}:latest
94+
docker push ${REGISTRY}/${{ matrix.component }}:latest
10095
fi
10196
10297
publish-java-sdk:
10398
container: maven:3.6-jdk-11
104-
runs-on: [ubuntu-latest]
99+
runs-on: ubuntu-latest
105100
needs: get-version
106101
steps:
107102
- uses: actions/checkout@v2
@@ -135,27 +130,3 @@ jobs:
135130
mkdir -p /root/.m2/
136131
echo -n "$MAVEN_SETTINGS" > /root/.m2/settings.xml
137132
infra/scripts/publish-java-sdk.sh --revision ${VERSION_WITHOUT_PREFIX} --gpg-key-import-dir /root
138-
139-
publish-helm-charts:
140-
runs-on: ubuntu-latest
141-
needs: get-version
142-
env:
143-
HELM_VERSION: v2.17.0
144-
VERSION_WITHOUT_PREFIX: ${{ needs.get-version.outputs.version_without_prefix }}
145-
steps:
146-
- uses: actions/checkout@v2
147-
- uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
148-
with:
149-
version: '290.0.1'
150-
export_default_credentials: true
151-
project_id: ${{ secrets.GCP_PROJECT_ID }}
152-
service_account_key: ${{ secrets.GCP_SA_KEY }}
153-
- run: gcloud auth configure-docker --quiet
154-
- name: Remove previous Helm
155-
run: sudo rm -rf $(which helm)
156-
- name: Install Helm
157-
run: ./infra/scripts/install-helm.sh
158-
- name: Validate all version consistency
159-
run: ./infra/scripts/validate-helm-chart-versions.sh $VERSION_WITHOUT_PREFIX
160-
- name: Publish Helm charts
161-
run: ./infra/scripts/push-helm-charts.sh $VERSION_WITHOUT_PREFIX

Makefile

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,4 +185,17 @@ build-sphinx: compile-protos-python
185185
cd $(ROOT_DIR)/sdk/python/docs && $(MAKE) build-api-source
186186

187187
build-templates:
188-
python infra/scripts/compile-templates.py
188+
python infra/scripts/compile-templates.py
189+
190+
191+
# Java Docker
192+
193+
build-push-java-docker:
194+
@$(MAKE) build-feature-server-java-docker registry=$(REGISTRY) version=$(VERSION)
195+
@$(MAKE) push-feature-server-java-docker registry=$(REGISTRY) version=$(VERSION)
196+
197+
push-feature-server-java-docker:
198+
docker push $(REGISTRY)/feature-server-java:$(VERSION)
199+
200+
build-feature-server-java-docker:
201+
docker build --build-arg VERSION=$(VERSION) -t $(REGISTRY)/feature-server-java:$(VERSION) -f java/infra/docker/feature-server/Dockerfile .

java/Makefile

Lines changed: 0 additions & 77 deletions
This file was deleted.

java/infra/docker/serving/Dockerfile renamed to java/infra/docker/feature-server/Dockerfile

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,26 @@ FROM maven:3.6-jdk-11 as builder
66

77
WORKDIR /build
88

9-
COPY pom.xml .
10-
COPY datatypes/java/pom.xml datatypes/java/pom.xml
11-
COPY common/pom.xml common/pom.xml
12-
COPY core/pom.xml core/pom.xml
13-
COPY serving/pom.xml serving/pom.xml
14-
COPY storage/api/pom.xml storage/api/pom.xml
15-
COPY storage/connectors/pom.xml storage/connectors/pom.xml
16-
COPY storage/connectors/redis/pom.xml storage/connectors/redis/pom.xml
17-
COPY sdk/java/pom.xml sdk/java/pom.xml
18-
COPY docs/coverage/java/pom.xml docs/coverage/java/pom.xml
19-
COPY deps/feast/protos/ deps/feast/protos/
9+
COPY java/pom.xml .
10+
COPY java/datatypes/java/pom.xml datatypes/java/pom.xml
11+
COPY java/common/pom.xml common/pom.xml
12+
COPY java/serving/pom.xml serving/pom.xml
13+
COPY java/storage/api/pom.xml storage/api/pom.xml
14+
COPY java/storage/connectors/pom.xml storage/connectors/pom.xml
15+
COPY java/storage/connectors/redis/pom.xml storage/connectors/redis/pom.xml
16+
COPY java/sdk/java/pom.xml sdk/java/pom.xml
17+
COPY java/docs/coverage/java/pom.xml docs/coverage/java/pom.xml
2018

2119
# Setting Maven repository .m2 directory relative to /build folder gives the
2220
# user to optionally use cached repository when building the image by copying
2321
# the existing .m2 directory to $FEAST_REPO_ROOT/.m2
2422
ENV MAVEN_OPTS="-Dmaven.repo.local=/build/.m2/repository -DdependencyLocationsEnabled=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=25 -Dmaven.wagon.http.retryHandler.count=3"
25-
COPY pom.xml .m2/* .m2/
23+
COPY java/pom.xml .m2/* .m2/
2624
RUN mvn dependency:go-offline -DexcludeGroupIds:dev.feast 2>/dev/null || true
2725

28-
COPY . .
26+
COPY java/ .
27+
COPY protos/feast datatypes/java/src/main/proto/feast
28+
COPY protos/tensorflow_metadata datatypes/java/src/main/proto/tensorflow_metadata
2929

3030
ARG VERSION=dev
3131
RUN mvn --also-make --projects serving -Drevision=$VERSION \
File renamed without changes.

java/pom.xml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
</modules>
3939

4040
<properties>
41-
<revision>0.26.2</revision>
41+
<revision>0.15.2-SNAPSHOT</revision>
4242
<github.url>https://github.com/feast-dev/feast</github.url>
4343

4444
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -103,16 +103,16 @@
103103
</properties>
104104

105105
<organization>
106-
<name>Gojek</name>
107-
<url>https://www.gojek.com</url>
106+
<name>Tecton</name>
107+
<url>https://www.tecton.ai</url>
108108
</organization>
109109

110110
<developers>
111111
<developer>
112112
<name>Feast Authors</name>
113113
<url>${github.url}</url>
114-
<organization>Gojek</organization>
115-
<organizationUrl>https://www.gojek.com</organizationUrl>
114+
<organization>Tecton</organization>
115+
<organizationUrl>https://www.tecton.ai</organizationUrl>
116116
</developer>
117117
</developers>
118118

@@ -565,8 +565,7 @@
565565
<groupId>org.apache.maven.plugins</groupId>
566566
<artifactId>maven-compiler-plugin</artifactId>
567567
<configuration>
568-
<!-- Our leaf applications target 11, except Ingestion and its deps remain on 8 for Beam -->
569-
<release>8</release>
568+
<release>11</release>
570569
<annotationProcessorPaths>
571570
<path>
572571
<groupId>com.google.auto.value</groupId>
@@ -648,7 +647,7 @@
648647
<dependency>
649648
<groupId>org.junit.vintage</groupId>
650649
<artifactId>junit-vintage-engine</artifactId>
651-
<version>5.5.2</version>
650+
<version>5.6.3</version>
652651
</dependency>
653652
</dependencies>
654653
</plugin>

0 commit comments

Comments
 (0)