Skip to content

Commit 622851b

Browse files
authored
Merge pull request #575 from iExecBlockchainComputing/release/8.3.0
Release/8.3.0
2 parents 5168d75 + 5c59e27 commit 622851b

File tree

52 files changed

+1849
-619
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1849
-619
lines changed

CHANGELOG.md

Lines changed: 109 additions & 18 deletions
Large diffs are not rendered by default.

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM eclipse-temurin:11.0.20_8-jre-focal
1+
FROM eclipse-temurin:11.0.21_9-jre-focal
22

33
ARG jar
44

Jenkinsfile

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
@Library('[email protected].3') _
1+
@Library('[email protected].4') _
22
buildJavaProject(
3-
buildInfo: getBuildInfo(),
4-
integrationTestsEnvVars: [],
53
shouldPublishJars: true,
6-
shouldPublishDockerImages: true,
7-
dockerfileDir: '.')
4+
shouldPublishDockerImages: true)

README.md

Lines changed: 74 additions & 32 deletions
Large diffs are not rendered by default.

build.gradle

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
plugins {
22
id 'java'
33
id 'io.freefair.lombok' version '8.2.2'
4-
id 'org.springframework.boot' version '2.7.14'
5-
id 'io.spring.dependency-management' version '1.1.3'
4+
id 'org.springframework.boot' version '2.7.17'
5+
id 'io.spring.dependency-management' version '1.1.4'
66
id 'jacoco'
77
id 'org.sonarqube' version '4.2.1.3168'
88
id 'maven-publish'
@@ -12,15 +12,14 @@ group = 'com.iexec.worker'
1212

1313
ext {
1414
springCloudVersion = '2021.0.8'
15-
dockerJavaVersion = '3.2.12'
16-
lombokVersion = '1.18.2'
15+
commonsMathsVersion = '3.6.1'
1716
}
1817

1918
if (!project.hasProperty('gitBranch')) {
2019
ext.gitBranch = 'git rev-parse --abbrev-ref HEAD'.execute().text.trim()
2120
}
2221

23-
if (gitBranch != 'main' && gitBranch != 'master' && ! (gitBranch ==~ '(release|hotfix|support)/.*')) {
22+
if (gitBranch != 'main' && gitBranch != 'master' && !(gitBranch ==~ '(release|hotfix|support)/.*')) {
2423
version += '-NEXT-SNAPSHOT'
2524
}
2625

@@ -64,9 +63,12 @@ dependencies {
6463
implementation "org.springframework.cloud:spring-cloud-starter-openfeign"
6564
implementation "org.springframework.retry:spring-retry"
6665

67-
// apache commons.lang3
66+
// apache commons-lang3
6867
implementation 'org.apache.commons:commons-lang3'
6968

69+
// Apache commons-math3
70+
implementation "org.apache.commons:commons-math3:${commonsMathsVersion}"
71+
7072
// Required for com.iexec.worker.feign.config.RestTemplateConfig
7173
implementation 'org.apache.httpcomponents:httpclient'
7274

@@ -80,9 +82,6 @@ dependencies {
8082
// observability
8183
runtimeOnly 'io.micrometer:micrometer-registry-prometheus'
8284

83-
// docker
84-
implementation "com.github.docker-java:docker-java:${dockerJavaVersion}"
85-
8685
// expiring map
8786
implementation 'net.jodah:expiringmap:0.5.10'
8887

@@ -97,8 +96,10 @@ dependencies {
9796

9897
java {
9998
toolchain {
100-
languageVersion.set(JavaLanguageVersion.of(11))
99+
languageVersion.set(JavaLanguageVersion.of(17))
101100
}
101+
sourceCompatibility = "11"
102+
targetCompatibility = "11"
102103
}
103104

104105
springBoot {
@@ -108,7 +109,7 @@ springBoot {
108109
tasks.named("bootJar") {
109110
manifest {
110111
attributes("Implementation-Title": "iExec Worker",
111-
"Implementation-Version": project.version)
112+
"Implementation-Version": project.version)
112113
}
113114
}
114115

@@ -127,7 +128,7 @@ jacocoTestReport {
127128
xml.required = true
128129
}
129130
}
130-
tasks.test.finalizedBy tasks.jacocoTestReport
131+
tasks.test.finalizedBy tasks.jacocoTestReport
131132
tasks.sonarqube.dependsOn tasks.jacocoTestReport
132133

133134
publishing {
@@ -148,16 +149,15 @@ publishing {
148149
}
149150
}
150151

151-
ext.jarPathForOCI = relativePath(tasks.bootJar.outputs.files.singleFile)
152+
ext.jarPathForOCI = relativePath(tasks.bootJar.outputs.files.singleFile)
152153
ext.gitShortCommit = 'git rev-parse --short=8 HEAD'.execute().text.trim()
153-
ext.ociImageName = 'local/' + ['bash', '-c', 'basename $(git config --get remote.origin.url) .git'].execute().text.trim()
154+
ext.ociImageName = 'local/' + ['bash', '-c', 'basename $(git config --get remote.origin.url) .git'].execute().text.trim()
154155

155156
tasks.register('buildImage', Exec) {
156-
group 'Build'
157+
group 'Build'
157158
description 'Builds an OCI image from a Dockerfile.'
158-
dependsOn bootJar
159-
commandLine ("sh", "-c", "docker build --build-arg jar=$jarPathForOCI -t $ociImageName:$gitShortCommit ."
160-
+ " && docker tag $ociImageName:$gitShortCommit $ociImageName:dev")
159+
dependsOn bootJar
160+
commandLine 'docker', 'build', '--build-arg', 'jar=' + jarPathForOCI, '-t', ociImageName + ':dev', '.'
161161
}
162162

163163
// ##################
@@ -167,9 +167,9 @@ tasks.register('buildImage', Exec) {
167167
//gradle bootRun -PproxyHost=192.168.XX.XXX -PproxyPort=3128
168168
project.ext.getJvmArgs = {
169169
if (project.hasProperty("proxyHost") && project.hasProperty("proxyPort")) {
170-
return ["-Dhttp.proxyHost="+project.proxyHost, "-Dhttp.proxyPort="+project.proxyPort]
170+
return ["-Dhttp.proxyHost=" + project.proxyHost, "-Dhttp.proxyPort=" + project.proxyPort]
171171
} else {
172-
return []
172+
return []
173173
}
174174
}
175175

gradle.properties

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
version=8.2.0
2-
iexecCommonVersion=8.3.0
3-
iexecCommonsContainersVersion=1.1.2
4-
iexecCommonsPocoVersion=3.1.0
5-
iexecBlockchainAdapterVersion=8.2.0
6-
iexecResultVersion=8.2.0
7-
iexecSmsVersion=8.3.0
1+
version=8.3.0
2+
iexecCommonVersion=8.3.1
3+
iexecCommonsContainersVersion=1.2.1
4+
iexecCommonsPocoVersion=3.2.0
5+
iexecBlockchainAdapterVersion=8.3.0
6+
iexecResultVersion=8.3.0
7+
iexecSmsVersion=8.4.0
88

99
nexusUser
1010
nexusPassword

src/main/java/com/iexec/worker/Application.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
package com.iexec.worker;
1818

1919

20-
import com.iexec.worker.chain.CredentialsService;
2120
import com.iexec.worker.chain.IexecHubService;
2221
import com.iexec.worker.feign.LoginService;
2322
import com.iexec.worker.replicate.ReplicateRecoveryService;
@@ -45,7 +44,7 @@
4544
public class Application implements CommandLineRunner {
4645

4746
@Autowired
48-
private CredentialsService credentialsService;
47+
private String workerWalletAddress;
4948

5049
@Autowired
5150
private IexecHubService iexecHubService;
@@ -68,11 +67,9 @@ public static void main(String[] args) {
6867

6968
@Override
7069
public void run(String... args) {
71-
String workerAddress = credentialsService.getCredentials().getAddress();
72-
7370
if (!iexecHubService.hasEnoughGas()) {
7471
String noEnoughGas = "No enough gas! please refill your wallet [walletAddress:%s]";
75-
String formatted = String.format(noEnoughGas, workerAddress);
72+
String formatted = String.format(noEnoughGas, workerWalletAddress);
7673
LoggingUtils.printHighlightedMessage(formatted);
7774
System.exit(0);
7875
}

src/main/java/com/iexec/worker/chain/ContributionService.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,16 @@ public class ContributionService {
4040
private final IexecHubService iexecHubService;
4141
private final WorkerpoolAuthorizationService workerpoolAuthorizationService;
4242
private final EnclaveAuthorizationService enclaveAuthorizationService;
43-
private final CredentialsService credentialsService;
43+
private final String workerWalletAddress;
4444

4545
public ContributionService(IexecHubService iexecHubService,
4646
WorkerpoolAuthorizationService workerpoolAuthorizationService,
4747
EnclaveAuthorizationService enclaveAuthorizationService,
48-
CredentialsService credentialsService) {
48+
String workerWalletAddress) {
4949
this.iexecHubService = iexecHubService;
5050
this.workerpoolAuthorizationService = workerpoolAuthorizationService;
5151
this.enclaveAuthorizationService = enclaveAuthorizationService;
52-
this.credentialsService = credentialsService;
52+
this.workerWalletAddress = workerWalletAddress;
5353
}
5454

5555
public boolean isChainTaskInitialized(String chainTaskId) {
@@ -180,7 +180,7 @@ public Contribution getContribution(ComputedFile computedFile) {
180180

181181
String resultDigest = computedFile.getResultDigest();
182182
String resultHash = ResultUtils.computeResultHash(chainTaskId, resultDigest);
183-
String resultSeal = ResultUtils.computeResultSeal(credentialsService.getCredentials().getAddress(), chainTaskId, resultDigest);
183+
String resultSeal = ResultUtils.computeResultSeal(workerWalletAddress, chainTaskId, resultDigest);
184184
String workerpoolSignature = workerpoolAuthorization.getSignature().getValue();
185185
String enclaveChallenge = workerpoolAuthorization.getEnclaveChallenge();
186186
String enclaveSignature = computedFile.getEnclaveSignature();

src/main/java/com/iexec/worker/chain/CredentialsService.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
package com.iexec.worker.chain;
1818

1919
import com.iexec.common.chain.CredentialsAbstractService;
20-
2120
import org.springframework.beans.factory.annotation.Value;
21+
import org.springframework.context.annotation.Bean;
2222
import org.springframework.stereotype.Service;
2323

2424
@Service
@@ -30,4 +30,9 @@ public CredentialsService(
3030
) throws Exception {
3131
super(walletPassword, walletPath);
3232
}
33+
34+
@Bean
35+
public String workerWalletAddress() {
36+
return getCredentials().getAddress();
37+
}
3338
}

0 commit comments

Comments
 (0)