From 4ace0b5b5d6afbe2f2b87ce243abb8f62d818263 Mon Sep 17 00:00:00 2001 From: munishchouhan Date: Fri, 5 Jul 2024 12:12:30 +0200 Subject: [PATCH 01/15] updated k8s client Signed-off-by: munishchouhan --- build.gradle | 2 +- .../wave/service/k8s/K8sServiceImpl.groovy | 21 ++++++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/build.gradle b/build.gradle index 4d3be2206..ac5827cc4 100644 --- a/build.gradle +++ b/build.gradle @@ -53,7 +53,7 @@ dependencies { implementation("io.seqera:tower-crypto:22.4.0-watson") { transitive = false } // to be replaced with 22.4.0 once released implementation 'org.apache.commons:commons-compress:1.24.0' implementation 'org.apache.commons:commons-lang3:3.12.0' - implementation 'io.kubernetes:client-java:19.0.0' + implementation 'io.kubernetes:client-java:21.0.0' implementation 'io.kubernetes:client-java-api-fluent:18.0.1' implementation 'com.google.code.gson:gson:2.9.0' implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310" diff --git a/src/main/groovy/io/seqera/wave/service/k8s/K8sServiceImpl.groovy b/src/main/groovy/io/seqera/wave/service/k8s/K8sServiceImpl.groovy index 01d03dd98..53e87bbca 100644 --- a/src/main/groovy/io/seqera/wave/service/k8s/K8sServiceImpl.groovy +++ b/src/main/groovy/io/seqera/wave/service/k8s/K8sServiceImpl.groovy @@ -188,7 +188,8 @@ class K8sServiceImpl implements K8sService { V1Job getJob(String name) { k8sClient .batchV1Api() - .readNamespacedJob(name, namespace, null) + .readNamespacedJob(name, namespace) + .execute() } /** @@ -201,7 +202,8 @@ class K8sServiceImpl implements K8sService { JobStatus getJobStatus(String name) { def job = k8sClient .batchV1Api() - .readNamespacedJob(name, namespace, null) + .readNamespacedJob(name, namespace) + .execute() if( !job ) return null if( job.status.succeeded==1 ) @@ -221,7 +223,8 @@ class K8sServiceImpl implements K8sService { V1Pod getPod(String name) { return k8sClient .coreV1Api() - .readNamespacedPod(name, namespace, null) + .readNamespacedPod(name, namespace) + .execute() } /** @@ -335,7 +338,8 @@ class K8sServiceImpl implements K8sService { final spec = buildSpec(name, containerImage, args, workDir, creds, spackConfig, nodeSelector) return k8sClient .coreV1Api() - .createNamespacedPod(namespace, spec, null, null, null,null) + .createNamespacedPod(namespace, spec) + .execute() } V1Pod buildSpec(String name, String containerImage, List args, Path workDir, Path credsFile, SpackConfig spackConfig, Map nodeSelector) { @@ -484,7 +488,8 @@ class K8sServiceImpl implements K8sService { void deletePod(String name) { k8sClient .coreV1Api() - .deleteNamespacedPod(name, namespace, (String)null, (String)null, (Integer)null, (Boolean)null, (String)null, (V1DeleteOptions)null) + .deleteNamespacedPod(name, namespace) + .execute() } @Override @@ -492,7 +497,8 @@ class K8sServiceImpl implements K8sService { final spec = scanSpec(name, containerImage, args, workDir, creds, scanConfig, nodeSelector) return k8sClient .coreV1Api() - .createNamespacedPod(namespace, spec, null, null, null,null) + .createNamespacedPod(namespace, spec) + .execute() } V1Pod scanSpec(String name, String containerImage, List args, Path workDir, Path credsFile, ScanConfig scanConfig, Map nodeSelector) { @@ -551,7 +557,8 @@ class K8sServiceImpl implements K8sService { final spec = transferSpec(name, containerImage, args, blobConfig) return k8sClient .coreV1Api() - .createNamespacedPod(namespace, spec, null, null, null,null) + .createNamespacedPod(namespace, spec) + .execute() } V1Pod transferSpec(String name, String containerImage, List args, BlobCacheConfig blobConfig) { From 6b3a974bfc5804d85b99913be59344158bd19b61 Mon Sep 17 00:00:00 2001 From: munishchouhan Date: Mon, 8 Jul 2024 18:53:08 +0200 Subject: [PATCH 02/15] update more dependencies Signed-off-by: munishchouhan --- build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index ac5827cc4..8b608a79f 100644 --- a/build.gradle +++ b/build.gradle @@ -51,10 +51,10 @@ dependencies { implementation 'dev.failsafe:failsafe:3.1.0' implementation('io.projectreactor:reactor-core') implementation("io.seqera:tower-crypto:22.4.0-watson") { transitive = false } // to be replaced with 22.4.0 once released - implementation 'org.apache.commons:commons-compress:1.24.0' + implementation 'org.apache.commons:commons-compress:1.26.0' implementation 'org.apache.commons:commons-lang3:3.12.0' implementation 'io.kubernetes:client-java:21.0.0' - implementation 'io.kubernetes:client-java-api-fluent:18.0.1' + implementation 'io.kubernetes:client-java-api-fluent:21.0.0' implementation 'com.google.code.gson:gson:2.9.0' implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310" implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml' From 62b9bfd4741df1b0bacf5917ff7d21801f0f46ce Mon Sep 17 00:00:00 2001 From: munishchouhan Date: Fri, 19 Jul 2024 18:29:21 +0200 Subject: [PATCH 03/15] added withOverhead(null) Signed-off-by: munishchouhan --- .../groovy/io/seqera/wave/service/k8s/K8sServiceImpl.groovy | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/groovy/io/seqera/wave/service/k8s/K8sServiceImpl.groovy b/src/main/groovy/io/seqera/wave/service/k8s/K8sServiceImpl.groovy index 53e87bbca..70d8554f0 100644 --- a/src/main/groovy/io/seqera/wave/service/k8s/K8sServiceImpl.groovy +++ b/src/main/groovy/io/seqera/wave/service/k8s/K8sServiceImpl.groovy @@ -387,6 +387,7 @@ class K8sServiceImpl implements K8sService { .withActiveDeadlineSeconds( buildConfig.buildTimeout.toSeconds() ) .withRestartPolicy("Never") .addAllToVolumes(volumes) + .withOverhead(null) final requests = new V1ResourceRequirements() @@ -531,6 +532,7 @@ class K8sServiceImpl implements K8sService { .withActiveDeadlineSeconds( scanConfig.timeout.toSeconds() ) .withRestartPolicy("Never") .addAllToVolumes(volumes) + .withOverhead(null) final requests = new V1ResourceRequirements() @@ -578,6 +580,7 @@ class K8sServiceImpl implements K8sService { .withServiceAccount(serviceAccount) .withActiveDeadlineSeconds( blobConfig.transferTimeout.toSeconds() ) .withRestartPolicy("Never") + .withOverhead(null) final requests = new V1ResourceRequirements() if( blobConfig.requestsCpu ) From b8eb0cb2ff242a0ab426cc693978662bcd2b7fa6 Mon Sep 17 00:00:00 2001 From: munishchouhan Date: Mon, 22 Jul 2024 16:13:53 +0200 Subject: [PATCH 04/15] fixed tests Signed-off-by: munishchouhan --- .../wave/service/k8s/K8sServiceImplTest.groovy | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/test/groovy/io/seqera/wave/service/k8s/K8sServiceImplTest.groovy b/src/test/groovy/io/seqera/wave/service/k8s/K8sServiceImplTest.groovy index f7c064b5c..2cbfeedca 100644 --- a/src/test/groovy/io/seqera/wave/service/k8s/K8sServiceImplTest.groovy +++ b/src/test/groovy/io/seqera/wave/service/k8s/K8sServiceImplTest.groovy @@ -581,7 +581,9 @@ class K8sServiceImplTest extends Specification { def statusName = "Succeeded" def timeout = 5000 def api = Mock(CoreV1Api) - api.readNamespacedPod(_,_,_) >> new V1Pod(status: new V1PodStatus(phase: statusName)) + def namespacedPodRequest = Mock(CoreV1Api.APIreadNamespacedPodRequest) + api.readNamespacedPod(_,_) >> namespacedPodRequest + namespacedPodRequest.execute() >> new V1Pod(status: new V1PodStatus(phase: statusName)) def k8sClient = new K8sClient() { @Override ApiClient apiClient() { @@ -593,12 +595,13 @@ class K8sServiceImplTest extends Specification { } def k8sService = new K8sServiceImpl(k8sClient: k8sClient) - + def deleteNamespacedPodRequest = Mock(CoreV1Api. APIdeleteNamespacedPodRequest) when: k8sService.deletePodWhenReachStatus(podName, statusName, timeout) then: - 1 * api.deleteNamespacedPod('test-pod', null, null, null, null, null, null, null) + 1 * api.deleteNamespacedPod('test-pod', null) >> deleteNamespacedPodRequest + 1 * deleteNamespacedPodRequest.execute() } def "deletePodWhenReachStatus should not delete pod if status is not reached within timeout"() { @@ -607,7 +610,10 @@ class K8sServiceImplTest extends Specification { def statusName = "Succeeded" def timeout = 5000 def api = Mock(CoreV1Api) - api.readNamespacedPod(_,_,_) >> new V1Pod(status: new V1PodStatus(phase: "Running")) + def namespacedPodRequest = Mock(CoreV1Api.APIreadNamespacedPodRequest) + api.readNamespacedPod(_,_) >> namespacedPodRequest + namespacedPodRequest.execute() >> new V1Pod(status: new V1PodStatus(phase: "Running")) + def k8sClient = new K8sClient() { @Override ApiClient apiClient() { @@ -624,7 +630,7 @@ class K8sServiceImplTest extends Specification { k8sService.deletePodWhenReachStatus(podName, statusName, timeout) then: - 0 * api.deleteNamespacedPod('test-pod', null, null, null, null, null, null, null) + 0 * api.deleteNamespacedPod('test-pod', null) } } From 41110e9248ee3e812d5fae6488deb292274c0571 Mon Sep 17 00:00:00 2001 From: munishchouhan Date: Wed, 28 Aug 2024 15:06:38 +0200 Subject: [PATCH 05/15] fixed errors Signed-off-by: munishchouhan --- .../io/seqera/wave/service/k8s/K8sServiceImpl.groovy | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/groovy/io/seqera/wave/service/k8s/K8sServiceImpl.groovy b/src/main/groovy/io/seqera/wave/service/k8s/K8sServiceImpl.groovy index fbd89bb15..c46ffc442 100644 --- a/src/main/groovy/io/seqera/wave/service/k8s/K8sServiceImpl.groovy +++ b/src/main/groovy/io/seqera/wave/service/k8s/K8sServiceImpl.groovy @@ -598,7 +598,7 @@ class K8sServiceImpl implements K8sService { return k8sClient .batchV1Api() - .createNamespacedJob(namespace, spec, null, null, null,null) + .createNamespacedJob(namespace, spec) .execute() } @@ -670,7 +670,8 @@ class K8sServiceImpl implements K8sService { if (status != JobStatus.Pending) { return k8sClient .coreV1Api() - .listNamespacedPod(namespace, null, null, null, null, "job-name=$name", null, null, null, null, null, null) + .listNamespacedPod(namespace) + .execute() } job = getJob(name) } @@ -686,7 +687,8 @@ class K8sServiceImpl implements K8sService { void deleteJob(String name) { k8sClient .batchV1Api() - .deleteNamespacedJob(name, namespace, null, null, null, null,"Foreground", null) + .deleteNamespacedJob(name, namespace) + .execute() } @Override @@ -694,7 +696,8 @@ class K8sServiceImpl implements K8sService { // list all pods for the given job final allPods = k8sClient .coreV1Api() - .listNamespacedPod(namespace, null, null, null, null, "job-name=${jobName}", null, null, null, null, null, null) + .listNamespacedPod(namespace) + .execute() if( !allPods ) return null From 9ea01c23cf60efe9526c491ca390221433c8769f Mon Sep 17 00:00:00 2001 From: Paolo Di Tommaso Date: Sat, 2 Nov 2024 10:59:14 +0100 Subject: [PATCH 06/15] Bump logback-classic:1.4.14 Signed-off-by: Paolo Di Tommaso --- build.gradle | 2 +- .../groovy/io.seqera.wave.java-library-conventions.gradle | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 02834ad7d..f4aef0d76 100644 --- a/build.gradle +++ b/build.gradle @@ -85,7 +85,7 @@ dependencies { testImplementation("org.testcontainers:mysql:1.17.3") // -- - implementation("ch.qos.logback:logback-classic:1.4.8") + implementation 'ch.qos.logback:logback-classic:1.4.14' // rate limit implementation 'com.github.seqeralabs:spillway:7b72700293' diff --git a/buildSrc/src/main/groovy/io.seqera.wave.java-library-conventions.gradle b/buildSrc/src/main/groovy/io.seqera.wave.java-library-conventions.gradle index f6197b641..b51d45578 100644 --- a/buildSrc/src/main/groovy/io.seqera.wave.java-library-conventions.gradle +++ b/buildSrc/src/main/groovy/io.seqera.wave.java-library-conventions.gradle @@ -42,8 +42,8 @@ java { dependencies { implementation 'org.slf4j:slf4j-api:1.7.36' - testImplementation 'ch.qos.logback:logback-core:1.2.11' - testImplementation 'ch.qos.logback:logback-classic:1.2.11' + testImplementation 'ch.qos.logback:logback-core:1.4.14' + testImplementation 'ch.qos.logback:logback-classic:1.4.14' testImplementation "org.codehaus.groovy:groovy:3.0.15" testImplementation "org.codehaus.groovy:groovy-nio:3.0.15" testImplementation ("org.codehaus.groovy:groovy-test:3.0.17") From 8553fbcb66c01c1fe64bbed4215ab88da267e5f9 Mon Sep 17 00:00:00 2001 From: munishchouhan Date: Mon, 18 Nov 2024 13:10:22 +0100 Subject: [PATCH 07/15] fixed error Signed-off-by: munishchouhan --- .../io/seqera/wave/service/k8s/K8sServiceImpl.groovy | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/groovy/io/seqera/wave/service/k8s/K8sServiceImpl.groovy b/src/main/groovy/io/seqera/wave/service/k8s/K8sServiceImpl.groovy index 40ab83e8c..71e9821d3 100644 --- a/src/main/groovy/io/seqera/wave/service/k8s/K8sServiceImpl.groovy +++ b/src/main/groovy/io/seqera/wave/service/k8s/K8sServiceImpl.groovy @@ -500,7 +500,8 @@ class K8sServiceImpl implements K8sService { final spec = buildJobSpec(name, containerImage, args, workDir, creds, timeout, nodeSelector) return k8sClient .batchV1Api() - .createNamespacedJob(namespace, spec, null, null, null,null) + .createNamespacedJob(namespace, spec) + .execute() } V1Job buildJobSpec(String name, String containerImage, List args, Path workDir, Path credsFile, Duration timeout, Map nodeSelector) { @@ -589,7 +590,8 @@ class K8sServiceImpl implements K8sService { final spec = scanJobSpec(name, containerImage, args, workDir, creds, scanConfig) return k8sClient .batchV1Api() - .createNamespacedJob(namespace, spec, null, null, null,null) + .createNamespacedJob(namespace, spec) + .execute() } V1Job scanJobSpec(String name, String containerImage, List args, Path workDir, Path credsFile, ScanConfig scanConfig) { @@ -656,7 +658,8 @@ class K8sServiceImpl implements K8sService { final spec = mirrorJobSpec(name, containerImage, args, workDir, creds, config) return k8sClient .batchV1Api() - .createNamespacedJob(namespace, spec, null, null, null,null) + .createNamespacedJob(namespace, spec) + .execute() } V1Job mirrorJobSpec(String name, String containerImage, List args, Path workDir, Path credsFile, MirrorConfig config) { From cd8af8e0105c06b62f528d9e14f0f233c31f398a Mon Sep 17 00:00:00 2001 From: munishchouhan Date: Mon, 18 Nov 2024 13:47:02 +0100 Subject: [PATCH 08/15] added job label selector Signed-off-by: munishchouhan --- .../groovy/io/seqera/wave/service/k8s/K8sServiceImpl.groovy | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/groovy/io/seqera/wave/service/k8s/K8sServiceImpl.groovy b/src/main/groovy/io/seqera/wave/service/k8s/K8sServiceImpl.groovy index 71e9821d3..56b512655 100644 --- a/src/main/groovy/io/seqera/wave/service/k8s/K8sServiceImpl.groovy +++ b/src/main/groovy/io/seqera/wave/service/k8s/K8sServiceImpl.groovy @@ -252,6 +252,7 @@ class K8sServiceImpl implements K8sService { .subPath(rel) } + @Deprecated V1Pod buildSpec(String name, String containerImage, List args, Path workDir, Path credsFile, Duration timeout, Map nodeSelector) { // dirty dependency to avoid introducing another parameter @@ -449,7 +450,7 @@ class K8sServiceImpl implements K8sService { .withName(name) .withLabels(labels) .endMetadata() - + final requests = new V1ResourceRequirements() if( blobConfig.requestsCpu ) requests.putRequestsItem('cpu', new Quantity(blobConfig.requestsCpu)) @@ -741,6 +742,7 @@ class K8sServiceImpl implements K8sService { final allPods = k8sClient .coreV1Api() .listNamespacedPod(namespace) + .labelSelector("job-name=${jobName}") .execute() if( !allPods || !allPods.items ) From 362903f693f253d9fe660976c62b687aad22b411 Mon Sep 17 00:00:00 2001 From: munishchouhan Date: Mon, 18 Nov 2024 16:35:51 +0100 Subject: [PATCH 09/15] fixed tests Signed-off-by: munishchouhan --- .../service/k8s/K8sServiceImplTest.groovy | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/src/test/groovy/io/seqera/wave/service/k8s/K8sServiceImplTest.groovy b/src/test/groovy/io/seqera/wave/service/k8s/K8sServiceImplTest.groovy index f1b276c47..3a0f1ad77 100644 --- a/src/test/groovy/io/seqera/wave/service/k8s/K8sServiceImplTest.groovy +++ b/src/test/groovy/io/seqera/wave/service/k8s/K8sServiceImplTest.groovy @@ -513,11 +513,16 @@ class K8sServiceImplTest extends Specification { def "getLatestPodForJob should return the latest pod when multiple pods are present"() { given: def jobName = "test-job" + def namespace = "test-ns" def pod1 = new V1Pod().metadata(new V1ObjectMeta().creationTimestamp(OffsetDateTime.now().minusDays(1))) def pod2 = new V1Pod().metadata(new V1ObjectMeta().creationTimestamp(OffsetDateTime.now())) def allPods = new V1PodList().items(Arrays.asList(pod1, pod2)) def api = Mock(CoreV1Api) - api.listNamespacedPod(_, _, _, _, _, "job-name=${jobName}", _, _, _, _, _, _) >> allPods + def podRequest2 = Mock(CoreV1Api. APIlistNamespacedPodRequest) + podRequest2.execute() >> allPods + def podRequest1 = Mock(CoreV1Api. APIlistNamespacedPodRequest) + podRequest1.labelSelector("job-name=${jobName}") >> podRequest2 + api.listNamespacedPod(namespace) >> podRequest1 def k8sClient = new K8sClient() { @Override ApiClient apiClient() { @@ -528,7 +533,7 @@ class K8sServiceImplTest extends Specification { } } and: - def k8sService = new K8sServiceImpl(k8sClient: k8sClient) + def k8sService = new K8sServiceImpl(k8sClient: k8sClient, namespace: namespace) when: def latestPod = k8sService.getLatestPodForJob(jobName) @@ -540,8 +545,13 @@ class K8sServiceImplTest extends Specification { def "getLatestPodForJob should return null when no pod is present"() { given: def jobName = "test-job" + def namespace = "test-ns" def api = Mock(CoreV1Api) - api.listNamespacedPod(_, _, _, _, _, "job-name=${jobName}", _, _, _, _, _, _) >> null + def podRequest2 = Mock(CoreV1Api. APIlistNamespacedPodRequest) + podRequest2.execute() >> null + def podRequest1 = Mock(CoreV1Api. APIlistNamespacedPodRequest) + podRequest1.labelSelector("job-name=${jobName}") >> podRequest2 + api.listNamespacedPod(namespace) >> podRequest1 def k8sClient = new K8sClient() { @Override ApiClient apiClient() { @@ -552,7 +562,7 @@ class K8sServiceImplTest extends Specification { } } and: - def k8sService = new K8sServiceImpl(k8sClient: k8sClient) + def k8sService = new K8sServiceImpl(k8sClient: k8sClient, namespace: namespace) when: def latestPod = k8sService.getLatestPodForJob(jobName) @@ -826,7 +836,7 @@ class K8sServiceImplTest extends Specification { job.spec.backoffLimit == 3 job.spec.template.spec.containers[0].image == containerImage job.spec.template.spec.containers[0].args == args - job.spec.template.spec.containers[0].resources.requests == null + job.spec.template.spec.containers[0].resources.requests == [:] job.spec.template.spec.containers[0].env == [new V1EnvVar().name('REGISTRY_AUTH_FILE').value('/tmp/config.json')] and: job.spec.template.spec.containers[0].volumeMounts.size() == 2 @@ -886,7 +896,7 @@ class K8sServiceImplTest extends Specification { job.spec.backoffLimit == 3 job.spec.template.spec.containers[0].image == containerImage job.spec.template.spec.containers[0].args == args - job.spec.template.spec.containers[0].resources.requests == null + job.spec.template.spec.containers[0].resources.requests == [:] job.spec.template.spec.volumes.size() == 1 job.spec.template.spec.volumes[0].persistentVolumeClaim.claimName == 'bar' job.spec.template.spec.restartPolicy == 'Never' @@ -973,11 +983,14 @@ class K8sServiceImplTest extends Specification { def api = Mock(BatchV1Api) def client = Mock(K8sClient) { batchV1Api()>>api } def service = Spy(new K8sServiceImpl(namespace:NS, k8sClient: client)) + def jobRequest = Mock(BatchV1Api. APIreadNamespacedJobRequest) when: def status = service.getJobStatus(NAME) + then: - 1 * api.readNamespacedJob(NAME, NS, null) >> JOB + jobRequest.execute() >> JOB + 1 * api.readNamespacedJob(NAME, NS) >> jobRequest and: status == EXPECTED From 6b0c3e024af0dde70ba3ea778c9a09d4d0012b1d Mon Sep 17 00:00:00 2001 From: munishchouhan Date: Mon, 18 Nov 2024 18:11:40 +0100 Subject: [PATCH 10/15] [release] bump 1.15.1-A1 Signed-off-by: munishchouhan --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 141f2e805..287aff0bb 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.15.0 +1.15.1-A1 From 8260c4bf7d5c731823084b8cbf56e32c3a71665a Mon Sep 17 00:00:00 2001 From: munishchouhan Date: Tue, 19 Nov 2024 11:39:40 +0100 Subject: [PATCH 11/15] revert VERSION [ci skip] Signed-off-by: munishchouhan --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 287aff0bb..141f2e805 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.15.1-A1 +1.15.0 From 62b97b3d2f5e3365996b4b9bd19ffcffa72e0e54 Mon Sep 17 00:00:00 2001 From: munishchouhan Date: Tue, 19 Nov 2024 11:51:20 +0100 Subject: [PATCH 12/15] minor change [ci skip] Signed-off-by: munishchouhan --- .../main/groovy/io.seqera.wave.java-library-conventions.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/buildSrc/src/main/groovy/io.seqera.wave.java-library-conventions.gradle b/buildSrc/src/main/groovy/io.seqera.wave.java-library-conventions.gradle index 0b244fd58..835199bd4 100644 --- a/buildSrc/src/main/groovy/io.seqera.wave.java-library-conventions.gradle +++ b/buildSrc/src/main/groovy/io.seqera.wave.java-library-conventions.gradle @@ -41,6 +41,7 @@ java { dependencies { implementation 'org.slf4j:slf4j-api:2.0.16' + testImplementation 'ch.qos.logback:logback-core:1.5.12' testImplementation 'ch.qos.logback:logback-classic:1.5.12' testImplementation 'org.apache.groovy:groovy:4.0.15' From 206e01318e777da853ccbd14d9beafd0b88d0025 Mon Sep 17 00:00:00 2001 From: munishchouhan Date: Sun, 24 Nov 2024 06:37:17 +0100 Subject: [PATCH 13/15] Added Foreground propagationPolicy Signed-off-by: munishchouhan --- src/main/groovy/io/seqera/wave/service/k8s/K8sServiceImpl.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/groovy/io/seqera/wave/service/k8s/K8sServiceImpl.groovy b/src/main/groovy/io/seqera/wave/service/k8s/K8sServiceImpl.groovy index 56b512655..3a1cdc206 100644 --- a/src/main/groovy/io/seqera/wave/service/k8s/K8sServiceImpl.groovy +++ b/src/main/groovy/io/seqera/wave/service/k8s/K8sServiceImpl.groovy @@ -733,6 +733,7 @@ class K8sServiceImpl implements K8sService { k8sClient .batchV1Api() .deleteNamespacedJob(name, namespace) + .propagationPolicy("Foreground") .execute() } From 8d46fb7d9e7391c54dfa610bedf381d0e235e256 Mon Sep 17 00:00:00 2001 From: Paolo Di Tommaso Date: Mon, 25 Nov 2024 20:11:56 +0100 Subject: [PATCH 14/15] Remove K8s withOverhead [ci skip] Signed-off-by: Paolo Di Tommaso --- .../groovy/io/seqera/wave/service/k8s/K8sServiceImpl.groovy | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/main/groovy/io/seqera/wave/service/k8s/K8sServiceImpl.groovy b/src/main/groovy/io/seqera/wave/service/k8s/K8sServiceImpl.groovy index 3a1cdc206..199c788ac 100644 --- a/src/main/groovy/io/seqera/wave/service/k8s/K8sServiceImpl.groovy +++ b/src/main/groovy/io/seqera/wave/service/k8s/K8sServiceImpl.groovy @@ -26,7 +26,6 @@ import groovy.transform.CompileStatic import groovy.util.logging.Slf4j import io.kubernetes.client.custom.Quantity import io.kubernetes.client.openapi.models.V1ContainerBuilder -import io.kubernetes.client.openapi.models.V1DeleteOptions import io.kubernetes.client.openapi.models.V1EnvVar import io.kubernetes.client.openapi.models.V1HostPathVolumeSource import io.kubernetes.client.openapi.models.V1Job @@ -294,8 +293,6 @@ class K8sServiceImpl implements K8sService { .withActiveDeadlineSeconds( timeout.toSeconds() ) .withRestartPolicy("Never") .addAllToVolumes(volumes) - .withOverhead(null) - final requests = new V1ResourceRequirements() if( requestsCpu ) @@ -394,8 +391,6 @@ class K8sServiceImpl implements K8sService { .withActiveDeadlineSeconds( scanConfig.timeout.toSeconds() ) .withRestartPolicy("Never") .addAllToVolumes(volumes) - .withOverhead(null) - final requests = new V1ResourceRequirements() if( scanConfig.requestsCpu ) @@ -464,7 +459,6 @@ class K8sServiceImpl implements K8sService { .editOrNewSpec() .withServiceAccount(serviceAccount) .withRestartPolicy("Never") - .withOverhead(null) //container section .addNewContainer() .withName(name) From fe2c76b83e85cb2aeee41fb23c598f3c2cac1aab Mon Sep 17 00:00:00 2001 From: Paolo Di Tommaso Date: Mon, 25 Nov 2024 20:15:19 +0100 Subject: [PATCH 15/15] Bump K8s client 21.0.1 Signed-off-by: Paolo Di Tommaso --- build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 1e678be82..7e240d16c 100644 --- a/build.gradle +++ b/build.gradle @@ -56,8 +56,8 @@ dependencies { implementation 'io.micronaut.reactor:micronaut-reactor-http-client' implementation 'org.apache.commons:commons-compress:1.27.1' implementation 'org.apache.commons:commons-lang3:3.17.0' - implementation 'io.kubernetes:client-java:21.0.0' - implementation 'io.kubernetes:client-java-api-fluent:21.0.0' + implementation 'io.kubernetes:client-java:21.0.1' + implementation 'io.kubernetes:client-java-api-fluent:21.0.1' implementation 'com.google.code.gson:gson:2.10.1' implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310' implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml'