diff --git a/.github/workflows/dockerimagerelease.yml b/.github/workflows/dockerimagerelease.yml new file mode 100644 index 0000000000000000000000000000000000000000..e1013bb51124af74933992a1339c6906ee16ac06 --- /dev/null +++ b/.github/workflows/dockerimagerelease.yml @@ -0,0 +1,32 @@ +name: Build, test and push release SGX container +on: [push] +jobs: + build: + runs-on: ubuntu-latest + env: + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} + DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} + steps: + - name: Login to docker + env: + GITHUB_TOKEN: ${{ secrets.DOCKER_SECRET }} + run: docker login -u skalelabs -p ${GITHUB_TOKEN} + - uses: actions/checkout@v1 + - name: submodule update + run: git submodule update --init --recursive + - name: build + run: python3 scripts/docker_build.py Dockerfile sgxwallet ${GITHUB_SHA} + - name: deploy docker image + if: contains(github.ref, 'develop') || contains(github.ref, 'beta') || contains(github.ref, 'master') || contains(github.ref, 'stable') + run : | + export BRANCH=${GITHUB_REF##*/} + echo "Branch $BRANCH" + export VERSION=$(cat VERSION) + echo "Version $VERSION" + export VERSION=$(bash ./scripts/calculate_version.sh $BRANCH $VERSION) + echo "::set-env name=VERSION::$VERSION" + echo "Version $VERSION" + export RELEASE=true + echo "::set-env name=RELEASE::$RELEASE" + bash ./scripts/build_image.sh DockerfileRelease sgxwallet_release + bash ./scripts/publish_image.sh sgxwallet_release \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index beae2b1cfe40b45966a78f85c101ef6875123178..a9da3e7b6dcba909deb93aa77911f3e06f77a080 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,9 @@ FROM skalenetwork/sgxwallet_base:latest COPY . /usr/src/sdk -RUN apt-install curl +RUN apt install -y curl WORKDIR /usr/src/sdk - +RUN cp -f secure_enclave/secure_enclave.config.xml.release secure_enclave/secure_enclave.config.xml RUN touch /var/hwmode diff --git a/DockerfileRelease b/DockerfileRelease new file mode 100644 index 0000000000000000000000000000000000000000..64c74dc0d0f8a6a67053319f59ef8fbbde5827eb --- /dev/null +++ b/DockerfileRelease @@ -0,0 +1,16 @@ +FROM skalenetwork/sgxwallet_base:latest + +COPY . /usr/src/sdk +RUN apt install -y curl +WORKDIR /usr/src/sdk + +RUN touch /var/hwmode + + +RUN ./autoconf.bash +RUN ./configure --with-sgx-build=release +RUN bash -c "make -j$(nproc)" +RUN ccache -sz +RUN mkdir /usr/src/sdk/sgx_data +COPY docker/start.sh ./ +ENTRYPOINT ["/usr/src/sdk/start.sh"] diff --git a/DockerfileSimulation b/DockerfileSimulation index 232eedf0a894792af5c443b7034fcdb9e6a093aa..011346e7fb4767ccb36d5924187210f9168fa66e 100644 --- a/DockerfileSimulation +++ b/DockerfileSimulation @@ -1,7 +1,7 @@ FROM skalenetwork/sgxwallet_base:latest -RUN apt-install curl +RUN apt install -y curl RUN ccache -sz diff --git a/build_instructions.txt b/build_instructions.txt new file mode 100644 index 0000000000000000000000000000000000000000..088b8d0cb74f6c8db47ca42e9325f7b3d661ae7d --- /dev/null +++ b/build_instructions.txt @@ -0,0 +1,21 @@ +How to Build/Execute the C++11 sample program +--------------------------------------------- +1. Install Intel(R) Software Guard Extensions (Intel(R) SGX) SDK for Linux* OS +2. Make sure your environment is set: + $ source ${sgx-sdk-install-path}/environment +3. Build the project with the prepared Makefile: + a. Hardware Mode, Debug build: + $ make + b. Hardware Mode, Pre-release build: + $ make SGX_PRERELEASE=1 SGX_DEBUG=0 + c. Hardware Mode, Release build: + $ make SGX_DEBUG=0 + d. Simulation Mode, Debug build: + $ make SGX_MODE=SIM + e. Simulation Mode, Pre-release build: + $ make SGX_MODE=SIM SGX_PRERELEASE=1 SGX_DEBUG=0 + f. Simulation Mode, Release build: + $ make SGX_MODE=SIM SGX_DEBUG=0 +4. Execute the binary directly: + $ ./app +5. Remember to "make clean" before switching build mode