Skip to content

Commit 60b73fe

Browse files
authored
Merge pull request #2 from iExecBlockchainComputing/feature/gramine
Add Gramine CI/CD support
2 parents e9068dd + 161199d commit 60b73fe

2 files changed

Lines changed: 46 additions & 10 deletions

File tree

Jenkinsfile

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,27 @@
22

33
buildInfo = getBuildInfo()
44

5-
def nativeImage = buildSimpleDocker_v2(
6-
buildInfo: buildInfo,
7-
dockerfileDir: 'offchain-computing',
8-
dockerImageRepositoryName: 'offchain-python-hello-world',
9-
imageprivacy: 'public'
5+
baseDir = 'offchain-computing'
6+
def nativeImage = buildSimpleDocker_v3(
7+
buildInfo: buildInfo,
8+
dockerfileDir: baseDir,
9+
buildContext: baseDir,
10+
dockerImageRepositoryName: 'offchain-python-hello-world',
11+
visibility: 'docker.io'
12+
)
13+
14+
buildSimpleDocker_v3(
15+
buildInfo: buildInfo,
16+
dockerfileDir: baseDir + '/gramine',
17+
buildContext: baseDir,
18+
dockerImageRepositoryName: 'tee-gramine-offchain-python-hello-world',
19+
visibility: 'iex.ec'
1020
)
1121

1222
sconeBuildUnlocked(
13-
nativeImage: nativeImage,
14-
imageName: 'offchain-python-hello-world',
15-
imageTag: buildInfo.imageTag,
16-
sconifyArgsPath: 'offchain-computing/sconify.args',
17-
sconifyVersion: '5.7.1'
23+
nativeImage: nativeImage,
24+
imageName: 'offchain-python-hello-world',
25+
imageTag: buildInfo.imageTag,
26+
sconifyArgsPath: baseDir + '/sconify.args',
27+
sconifyVersion: '5.7.1'
1828
)
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# FIXME: use tagged version when released
2+
FROM docker-regis.iex.ec/iexec-graphene-base:0.7.0
3+
4+
RUN apt-get update \
5+
&& apt install -y python3 apktool gcc musl-dev \
6+
&& pip3 install eth_abi \
7+
&& rm -rf /var/lib/apt/lists/*
8+
9+
ARG SOURCE_DIR=src
10+
ARG GRAMINE_DIR=gramine
11+
12+
# get the code of app to /workplace/app
13+
COPY $SOURCE_DIR/app.py /workplace/app
14+
15+
# set the main function for python and node app, no need for binnary app
16+
RUN sed -i "s#MAIN_FUNC=#MAIN_FUNC=/workplace/app/app.py#" /apploader.sh
17+
18+
WORKDIR /workplace/app
19+
20+
# Copy the manifest to use from within the base image
21+
# or create your own
22+
RUN mv /common-manifests/python.entrypoint.manifest /entrypoint.manifest \
23+
&& rm -r /common-manifests
24+
25+
# Finalize app (finalize manifest and sign app)
26+
RUN /finalize-app.sh

0 commit comments

Comments
 (0)