You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@teaclave.apache.org by sh...@apache.org on 2022/11/11 05:17:49 UTC
[incubator-teaclave-java-tee-sdk] 09/48: [tools] Adapt CI to Enclave depedencies
This is an automated email from the ASF dual-hosted git repository.
shaojunwang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-teaclave-java-tee-sdk.git
commit 19c8799f891467bcc45dc651e8ad8559b102c263
Author: cengfeng.lzy <ce...@alibaba-inc.com>
AuthorDate: Thu Apr 7 21:50:41 2022 +0800
[tools] Adapt CI to Enclave depedencies
Summary: Adapt CI to Enclave depedencies
Test Plan: all tests pass
Reviewers: lei.yul, jeffery.wsj, sanhong.lsh
Issue: https://aone.alibaba-inc.com/task/40660818
CR:
https://code.aone.alibaba-inc.com/java-tee/JavaEnclave/codereview/8316913
---
build.sh | 21 +++++++++++++++++++++
sdk/enclave/pom.xml | 6 ++++++
.../enclave/framework/EnclaveMethodInvoker.java | 3 ++-
tools/cicd/Dockerfile | 3 ++-
tools/cicd/make.sh | 4 ++--
5 files changed, 33 insertions(+), 4 deletions(-)
diff --git a/build.sh b/build.sh
index 5368e42..f9c39ec 100644
--- a/build.sh
+++ b/build.sh
@@ -8,4 +8,25 @@ cd "${SHELL_FOLDER}"
# workspace dir is the same as build.sh path location.
WORKDIR="$PWD"
+# The necessary GraalVM jars are compiled from git@gitlab.alibaba-inc.com:graal/SGXGraalVM.git. When the patches are
+# accepted by the community, these jars will be gradually replaced by the official jars.
+VERSION="enclave-22.0.0"
+mkdir jartmp
+pushd jartmp > /dev/null
+wget https://graal.oss-cn-beijing.aliyuncs.com/graal-enclave/JDK11-22.0.0/graal-processor-22.0.0.jar
+wget https://graal.oss-cn-beijing.aliyuncs.com/graal-enclave/JDK11-22.0.0/graal-sdk-enclave-22.0.0.jar
+wget https://graal.oss-cn-beijing.aliyuncs.com/graal-enclave/JDK11-22.0.0/native-image-base-enclave-22.0.0.jar
+wget https://graal.oss-cn-beijing.aliyuncs.com/graal-enclave/JDK11-22.0.0/objectfile-enclave-22.0.0.jar
+wget https://graal.oss-cn-beijing.aliyuncs.com/graal-enclave/JDK11-22.0.0/pointsto-enclave-22.0.0.jar
+wget https://graal.oss-cn-beijing.aliyuncs.com/graal-enclave/JDK11-22.0.0/svm-enclave-22.0.0.jar
+mvn install:install-file -Dfile=graal-processor-22.0.0.jar -DgroupId=org.graalvm.compiler -DartifactId=graal-processor -Dversion=$VERSION -Dpackaging=jar
+mvn install:install-file -Dfile=graal-sdk-enclave-22.0.0.jar -DgroupId=org.graalvm.sdk -DartifactId=graal-sdk -Dversion=$VERSION -Dpackaging=jar
+mvn install:install-file -Dfile=svm-enclave-22.0.0.jar -DgroupId=org.graalvm.nativeimage -DartifactId=svm -Dversion=$VERSION -Dpackaging=jar
+mvn install:install-file -Dfile=objectfile-enclave-22.0.0.jar -DgroupId=org.graalvm.nativeimage -DartifactId=objectfile -Dversion=$VERSION -Dpackaging=jar
+mvn install:install-file -Dfile=pointsto-enclave-22.0.0.jar -DgroupId=org.graalvm.nativeimage -DartifactId=pointsto -Dversion=$VERSION -Dpackaging=jar
+mvn install:install-file -Dfile=native-image-base-enclave-22.0.0.jar -DgroupId=org.graalvm.nativeimage -DartifactId=native-image-base -Dversion=$VERSION -Dpackaging=jar
+
+popd > /dev/null
+rm -rf jartmp
+
cd "${WORKDIR}"/sdk && mvn clean package
diff --git a/sdk/enclave/pom.xml b/sdk/enclave/pom.xml
index 7d5cf01..8c79f06 100644
--- a/sdk/enclave/pom.xml
+++ b/sdk/enclave/pom.xml
@@ -51,6 +51,12 @@
<configuration>
<javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
<doclint>none</doclint>
+ <additionalJOptions>
+ <additionalJOption>--add-modules</additionalJOption>
+ <additionalJOption>jdk.internal.vm.ci</additionalJOption>
+ <additionalJOption>--add-exports</additionalJOption>
+ <additionalJOption>jdk.internal.vm.ci/jdk.vm.ci.meta=ALL-UNNAMED</additionalJOption>
+ </additionalJOptions>
</configuration>
<version>3.2.0</version>
<executions>
diff --git a/sdk/enclave/src/main/java/com/alibaba/confidentialcomputing/enclave/framework/EnclaveMethodInvoker.java b/sdk/enclave/src/main/java/com/alibaba/confidentialcomputing/enclave/framework/EnclaveMethodInvoker.java
index f174d08..4d5d5b4 100644
--- a/sdk/enclave/src/main/java/com/alibaba/confidentialcomputing/enclave/framework/EnclaveMethodInvoker.java
+++ b/sdk/enclave/src/main/java/com/alibaba/confidentialcomputing/enclave/framework/EnclaveMethodInvoker.java
@@ -4,11 +4,12 @@ import com.alibaba.confidentialcomputing.common.EnclaveInvocationResult;
/**
* There are two types of method invocations in Enclave:
- * <p>
+ * <ul>
* <li>Business methods: The subclass {@link ServiceMethodInvoker} of this class takes care
* of the business method invocation.</li>
* <li>Framework methods: The SDK defined methods that run inside the enclave to maintain the framework. These methods
* must be static, are taken care by the subclass {@link LoadServiceInvoker}.</li>
+ * </ul>
*/
public interface EnclaveMethodInvoker<T> {
EnclaveInvocationResult callMethod(T input);
diff --git a/tools/cicd/Dockerfile b/tools/cicd/Dockerfile
index 7ec87da..c3a7c4d 100644
--- a/tools/cicd/Dockerfile
+++ b/tools/cicd/Dockerfile
@@ -8,4 +8,5 @@ ENV DEBIAN_FRONTEND noninteractive
# install openjdk11 and maven.
RUN apt-get update && \
echo -e 'yes\n' | apt-get install -y openjdk-11-jdk && \
- echo -e 'yes\n' | apt-get install -y maven
+ echo -e 'yes\n' | apt-get install -y maven && \
+ echo -e 'yes\n' | apt-get install -y wget
diff --git a/tools/cicd/make.sh b/tools/cicd/make.sh
index b488573..0120911 100755
--- a/tools/cicd/make.sh
+++ b/tools/cicd/make.sh
@@ -1,7 +1,7 @@
#!/bin/bash
BUILD_IMAGE=javaenclave_build
-BUILD_TAG=v0.1.0
+BUILD_TAG=v0.1.1
SHELL_FOLDER=$(cd "$(dirname "$0")";pwd)
@@ -18,4 +18,4 @@ fi
docker run -i --rm --privileged --network host \
-w "${WORKDIR}" \
-v "${HOME}"/.m2:/root/.m2 -v "${WORKDIR}":"${WORKDIR}" \
-${BUILD_IMAGE}:${BUILD_TAG} /bin/bash build.sh
\ No newline at end of file
+${BUILD_IMAGE}:${BUILD_TAG} /bin/bash build.sh
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@teaclave.apache.org
For additional commands, e-mail: commits-help@teaclave.apache.org