Unverified Commit a4bf0388 authored by Stan Kladko's avatar Stan Kladko Committed by GitHub

Merge pull request #29 from skalenetwork/SKALE-2017-automatic-push

Skale 2017 automatic push
parents 1cff9656 9e45adce
name: C/C++ CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: install packages
run: >
sudo apt-get update && sudo apt-get install -yq --no-install-recommends python-yaml vim telnet git yasm python-yaml
ca-certificates build-essential ocaml ocamlbuild automake autoconf libtool wget python
libssl-dev libssl-dev libcurl4-openssl-dev protobuf-compiler git libprotobuf-dev alien
cmake debhelper uuid-dev libxml2-dev libprotobuf10 cmake flex bison libprocps-dev ccache
autoconf texinfo libssl-dev libboost-all-dev libjsonrpccpp-dev libjsonrpccpp-tools
- name: install sgx
run: >
git clone -b sgx_2.5 --depth 1 https://github.com/intel/linux-sgx &&
cd linux-sgx &&
patch -p1 -i ../docker/install-psw.patch && ./download_prebuilt.sh 2> /dev/null
&& make -s -j$(nproc) sdk_install_pkg psw_install_pkg
&& sudo ./linux/installer/bin/sgx_linux_x64_sdk_2.5.100.49891.bin --prefix=/opt/intel
&& sudo ./linux/installer/bin/sgx_linux_x64_psw_2.5.100.49891.bin &&
cd .. && rm -rf linux-sgx/
- name: update git
run: git submodule update --init --recursive
- name: build deps
run: cd scripts; ./build.py
- name: build sgx
run: autoreconf -vif && automake && ./configure && make
name: Docker Image CI name: Build and push SGX container
on: [push] on: [push]
...@@ -9,8 +9,14 @@ jobs: ...@@ -9,8 +9,14 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v1 - name: Login to docker
- name: submodule update env:
run: git submodule update --init --recursive GITHUB_TOKEN: ${{ secrets.DOCKER_SECRET }}
- name: Build the Docker image run: docker login -u skalelabs -p ${GITHUB_TOKEN}
run: docker build . --file Dockerfile --tag sgxcontainer:$(date +%s) - uses: actions/checkout@v1
- name: submodule update
run: git submodule update --init --recursive
- name: Build the Docker image
run: docker build . --file Dockerfile --tag skalenetwork/sgxwallet:latest
- name: push docker image
run: docker push skalenetwork/sgxwallet:latest
name: Build base container
on:
push:
tags:
- build_base*
jobs:
build:
runs-on: ubuntu-latest
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 the Docker image
run: docker build . --file DockerfileBase --tag skalenetwork/sgxwallet_base:latest
- name: push docker image
run: docker push skalenetwork/sgxwallet_base:latest
name: Docker Image CI name: Build and push sim container
on: [push] on: [push]
...@@ -9,8 +9,15 @@ jobs: ...@@ -9,8 +9,15 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Login to docker
env:
GITHUB_TOKEN: ${{ secrets.DOCKER_SECRET }}
run: docker login -u skalelabs -p ${GITHUB_TOKEN}
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- name: submodule update - name: submodule update
run: git submodule update --init --recursive run: git submodule update --init --recursive
- name: Build the Docker image - name: Build the Docker image
run: docker build . --file DockerfileSimulation --tag sgxcontainer:$(date +%s) run: docker build . --file DockerfileSimulation --tag skalenetwork/sgxwalletsim:latest
- name: push docker image
run: docker push skalenetwork/sgxwalletsim:latest
FROM ubuntu:bionic FROM skalenetwork/sgxwallet_base:latest
WORKDIR /usr/src/sdk WORKDIR /usr/src/sdk
COPY *.cpp ./
COPY *.h ./
COPY *.txt ./
COPY *.c ./
COPY *.am ./
COPY *.hpp ./
COPY *.sh ./
COPY *.m4 ./
COPY *.gmp ./
COPY *.ac ./
COPY *.json ./
COPY docker ./docker
COPY build-aux ./build-aux
COPY cert ./cert
COPY intel-sgx-ssl ./intel-sgx-ssl
COPY jsonrpc ./jsonrpc
COPY leveldb ./leveldb
COPY libBLS ./libBLS
COPY m4 ./m4
COPY scripts ./scripts
COPY secure_enclave ./secure_enclave
COPY sgx-gmp ./sgx-gmp
COPY sgx-software-enable ./sgx-software-enable
COPY trusted_libff ./trusted_libff
COPY spdlog ./spdlog
RUN rm -rf /usr/src/sdk/leveldb/build/
RUN apt-get update && apt-get install -yq --no-install-recommends python-yaml vim telnet git ca-certificates build-essential ocaml ocamlbuild automake autoconf libtool wget python libssl-dev libssl-dev libcurl4-openssl-dev protobuf-compiler git libprotobuf-dev alien cmake debhelper uuid-dev libxml2-dev
RUN apt install -y libprotobuf10 yasm cmake flex bison libprocps-dev ccache autoconf texinfo libssl-dev libboost-all-dev libjsonrpccpp-dev libjsonrpccpp-tools
COPY docker/install-psw.patch ./
RUN git clone -b sgx_2.5 --depth 1 https://github.com/intel/linux-sgx && \
cd linux-sgx && \
patch -p1 -i ../install-psw.patch && \
./download_prebuilt.sh 2> /dev/null && \
make -s -j$(nproc) sdk_install_pkg psw_install_pkg && \
./linux/installer/bin/sgx_linux_x64_sdk_2.5.100.49891.bin --prefix=/opt/intel && \
./linux/installer/bin/sgx_linux_x64_psw_2.5.100.49891.bin && \
cd .. && rm -rf linux-sgx/
# For debug purposes
# COPY docker/jhi.conf /etc/jhi/jhi.conf
###RUN git clone --recurse-submodules https://76b7983ebf14269178b99eff5b2be4b4b56fe7a5:@github.com/skalenetwork/sgxwallet.git
#RUN git clone --recurse-submodules https://76b7983ebf14269178b99eff5b2be4b4b56fe7a5:@github.com/skalenetwork/sgxwallet.git
#WORKDIR sgxwallet
#RUN cd sgx-software-enable && make && ./sgx_enable
COPY configure.gmp ./
RUN cd scripts; ./build.py
### RUN autoreconf -vif
### RUN automake
RUN autoreconf -vif RUN autoreconf -vif
RUN libtoolize --force RUN libtoolize --force
RUN aclocal RUN aclocal
...@@ -77,4 +18,7 @@ RUN wget --progress=dot:mega -O - https://github.com/intel/dynamic-application-l ...@@ -77,4 +18,7 @@ RUN wget --progress=dot:mega -O - https://github.com/intel/dynamic-application-l
make install && \ make install && \
cd .. && rm -rf dynamic-application-loader-host-interface-072d233296c15d0dcd1fb4570694d0244729f87b cd .. && rm -rf dynamic-application-loader-host-interface-072d233296c15d0dcd1fb4570694d0244729f87b
RUN mkdir /sgx_data
COPY docker/start.sh ./ COPY docker/start.sh ./
ENTRYPOINT ["/usr/src/sdk/start.sh"]
FROM ubuntu:bionic
WORKDIR /usr/src/sdk
COPY *.cpp ./
COPY *.h ./
COPY *.txt ./
COPY *.c ./
COPY *.am ./
COPY *.hpp ./
COPY *.sh ./
COPY *.m4 ./
COPY *.gmp ./
COPY *.ac ./
COPY *.json ./
COPY docker ./docker
COPY build-aux ./build-aux
COPY cert ./cert
COPY intel-sgx-ssl ./intel-sgx-ssl
COPY jsonrpc ./jsonrpc
COPY leveldb ./leveldb
COPY libBLS ./libBLS
COPY m4 ./m4
COPY scripts ./scripts
COPY secure_enclave ./secure_enclave
COPY sgx-gmp ./sgx-gmp
COPY sgx-software-enable ./sgx-software-enable
COPY trusted_libff ./trusted_libff
RUN rm -rf /usr/src/sdk/leveldb/build/
RUN apt-get update && apt-get install -yq --no-install-recommends python-yaml vim telnet git ca-certificates build-essential ocaml ocamlbuild automake autoconf libtool wget python libssl-dev libssl-dev libcurl4-openssl-dev protobuf-compiler git libprotobuf-dev alien cmake debhelper uuid-dev libxml2-dev
RUN apt install -y libprotobuf10 yasm cmake flex bison libprocps-dev ccache autoconf texinfo libssl-dev libboost-all-dev libjsonrpccpp-dev libjsonrpccpp-tools
COPY docker/install-psw.patch ./
RUN git clone -b sgx_2.5 --depth 1 https://github.com/intel/linux-sgx && \
cd linux-sgx && \
patch -p1 -i ../install-psw.patch && \
./download_prebuilt.sh 2> /dev/null && \
make -s -j$(nproc) sdk_install_pkg psw_install_pkg && \
./linux/installer/bin/sgx_linux_x64_sdk_2.5.100.49891.bin --prefix=/opt/intel && \
./linux/installer/bin/sgx_linux_x64_psw_2.5.100.49891.bin && \
cd .. && rm -rf linux-sgx/
# For debug purposes
# COPY docker/jhi.conf /etc/jhi/jhi.conf
COPY configure.gmp ./
RUN cd scripts; ./build.py
FROM ubuntu:bionic FROM skalenetwork/sgxwallet_base:latest
WORKDIR /usr/src/sdk WORKDIR /usr/src/sdk
COPY *.cpp ./
COPY *.h ./
COPY *.txt ./
COPY *.c ./
COPY *.am ./
COPY *.hpp ./
COPY *.sh ./
COPY *.m4 ./
COPY *.gmp ./
COPY *.ac ./
COPY *.json ./
COPY docker ./docker
COPY build-aux ./build-aux
COPY cert ./cert
COPY intel-sgx-ssl ./intel-sgx-ssl
COPY jsonrpc ./jsonrpc
COPY leveldb ./leveldb
COPY libBLS ./libBLS
COPY m4 ./m4
COPY scripts ./scripts
COPY secure_enclave ./secure_enclave
COPY sgx-gmp ./sgx-gmp
COPY sgx-software-enable ./sgx-software-enable
COPY trusted_libff ./trusted_libff
COPY spdlog ./spdlog
RUN rm -rf /usr/src/sdk/leveldb/build/
RUN apt-get update && apt-get install -yq --no-install-recommends python-yaml vim telnet git ca-certificates build-essential ocaml ocamlbuild automake autoconf libtool wget python libssl-dev libssl-dev libcurl4-openssl-dev protobuf-compiler git libprotobuf-dev alien cmake debhelper uuid-dev libxml2-dev
RUN apt install -y libprotobuf10 yasm cmake flex bison libprocps-dev ccache autoconf texinfo libssl-dev libboost-all-dev libjsonrpccpp-dev libjsonrpccpp-tools
COPY docker/install-psw.patch ./
RUN git clone -b sgx_2.5 --depth 1 https://github.com/intel/linux-sgx && \
cd linux-sgx && \
patch -p1 -i ../install-psw.patch && \
./download_prebuilt.sh 2> /dev/null && \
make -s -j$(nproc) sdk_install_pkg psw_install_pkg && \
./linux/installer/bin/sgx_linux_x64_sdk_2.5.100.49891.bin --prefix=/opt/intel && \
./linux/installer/bin/sgx_linux_x64_psw_2.5.100.49891.bin && \
cd .. && rm -rf linux-sgx/
# For debug purposes
# COPY docker/jhi.conf /etc/jhi/jhi.conf
COPY configure.gmp ./
RUN cd scripts; ./build.py
### RUN autoreconf -vif
### RUN automake
RUN autoreconf -vif RUN autoreconf -vif
RUN libtoolize --force RUN libtoolize --force
RUN aclocal RUN aclocal
...@@ -73,4 +16,7 @@ RUN wget --progress=dot:mega -O - https://github.com/intel/dynamic-application-l ...@@ -73,4 +16,7 @@ RUN wget --progress=dot:mega -O - https://github.com/intel/dynamic-application-l
make install && \ make install && \
cd .. && rm -rf dynamic-application-loader-host-interface-072d233296c15d0dcd1fb4570694d0244729f87b cd .. && rm -rf dynamic-application-loader-host-interface-072d233296c15d0dcd1fb4570694d0244729f87b
RUN mkdir /sgx_data
COPY docker/start.sh ./ COPY docker/start.sh ./
ENTRYPOINT ["/usr/src/sdk/start.sh"]
...@@ -12,11 +12,7 @@ ...@@ -12,11 +12,7 @@
This sgxwallet library is still in active development and therefore should be regarded as _alpha software_. The development is still subject to security hardening, further testing, and breaking changes. **This library has not yet been reviewed or audited for security.** This sgxwallet library is still in active development and therefore should be regarded as _alpha software_. The development is still subject to security hardening, further testing, and breaking changes. **This library has not yet been reviewed or audited for security.**
## Install Prerequisites # Running sgxwallet
```bash
sudo apt-get install build-essential make cmake gcc g++ yasm python libprotobuf10 flex bison automake libtool texinfo libgcrypt20-dev libgnutls28-dev
```
## Clone this repository and its submodules ## Clone this repository and its submodules
...@@ -32,23 +28,42 @@ To build and run **sgxd**, you'll need **Intel SGX** capable hardware. Most Inte ...@@ -32,23 +28,42 @@ To build and run **sgxd**, you'll need **Intel SGX** capable hardware. Most Inte
- If you can set SGX to `enabled` you are done! Proceed with "Install SGX Driver" section - If you can set SGX to `enabled` you are done! Proceed with "Install SGX Driver" section
- If not, set SGX in BIOS to `software-controlled` and then enable by running a sgx-enable utility, as described below. - If not, set SGX in BIOS to `software-controlled` and then enable by running a sgx-enable utility, as described below.
## Enable "software-controlled" SGX (for testing purposes only) ## Enable "software-controlled" SGX
To enable SGX using a software utility: To enable SGX using a software utility:
- Build `sgx-enable` utility by typing `cd sgx-software-enable; make` - Build `sgx-enable` utility by typing `cd sgx-software-enable; make`
- Run `./sgx_enable`. Verify that it says that **SGX** is successfully enabled - Run `./sgx_enable`. Verify that it says that **SGX** is successfully enabled
## Install SGX driver ## Install SGX driver
```bash ```bash
cd scripts; sudo ./sgx_linux_x64_driver_2.5.0_2605efa.bin; cd .. cd scripts; sudo ./sgx_linux_x64_driver_2.5.0_2605efa.bin; cd ..
``` ```
Reboot you machine after driver install. Do `ls /dev/isgx` to check that `isgx` device is properly installed. Reboot you machine after driver install. Do `ls /dev/isgx` to check that `isgx` device is properly installed.
If you do not see the `isgx` device, you need to troubleshoot your driver installation. If you do not see the `isgx` device, you need to troubleshoot your driver installation.
## Install docker and docker-compose
```
sudo apt-get install docker.io docker-compose
```
## Run the latest sgxwallet docker container from dockerhub
```
sudo docker-compose up -d
```
# Development
## Install Prerequisites
```bash
sudo apt-get install build-essential make cmake gcc g++ yasm python libprotobuf10 flex bison automake libtool texinfo libgcrypt20-dev libgnutls28-dev
```
## Install SGX sdk ## Install SGX sdk
```bash ```bash
...@@ -72,7 +87,7 @@ cd scripts; ./build.py; cd .. ...@@ -72,7 +87,7 @@ cd scripts; ./build.py; cd ..
``` ```
## Configure and build ## Configure and build sgxwallet
Go to the project's top directory, then run Go to the project's top directory, then run
...@@ -92,7 +107,7 @@ Note: to run in simulation mode, add --enable-sgx-simulation flag when you run c ...@@ -92,7 +107,7 @@ Note: to run in simulation mode, add --enable-sgx-simulation flag when you run c
./configure --enable-sgx-simulation ./configure --enable-sgx-simulation
``` ```
## Running sgxwallet ## Run sgxwallet
Type: Type:
...@@ -103,7 +118,6 @@ Type: ...@@ -103,7 +118,6 @@ Type:
## Build Docker container ## Build Docker container
```bash ```bash
sudo apt-get install -y docker.io;
sudo docker build -t sgxcontainer . sudo docker build -t sgxcontainer .
``` ```
...@@ -115,18 +129,13 @@ sudo docker build -t sgxcontainersim -f ./DockerfileSimulation . ...@@ -115,18 +129,13 @@ sudo docker build -t sgxcontainersim -f ./DockerfileSimulation .
## Run Docker container ## Run Docker container
Enable SGX and install SGX driver on the host machine as described above.
Then run
```bash ```bash
sudo docker run -di --network host --device /dev/isgx --device /dev/mei0 --name sgxwallet sgxcontainer ./start.sh sudo docker run -di --network host --device /dev/isgx --device /dev/mei0 --name sgxwallet sgxcontainer
``` ```
This will run the server in a Docker container named sgxwallet This will run the server in a Docker container named sgxwallet
You can check that the server is running by doing
You can start and stop running sgxwallet container by doing You can start and stop running sgxwallet container by doing
```bash ```bash
...@@ -137,11 +146,11 @@ docker start sgxwallet ...@@ -137,11 +146,11 @@ docker start sgxwallet
## Run Docker container in simulation mode ## Run Docker container in simulation mode
```bash ```bash
sudo docker run -di --network host --name sgxwalletsim sgxcontainersim ./start.sh sudo docker run -di --network host --name sgxwalletsim sgxcontainersim
``` ```
## Development ## Adding new source files
Note that `configure, Makefile` and `Makefile.in` files are created by `automake` tools on the fly. Note that `configure, Makefile` and `Makefile.in` files are created by `automake` tools on the fly.
Please do not add these files to the source tree! Please do not add these files to the source tree!
......
version: '3'
services:
sgxwallet:
image: skalenetwork/sgxwalletsim:latest
ports:
- "1026:1026"
- "1027:1027"
- "1028:1028"
volumes:
- ./sgx_data:/sgx_data
version: '3'
services:
sgxwallet:
image: skalenetwork/sgxwallet:latest
ports:
- "1026:1026"
- "1027:1027"
- "1028:1028"
devices:
- "/dev/isgx"
- "/dev/mei0"
volumes:
- ./sgx_data:/sgx_data
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment