Skip to content

Commit 3568516

Browse files
Dep upgrades
- Ubuntu 22.04 - SGX SDK 2.22 - SGX SSL 3.0_Rev1 - OpenSSL 3.0.12 - Ego 1.5.0 - Python 3 Signed-off-by: Marcus Brandenburger <bur@zurich.ibm.com>
1 parent 8d4f397 commit 3568516

8 files changed

Lines changed: 66 additions & 95 deletions

File tree

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ jobs:
2929
strategy:
3030
matrix:
3131
include:
32-
- os: ubuntu-20.04
33-
os-version: 20.04
34-
os-name: focal
32+
- os: ubuntu-22.04
33+
os-version: 22.04
34+
os-name: jammy
3535

3636
steps:
3737
- uses: actions/checkout@v4

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,8 @@ Note that by default the dev container mounts your local cloned FPC project as a
220220
This allows you to edit the content of the repository using your favorite editor in your system and the changes inside the docker container. Additionally, you are also not loosing changes inside the container when you reboot or the container gets stopped for other reasons.
221221

222222
A few more notes:
223-
* We use Ubuntu 20.04 by default.
224-
To build also docker images based on Ubuntu 18.04, add the following to `$FPC_PATH/config.override.mk`.
223+
* We use Ubuntu 22.04 by default.
224+
To build also docker images with a different version of Ubuntu, add the following to `$FPC_PATH/config.override.mk`.
225225
```bash
226226
DOCKER_BUILD_OPTS=--build-arg UBUNTU_VERSION=18.04 --build-arg UBUNTU_NAME=bionic
227227
```
@@ -255,7 +255,7 @@ As an alternative to the Docker-based FPC development environment you can instal
255255
#### Requirements
256256

257257
Make sure that you have the following required dependencies installed:
258-
* Linux (OS) (we recommend Ubuntu 20.04, see [list](https://github.com/intel/linux-sgx#prerequisites) supported OS)
258+
* Linux (OS) (we recommend Ubuntu 22.04, see [list](https://github.com/intel/linux-sgx#prerequisites) supported OS)
259259

260260
* CMake v3.5.1 or higher
261261

@@ -274,23 +274,23 @@ Make sure that you have the following required dependencies installed:
274274
sudo chmod +x /usr/local/bin/docker-compose
275275
```
276276

277-
* yq v3.x (newer versions, v4.x and higher, are currently *not* supported!)
278-
You can install `yq` v3 via `go get`.
277+
* yq v4.x
278+
You can install `yq` via `go get`.
279279
```bash
280-
GO111MODULE=on go get github.com/mikefarah/yq/v4
280+
go get github.com/mikefarah/yq/v4
281281
```
282282

283283
* Protocol Buffers
284284
- Protocol Buffers 3.0.x needed for the Intel SGX SDK
285285
- Protocol Buffers 3.11.x or higher and [Nanopb](http://github.com/nanopb/nanopb) 0.4.7
286286

287-
* SGX PSW & SDK v2.12 for [Linux](https://01.org/intel-software-guard-extensions/downloads)
287+
* SGX PSW & SDK v2.22 for [Linux](https://01.org/intel-software-guard-extensions/downloads)
288288
(alternatively, you could also install it from the [source](https://github.com/intel/linux-sgx)
289289

290290
* Credentials for Intel Attestation Service, read [here](#intel-attestation-service-ias) (for hardware-mode SGX)
291291

292292
* [Intel Software Guard Extensions SSL](https://github.com/intel/intel-sgx-ssl)
293-
(we recommend using branch `lin_2.10_1.1.1g` OpenSSL `1.1.1g`)
293+
(we recommend using tag `3.0_Rev2` OpenSSL `3.0.12`)
294294

295295
* Hyperledger [Fabric](https://github.com/hyperledger/fabric/tree/v2.5.4) v2.5.4
296296

@@ -326,7 +326,7 @@ are set correctly in your environment.
326326

327327
We use *nanopb*, a lightweight implementation of Protocol Buffers, inside the enclaves to parse blocks of
328328
transactions. Install nanopb by following the instruction below. For this you need a working Google Protocol Buffers
329-
compiler with python bindings (e.g. via `apt-get install protobuf-compiler python-protobuf libprotobuf-dev`).
329+
compiler with python bindings (e.g. via `apt-get install protobuf-compiler python3-protobuf libprotobuf-dev`).
330330
For more detailed information consult the official nanopb documentation http://github.com/nanopb/nanopb.
331331
```bash
332332
export NANOPB_PATH=/path-to/install/nanopb/
@@ -341,8 +341,8 @@ Make sure that you set `$NANOPB_PATH` as it is needed to build Fabric Private Ch
341341
Moreover, in order to build Fabric protobufs we also require a newer Protobuf compiler than what is provided as standard Ubuntu package and is used to build the
342342
Intel SGX SDK. For this reason you will have to download and install another version and use it together with Nanopb. Do not install the new protobuf, though, such that it is not found in your standard PATH but instead define the `PROTOC_CMD`, either as environment variable or via `config.override.mk` to point to the new `protoc` binary
343343
```bash
344-
wget https://github.com/protocolbuffers/protobuf/releases/download/v3.11.4/protoc-3.11.4-linux-x86_64.zip
345-
unzip protoc-3.11.4-linux-x86_64.zip -d /usr/local/proto3
344+
wget https://github.com/protocolbuffers/protobuf/releases/download/v22.3/protoc-22.3-linux-x86_64.zip
345+
unzip protoc-22.3-linux-x86_64.zip -d /usr/local/proto3
346346
export PROTOC_CMD=/usr/local/proto3/bin/protoc
347347
```
348348

@@ -444,7 +444,7 @@ Note that this is indented for developing purpose only and does not provide any
444444

445445
In your `config.override.mk` set the following to variables:
446446
```Makefile
447-
FPC_CCENV_IMAGE=ubuntu:20.04
447+
FPC_CCENV_IMAGE=ubuntu:22.04
448448
ERCC_GOTAGS=
449449
```
450450
This configuration sets a standard Ubuntu image as alternative to our `fabric-private-chaincode-ccenv` image and overrides the default build tags we use to build `ercc`.

build.mk

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
include $(TOP)/config.mk
66

7-
# optionlly allow local overriding defaults
7+
# optionally allow local overriding defaults
88
-include $(TOP)/config.override.mk
99

1010
# define composites only here and not in config.mk so we can override parts in config.override.mk
@@ -17,9 +17,7 @@ GO := $(GO_CMD) $(GOFLAGS)
1717
GOTESTFLAGS := -v -race -covermode=atomic -coverprofile=coverage.out
1818

1919
.PHONY: all
20-
all: build test ci_report checks # keep checks last as license test is brittle ...
21-
22-
.PHONY: ci_report
20+
all: build test checks # keep checks last as license test is brittle ...
2321

2422
.PHONY: build
2523
.PHONY: test

ecc_go/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ Install ego by running the following:
8080
```bash
8181
wget -qO- https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key | apt-key add
8282
add-apt-repository "deb [arch=amd64] https://download.01.org/intel-sgx/sgx_repo/ubuntu `lsb_release -cs` main"
83-
wget https://github.com/edgelesssys/ego/releases/download/v1.4.1/ego_1.4.1_amd64_ubuntu-20.04.deb
84-
apt install ./ego_1.4.1_amd64_ubuntu-20.04.deb build-essential libssl-dev
83+
wget https://github.com/edgelesssys/ego/releases/download/v1.5.0/ego_1.5.0_amd64_ubuntu-22.04.deb
84+
apt install ./ego_1.5.0_amd64_ubuntu-22.04.deb build-essential libssl-dev
8585
```
8686

8787
You can find more information about ego installation on the official [documentation](https://docs.edgeless.systems/ego/#/getting-started/install).

protos/generate_protos.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ cat <<EOT > "${GO_BUILD_DIR}/staticcheck.conf"
5252
checks = ["-all"]
5353
EOT
5454

55-
PROTOC_OPTS="--plugin=protoc-gen-nanopb=$NANOPB_PATH/generator/protoc-gen-nanopb-py2"
55+
PROTOC_OPTS="--plugin=protoc-gen-nanopb=$NANOPB_PATH/generator/protoc-gen-nanopb"
5656

5757
# compile google protos
5858
$PROTOC_CMD "$PROTOC_OPTS" --proto_path=${PROTOS_DIR} --nanopb_out=$BUILD_DIR google/protobuf/*.proto

samples/demos/irb/chaincode/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ PROTO_FILES := irb.proto
3838
.PHONY: protos
3939
protos: $(PROTO_BUILD_DIR)
4040
$(PROTOC_CMD) \
41-
--plugin=protoc-gen-nanopb=$(NANOPB_PATH)/generator/protoc-gen-nanopb-py2 \
41+
--plugin=protoc-gen-nanopb=$(NANOPB_PATH)/generator/protoc-gen-nanopb \
4242
--proto_path=$(PROTO_PATH) --nanopb_out=$(PROTO_BUILD_DIR) --nanopb_opt="-I${PROTO_PATH} -f ${PROTO_PATH}/irb.options" $(PROTO_FILES)
4343

4444
$(PROTO_BUILD_DIR):

utils/docker/base-dev/Dockerfile

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
# - fpc image version: FPC_VERSION
1111
# - go version: GO_VERSION
1212
# - nanopb version: NANOPB_VERSION
13-
# - openssl version: OPENSSL
14-
# - sgxssl version: SGXSSL
13+
# - openssl version: OPENSSL_VERSION
14+
# - sgxssl version: SGXSSL_VERSION
1515
# - additional apt pkgs: APT_ADD_PKGS
1616

1717

@@ -23,25 +23,23 @@ LABEL org.opencontainers.image.source https://github.com/hyperledger/fabric-priv
2323
# config/build params
2424
ARG GO_VERSION=1.21.9
2525
ARG NANOPB_VERSION=0.4.7
26-
ARG OPENSSL=1.1.1n
27-
ARG SGXSSL=2.16_1.1.1n
26+
ARG OPENSSL_VERSION=3.0.12
27+
ARG SGXSSL_VERSION=3.0_Rev1
2828
ARG APT_ADD_PKGS=
29-
ARG EGO_VERSION=1.4.1
29+
ARG EGO_VERSION=1.5.0
3030

3131
# for convenience remember all versions as env variables ..
3232
ENV GO_VERSION=${GO_VERSION}
3333
ENV NANOPB_VERSION=${NANOPB_VERSION}
3434
ENV OPENSSL_VERSION=${OPENSSL_VERSION}
3535
ENV SGXSSL_VERSION=${SGXSSL_VERSION}
3636

37+
ENV DEBIAN_FRONTEND "noninteractive"
3738

3839
WORKDIR /tmp
3940

4041
RUN apt-get update -q \
41-
&& env DEBIAN_FRONTEND="noninteractive" TZ="UTC" \
42-
# above makes sure any install of 'tzdata' or alike (as e.g., pulled in via ubuntu 20.04) does not hang ...
43-
apt-get install -y -q \
44-
# build tools
42+
&& apt-get install -y -q \
4543
build-essential \
4644
clang-format \
4745
cmake \
@@ -51,9 +49,9 @@ RUN apt-get update -q \
5149
libssl-dev \
5250
libtool \
5351
pkg-config \
54-
python \
52+
python-is-python3 \
5553
protobuf-compiler \
56-
python-protobuf \
54+
python3-protobuf \
5755
psmisc \
5856
bc \
5957
software-properties-common \
@@ -64,9 +62,7 @@ RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \
6462
&& add-apt-repository "deb [arch="$(dpkg --print-architecture)"] https://download.docker.com/linux/ubuntu "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" \
6563
&& apt-get update -q \
6664
&& apt-get install -y -q \
67-
# docker-ce \
6865
docker-ce-cli \
69-
# containerd.io \
7066
docker-buildx-plugin \
7167
docker-compose-plugin
7268

@@ -90,18 +86,17 @@ RUN go install golang.org/x/tools/cmd/goimports@latest \
9086

9187
# Install SGX SSL
9288
ENV SGX_SSL /opt/intel/sgxssl
93-
RUN git clone 'https://github.com/intel/intel-sgx-ssl.git' \
94-
&& cd intel-sgx-ssl \
95-
&& . /opt/intel/sgxsdk/environment \
96-
&& git checkout lin_${SGXSSL} \
97-
&& cd openssl_source \
98-
&& wget -q https://www.openssl.org/source/openssl-${OPENSSL}.tar.gz \
99-
&& cd ../Linux \
100-
&& make SGX_MODE=SIM NO_THREADS=1 SKIP_INTELCPU_CHECK=TRUE DESTDIR=${SGX_SSL} all test\
89+
RUN . /opt/intel/sgxsdk/environment \
90+
&& git clone --depth 1 --branch ${SGXSSL_VERSION} 'https://github.com/intel/intel-sgx-ssl.git' \
91+
&& wget -q -P /tmp/intel-sgx-ssl/openssl_source https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz \
92+
&& cd /tmp/intel-sgx-ssl/Linux \
93+
&& make SGX_MODE=SIM NO_THREADS=1 SKIP_INTELCPU_CHECK=TRUE DESTDIR=${SGX_SSL} all \
10194
# Note: we need explicitly set to SIM as default is HW yet during docker
10295
# build you never have access to HW, regardless of platform. Note, though,
10396
# that libraries built work for both modes, on tests are executed for SIM only.
104-
&& make install
97+
&& make install \
98+
&& make clean \
99+
&& rm -rf /tmp/intel-sgx-ssl
105100

106101
# Install nanopb
107102
ENV NANOPB_PATH=/usr/local/nanopb/
@@ -112,6 +107,6 @@ RUN git clone https://github.com/nanopb/nanopb.git ${NANOPB_PATH} \
112107
&& make
113108

114109
# Install ego
115-
RUN wget https://github.com/edgelesssys/ego/releases/download/v${EGO_VERSION}/ego_${EGO_VERSION}_amd64_ubuntu-20.04.deb \
116-
&& apt install -y -q ./ego_${EGO_VERSION}_amd64_ubuntu-20.04.deb \
117-
&& rm ego_${EGO_VERSION}_amd64_ubuntu-20.04.deb
110+
RUN wget https://github.com/edgelesssys/ego/releases/download/v${EGO_VERSION}/ego_${EGO_VERSION}_amd64_ubuntu-22.04.deb \
111+
&& apt install -y -q ./ego_${EGO_VERSION}_amd64_ubuntu-22.04.deb \
112+
&& rm ego_${EGO_VERSION}_amd64_ubuntu-22.04.deb

utils/docker/base-rt/Dockerfile

Lines changed: 25 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
# - additional apt pkgs: APT_ADD_PKGS
1515

1616
# config/build params (part 1)
17-
ARG UBUNTU_VERSION=20.04
18-
ARG UBUNTU_NAME=focal
17+
ARG UBUNTU_VERSION=22.04
18+
ARG UBUNTU_NAME=jammy
1919
# NOTE:
2020
# - unfortunately, we do need both name (for repo) and version (for sgx directories), only docker image supports both ..
2121
# 18.04 <-> bionic, 20.04 <-> focal
@@ -30,20 +30,19 @@ ARG UBUNTU_VERSION
3030
ARG UBUNTU_NAME
3131

3232
# config/build params (part 2)
33-
ARG SGX=2.16
33+
ARG SGX=2.22
3434
ARG PROTO_VERSION=22.3
3535
ARG APT_ADD_PKGS=
3636

3737
# We define it here even so the installation path is known to all derivates,
3838
# even when not all of them use go (or have it installed)
3939
ENV GOPATH=/project
4040

41+
ENV DEBIAN_FRONTEND "noninteractive"
4142

4243
# Get all necessary apt packages
4344
RUN apt-get update -q \
44-
&& env DEBIAN_FRONTEND="noninteractive" TZ="UTC" \
45-
# above makes sure any install of 'tzdata' or alike (as e.g., pulled in via ubuntu 20.04) does not hang ...
46-
apt-get install -y -q\
45+
&& apt-get install -y -q \
4746
basez \
4847
ca-certificates \
4948
curl \
@@ -52,79 +51,58 @@ RUN apt-get update -q \
5251
wget \
5352
# jq need for e.g., external-builder
5453
jq \
54+
build-essential \
5555
${APT_ADD_PKGS} \
56-
&& apt-get -y -q upgrade \
5756
&& apt-get clean \
5857
&& rm -rf /var/lib/apt/lists/*
5958

6059
# Install SGX PSW packages
6160
RUN echo "deb [arch=amd64] https://download.01.org/intel-sgx/sgx_repo/ubuntu ${UBUNTU_NAME} main" >> /etc/apt/sources.list \
6261
&& wget -qO - https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key | apt-key add - \
6362
&& apt-get update -q \
64-
&& env DEBIAN_FRONTEND="noninteractive" TZ="UTC" \
65-
apt-get install -y -q \
63+
&& apt-get install -y -q \
6664
# We do not need daemons like AESMD as we run them on host (side-steps also
6765
# issues with config of /etc/aesmd.conf like proxy ..). Without this option
6866
# aesmd and lots of other plugsin are automatically pulled in.
6967
# See SGX Installation notes and, in particular, linux/installer/docker/Dockerfile
7068
# in linux-sgx git repo of sdk/psw source.
7169
--no-install-recommends \
72-
# - dependencies
73-
# - PSW
74-
libssl-dev \
75-
libcurl4-openssl-dev \
76-
libprotobuf-dev \
77-
# - SDK
78-
# Doc mentions 'build-essential' and 'python' but here
79-
# we need only shared libraries, build-essentials only in dev
80-
# and so omit them here to keep image small
81-
# Installation itself, though, needs make ..
82-
make \
83-
# - sgx packages
84-
# - runtime
85-
libsgx-urts \
86-
# (also pulls in libsgx-enclave-common)
87-
# - basic architectural services, e.g., launch & attestation
88-
# sgx-aesm-service (see above why commented out)
89-
# - launch service
90-
libsgx-launch \
91-
# - algorithm agnostic attestation service (only need once moving to DCAP)
92-
# libsgx-quote-ex
70+
libsgx-urts \
71+
libsgx-uae-service \
9372
# - EPID-based attestation service \
94-
libsgx-epid
73+
libsgx-epid \
9574
# - DCAP-based attesation service
9675
# libsgx-dcap* ...
76+
&& apt-get clean \
77+
&& rm -rf /var/lib/apt/lists/*
9778

9879
# Install SGX SDK
9980
# Note: not all descendents of this base image, e.g., ccenv, boilerplate and fpc-app, build sgx app.
10081
# However, as simulation-mode libraries are only in the sdk and not in the psw packages, we need
10182
# it already here and not only in the 'dev' image.
102-
RUN mkdir -p /opt/intel
10383
WORKDIR /opt/intel
10484
RUN SGX_SDK_BIN_REPO=https://download.01.org/intel-sgx/sgx-linux/${SGX}/distro/ubuntu${UBUNTU_VERSION}-server \
105-
&& SGX_SDK_BIN_FILE=$(cd /tmp; wget --spider --recursive --level=1 --no-parent ${SGX_SDK_BIN_REPO} 2>&1 | perl -ne 'if (m|'${SGX_SDK_BIN_REPO}'/(sgx_linux_x64_sdk.*)|) { print "$1\n"; }') \
106-
&& wget -q ${SGX_SDK_BIN_REPO}/${SGX_SDK_BIN_FILE} \
107-
&& chmod +x ${SGX_SDK_BIN_FILE} \
108-
&& echo -e "no\n/opt/intel" | ./${SGX_SDK_BIN_FILE} \
109-
&& rm ${SGX_SDK_BIN_FILE}
85+
&& SGX_SDK_BIN_FILE=$(wget -P /tmp --delete-after --spider --recursive --level=1 --no-parent ${SGX_SDK_BIN_REPO} 2>&1 | perl -ne 'if (m|'${SGX_SDK_BIN_REPO}'/(sgx_linux_x64_sdk.*)|) { print "$1\n"; }') \
86+
&& wget -q -P /tmp ${SGX_SDK_BIN_REPO}/${SGX_SDK_BIN_FILE} \
87+
&& chmod +x /tmp/${SGX_SDK_BIN_FILE} \
88+
&& echo -e "no\n/opt/intel" | /tmp/${SGX_SDK_BIN_FILE} \
89+
&& rm /tmp/${SGX_SDK_BIN_FILE}
90+
11091
ENV SGX_SDK=/opt/intel/sgxsdk
11192
ENV PATH=${PATH}:${SGX_SDK}/bin:${SGX_SDK}/bin/x64
11293
ENV PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:${SGX_SDK}/pkgconfig
11394
ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${SGX_SDK}/sdk_libs
11495

11596
# LVI mitigations, needed to compile sgxssl, requires a
116-
# recent version of binutils (>= 2.32). Ubuntu 18.04 only
117-
# has 2.30 but Intel ships binary distro for 2.32.51.20190719
118-
# As sgx ships tools also for 20.04, use these for simplicity
119-
# and uniformity reason
120-
RUN \
121-
SGX_SDK_BINUTILS_REPO=https://download.01.org/intel-sgx/sgx-linux/${SGX} \
122-
&& SGX_SDK_BINUTILS_FILE=$(cd /tmp; wget --spider --recursive --level=1 --no-parent ${SGX_SDK_BINUTILS_REPO} 2>&1 | perl -ne 'if (m|'${SGX_SDK_BINUTILS_REPO}'/(as.ld.objdump.*)|) { print "$1\n"; }') \
123-
&& wget -q ${SGX_SDK_BINUTILS_REPO}/${SGX_SDK_BINUTILS_FILE} \
97+
# recent version of binutils (>= 2.32).
98+
WORKDIR /opt/intel
99+
RUN SGX_SDK_BINUTILS_REPO=https://download.01.org/intel-sgx/sgx-linux/${SGX} \
100+
&& SGX_SDK_BINUTILS_FILE=$(wget -P /tmp --delete-after --spider --recursive --level=1 --no-parent ${SGX_SDK_BINUTILS_REPO} 2>&1 | perl -ne 'if (m|'${SGX_SDK_BINUTILS_REPO}'/(as.ld.objdump.*)|) { print "$1\n"; }') \
101+
&& wget -q -P /tmp ${SGX_SDK_BINUTILS_REPO}/${SGX_SDK_BINUTILS_FILE} \
124102
&& mkdir sgxsdk.extras \
125103
&& cd sgxsdk.extras \
126-
&& tar -zxf ../${SGX_SDK_BINUTILS_FILE} \
127-
&& rm ../${SGX_SDK_BINUTILS_FILE} \
104+
&& tar -zxf /tmp/${SGX_SDK_BINUTILS_FILE} \
105+
&& rm /tmp/${SGX_SDK_BINUTILS_FILE} \
128106
&& (cd /opt/intel/sgxsdk.extras/external/toolset/ && \
129107
for f in $(ls | grep -v ${UBUNTU_VERSION}); do rm -rf ${f}; done)
130108
# Note: above install file contains binutitls for _all_ supported distros

0 commit comments

Comments
 (0)