Skip to content

Commit c94a648

Browse files
g2flyermbrandenburgerlengyijundependabot[bot]
authored
Concept Release (1.0) with versioned images & able out of the box to run demo (#339)
* Update rocket chat We got our own rocket chat channel! Please join us at Signed-off-by: bur <[email protected]> * fix environment Signed-off-by: lengyijun <[email protected]> * fix README.md Signed-off-by: lengyijun <[email protected]> * Bump acorn from 6.4.0 to 6.4.1 in /demo/client/frontend Bumps [acorn](https://github.com/acornjs/acorn) from 6.4.0 to 6.4.1. - [Release notes](https://github.com/acornjs/acorn/releases) - [Commits](acornjs/acorn@6.4.0...6.4.1) Signed-off-by: dependabot[bot] <[email protected]> * Bump node deps Update node deps in demo frontend/backend and docker utils Signed-off-by: bur <[email protected]> * update CODEOWNERS (#263) * update list Signed-off-by: Michael Steiner <[email protected]> * fixup! update list Signed-off-by: Michael Steiner <[email protected]> * disclaimer and explicit list of "official" releases Signed-off-by: Michael Steiner <[email protected]> * make avatar download a bit more robust and graceful Signed-off-by: Michael Steiner <[email protected]> * Docker dev run mounts FPC from local fs This mounts the local FPC repository by default into a dev container when `make run` is called. Before this was optional but turned out that it should be the default. Signed-off-by: bur <[email protected]> * Fix build for concept-release - move both dev and peer to build from local HEAD commit - (try to) minimize re-build of images - add missing dependencies to dev container Signed-off-by: michael steiner <[email protected]> * Version docker images Signed-off-by: michael steiner <[email protected]> * Make FABRIC_VERSION arg/env in dockerfile consistent with vars used to get docker tag Signed-off-by: michael steiner <[email protected]> * More robust and precise handling of docker image cleanup Signed-off-by: michael steiner <[email protected]> * A more robust teardown Signed-off-by: Michael Steiner <[email protected]> * Make missing device error more explicit and make SGX_MODE=SIM default for build - note this is already done for a number of scripts and makes it more fail-safe from usage-perspective (though not from security :-). Also note that cmake still has a HW default but that will be removed and referring to the config.mk default in a separate PR) Signed-off-by: michael steiner <[email protected]> * Fix path so we can call make also via `make -C utils/docker run` Signed-off-by: michael steiner <[email protected]> * Make rm failure abort make (Note rm -f does _not_ file if the files do not exist ..) Signed-off-by: michael steiner <[email protected]> * Make docker-based tests run also inside dev(elopment) container * make sure host network is also available inside * for volume mounts, make sure the source path maps to a path understood by docker daemon Signed-off-by: michael steiner <[email protected]> * Build/Test only via dev container and not also directly on host Signed-off-by: michael steiner <[email protected]> Co-authored-by: bur <[email protected]> Co-authored-by: lyj <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent ee471b6 commit c94a648

40 files changed

+3316
-4221
lines changed

.travis.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,12 @@ before_install:
6565
- GO_TAGS=pluginsenabled make peer orderer cryptogen configtxgen && popd
6666

6767
script:
68-
# travis doesn't check out the branch itself but for our make to work we
69-
# need a branch or alike. So check create a local one ...
70-
- git checkout -b we-need-a-branch-for-below-to-work
71-
- make
68+
# * test directly on host
69+
# - make all clobber
70+
# NOTE: disabled as it will reach the 50 min limits. Testing inside dev container
71+
# hopefully/presumably should hopefully be a super-set of the host build/test
72+
#
73+
# * test that it also runs properly in dev container
74+
- make -C utils/docker run DOCKER_DEV_OPTIONAL_CMD='make all clobber'
75+
# Note: travis of couse does an implicit clobber but adding it here makes sure
76+
# it works properly, also to make sure below is clean-slate

CODEOWNERS

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
* @mbrandenburger @bvavala @g2flyer @swetharepakula @sjanakir2015
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
# FPC Maintainers
4+
* @mbrandenburger @bvavala @g2flyer @jordy24

README.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,16 @@ The system consists of the following components:
9797
ledger enclave, which crosschecks the decision before it finally commits
9898
the transaction to the ledger.
9999

100+
## Releases
101+
102+
- [Concept Release - March 2, 2020](https://github.com/hyperledger-labs/fabric-private-chaincode/tree/concept-release-1.0)
103+
104+
*WARNING: This project is in continous development and the `master`
105+
branch will not always be stable. Unless you want to actively
106+
contribute to the project itself, we advice you to use one of above releases*
107+
108+
109+
100110
## Getting started
101111

102112
The following steps guide you through the build phase and configuration, for
@@ -197,7 +207,6 @@ A few notes:
197207
`/dev/isgx` and your PSW daemon listens to `/var/run/aesmd`, then the docker image will be sgx-enabled and your settings from `./config/ias` will be used. You will have to manually set `SGX_MODE=HW` before building anything to use HW mode.
198208
* if you want additional apt packages in your container image, add to the `<absolute-project-path>/fabric-private-chaincode/config.override.mk` file in the fabric-private-chaincode directory. In that file, define `DOCKER_DEV_IMAGE_APT_ADD__PKGS` with a
199209
list of packages you want. They will then be automatically added to the docker image
200-
* docker images do not persist between runs and there are setup files that will be needed in the docker container. Therefore, map the local cloned filesystem as a volume to `/project/src/github.com/hyperledger-labs/fabric-private-chaincode` within the docker container. To achieve this, add `DOCKER_DEV_RUN_OPTS= -v <absolute-project-path>/fabric-private-chaincode:/project/src/github.com/hyperledger-labs/fabric-private-chaincode` to your `<absolute-project-path>/fabric-private-chaincode/config.override.mk`, where <absolute-project-path> is where you have cloned the FPC project on your local machine.
201210
* due to the way the peer's port for chaincode connection is managed,
202211
you will be able to run only a single FPC development container on a
203212
particular host.
@@ -214,6 +223,9 @@ This will open a shell inside the FPC development container, with
214223
environment variables like GOPATH appropriately defined and all
215224
dependencies like fabric built, ready to build and run FPC.
216225

226+
Note that by default the dev container mounts your local cloned FPC project as a volume to `/project/src/github.com/hyperledger-labs/fabric-private-chaincode` within the docker container.
227+
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.
228+
217229
Optional: to do a clean build do the following within the container
218230
```
219231
<docker-root>:project/src/github.com/hyperledger-labs/fabric-private-chaincode# make clean
@@ -377,7 +389,7 @@ The current code should work behind a proxy assuming
377389
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.
378390

379391
You will also require a recent version of docker-compose. In particular, the docker-compose from ubuntu 18.04
380-
(docker-compose 1.17) is _not_ recent enough to understand `~/.docker/config.js` and related proxy options.
392+
(docker-compose 1.17) is _not_ recent enough to understand `~/.docker/config.json` and related proxy options.
381393
To upgrade, install a recent version following the instructions from [docker.com](https://docs.docker.com/compose/install/), e.g.,
382394
for version 1.25.4 execute
383395
```
@@ -419,10 +431,10 @@ export SGX_MODE=HW
419431
# The attestation type is ignored when SGX_MODE=SIM is set.
420432

421433
# IAS attestation (unlinkable)
422-
export FPC_ATTESTATION_TYPE = epid_unlinkable
434+
export FPC_ATTESTATION_TYPE=epid_unlinkable
423435

424436
# IAS attestation (linkable)
425-
export FPC_ATTESTATION_TYPE = epid_linkable
437+
export FPC_ATTESTATION_TYPE=epid_linkable
426438

427439
```
428440
##### Clang-format
@@ -474,7 +486,7 @@ By running the following command you can generate the documentation.
474486
## Getting Help
475487

476488
Found a bug? Need help to fix an issue? You have a great idea for a new feature? Talk to us! You can reach us on
477-
[RocketChat](https://chat.hyperledger.org/) in #private-data-objects.
489+
[RocketChat](https://chat.hyperledger.org/) in #fabric-private-chaincode.
478490

479491
We also have a weekly meeting every Tuesday at 3 pm GMT on [Zoom](https://zoom.us/my/hyperledger.community.3). Please
480492
see the Hyperledger [community calendar](https://wiki.hyperledger.org/display/HYP/Calendar+of+Public+Meetings) for

config.mk

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,19 @@ DOCKER := docker $(DOCKERFLAGS)
1010

1111
PROJECT_NAME=fabric-private-chaincode
1212

13-
export SGX_MODE ?= HW
13+
export FPC_VERSION := cr1.0.1
14+
15+
export SGX_MODE ?= SIM
1416
export SGX_BUILD ?= PRERELEASE
1517

1618
export FABRIC_PATH ?= ${GOPATH}/src/github.com/hyperledger/fabric
1719

20+
export FPC_PATH=$(abspath $(TOP))
21+
# to allow volume mounts from within a dev(elopment) container,
22+
# below variable is used for volume mounts and can hence be
23+
# re-defined to point to the FPC path as seen by the docker daemon
24+
export DOCKERD_FPC_PATH ?= $(FPC_PATH)
25+
1826
JAVA ?= java
1927
PLANTUML_JAR ?= plantuml.jar
2028
PLANTUML_CMD ?= $(JAVA) -jar $(PLANTUML_JAR)

demo/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ include $(TOP)/build.mk
77

88
SUB_DIRS = chaincode client
99

10-
build test clean clobber:
10+
build test clean:
1111
$(foreach DIR, $(SUB_DIRS), $(MAKE) -C $(DIR) $@ || exit;)
1212

13-
1413
clobber:
1514
./scripts/teardown.sh --clean-slate
15+
$(foreach DIR, $(SUB_DIRS), $(MAKE) -C $(DIR) $@ || exit;)

demo/chaincode/fpc/Makefile

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,7 @@
44
# SPDX-License-Identifier: Apache-2.0
55

66
#ifneq ($(FPC_PATH), '')
7-
ifdef FPC_PATH
8-
TOP = $(FPC_PATH)
9-
else
10-
TOP = ../../../
11-
export FPC_PATH = $(abspath $(TOP))
12-
endif
7+
TOP = ../../../
138

149
include $(TOP)/build.mk
1510

@@ -26,7 +21,7 @@ build: $(BUILD_DIR)
2621
$(MAKE) --directory=$<
2722

2823
clean:
29-
-rm -rf $(BUILD_DIR)
24+
rm -rf $(BUILD_DIR)
3025

3126

3227
HW_EXTENSION=$(shell if [ "${SGX_MODE}" = "HW" ]; then echo "-hw"; fi)
@@ -39,7 +34,7 @@ docker-build: clean
3934
|| { cd $(TOP)/utils/docker && make cc-builder; }
4035
$(DOCKER) run \
4136
-u $$(id -u):$$(id -g)\
42-
-v ${PWD}:/project/src/github.com/hyperledger-labs/fabric-private-chaincode/demo/chaincode/fpc\
37+
-v "$(DOCKERD_FPC_PATH)/demo/chaincode/fpc":/project/src/github.com/hyperledger-labs/fabric-private-chaincode/demo/chaincode/fpc\
4338
-w /project/src/github.com/hyperledger-labs/fabric-private-chaincode/demo/chaincode/fpc\
4439
$(FPC_DOCKER_CC_BUILDER_NAME)\
4540
sh -c 'make build'

demo/client/backend/fabric-gateway/Makefile

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
TOP = ../../../..
66
include $(TOP)/build.mk
77

8-
DOCKER_IMAGE=auction_client_backend
8+
FPC_DOCKER_NAMESPACE := hyperledger/fabric-private-chaincode
9+
DOCKER_IMAGE = ${FPC_DOCKER_NAMESPACE}-auction_client_backend
910

1011
# Note:
1112
# - docker images are not necessarily rebuild if they exist but are outdated.
@@ -25,9 +26,16 @@ docker:
2526
# this image is usually built by docker-compose but we still add a
2627
# convenience target ere until proxy issues with docker-compose are resolved
2728
$(DOCKER) build $(DOCKER_BUILD_OPTS) -t ${DOCKER_IMAGE} .
29+
$(DOCKER) tag $(DOCKER_IMAGE) $(DOCKER_IMAGE):${FPC_VERSION}
2830

2931
clobber:
30-
IMAGE=$$(${DOCKER} images ${DOCKER_IMAGE} -q); \
31-
if [ ! -z "$${IMAGE}" ]; then ${DOCKER} rmi ${IMAGE}; fi
32+
for tag in \
33+
${FPC_VERSION} \
34+
latest \
35+
; do \
36+
if [ ! -z "$$(docker images -q ${DOCKER_IMAGE}:$${tag} 2> /dev/null)" ]; then \
37+
docker rmi $(DOCKER_IMAGE):$${tag}; \
38+
fi \
39+
done
3240
# make clobber in demo/ also would take care but better safe than sorry
3341

0 commit comments

Comments
 (0)