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

Updating documentation on cli.js location and 3rd party repo links #1442

Merged
merged 18 commits into from
Nov 7, 2023

Conversation

Neyromancer
Copy link
Contributor

@Neyromancer Neyromancer commented Oct 23, 2023

Description

Some part of ducmentation is outdated which makes it difficult to follow it.

What was done?

  1. dist/cli.js location updated, from dist/cli.js to cli/dist/cli.js. Changes introduced with PR.
  2. links to polkadot repo replaced with links to polkadot-sdk repo as polkadot repo was archived. See
  3. Removed one Note as excessive.

Relates to Issue #1412 Error when trying to spawn network in kubernetes


Tasks:

  • Code review
  • Validate script's changes by running them locally

@cla-bot-2021
Copy link

cla-bot-2021 bot commented Oct 23, 2023

User @Neyromancer, please sign the CLA here.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
javascript/package.json Outdated Show resolved Hide resolved
scripts/ci/docker/zombienet_injected.Dockerfile Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@@ -28,9 +28,6 @@ Internally zombienet is a `javascript` library, designed to run on `Node.js` and
backend `providers` to run the *nodes*, at this moment `kubernetes`, `podman` and `native` are
supported.

**Note:** Currently, it is only possible to use `podman` for Zombienet users on Linux machines.
Copy link
Contributor Author

@Neyromancer Neyromancer Oct 27, 2023

Choose a reason for hiding this comment

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

This Note totally repeats Note several lines below, here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

applicable to all similar changes

@@ -120,7 +117,7 @@ Native provider doesn't run any extra layer/process at the moment.
*For this example we will use the `macos` version of the executable*

```bash
./zombienet-macos
./zombienet-macos
Copy link
Contributor Author

Choose a reason for hiding this comment

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

to make all bash snippets alike

applicable to all changes around the project's docs

README.md Outdated
@@ -343,27 +341,28 @@ You can use the following arguments:
For example:

```bash
node dist/cli.js setup polkadot polkadot-parachain
❯ cd zombinet/javascript/packages
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have the following directory tree structure

> javascript % tree -L 3 -I node_modules -d

.
└── packages
   ├── cli
   │   ├── dist
   │   └── src
   ├── orchestrator
   │   ├── dist
   │   ├── src
   │   └── static-configs
   └── utils
        ├── dist
        └── src

where cli.js is in cli/dist/cli.js.

When i am trying to execute node dist/cli.js version from javascript or javascript/packages i've got error message Error: Cannot find module '/zombienet/javascript/dist/cli.js. If i try to call node cli/dist/cli.js version from javasript dir i get the same error. However if to call node cli/dist/cli.js version from javascript/packages i get the current cli version.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

as far as i understood cli.ts was moved from src/cli.ts to packages/cli/cli.ts with this PR.

It seems for me that we need to update the previosly working call node dist/cli.js with node cli/dist/cli.js. And we have to do this from packages directory as currently cli/dist/cli.js is located in packages

Copy link
Contributor

Choose a reason for hiding this comment

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

I think there is a misunderstanding here. Each package has its own structure and when build creates its own dist directory. All TS is transpiled to JS insde that dist dir.
Having said that, with the structure you mentioned above, you will need indeed to run the command you mention... but first you need to run the build command. INSTEAD, though you can run the commands inside the package.json of /zombienet/javascript instead. e.g.:
❯ npm run zombie -- spawn ....
etc..etc..

```

> Note: If you are using macOS please clone the [Polkadot repo](https://github.com/paritytech/polkadot) and run it locally. At the moment there is no `polkadot` binary for MacOs.
> Note: If you are using macOS please clone the [polkadot-sdk repo](https://github.com/paritytech/polkadot-sdk) and run it locally. At the moment there is no `polkadot` binary for MacOs.
Copy link
Contributor Author

@Neyromancer Neyromancer Oct 27, 2023

Choose a reason for hiding this comment

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

polkadot repo archived and project moved to polkadot-sdk repo, see

applicable to all similar changes around this PR

README.md Outdated Show resolved Hide resolved
cd polkadot
cargo build --profile testnet -p test-parachain-adder-collator
export PATH=$(pwd)/target/testnet:$PATH
❯ git clone git@github.com:paritytech/polkadot-sdk.git
Copy link
Contributor Author

Choose a reason for hiding this comment

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

polkadot repo archived and project moved to polkadot-sdk repo, see

applicable to all similar changes around this PR

@Neyromancer Neyromancer marked this pull request as ready for review October 27, 2023 21:37
@Neyromancer Neyromancer changed the title Updating cli.js location and name Updating documentation on cli.js location and 3rd party repo links Oct 28, 2023
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated
@@ -343,27 +341,28 @@ You can use the following arguments:
For example:

```bash
node dist/cli.js setup polkadot polkadot-parachain
❯ cd zombinet/javascript/packages
Copy link
Contributor

Choose a reason for hiding this comment

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

I think there is a misunderstanding here. Each package has its own structure and when build creates its own dist directory. All TS is transpiled to JS insde that dist dir.
Having said that, with the structure you mentioned above, you will need indeed to run the command you mention... but first you need to run the build command. INSTEAD, though you can run the commands inside the package.json of /zombienet/javascript instead. e.g.:
❯ npm run zombie -- spawn ....
etc..etc..

README.md Outdated Show resolved Hide resolved
javascript/packages/cli/README.md Outdated Show resolved Hide resolved
javascript/packages/cli/README.md Outdated Show resolved Hide resolved
javascript/packages/orchestrator/README.md Outdated Show resolved Hide resolved
javascript/packages/orchestrator/README.md Outdated Show resolved Hide resolved
javascript/packages/orchestrator/README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Neyromancer and others added 4 commits November 2, 2023 21:49
Co-authored-by: Nikos Kontakis <wirednkod@gmail.com>
Co-authored-by: Nikos Kontakis <wirednkod@gmail.com>
Co-authored-by: Javier Viola <pepoviola@gmail.com>
Co-authored-by: Javier Viola <pepoviola@gmail.com>
@Neyromancer Neyromancer marked this pull request as draft November 2, 2023 21:35
```

### Download and install needed artifacts (optional)

For an easier and faster setup of your local environment, run:

```bash
node dist/cli.js setup <binaries>
❯ cd zombinet/javascript
❯ npm i && npm run zombie -- setup <binaries>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

command represented as recommended in the comment


Usage: zombienet [options] [command]

Options:
-p, --provider <provider> Override provider to use (choices: "podman",
"kubernetes", default: kubernetes)
-c, --spawn-concurrency <concurrency> Number of concurrent spawning process to launch, default is 1
Copy link
Contributor Author

Choose a reason for hiding this comment

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

make it aligned with current output, see

Copy link
Contributor Author

Choose a reason for hiding this comment

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

here and others

@Neyromancer Neyromancer marked this pull request as ready for review November 3, 2023 20:29
Copy link
Contributor

@wirednkod wirednkod left a comment

Choose a reason for hiding this comment

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

lgtm. Beside some minor corrections. Thank you so much @Neyromancer . Thats a great amount of work on the doc!

javascript/README.md Outdated Show resolved Hide resolved
javascript/packages/orchestrator/README.md Outdated Show resolved Hide resolved
javascript/packages/orchestrator/README.md Outdated Show resolved Hide resolved
@wirednkod
Copy link
Contributor

@Neyromancer can you please sign the cla?

@Neyromancer
Copy link
Contributor Author

@wirednkod, thank you for review and approve however i seem not posses the required rights to merge the PR. Could you merge it plz?

@wirednkod wirednkod merged commit 5ad9359 into paritytech:main Nov 7, 2023
20 checks passed
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.

3 participants