Skip to content
This repository has been archived by the owner on Nov 29, 2024. It is now read-only.

Update jib plugin to address jenkins CI error #382

Merged
merged 1 commit into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 20 additions & 17 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
}
Expand Down Expand Up @@ -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/"
}
}
}
}
Expand Down Expand Up @@ -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} \
Expand Down Expand Up @@ -318,4 +322,3 @@ void withGCRCredentials(final String credentialsId, final Closure body) {
body()
}
}

2 changes: 1 addition & 1 deletion aws-sagemaker-hosted-scorer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion gcp-cloud-run/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion gcp-vertex-ai-mojo-scorer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = 1.1.21-SNAPSHOT
version = 1.2.1-SNAPSHOT

# Versions of dependencies. Try to keep these at the same version across the deployment templates to facilitate
# issue resolution.
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion local-rest-scorer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading