Substra / hlf-k8s

Initializes an Hyperledger Fabric network (orchestrator distributed mode)
https://docs.substra.org
Apache License 2.0
31 stars 20 forks source link

chaincode: support local filepath for chaincode source code (in addition to archive URL) #14

Closed AurelienGasser closed 4 years ago

AurelienGasser commented 4 years ago

The network currently downloads the chaincode source code from the public internet on each startup.

This PR allows developers to instruct hlf-k8s to fetch the chaincode source code from a local folder.

This can be useful to test local chaincode changes. This also allows developers to start the network without an internet acccess.

AurelienGasser commented 4 years ago

Could someone please test this on Mac with Docker Desktop ?

I tested it on minikube.

For easy testing, you can just change the src of the first peer to point to a local folder, and keep the second peer pointing to the archive URL.

Then check chaincode-install logs for both peers: they should both show that the chaincode was correctly installed.

samlesu commented 4 years ago

I will test it on Docker Desktop for Mac.

@AurelienGasser we could update the skaffold file used for development purposes to use by default a local chaincode folder?

AurelienGasser commented 4 years ago

we could update the skaffold file used for development purposes to use by default a local chaincode folder?

I don't think there's a way to do that currently, since using $SUBSTRA_PATH in the skaffold file won't work, and each developer has a different SUBSTRA_PATH.

Edit: I added comments in skaffold.dev: https://github.com/SubstraFoundation/hlf-k8s/pull/14/commits/efbc1f4c171eae43ef628a1d7347a19d5178683b

AurelienGasser commented 4 years ago

@Kelvin-M or @samlesu, could you please tell me how to share a folder with the k8s cluster on Docker for Mac? I'd like to put a line in the readme like I did for minikube!

Kelvin-M commented 4 years ago

@AurelienGasser
In the docker for mac parameters :) image

Kelvin-M commented 4 years ago

@AurelienGasser helm has been updated you should use now just helm init instead of helm init --client-only

Kelvin-M commented 4 years ago
$ helm init --client-only
Error: unknown flag: --client-only
The command "helm init --client-only" failed and exited with 1 during .
AurelienGasser commented 4 years ago

@Kelvin-M https://github.com/SubstraFoundation/hlf-k8s/pull/15