From 90667c536334f6a1faca43f7fc9d59b212216605 Mon Sep 17 00:00:00 2001 From: jackjii79 Date: Thu, 22 Feb 2024 01:14:37 -0800 Subject: [PATCH] fix ci (#383) --- Jenkinsfile | 36 +++++++++++++----------- aws-sagemaker-hosted-scorer/build.gradle | 2 +- gcp-cloud-run/build.gradle | 2 +- gcp-vertex-ai-mojo-scorer/build.gradle | 2 +- gradle.properties | 2 +- local-rest-scorer/build.gradle | 2 +- 6 files changed, 25 insertions(+), 21 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 879d66c2..fad071a4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -169,14 +169,16 @@ pipeline { def imageTags = isMasterBranch() || isReleaseBranch() ? "${versionText},${gitCommitHash}" : "${gitCommitHash}" withDockerCredentials(DOCKERHUB_CREDS, "FROM_") { withDockerCredentials("harbor.h2o.ai", "TO_") { - sh "./gradlew --init-script init.gradle jib \ - -Djib.to.auth.username=${TO_DOCKER_USERNAME} \ - -Djib.to.auth.password=${TO_DOCKER_PASSWORD} \ - -Djib.from.auth.username=${FROM_DOCKER_USERNAME} \ - -Djib.from.auth.password=${FROM_DOCKER_PASSWORD} \ - -Djib.to.tags=${imageTags} \ - -Djib.allowInsecureRegistries=true \ - -DsendCredentialsOverHttp=true" + withEnv(["XDG_CONFIG_HOME=/tmp", "XDG_CACHE_HOME=/tmp"]) { + sh "./gradlew --init-script init.gradle jib \ + -Djib.to.auth.username=${TO_DOCKER_USERNAME} \ + -Djib.to.auth.password=${TO_DOCKER_PASSWORD} \ + -Djib.from.auth.username=${FROM_DOCKER_USERNAME} \ + -Djib.from.auth.password=${FROM_DOCKER_PASSWORD} \ + -Djib.to.tags=${imageTags} \ + -Djib.allowInsecureRegistries=true \ + -DsendCredentialsOverHttp=true" + } } } } @@ -205,13 +207,15 @@ pipeline { def imageTags = isMasterBranch() || isReleaseBranch() ? "${versionText},${gitCommitHash}" : "${gitCommitHash}" withDockerCredentials(DOCKERHUB_CREDS, "FROM_") { withDockerCredentials(DOCKERHUB_CREDS, "TO_") { - sh "./gradlew --init-script init.gradle jib \ - -Djib.to.auth.username=${TO_DOCKER_USERNAME} \ - -Djib.to.auth.password=${TO_DOCKER_PASSWORD} \ - -Djib.from.auth.username=${FROM_DOCKER_USERNAME} \ - -Djib.from.auth.password=${FROM_DOCKER_PASSWORD} \ - -Djib.to.tags=${imageTags} \ - -PdockerRepositoryPrefix=h2oai/" + withEnv(["XDG_CONFIG_HOME=/tmp", "XDG_CACHE_HOME=/tmp"]) { + sh "./gradlew --init-script init.gradle jib \ + -Djib.to.auth.username=${TO_DOCKER_USERNAME} \ + -Djib.to.auth.password=${TO_DOCKER_PASSWORD} \ + -Djib.from.auth.username=${FROM_DOCKER_USERNAME} \ + -Djib.from.auth.password=${FROM_DOCKER_PASSWORD} \ + -Djib.to.tags=${imageTags} \ + -PdockerRepositoryPrefix=h2oai/" + } } } } @@ -241,7 +245,7 @@ pipeline { withDockerCredentials(DOCKERHUB_CREDS, "FROM_") { withGCRCredentials(VORVAN_CRED) { def gcrCreds = readFile("${GCR_JSON_KEY}") - withEnv(['TO_DOCKER_USERNAME=_json_key', "TO_DOCKER_PASSWORD=${gcrCreds}"]) { + withEnv(['TO_DOCKER_USERNAME=_json_key', "TO_DOCKER_PASSWORD=${gcrCreds}", "XDG_CONFIG_HOME=/tmp", "XDG_CACHE_HOME=/tmp"]) { sh "./gradlew --init-script init.gradle jib \ -Djib.from.auth.username=${FROM_DOCKER_USERNAME} \ -Djib.from.auth.password=${FROM_DOCKER_PASSWORD} \ diff --git a/aws-sagemaker-hosted-scorer/build.gradle b/aws-sagemaker-hosted-scorer/build.gradle index 77d30014..a66d579a 100644 --- a/aws-sagemaker-hosted-scorer/build.gradle +++ b/aws-sagemaker-hosted-scorer/build.gradle @@ -49,7 +49,7 @@ jib { } } container { - jvmFlags = defaultJibContainerJvmFlags.split(" ").each { it.trim() } + jvmFlags = defaultJibContainerJvmFlags.split(" ").each { it.trim() }.toList() ports = ['8080'] volumes = [ // mojo pipeline and license file will live here diff --git a/gcp-cloud-run/build.gradle b/gcp-cloud-run/build.gradle index 6e587e42..32ebfea0 100644 --- a/gcp-cloud-run/build.gradle +++ b/gcp-cloud-run/build.gradle @@ -46,7 +46,7 @@ jib { } } container { - jvmFlags = defaultJibContainerJvmFlags.split(" ").each { it.trim() } + jvmFlags = defaultJibContainerJvmFlags.split(" ").each { it.trim() }.toList() ports = ['8080'] environment = [ // The expected path to the DAI license file. diff --git a/gcp-vertex-ai-mojo-scorer/build.gradle b/gcp-vertex-ai-mojo-scorer/build.gradle index f3e42f12..482bd0b4 100644 --- a/gcp-vertex-ai-mojo-scorer/build.gradle +++ b/gcp-vertex-ai-mojo-scorer/build.gradle @@ -63,7 +63,7 @@ jib { } } container { - jvmFlags = defaultJibContainerJvmFlags.split(" ").each { it.trim() } + jvmFlags = defaultJibContainerJvmFlags.split(" ").each { it.trim() }.toList() ports = ['8080'] environment = [ // The expected path to the DAI license file. diff --git a/gradle.properties b/gradle.properties index f1376738..a36b5dee 100644 --- a/gradle.properties +++ b/gradle.properties @@ -40,7 +40,7 @@ tomcatVersion = 9.0.75 springBootPluginVersion = 3.2.0 swaggerGradlePluginVersion = 2.19.2 errorpronePluginVersion = 3.1.0 -jibPluginVersion = 2.7.1 +jibPluginVersion = 3.4.0 openApiGeneratorGradlePluginVersion = 7.0.1 # External tools: diff --git a/local-rest-scorer/build.gradle b/local-rest-scorer/build.gradle index f97fb6d8..bf22837f 100644 --- a/local-rest-scorer/build.gradle +++ b/local-rest-scorer/build.gradle @@ -72,7 +72,7 @@ jib { } } container { - jvmFlags = defaultJibContainerJvmFlags.split(" ").each { it.trim() } + jvmFlags = defaultJibContainerJvmFlags.split(" ").each { it.trim() }.toList() ports = ['8080'] volumes = [ // For storing the mojo2 file with the model to be used for scoring.