Skip to content

Commit

Permalink
Merge pull request #74 from iExecBlockchainComputing/release/8.0.0
Browse files Browse the repository at this point in the history
Release/8.0.0
  • Loading branch information
jeremyjams authored Mar 8, 2023
2 parents 334a2ad + a380cca commit e29727b
Show file tree
Hide file tree
Showing 19 changed files with 373 additions and 237 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Changelog

All notable changes to this project will be documented in this file.

## [[8.0.0]](https://github.com/iExecBlockchainComputing/tee-worker-post-compute/releases/tag/v8.0.0) 2023-03-08

### New Features
* #69 #68 #63 #61 #54 Enable Gramine framework for TEE tasks.
* #60 Set scone heap to 3G.
* #59 Upgrade to scone 5.7.
### Quality
* #67 Remove deprecated Palantir Docker Gradle plugin.
### Dependency Upgrades
* #73 Upgrade to `iexec-common` 7.0.0.
* #72 #65 #64 #62 #58 Upgrade to `jenkins-library` 2.5.0.
* #70 Replace the deprecated `openjdk` Docker base image with `eclipse-temurin` and upgrade to Java 11.0.16 patch.
* #66 Upgrade to Gradle 7.6.
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM openjdk:11.0.16-jre-slim

ARG jar

RUN test -n "$jar"

# By default JVM will try to allocate 16GB heap, let's reduce its size a bit
ENV JAVA_TOOL_OPTIONS="-Xmx256m"

COPY $jar /app/app.jar

ENTRYPOINT ["java", "-jar", "/app/app.jar"]
16 changes: 12 additions & 4 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@Library('global-jenkins-library@2.0.1') _
@Library('global-jenkins-library@2.5.0') _

String repositoryName = 'tee-worker-post-compute'

Expand All @@ -9,14 +9,22 @@ buildJavaProject(
integrationTestsEnvVars: [],
shouldPublishJars: false,
shouldPublishDockerImages: true,
dockerfileDir: 'docker',
dockerfileDir: '.',
buildContext: '.',
dockerImageRepositoryName: repositoryName,
preProductionVisibility: 'docker.io',
productionVisibility: 'docker.io')
productionVisibility: Registries.EXTERNAL_DOCKERIO_HOST
)

buildGramine(
buildInfo: buildInfo,
dockerfileDir: 'gramine'
)

sconeBuildUnlocked(
nativeImage: "docker-regis.iex.ec/$repositoryName:$buildInfo.imageTag",
imageName: repositoryName,
imageTag: buildInfo.imageTag,
sconifyArgsPath: './docker/sconify.args')
sconifyArgsPath: './docker/sconify.args',
sconifyVersion: '5.7.1'
)
61 changes: 39 additions & 22 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,32 +1,42 @@
plugins {
id 'java'
// Apply the application plugin to add support for building a CLI application in Java.
id 'application'
id 'io.freefair.lombok' version '6.6.1'
id 'jacoco'
id 'org.sonarqube' version '3.3'
id 'maven-publish'
id 'com.palantir.docker' version '0.26.0'
id 'com.github.johnrengelman.shadow' version '6.1.0'
id 'com.github.johnrengelman.shadow' version '7.1.2'
}

sourceCompatibility = 11
targetCompatibility = 11

ext {
gitBranch = 'git rev-parse --abbrev-ref HEAD'.execute().text.trim()
jarPathForOCI = relativePath(tasks.shadowJar.outputs.files.singleFile)
ociImageBase = 'local/' + rootProject.name
ociImageName = ociImageBase + ':dev'
ociTeeImageName = ociImageBase + '-unlocked:dev'
// versions
testContainersVersion = '1.16.2'
mockitoVersion = '4.4.0'
systemStubsVersion = '2.0.1'
}

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

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

repositories {
mavenLocal()
mavenCentral()
maven {
url "https://docker-regis-adm.iex.ec/repository/maven-public/"
credentials {
username nexusUser
password nexusPassword
}
}
maven {
url "https://nexus.intra.iex.ec/repository/maven-public/"
}
Expand Down Expand Up @@ -84,11 +94,17 @@ dependencies {

}

tasks.withType(Tar) {
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
}
}

tasks.withType(Tar).configureEach {
enabled = false
}

tasks.withType(Test) {
tasks.withType(Test).configureEach {
finalizedBy jacocoTestReport
useJUnitPlatform()
}
Expand All @@ -99,7 +115,7 @@ jacoco {
// sonarqube code coverage requires jacoco XML report
jacocoTestReport {
reports {
xml.enabled true
xml.required = true
}
}
tasks.sonarqube.dependsOn tasks.jacocoTestReport
Expand All @@ -125,26 +141,27 @@ jar {
}
}

def app = 'app'
def fatJar = "${app}-all.jar"

// Jar with all dependencies (app-all.jar)
shadowJar {
mainClassName = mainClass
archiveBaseName.set(app)
archiveBaseName.set('app')
archiveVersion.set('') // remove version from name
}

docker {
name 'nexus.intra.iex.ec/' + rootProject.name + ':dev'
dockerfile file('docker/Dockerfile.local')
files('build/libs/' + fatJar)
buildArgs([JAR_PATH: fatJar ])
ext.jarPathForOCI = relativePath(tasks.shadowJar.outputs.files.singleFile)

task buildImage(type: Exec) {
group 'Build'
description 'Builds an OCI image from a Dockerfile.'
dependsOn shadowJar
commandLine 'docker', 'build', '--build-arg', 'jar=' + jarPathForOCI, '-t', ociImageName, '.'
}
tasks.docker.dependsOn tasks.build

task buildImage {
dependsOn tasks.docker
task buildTeeImage(type: Exec) {
dependsOn buildImage
environment 'IMG_FROM', ociImageName
environment 'IMG_TO', ociTeeImageName
commandLine 'docker/sconify.sh'
}

task itest(type: Test) {
Expand Down
50 changes: 0 additions & 50 deletions docker/Dockerfile

This file was deleted.

27 changes: 0 additions & 27 deletions docker/Dockerfile.local

This file was deleted.

7 changes: 4 additions & 3 deletions docker/sconify.args
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
--name=tee-post-compute \
--base=openjdk:11.0.16-jre-slim \
--from=${IMG_FROM} \
--to=${IMG_TO} \
--binary-fs \
--fs-dir=/app \
--host-path=/etc/hosts \
--host-path=/etc/resolv.conf \
--binary=/usr/lib/jvm/java-11-openjdk/bin/java \
--heap="4G" \
--dlopen="2" \
--binary=/usr/local/openjdk-11/bin/java \
--heap="3G" \
--dlopen="1" \
--verbose \
--no-color \
--command="java -jar /app/app.jar"
30 changes: 15 additions & 15 deletions docker/sconify.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
#!/bin/bash

<< 'USAGE'
IMG_FROM=docker.io/iexechub/tee-worker-post-compute:dev \
IMG_TO=docker.io/iexechub/tee-worker-post-compute:dev-debug \
SCONIFIER_VERSION=x.y.z \
./sconify.sh
USAGE

cd $(dirname $0)

SCONE_IMG_NAME=scone-debug/iexec-sconify-image-unlocked
SCONE_IMG_VERSION=5.7.1

IMG_TO=${IMG_TO}-sconify-${SCONE_IMG_VERSION}-debug

ARGS=$(sed -e "s'\${IMG_FROM}'${IMG_FROM}'" -e "s'\${IMG_TO}'${IMG_TO}'" sconify.args)
echo $ARGS

SCONIFIER_IMAGE="registry.scontain.com:5050/scone-production/iexec-sconify-image:${SCONIFIER_VERSION}"
SCONE_IMAGE="registry.scontain.com:5050/${SCONE_IMG_NAME}:${SCONE_IMG_VERSION}"

/bin/bash -c "docker run \
--rm \
/bin/bash -c "docker run -t --rm \
-v /var/run/docker.sock:/var/run/docker.sock \
${SCONIFIER_IMAGE} \
sconify_iexec \
--cli=${SCONIFIER_IMAGE} \
--crosscompiler=${SCONIFIER_IMAGE} \
$ARGS"
${SCONE_IMAGE} \
sconify_iexec \
--cli=${SCONE_IMAGE} \
--crosscompiler=${SCONE_IMAGE} \
$ARGS"

echo
docker run --rm -e SCONE_HASH=1 $IMG_TO
7 changes: 5 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
version=7.1.1
iexecCommonVersion=6.0.0
version=8.0.0
iexecCommonVersion=7.0.0

nexusUser
nexusPassword
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit e29727b

Please sign in to comment.