Skip to content

Commit cca8578

Browse files
bvavalag2flyermbrandenburger
authored
Enable CI for Ubuntu 18.04 and 20.04 + fix READMEs (#532)
* move to dual-os CI * update README files Signed-off-by: Bruno Vavala <bruno.vavala@intel.com> Co-authored-by: Michael Steiner <michael.steiner@intel.com> Co-authored-by: Marcus Brandenburger <bur@zurich.ibm.com>
1 parent c66d8f4 commit cca8578

File tree

4 files changed

+52
-28
lines changed

4 files changed

+52
-28
lines changed

.github/workflows/test.yaml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,19 @@ name: FPC test
66
on: [push, pull_request]
77
jobs:
88
docker:
9-
runs-on: ubuntu-latest
9+
runs-on: ${{ matrix.os }}
10+
11+
strategy:
12+
matrix:
13+
include:
14+
- os: ubuntu-18.04
15+
os-version: 18.04
16+
os-name: bionic
17+
18+
- os: ubuntu-20.04
19+
os-version: 20.04
20+
os-name: focal
21+
1022
steps:
1123
- uses: actions/checkout@v2
1224
with:
@@ -16,4 +28,12 @@ jobs:
1628
DOCKER_DEV_CI_MODE: 1
1729
DOCKER_BUILDKIT: 0
1830
DOCKER_QUIET_BUILD: 1
19-
run: make -C utils/docker run DOCKER_DEV_OPTIONAL_CMD='env DOCKER_QUIET_BUILD=1 DOCKER_BUILDKIT=0 make all clobber'
31+
run: |
32+
DOCKER_BUILD_OPTS="--build-arg UBUNTU_VERSION=${{ matrix.os-version }} --build-arg UBUNTU_NAME=${{ matrix.os-name }}" \
33+
make -C utils/docker run DOCKER_DEV_OPTIONAL_CMD='env DOCKER_QUIET_BUILD=1 \
34+
DOCKER_BUILDKIT=0 \
35+
DOCKER_BUILD_OPTS="--build-arg UBUNTU_VERSION=${{ matrix.os-version }} --build-arg UBUNTU_NAME=${{ matrix.os-name }}" \
36+
make all clobber'
37+
# we pass DOCKER_BUILD_OPTS, similar to DOCKER_QUITE_BUILD and DOCKER_BUILDKIT, to both 'make' invocations as
38+
# they are required when building the containers as part of 'make run' and when building inside the container (as part of make all)
39+
# but make run does not automatically propagate environment variables to the container.

README.md

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -234,13 +234,11 @@ to set privileges to manage docker as a non-root user. See the
234234
official docker [documentation](https://docs.docker.com/install/linux/linux-postinstall/)
235235
for more details.
236236

237-
We provide a docker image containing the FPC development environment. This will enable you to get a quick start to
238-
get FPC running.
237+
We provide instructions to build and run a docker image containing the FPC development environment.
239238

240239
First make sure your host has
241-
* A running Docker daemon compatible with docker provided by Ubuntu
242-
18.04, currently `Docker version 18.09`. It also should use
243-
`/var/run/docker.sock` as socket to interact with the daemon (or you
240+
* Docker 18.09 (or higher).
241+
It also should use `/var/run/docker.sock` as socket to interact with the daemon (or you
244242
will have to override in `<absolute-project-path>/fabric-private-chaincode/config.override.mk` the default definition in make of `DOCKER_DAEMON_SOCKET`)
245243
* GNU make
246244

@@ -304,12 +302,25 @@ Make sure that you have the following required dependencies installed:
304302

305303
* [Go](https://golang.org/) 1.15.4 or higher
306304

307-
* Docker 18.x and docker-compose (1.25.x or higher)
305+
* Docker 18.09 (or higher) and docker-compose 1.25.x (or higher)
306+
Note that version from Ubuntu 18.04 is not recent enough! To upgrade, install a recent version following the instructions from [docker.com](https://docs.docker.com/compose/install/), e.g., for version 1.25.4 execute
307+
```bash
308+
sudo curl -L "https://github.com/docker/compose/releases/download/1.25.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
309+
sudo chmod +x /usr/local/bin/docker-compose
310+
```
311+
312+
To install docker-componse 1.25.4 from [docker.com](https://docs.docker.com/compose/install/), execute
313+
```bash
314+
sudo curl -L "https://github.com/docker/compose/releases/download/1.25.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
315+
sudo chmod +x /usr/local/bin/docker-compose
316+
```
308317

309-
* yq (version 3.x. Newer versions (v4.x and higher) are currently *not* supported!)
318+
* yq v3.x (newer versions, v4.x and higher, are currently *not* supported!)
310319
You can install `yq` v3 via `go get`.
311320
```bash
312321
GO111MODULE=on go get github.com/mikefarah/yq/v3
322+
```
323+
313324
* Protocol Buffers
314325
- Protocol Buffers 3.0.x needed for the Intel SGX SDK
315326
- Protocol Buffers 3.11.x or higher and [Nanopb](http://github.com/nanopb/nanopb) 0.4.3
@@ -327,6 +338,7 @@ Make sure that you have the following required dependencies installed:
327338
* Clang-format 6.x or higher
328339

329340
* jq
341+
330342
* hex (for Ubuntu, found in package basez)
331343

332344
* A recent version of [PlantUML](http://plantuml.com/), including Graphviz, for building documentation. See [Documentation](#building-documentation) for our recommendations on installing. The version available in common package repositories may be out of date.
@@ -342,7 +354,7 @@ official [documentation](https://github.com/intel/linux-sgx). Please make sure t
342354
SDK version as denoted above in the list of requirements.
343355

344356
For SGX SSL, just follow the instructions on the [corresponding
345-
github page](https://github.com/intel/intel-sgx-Sal). In case you are
357+
github page](https://github.com/intel/intel-sgx-ssl). In case you are
346358
building for simulation mode only and do not have HW support, you
347359
might also want to make sure that [simulation mode is set](https://github.com/intel/intel-sgx-ssl#available-make-flags)
348360
when building and installing it.
@@ -379,7 +391,7 @@ export PROTOC_CMD=/usr/local/proto3/bin/protoc
379391

380392
Clone the code and make sure it is on your `$GOPATH`. (Important: we assume in this documentation and default configuration that your `$GOPATH` has a _single_ root-directoy!)
381393
```bash
382-
git clone --recursive https://github.com/hyperledger-labs/fabric-private-chaincode.git $GOPATH/src/github.com/hyperledger-labs/fabric-private-chaincode
394+
git clone --recursive https://github.com/hyperledger-labs/fabric-private-chaincode.git $GOPATH/src/github.com/hyperledger-labs/fabric-private-chaincode
383395
```
384396

385397
#### Prepare Fabric
@@ -446,16 +458,12 @@ The current code should work behind a proxy assuming
446458
outlined in the Docker documentation for
447459
[clients](https://docs.docker.com/network/proxy/) and the
448460
[daemon](https://docs.docker.com/config/daemon/systemd/#httphttps-proxy).
449-
If you run Ubuntu 18.04, make sure you run docker 18.09 or later. Otherwise you will run into problems with DNS resolution inside the container.
461+
* the docker version is correct.
462+
Otherwise you may run into problems with DNS resolution inside the container.
463+
* the docker-compose version is correct.
464+
For example, the docker-compose from Ubuntu 18.04 (docker-compose 1.17)
465+
is _not_ recent enough to understand `~/.docker/config.json` and related proxy options.
450466

451-
You will also require a recent version of docker-compose. In particular, the docker-compose from Ubuntu 18.04
452-
(docker-compose 1.17) is _not_ recent enough to understand `~/.docker/config.json` and related proxy options.
453-
To upgrade, install a recent version following the instructions from [docker.com](https://docs.docker.com/compose/install/), e.g.,
454-
for version 1.25.4 execute
455-
```bash
456-
sudo curl -L "https://github.com/docker/compose/releases/download/1.25.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
457-
sudo chmod +x /usr/local/bin/docker-compose
458-
```
459467
Furthermore, for docker-compose networks to work properly with proxies, the `noProxy`
460468
variable in your `~/.docker/config.json` should at least contain `127.0.0.1,127.0.1.1,localhost,.org1.example.com,.example.com`.
461469

@@ -587,7 +595,7 @@ section.
587595
Sorniotti: Blockchain and Trusted Computing: Problems, Pitfalls, and a
588596
Solution for Hyperledger Fabric. https://arxiv.org/abs/1805.08541
589597

590-
- [Fabric Private Chaincode RFC](https://github.com/hyperledger/fabric-rfcs/blob/d1dc48ee934b1430b43f870f4d01e7f145576ec8/text/0000-fabric-private-chaincode-1.0.md) <!-- TODO: fix-me with pointer to version in fabric-rfcs once RFC is accepted ... -->
598+
- [Fabric Private Chaincode RFC](https://github.com/hyperledger/fabric-rfcs/blob/d1dc48ee934b1430b43f870f4d01e7f145576ec8/text/0000-fabric-private-chaincode-1.0.md) <!-- TODO: fix-me with pointer to version in fabric-rfcs once RFC is accepted ... -->
591599

592600
- Presentation at the Hyperledger Fabric contributor meeting
593601
August 21, 2019.

integration/test-network/README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,8 @@
33
The FPC test network builds on the test-network provided by [fabric-samples](https://github.com/hyperledger/fabric-samples).
44
We provide fabric-samples as a submodule in `$FPC_PATH/integration/test-network/fabric-samples`.
55

6-
In order to use FPC with the test network, make sure you have installed [yq](https://github.com/mikefarah/yq) (version 3.x).
7-
Not that newer versions (v4.x and higher) are currently not supported.
8-
You can install `yq` v3 via `go get`.
9-
```bash
10-
GO111MODULE=on go get github.com/mikefarah/yq/v3
11-
```
6+
Before moving forward, follow the main [README](../../README.md) to set up your environment.
7+
128
## Prepare FPC containers and network
139

1410
Before you start the network make sure you build ercc and ecc containers:

utils/docker/base-rt/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#
99
# Configuration (build) paramaters (for defaults, see below section with ARGs)
1010
# - ubuntu version to use: UBUNTU_VERSION
11-
# - ubuntu name to use: UBUNTU_VERSION
11+
# - ubuntu name to use: UBUNTU_NAME
1212
# - sgx sdk/psw version: SGX
1313
# - protobuf version: PROTO_VERSION
1414
# - additional apt pkgs: APT_ADD_PKGS

0 commit comments

Comments
 (0)