Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding examples of CCAAS and support into the test-network-k8s #527

Merged
merged 2 commits into from
Dec 17, 2021

Conversation

mbwhite
Copy link
Member

@mbwhite mbwhite commented Nov 3, 2021

Using the variant of the peer's docker container from hyperledger/fabric#2990 this PR adapts the K8S deployment to use this inbuilt chaincode builder.

  • creates two deployments of the chaincode for each peer
  • uses the builders ability to template the fields in the connection.json

Signed-off-by: Matthew B White [email protected]

Copy link
Contributor

@jkneubuh jkneubuh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had success with this approach and the latest default builder PR. A couple of tweaks are still necessary:

  • metadata.json should reference ccaas not external type

  • org2/peer1 is still loading an init container with the fabric-ccaas-builder image from ghca.io, it should be scrubbed.

  • org2/peer2 should also propagate the CHAINCODE_AS_A_SERVICE_BUILDER_CONFIG in env.

test-network-k8s/config/org2/core.yaml Outdated Show resolved Hide resolved
test-network-k8s/kube/org1/org1-peer1.yaml Outdated Show resolved Hide resolved
test-network-k8s/kube/org1/org1-peer2.yaml Outdated Show resolved Hide resolved
@mbwhite mbwhite force-pushed the candidate-use-builtin-cc-builder branch from 39996f3 to c82338c Compare November 18, 2021 17:24
@mbwhite mbwhite marked this pull request as ready for review November 18, 2021 17:25
@mbwhite mbwhite requested a review from a team as a code owner November 18, 2021 17:25
@mbwhite mbwhite force-pushed the candidate-use-builtin-cc-builder branch from c82338c to dc085f0 Compare November 22, 2021 09:04
@mbwhite mbwhite requested a review from jkneubuh November 22, 2021 09:04
@jkneubuh
Copy link
Contributor

This looks better but still needs the 'external' -> 'ccaas' type updated in the metadata.json files.

Also just a reminder (to @jkneubuh) that this PR should not land until after the gateway / 2.4.x images are available on the public repositories.

built-in as-a-service chaincode builder from the Peer Container

Signed-off-by: Matthew B White <[email protected]>
@mbwhite mbwhite force-pushed the candidate-use-builtin-cc-builder branch from d4bf866 to 059a1d0 Compare December 10, 2021 14:33
@mbwhite
Copy link
Member Author

mbwhite commented Dec 10, 2021

@jkneubuh I've updated this, and checked it's working with the very latest docker images from Artifactory.

Updated 15December - confirmed that this is still working as expected.

@mbwhite mbwhite changed the title Use built-in Peer chaincode-as-a-server builder Adding examples of CCAAS and support into the test-network-k8s Dec 14, 2021
@mbwhite
Copy link
Member Author

mbwhite commented Dec 15, 2021

@jkneubuh the PR #560 gives the asset-transfer-basic/chaincode-typescript and asset-transfer-basic/chaincode-java dockerfiles... this PR should use those images rather than any others.

WIll need the other PR to land first though.

Copy link
Contributor

@jkneubuh jkneubuh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Matthew I really like this PR. Working with the new, default CCAAS builder is a huge relief and really makes it easy to work with smart contracts on K8s.

I took the liberty of pushing a few extra changes into this branch / fork / PR. Feel free to squash the commits if desired:

  • Bumped the ./network TEST_NETWORK_FABRIC_VERSION to 2.4.1. (Note: this PR still needs to linger for a couple more days until the patch images have been uploaded to the Docker Hub.)

  • org 2's peer1 config yaml was still referencing the labs ccaas-builder image from ghcr.io in an init container. NONE of the peers reference the hyperledendary init container in the current PR.

  • There were a couple of md docs referencing the hyperledgendary init container. Also scrubbed.

Overall, it looks great, works great, and ... just works. I really, really like how this opens the door for running chaincode endpoints in a local IDE/debugger, and is seamlessly linked up with the new builder. The use of the templating in the connection JSON is a brilliant technique to match the cc hash, independent of the service URL. Nice one.

Really great. I "triple-approve" : 👍 👍 👍

@mbwhite
Copy link
Member Author

mbwhite commented Dec 16, 2021

@jkneubuh thanks for the updates!!

must remember not to merge this just yet...

@mbwhite mbwhite merged commit e07a9ff into hyperledger:main Dec 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants