diff --git a/.github/workflows/java_pr.yml b/.github/workflows/java_pr.yml index f7b90c729f..081a4f4274 100644 --- a/.github/workflows/java_pr.yml +++ b/.github/workflows/java_pr.yml @@ -13,7 +13,11 @@ jobs: steps: - uses: actions/checkout@v2 with: - submodules: 'true' + # pull_request_target runs the workflow in the context of the base repo + # as such actions/checkout needs to be explicit configured to retrieve + # code from the PR. + ref: refs/pull/${{ github.event.pull_request.number }}/merge + submodules: recursive - name: Lint java run: make lint-java @@ -23,7 +27,11 @@ jobs: steps: - uses: actions/checkout@v2 with: - submodules: 'true' + # pull_request_target runs the workflow in the context of the base repo + # as such actions/checkout needs to be explicit configured to retrieve + # code from the PR. + ref: refs/pull/${{ github.event.pull_request.number }}/merge + submodules: recursive - name: Set up JDK 11 uses: actions/setup-java@v1 with: @@ -52,7 +60,11 @@ jobs: steps: - uses: actions/checkout@v2 with: - submodules: 'true' + # pull_request_target runs the workflow in the context of the base repo + # as such actions/checkout needs to be explicit configured to retrieve + # code from the PR. + ref: refs/pull/${{ github.event.pull_request.number }}/merge + submodules: recursive - name: Set up JDK 11 uses: actions/setup-java@v1 with: diff --git a/.github/workflows/java_release.yml b/.github/workflows/java_release.yml index 24efac3583..f689f1fa23 100644 --- a/.github/workflows/java_release.yml +++ b/.github/workflows/java_release.yml @@ -77,15 +77,18 @@ jobs: infra/scripts/download-maven-cache.sh \ --archive-uri ${MAVEN_CACHE} \ --output-dir . - - name: Build and push versioned images + - name: Build image + run: make build-${{ matrix.component }}-docker REGISTRY=${REGISTRY} VERSION=${RELEASE_VERSION} env: RELEASE_VERSION: ${{ needs.get-version.outputs.release_version }} VERSION_WITHOUT_PREFIX: ${{ needs.get-version.outputs.version_without_prefix }} HIGHEST_SEMVER_TAG: ${{ needs.get-version.outputs.highest_semver_tag }} - - name: Build image - run: make build-${{ matrix.component }}-docker REGISTRY=${REGISTRY} VERSION=${RELEASE_VERSION} - name: Push image run: make push-${{ matrix.component }}-docker REGISTRY=${REGISTRY} VERSION=${RELEASE_VERSION} + env: + RELEASE_VERSION: ${{ needs.get-version.outputs.release_version }} + VERSION_WITHOUT_PREFIX: ${{ needs.get-version.outputs.version_without_prefix }} + HIGHEST_SEMVER_TAG: ${{ needs.get-version.outputs.highest_semver_tag }} - run: | echo "Only push to latest tag if tag is the highest semver version $HIGHEST_SEMVER_TAG" if [ "${VERSION_WITHOUT_PREFIX}" = "${HIGHEST_SEMVER_TAG:1}" ] @@ -93,6 +96,10 @@ jobs: docker tag ${REGISTRY}/${{ matrix.component }}:${VERSION_WITHOUT_PREFIX} ${REGISTRY}/${{ matrix.component }}:latest docker push ${REGISTRY}/${{ matrix.component }}:latest fi + env: + RELEASE_VERSION: ${{ needs.get-version.outputs.release_version }} + VERSION_WITHOUT_PREFIX: ${{ needs.get-version.outputs.version_without_prefix }} + HIGHEST_SEMVER_TAG: ${{ needs.get-version.outputs.highest_semver_tag }} publish-java-sdk: container: maven:3.6-jdk-11 diff --git a/java/serving/src/main/java/feast/serving/config/RegistryConfig.java b/java/serving/src/main/java/feast/serving/config/RegistryConfig.java index 3e4c6b7298..38333dba16 100644 --- a/java/serving/src/main/java/feast/serving/config/RegistryConfig.java +++ b/java/serving/src/main/java/feast/serving/config/RegistryConfig.java @@ -22,7 +22,6 @@ import com.google.cloud.storage.StorageOptions; import feast.serving.registry.*; import java.net.URI; -import java.nio.file.Paths; import java.util.Optional; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; @@ -59,7 +58,7 @@ RegistryFile registryFile(FeastProperties feastProperties, ApplicationContext co return new S3RegistryFile(context.getBean(AmazonS3.class), registryPath); case "": case "file": - return new LocalRegistryFile(Paths.get(registryPath)); + return new LocalRegistryFile(registryPath); default: throw new RuntimeException("Registry storage %s is unsupported"); }