From ff621314010ea968233a8edd3a09d05343a7984e Mon Sep 17 00:00:00 2001 From: golanha Date: Wed, 11 Aug 2021 09:08:57 +0300 Subject: [PATCH 1/4] java version in one place --- core/algorithm-builder/dockerfile/get-deps-java.sh | 2 +- .../environments/java/dockerfile/DockerfileTemplate | 2 +- core/algorithm-builder/environments/java/wrapper/version.txt | 2 +- core/algorithm-builder/lib/builds/docker-builder.js | 1 - 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/core/algorithm-builder/dockerfile/get-deps-java.sh b/core/algorithm-builder/dockerfile/get-deps-java.sh index 44aa9515c..84e807363 100755 --- a/core/algorithm-builder/dockerfile/get-deps-java.sh +++ b/core/algorithm-builder/dockerfile/get-deps-java.sh @@ -1,7 +1,7 @@ #!/bin/bash set -eo pipefail SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )" -export javaWrapperVersion='2.0.00' +export javaWrapperVersion=`cat $SCRIPTPATH/../environments/java/wrapper/version.txt` mkdir -p $SCRIPTPATH/../environments/java/debs cd $SCRIPTPATH/../environments/java/debs docker run --rm --workdir /tmp/pkg -v $SCRIPTPATH/../environments/java/debs:/tmp/pkg\ diff --git a/core/algorithm-builder/environments/java/dockerfile/DockerfileTemplate b/core/algorithm-builder/environments/java/dockerfile/DockerfileTemplate index cdb461932..5a42e3fef 100644 --- a/core/algorithm-builder/environments/java/dockerfile/DockerfileTemplate +++ b/core/algorithm-builder/environments/java/dockerfile/DockerfileTemplate @@ -6,7 +6,7 @@ ENV PACKAGES_REGISTRY ${PACKAGES_REGISTRY} COPY ./dockerfile/settings.xml /root/.m2/settings.xml COPY algorithm_unique_folder/ /hkube/algorithm-runner/algorithm_unique_folder/ RUN cp /hkube/algorithm-runner/algorithm_unique_folder/src/main/resources/settings.xml /root/.m2/settings.xml || true -RUN mvn -q dependency:get -Dartifact=io.hkube:wrapper:${javaWrapperVersion}:jar:wide -Ddest=/hkube/algorithm-runner/wrapper.jar +RUN mvn -q dependency:get -Dartifact=io.hkube:wrapper:${WRAPPER_VERSION}:jar:wide -Ddest=/hkube/algorithm-runner/wrapper.jar COPY ./runJava.sh /hkube/algorithm-runner/ WORKDIR /hkube/algorithm-runner/algorithm_unique_folder/ RUN mvn -q package diff --git a/core/algorithm-builder/environments/java/wrapper/version.txt b/core/algorithm-builder/environments/java/wrapper/version.txt index f08cf983d..e95f83944 100644 --- a/core/algorithm-builder/environments/java/wrapper/version.txt +++ b/core/algorithm-builder/environments/java/wrapper/version.txt @@ -1 +1 @@ -2.0.00 +2.0.00-SNAPSHOT \ No newline at end of file diff --git a/core/algorithm-builder/lib/builds/docker-builder.js b/core/algorithm-builder/lib/builds/docker-builder.js index 889269c92..b30a1fc38 100644 --- a/core/algorithm-builder/lib/builds/docker-builder.js +++ b/core/algorithm-builder/lib/builds/docker-builder.js @@ -402,7 +402,6 @@ const buildAlgorithmImage = async ({ buildMode, env, docker, algorithmName, imag // docker pull _createDockerCredsConfig(envs, docker, packages); - _envsHelper(envs, 'javaWrapperVersion', '2.0.00'); if (buildMode === KANIKO) { await _createKanikoConfigs(envs, tmpFolder, docker); } From 12c469efc31064d82dd6d0d59f7ac0c7223f9930 Mon Sep 17 00:00:00 2001 From: golanha Date: Wed, 11 Aug 2021 10:38:30 +0300 Subject: [PATCH 2/4] omit \n of version --- core/algorithm-builder/lib/builds/docker-builder.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/algorithm-builder/lib/builds/docker-builder.js b/core/algorithm-builder/lib/builds/docker-builder.js index 106c1218a..a94149e0a 100644 --- a/core/algorithm-builder/lib/builds/docker-builder.js +++ b/core/algorithm-builder/lib/builds/docker-builder.js @@ -58,7 +58,8 @@ const wrapperVersions = { java: { file: 'version.txt', parse: (file) => { - return file; + const firstLine = file.split('\n')[0]; + return firstLine; }, override: async (file, version) => { await fse.writeFile(file, version); From 3a88b9c4142cb5c933f2140ae36c24328df839d7 Mon Sep 17 00:00:00 2001 From: golanha Date: Wed, 11 Aug 2021 14:31:50 +0300 Subject: [PATCH 3/4] get plugin from the snapshot rep as well --- .../environments/java/dockerfile/settings.xml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/algorithm-builder/environments/java/dockerfile/settings.xml b/core/algorithm-builder/environments/java/dockerfile/settings.xml index 5cfc20efb..c162ad7db 100644 --- a/core/algorithm-builder/environments/java/dockerfile/settings.xml +++ b/core/algorithm-builder/environments/java/dockerfile/settings.xml @@ -230,6 +230,16 @@ under the License. never + + + + snapshots + snapshots + https://oss.sonatype.org/content/repositories/snapshots + default + + true + From 47f675ca319c5729118bd574f19eb314ce2e143d Mon Sep 17 00:00:00 2001 From: golanha Date: Wed, 11 Aug 2021 16:23:24 +0300 Subject: [PATCH 4/4] snapshot stright --- .../environments/java/dockerfile/settings.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/algorithm-builder/environments/java/dockerfile/settings.xml b/core/algorithm-builder/environments/java/dockerfile/settings.xml index c162ad7db..4dbd655e2 100644 --- a/core/algorithm-builder/environments/java/dockerfile/settings.xml +++ b/core/algorithm-builder/environments/java/dockerfile/settings.xml @@ -215,6 +215,15 @@ under the License. true + + + snapshots-stright + snapshots-stright + https://oss.sonatype.org/content/repositories/snapshots + default + + true +