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 Helper Tagets to multichain-testing Makefile #10093

Closed
wants to merge 1 commit into from

Conversation

amessbee
Copy link
Contributor

@Jovonni recommends devs to add these targets to multichain-testing Makefile to run/test dapp-orchestration-basics. If we find them useful, it would be nicer to have them here to being with.

Refs: Relevant section in README of orca-dapp.

@amessbee amessbee self-assigned this Sep 16, 2024
@amessbee amessbee added the automerge:rebase Automatically rebase updates, then merge label Sep 16, 2024
Copy link
Member

@turadg turadg left a comment

Choose a reason for hiding this comment

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

I don't agree that the Makefile should have all these commands. The targets of a Makefile should be idempotent. If we need some convenience commands for using this tooling, let's make scripts files. They're quite discoverable by ls scripts.

Comment on lines +117 to +119
.PHONY: corepack-enable
corepack-enable:
corepack enable
Copy link
Member

Choose a reason for hiding this comment

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

make corepack-enable has no value over corepack enable.

In general, I think we should get away from all these .PHONY targets. A makefile is for making. If we just want an inventory of commands, that's better in a package.json "scripts" list or just the documentation.

Copy link
Member

Choose a reason for hiding this comment

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

+1. And I don't think we should use the Makefile for anything JS related either.

Developers should also learn about corepack much earlier, from getting-started>installing yarn, and we shouldn't need to re-document it here.

yarn test test/install-contracts.test.ts

.PHONY: all
all: setup install
Copy link
Member

Choose a reason for hiding this comment

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

this one seems worthwhile since it has setup and install dependencies. but I still think it would be better as a script in scripts because it's not idempotent. "Making" should be repeatable and have the same outcome.

Copy link
Member

Choose a reason for hiding this comment

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

We have make start that does everything here except setup. The wait-for-pods command is also more robust than the sleeps here.

setup only needs to be called in two scenarios:

  1. First time user who doesn't have the needed dependencies or an agship kind cluster
  2. User chose to stop things with make stop clean instead of just make stop, so we need to recreate a kind cluster

A potential harm of including setup in the start or an all script is that it will fail if the user hasn't called make clean. This would suggest that we should amend start to clean setup install...

I am not sure what my ultimate opinion is here. I see benefit in adding clean setup to the current all script, but also see it adding extra overhead for non-first-time users.

Copy link
Member

@0xpatrickdev 0xpatrickdev left a comment

Choose a reason for hiding this comment

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

Appreciate the contribution. As @turadg mentioned, I think we only need to land some of this:

  1. include setup in the start script or a new all script

  2. Document update client flow when relayers get out of sync

###############################################################################

.PHONY: teardown
teardown: stop-forward stop clean delete
Copy link
Member

Choose a reason for hiding this comment

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

stop already calls stop-forward and delete, and clean calls stop. This would be simplified to teardown: clean which is redundant.

Comment on lines +117 to +119
.PHONY: corepack-enable
corepack-enable:
corepack enable
Copy link
Member

Choose a reason for hiding this comment

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

+1. And I don't think we should use the Makefile for anything JS related either.

Developers should also learn about corepack much earlier, from getting-started>installing yarn, and we shouldn't need to re-document it here.

yarn test test/install-contracts.test.ts

.PHONY: all
all: setup install
Copy link
Member

Choose a reason for hiding this comment

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

We have make start that does everything here except setup. The wait-for-pods command is also more robust than the sleeps here.

setup only needs to be called in two scenarios:

  1. First time user who doesn't have the needed dependencies or an agship kind cluster
  2. User chose to stop things with make stop clean instead of just make stop, so we need to recreate a kind cluster

A potential harm of including setup in the start or an all script is that it will fail if the user hasn't called make clean. This would suggest that we should amend start to clean setup install...

I am not sure what my ultimate opinion is here. I see benefit in adding clean setup to the current all script, but also see it adding extra overhead for non-first-time users.


.PHONY: hermes-update
hermes-update:
kubectl exec -i hermes-agoric-osmosis-0 -c relayer -- hermes update client --host-chain agoriclocal --client 07-tendermint-1
Copy link
Member

Choose a reason for hiding this comment

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

I like that we have this at our disposal and @Jovonni figured out a solution for expired clients. I would prefer to see us document the pain point/symptoms in an FAQ section of the README and we could document the kubectl command there. There are 3 different relayer nodes and 6 different clients that could go out of sync and this only covers one of the scenarios.

This FAQ item would also mention that this typically only happens if the environment has been running for a long time (several hours?) and another path is simply restarting the service.

@amessbee
Copy link
Contributor Author

Thanks for the comments - agreed with most of them. Will close this now!

@amessbee amessbee closed this Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge:rebase Automatically rebase updates, then merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants