From c19727a5e7ae891c475ce1495e0f7e8215a75193 Mon Sep 17 00:00:00 2001 From: Paolo Di Tommaso Date: Fri, 10 Nov 2023 17:45:33 +0100 Subject: [PATCH 1/8] Add ability to specify platform for Singularity build Signed-off-by: Paolo Di Tommaso Co-authored-by: Munish Chouhan --- app/src/main/java/io/seqera/wave/cli/App.java | 3 --- .../test/groovy/io/seqera/wave/cli/AppTest.groovy | 15 +++++++++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/io/seqera/wave/cli/App.java b/app/src/main/java/io/seqera/wave/cli/App.java index 345fb3a..f0d383a 100644 --- a/app/src/main/java/io/seqera/wave/cli/App.java +++ b/app/src/main/java/io/seqera/wave/cli/App.java @@ -366,9 +366,6 @@ protected void validateArgs() { if( !isEmpty(platform) && !VALID_PLATFORMS.contains(platform) ) throw new IllegalCliArgumentException(String.format("Unsupported container platform: '%s'", platform)); - if( singularity && !isEmpty(platform) && platform.contains("arm64") ) - throw new IllegalCliArgumentException("Options --platform is currently not supported by Singularity native build"); - } protected Client client() { diff --git a/app/src/test/groovy/io/seqera/wave/cli/AppTest.groovy b/app/src/test/groovy/io/seqera/wave/cli/AppTest.groovy index 146f3a8..b3c27a1 100644 --- a/app/src/test/groovy/io/seqera/wave/cli/AppTest.groovy +++ b/app/src/test/groovy/io/seqera/wave/cli/AppTest.groovy @@ -210,10 +210,10 @@ class AppTest extends Specification { noExceptionThrown() } - def 'should not allow platform arm64 with singularity' () { + def 'should allow platform arm64 with singularity' () { given: def app = new App() - String[] args = ['--singularity', "--platform", 'linux/arm64', '-i', 'ubuntu', '--freeze', '--build-repo', 'docker.io/foo', '--tower-token', 'xyz'] + String[] args = [ '--singularity', "--platform", 'linux/arm64', '-i', 'ubuntu', '--freeze', '--build-repo', 'docker.io/foo', '--tower-token', 'xyz'] when: new CommandLine(app).parseArgs(args) @@ -221,7 +221,14 @@ class AppTest extends Specification { app.validateArgs() then: - def e = thrown(IllegalCliArgumentException) - e.message == "Options --platform is currently not supported by Singularity native build" + noExceptionThrown() + and: + app.@platform == 'linux/arm64' + app.@image == 'ubuntu' + app.@singularity + app.@freeze + app.@buildRepository == 'docker.io/foo' + app.@towerToken == 'xyz' } + } From 34fb923d6ff35c5060bfc0881247f7c943233a02 Mon Sep 17 00:00:00 2001 From: Paolo Di Tommaso Date: Fri, 10 Nov 2023 17:50:59 +0100 Subject: [PATCH 2/8] [release] bump version 1.1.0 Signed-off-by: Paolo Di Tommaso --- VERSION | 2 +- changelog.txt | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 3eefcb9..9084fa2 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.0 +1.1.0 diff --git a/changelog.txt b/changelog.txt index 76a098d..2f7fe3b 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,8 @@ WAVE CLI CHANGE-LOG =================== +1.1.0 - 10 Nov 2023 +- Add ability to specify platform for Singularity build [c19727a5] +- Improve err handling for missing files [98df6ea3] + 1.0.0 - 16 Oct 2023 - Initial release \ No newline at end of file From 399f0b226204197184c2e420f06620ff94b97a9e Mon Sep 17 00:00:00 2001 From: Dr Marco Claudio De La Pierre Date: Tue, 21 Nov 2023 16:01:04 +0800 Subject: [PATCH 3/8] Bump gradle 8.4 (#39) --- gradle/wrapper/gradle-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index b91961b..371fd18 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -17,7 +17,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From d8eed21bbdff3e2e6807ab6a7fd02425214fe93c Mon Sep 17 00:00:00 2001 From: Munish Chouhan Date: Tue, 21 Nov 2023 09:06:23 +0100 Subject: [PATCH 4/8] Fix error when a context file path is longer than 100 chars (#26) --- app/build.gradle | 2 +- app/src/main/resources/META-INF/build-info.properties | 2 +- .../test/groovy/io/seqera/wave/cli/AppCondaOptsTest.groovy | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 4a4f4d9..e6d0788 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -21,7 +21,7 @@ repositories { dependencies { implementation 'io.seqera:wave-api:0.5.0' - implementation 'io.seqera:wave-utils:0.7.8' + implementation 'io.seqera:wave-utils:0.8.0' implementation 'info.picocli:picocli:4.6.1' implementation 'com.squareup.moshi:moshi:1.14.0' implementation 'com.squareup.moshi:moshi-adapters:1.14.0' diff --git a/app/src/main/resources/META-INF/build-info.properties b/app/src/main/resources/META-INF/build-info.properties index 8bf9c39..d647b60 100644 --- a/app/src/main/resources/META-INF/build-info.properties +++ b/app/src/main/resources/META-INF/build-info.properties @@ -16,5 +16,5 @@ # name=wave-cli -version=0.7.0 +version=1.1.0 commitId=unknown diff --git a/app/src/test/groovy/io/seqera/wave/cli/AppCondaOptsTest.groovy b/app/src/test/groovy/io/seqera/wave/cli/AppCondaOptsTest.groovy index a2b15aa..18b7b12 100644 --- a/app/src/test/groovy/io/seqera/wave/cli/AppCondaOptsTest.groovy +++ b/app/src/test/groovy/io/seqera/wave/cli/AppCondaOptsTest.groovy @@ -136,6 +136,7 @@ class AppCondaOptsTest extends Specification { && micromamba install -y -n base conda-forge::procps-ng \\ && micromamba clean -a -y USER root + ENV PATH="$MAMBA_ROOT_PREFIX/bin:$PATH" '''.stripIndent() and: new String(req.condaFile.decodeBase64()) == CONDA_RECIPE @@ -162,6 +163,7 @@ class AppCondaOptsTest extends Specification { && micromamba install -y -n base conda-forge::procps-ng \\ && micromamba clean -a -y USER root + ENV PATH="$MAMBA_ROOT_PREFIX/bin:$PATH" '''.stripIndent() and: new String(req.condaFile.decodeBase64()) == '''\ @@ -192,6 +194,7 @@ class AppCondaOptsTest extends Specification { && micromamba install -y -n base conda-forge::procps-ng \\ && micromamba clean -a -y USER root + ENV PATH="$MAMBA_ROOT_PREFIX/bin:$PATH" '''.stripIndent() and: req.condaFile == null @@ -222,6 +225,7 @@ class AppCondaOptsTest extends Specification { && micromamba install -y -n base conda-forge::procps-ng \\ && micromamba clean -a -y USER root + ENV PATH="$MAMBA_ROOT_PREFIX/bin:$PATH" RUN one RUN two '''.stripIndent() From 244be07508ab255385b27539682f0c17aafed8fb Mon Sep 17 00:00:00 2001 From: Munish Chouhan Date: Tue, 21 Nov 2023 10:47:20 +0100 Subject: [PATCH 5/8] Bump org.graalvm.buildtools.native to 0.9.28 (#40) --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index e6d0788..3e00963 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,7 +1,7 @@ plugins { id 'io.seqera.wave.cli.java-application-conventions' id 'groovy' - id 'org.graalvm.buildtools.native' version '0.9.24' + id 'org.graalvm.buildtools.native' version '0.9.28' } java { From 5e236b0a32a8bd43462df80d4b01436fa87ae335 Mon Sep 17 00:00:00 2001 From: Dr Marco Claudio De La Pierre Date: Thu, 23 Nov 2023 17:00:07 +0800 Subject: [PATCH 6/8] Fix execute CI tests on pull requests (#44) Signed-off-by: Paolo Di Tommaso Co-authored-by: Paolo Di Tommaso --- .github/workflows/build.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2a0185a..855efee 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,6 +6,13 @@ on: - '!refs/tags/.*' tags-ignore: - '*' + pull_request: + types: [opened, reopened, synchronize] + branches: + - '*' + - '!refs/tags/.*' + tags-ignore: + - '*' jobs: build: name: Wave on ${{ matrix.os }} From d37faca1f4a228976eb1f63089ebfff9ebd0fdf0 Mon Sep 17 00:00:00 2001 From: Paolo Di Tommaso Date: Thu, 30 Nov 2023 10:07:55 -0500 Subject: [PATCH 7/8] Fix invalid protol prefix with await option Signed-off-by: Paolo Di Tommaso --- .../main/java/io/seqera/wave/cli/Client.java | 13 +++++- .../io/seqera/wave/cli/ClientTest.groovy | 43 +++++++++++++++++++ 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 app/src/test/groovy/io/seqera/wave/cli/ClientTest.groovy diff --git a/app/src/main/java/io/seqera/wave/cli/Client.java b/app/src/main/java/io/seqera/wave/cli/Client.java index ac48443..9fdf3dd 100644 --- a/app/src/main/java/io/seqera/wave/cli/Client.java +++ b/app/src/main/java/io/seqera/wave/cli/Client.java @@ -18,7 +18,9 @@ package io.seqera.wave.cli; import java.io.IOException; +import java.net.MalformedURLException; import java.net.URI; +import java.net.URL; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; @@ -146,11 +148,20 @@ protected HttpResponse httpSend(HttpRequest req) { }); } + protected String protocol(String endpoint) { + if( StringUtils.isEmpty(endpoint) ) + return "https://"; + try { + return new URL(endpoint).getProtocol() + "://"; + } catch (MalformedURLException e) { + throw new RuntimeException("Invalid endpoint URL: " + endpoint, e); + } + } protected URI imageToManifestUri(String image) { final int p = image.indexOf('/'); if( p==-1 ) throw new IllegalArgumentException("Invalid container name: "+image); - final String result = "https://" + image.substring(0,p) + "/v2" + image.substring(p).replace(":","/manifests/"); + final String result = protocol(endpoint) + image.substring(0,p) + "/v2" + image.substring(p).replace(":","/manifests/"); return URI.create(result); } diff --git a/app/src/test/groovy/io/seqera/wave/cli/ClientTest.groovy b/app/src/test/groovy/io/seqera/wave/cli/ClientTest.groovy new file mode 100644 index 0000000..adeba0f --- /dev/null +++ b/app/src/test/groovy/io/seqera/wave/cli/ClientTest.groovy @@ -0,0 +1,43 @@ +/* + * Copyright 2023, Seqera Labs + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package io.seqera.wave.cli + +import spock.lang.Specification +import spock.lang.Unroll + +/** + * + * @author Paolo Di Tommaso + */ +class ClientTest extends Specification { + + @Unroll + def 'should get endpoint protocol' () { + given: + def client = new Client() + expect: + client.protocol(ENDPOINT) == EXPECTED + + where: + ENDPOINT | EXPECTED + null | 'https://' + 'http://foo' | 'http://' + 'https://bar.com' | 'https://' + + } +} From 9c925b74c5072dc83cad37ebb543fdbf2f356c79 Mon Sep 17 00:00:00 2001 From: Paolo Di Tommaso Date: Thu, 30 Nov 2023 10:09:13 -0500 Subject: [PATCH 8/8] [release] bump version 1.1.1 Signed-off-by: Paolo Di Tommaso --- VERSION | 2 +- changelog.txt | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 9084fa2..524cb55 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.1.0 +1.1.1 diff --git a/changelog.txt b/changelog.txt index 2f7fe3b..206c77f 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,12 @@ WAVE CLI CHANGE-LOG =================== +1.1.1 - 30 Nov 2023 +- Fix invalid protol prefix with await option [d37faca1] +- Fix execute CI tests on pull requests (#44) [5e236b0a] +- Fix error when a context file path is longer than 100 chars (#26) [d8eed21b] +- Bump org.graalvm.buildtools.native to 0.9.28 (#40) [244be075] +- Bump gradle 8.4 (#39) [399f0b22] + 1.1.0 - 10 Nov 2023 - Add ability to specify platform for Singularity build [c19727a5] - Improve err handling for missing files [98df6ea3]