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

refactor(examples): include sample apps in monorepo build #2030

Merged
merged 1 commit into from
Jul 14, 2022

Conversation

outSH
Copy link
Contributor

@outSH outSH commented May 17, 2022

  • Include discounted-cartrade and electricity trade in monorepo setup,
  • Update the devcontainer and include new environment setup instructions in BUILD.md,
  • Fix sample apps build error,
  • Rename of sample apps to cactus-example-*,
  • Change any "car" references to "asset" (in code, comments, documentation, etc..),
  • Rename asset-trade files to match the format of the rest of this repository.
  • Remove asset-trade eth asset management class and endpoint
    (not used right now, and it would confuse with fabric asset).
  • Renamed some uses of cartrade to asset-trade,
    (more complete changes are included in follow-up commit),
  • Add indy build artifacts to .gitignore,
  • Add cmake to devcontainer build (fixed warning during npm dependency build stage),
  • Fix random whitespace and typos errors,

BREAKING CHANGE: building discounted-asset-trade app (or any future app that use indy validator) requires Indy SDK to be installed on the build machine.

Closes: #2029

Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com

@outSH
Copy link
Contributor Author

outSH commented May 17, 2022

@petermetz @izuru0 Please review.

@outSH outSH force-pushed the examples_in_monorepo_pr branch from bc68370 to e7b4d3c Compare May 17, 2022 08:52
@outSH
Copy link
Contributor Author

outSH commented May 17, 2022

@petermetz I wrongly assumed that CI runs inside .devcontainer/Dockerfile cotainer, but it doesn't. Do you have an idea on how to add dependency (Indy SDK) to CI build environment? Install it in ci.sh (it set up npm and yarn already, not sure if OS packages fit here as well), or maybe use .devcontainer for CI build?

@outSH
Copy link
Contributor Author

outSH commented May 23, 2022

@petermetz I wrongly assumed that CI runs inside .devcontainer/Dockerfile cotainer, but it doesn't. Do you have an idea on how to add dependency (Indy SDK) to CI build environment? Install it in ci.sh (it set up npm and yarn already, not sure if OS packages fit here as well), or maybe use .devcontainer for CI build?

@jagpreetsinghsasan Do you have any ideas on this? I can add that Indy SDK is already required since initial indy support I suppose, but it did not affect the CI earlier since it had to be built manually.

@jagpreetsinghsasan
Copy link
Contributor

@petermetz I wrongly assumed that CI runs inside .devcontainer/Dockerfile cotainer, but it doesn't. Do you have an idea on how to add dependency (Indy SDK) to CI build environment? Install it in ci.sh (it set up npm and yarn already, not sure if OS packages fit here as well), or maybe use .devcontainer for CI build?

@jagpreetsinghsasan Do you have any ideas on this? I can add that Indy SDK is already required since initial indy support I suppose, but it did not affect the CI earlier since it had to be built manually.

@outSH is this what you are looking for? https://github.com/hyperledger/cactus/blob/main/.github/workflows/ci.yml

@outSH
Copy link
Contributor Author

outSH commented May 25, 2022

@outSH is this what you are looking for? https://github.com/hyperledger/cactus/blob/main/.github/workflows/ci.yml

@jagpreetsinghsasan My question was: what is your preferred way to install additional dependency in CI environment. Do you mean that I should add additional step in build-node jobs that will install these dependencies?

@petermetz petermetz requested review from izuru0, sandeepnRES, takeutak and VRamakrishna and removed request for jonathan-m-hamilton May 25, 2022 22:33
Copy link
Contributor

@petermetz petermetz left a comment

Choose a reason for hiding this comment

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

@outSH is this what you are looking for? https://github.com/hyperledger/cactus/blob/main/.github/workflows/ci.yml

@jagpreetsinghsasan My question was: what is your preferred way to install additional dependency in CI environment. Do you mean that I should add additional step in build-node jobs that will install these dependencies?

@outSH Sorry for the slow response. The preferred way is to do it declaratively (same as we do for NodeJS).
I found an GH workflow action that is pre-built to do what you want (AFAICT) here: https://github.com/actions/setup-python

If you find it too troublesome to do it this way I would also be okay with hacking it in ci.sh as long as you open a follow-up issue in the tracker so that later on someone gets it done in the ci.yml file with the action (or some other action) declaratively.
I can also offer to help with implementation of the workflow action, you can find me on the daily pair programming calls every morning that's on the HL Cactus calendar so if you stop by there we can collaborate live too.

@outSH outSH requested a review from jagpreetsinghsasan as a code owner May 26, 2022 13:11
@outSH
Copy link
Contributor Author

outSH commented May 26, 2022

@petermetz

Sorry for the slow response. The preferred way is to do it declaratively (same as we do for NodeJS).

  • That was my assumpion as well, that's why I've proposed using .devcontainer image for CI build as well. This'd have an advantage of having environment setup logic in one place (in case we need to add yet another dependency, we have to edit both ci.yml and .devcontainer now), but after all I've followed your advice and edited ci.yml to speed up the process.

I found an GH workflow action that is pre-built to do what you want (AFAICT) here: https://github.com/actions/setup-python

  • I don't want to setup python, I want to install deb package. I've added plain setup scripts in ci.yml, please review the last commit if it's satisfactory and I'll squash it with the main commit.

@outSH outSH requested a review from petermetz May 26, 2022 13:26
@outSH outSH force-pushed the examples_in_monorepo_pr branch from b1f0529 to 54c1e3d Compare May 26, 2022 13:27
Copy link
Contributor

@izuru0 izuru0 left a comment

Choose a reason for hiding this comment

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

LGTM

@takeutak
Copy link
Contributor

@petermetz @jagpreetsinghsasan (cc: @izuru0)
Could you review this PR?

outSH added a commit to outSH/cactus that referenced this pull request Jun 27, 2022
- Add support for starting Cactus CMD SocketIO server with multiple Bussiness Logic Plugins (BLP).
  All required TransactionManagement request should be routed to the correct BLP.
- Add optional onListening callback when starting the cactus cmd socketio server, to simplify tests.
- Fix some bugs and hard-coded BLP Ids in TransactionManagement.
- Add new unit tests to check newly added functionalities.

Closes hyperledger-cacti#2102

Depends on hyperledger-cacti#2030

Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
Copy link
Contributor

@petermetz petermetz left a comment

Choose a reason for hiding this comment

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

@outSH LGTM, thank you!

outSH added a commit to outSH/cactus that referenced this pull request Jul 1, 2022
- Enclose starting sawtooth ledger into single container that will fetch and run the entire setup.
- Remove reduntant files, update the readme.
- Add SawtoothTestLedger class to simplify setting the test ledger in jest tests.
- Refactor electricity-trade to generate usage without sawtooth shell patching.
- Refactor electricity-trade to use new sawtooth ledger container and wait until it's healthy.

Closes: hyperledger-cacti#2108

Depends on: hyperledger-cacti#2030

Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
outSH added a commit to outSH/cactus that referenced this pull request Jul 1, 2022
- Enclose starting sawtooth ledger into single container that will fetch and run the entire setup.
- Remove reduntant files, update the readme.
- Add SawtoothTestLedger class to simplify setting the test ledger in jest tests.
- Refactor electricity-trade to generate usage without sawtooth shell patching.
- Refactor electricity-trade to use new sawtooth ledger container and wait until it's healthy.

Closes: hyperledger-cacti#2108

Depends on: hyperledger-cacti#2030

Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
@outSH outSH force-pushed the examples_in_monorepo_pr branch 2 times, most recently from 514dd7f to 3ffaeb9 Compare July 12, 2022 16:54
@outSH outSH force-pushed the examples_in_monorepo_pr branch 8 times, most recently from fe96c27 to 214847a Compare July 13, 2022 17:07
@petermetz petermetz force-pushed the examples_in_monorepo_pr branch from 3a7aef4 to e31a2c4 Compare July 14, 2022 05:04
@outSH outSH force-pushed the examples_in_monorepo_pr branch from e31a2c4 to 7ae332e Compare July 14, 2022 08:03
- Include discounted-cartrade and electricity trade in monorepo setup,
- Update the devcontainer and include new environment setup instructions in BUILD.md,
- Fix sample apps build error,
- Rename of sample apps to cactus-example-*,
- Change any "car" references to "asset" (in code, comments, documentation, etc..),
- Rename asset-trade files to match the format of the rest of this repository.
- Remove asset-trade eth asset management class and endpoint
  (not used right now, and it would confuse with fabric asset).
- Renamed some uses of cartrade to asset-trade,
  (more complete changes are included in follow-up commit),
- Add indy build artifacts to .gitignore,
- Add cmake to devcontainer build (fixed warning during npm dependency build stage),
- Fix random whitespace and typos errors,

BREAKING CHANGE: building discounted-asset-trade app (or any future app that use indy validator)
                 requires Indy SDK to be installed on the build machine.

Closes: 2029

Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
@outSH outSH force-pushed the examples_in_monorepo_pr branch from 7ae332e to 00ea603 Compare July 14, 2022 08:06
@outSH
Copy link
Contributor Author

outSH commented Jul 14, 2022

@izuru0 @takeutak Finally adjusted the new CI to include Indy SDK, PR is ready to be merged now.

@petermetz
Copy link
Contributor

@outSH Thank you and sorry for the conflicts you (I guess) had with my PR.

That was my assumpion as well, that's why I've proposed using .devcontainer image for CI build as well. This'd have an advantage of having environment setup logic in one place (in case we need to add yet another dependency, we have to edit both ci.yml and .devcontainer now), but after all I've followed your advice and edited ci.yml to speed up the process.

It would be cool if we migrated the CI to run on the dev container, I agree!

@petermetz petermetz merged commit 51ac163 into hyperledger-cacti:main Jul 14, 2022
outSH added a commit to outSH/cactus that referenced this pull request Jul 15, 2022
- Add support for starting Cactus CMD SocketIO server with multiple Bussiness Logic Plugins (BLP).
  All required TransactionManagement request should be routed to the correct BLP.
- Add optional onListening callback when starting the cactus cmd socketio server, to simplify tests.
- Fix some bugs and hard-coded BLP Ids in TransactionManagement.
- Add new unit tests to check newly added functionalities.

Closes hyperledger-cacti#2102

Depends on hyperledger-cacti#2030

Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
outSH added a commit to outSH/cactus that referenced this pull request Aug 10, 2022
- Enclose starting sawtooth ledger into single container that will fetch and run the entire setup.
- Remove reduntant files, update the readme.
- Add SawtoothTestLedger class to simplify setting the test ledger in jest tests.
- Refactor electricity-trade to generate usage without sawtooth shell patching.
- Refactor electricity-trade to use new sawtooth ledger container and wait until it's healthy.

Closes: hyperledger-cacti#2108

Depends on: hyperledger-cacti#2030

Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
outSH added a commit to outSH/cactus that referenced this pull request Aug 10, 2022
- Enclose starting sawtooth ledger into single container that will fetch and run the entire setup.
- Remove reduntant files, update the readme.
- Add SawtoothTestLedger class to simplify setting the test ledger in jest tests.
- Refactor electricity-trade to generate usage without sawtooth shell patching.
- Refactor electricity-trade to use new sawtooth ledger container and wait until it's healthy.

Closes: hyperledger-cacti#2108

Depends on: hyperledger-cacti#2030

Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
petermetz pushed a commit to outSH/cactus that referenced this pull request Aug 25, 2022
- Enclose starting sawtooth ledger into single container that will fetch and run the entire setup.
- Remove reduntant files, update the readme.
- Add SawtoothTestLedger class to simplify setting the test ledger in jest tests.
- Refactor electricity-trade to generate usage without sawtooth shell patching.
- Refactor electricity-trade to use new sawtooth ledger container and wait until it's healthy.

Closes: hyperledger-cacti#2108

Depends on: hyperledger-cacti#2030

Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
petermetz pushed a commit that referenced this pull request Aug 25, 2022
- Enclose starting sawtooth ledger into single container that will fetch and run the entire setup.
- Remove reduntant files, update the readme.
- Add SawtoothTestLedger class to simplify setting the test ledger in jest tests.
- Refactor electricity-trade to generate usage without sawtooth shell patching.
- Refactor electricity-trade to use new sawtooth ledger container and wait until it's healthy.

Closes: #2108

Depends on: #2030

Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
outSH added a commit to outSH/cactus that referenced this pull request Sep 2, 2022
- Add support for starting Cactus CMD SocketIO server with multiple Bussiness Logic Plugins (BLP).
  All required TransactionManagement request should be routed to the correct BLP.
- Add optional onListening callback when starting the cactus cmd socketio server, to simplify tests.
- Fix some bugs and hard-coded BLP Ids in TransactionManagement.
- Add new unit tests to check newly added functionalities.

Closes hyperledger-cacti#2102

Depends on hyperledger-cacti#2030

Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
outSH added a commit to outSH/cactus that referenced this pull request Sep 2, 2022
- Add support for starting Cactus CMD SocketIO server with multiple Bussiness Logic Plugins (BLP).
  All required TransactionManagement request should be routed to the correct BLP.
- Add optional onListening callback when starting the cactus cmd socketio server, to simplify tests.
- Fix some bugs and hard-coded BLP Ids in TransactionManagement.
- Add new unit tests to check newly added functionalities.

Closes hyperledger-cacti#2102

Depends on hyperledger-cacti#2030

Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
outSH added a commit to outSH/cactus that referenced this pull request Sep 26, 2022
- Add support for starting Cactus CMD SocketIO server with multiple Bussiness Logic Plugins (BLP).
  All required TransactionManagement request should be routed to the correct BLP.
- Add optional onListening callback when starting the cactus cmd socketio server, to simplify tests.
- Fix some bugs and hard-coded BLP Ids in TransactionManagement.
- Add new unit tests to check newly added functionalities.

Closes hyperledger-cacti#2102

Depends on hyperledger-cacti#2030

Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
outSH added a commit to outSH/cactus that referenced this pull request Nov 28, 2022
- Add support for starting Cactus CMD SocketIO server with multiple Bussiness Logic Plugins (BLP).
  All required TransactionManagement request should be routed to the correct BLP.
- Add optional onListening callback when starting the cactus cmd socketio server, to simplify tests.
- Fix some bugs and hard-coded BLP Ids in TransactionManagement.
- Add new unit tests to check newly added functionalities.

Closes hyperledger-cacti#2102

Depends on hyperledger-cacti#2030

Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
petermetz pushed a commit to outSH/cactus that referenced this pull request Nov 29, 2022
- Add support for starting Cactus CMD SocketIO server with multiple Bussiness Logic Plugins (BLP).
  All required TransactionManagement request should be routed to the correct BLP.
- Add optional onListening callback when starting the cactus cmd socketio server, to simplify tests.
- Fix some bugs and hard-coded BLP Ids in TransactionManagement.
- Add new unit tests to check newly added functionalities.

Closes hyperledger-cacti#2102

Depends on hyperledger-cacti#2030

Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
petermetz pushed a commit that referenced this pull request Nov 29, 2022
- Add support for starting Cactus CMD SocketIO server with multiple Bussiness Logic Plugins (BLP).
  All required TransactionManagement request should be routed to the correct BLP.
- Add optional onListening callback when starting the cactus cmd socketio server, to simplify tests.
- Fix some bugs and hard-coded BLP Ids in TransactionManagement.
- Add new unit tests to check newly added functionalities.

Closes #2102

Depends on #2030

Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
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.

refactor(examples): include sample apps in monorepo build
5 participants