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

From db snapshot #604

Merged
merged 11 commits into from
Nov 17, 2022
Merged

From db snapshot #604

merged 11 commits into from
Nov 17, 2022

Conversation

pepoviola
Copy link
Collaborator

cc @michalkucharczyk

  • Add db_snapshot / default_db_snapshot config (nodes/relay-chain)
  • Add test using db_snapshot.

@michalkucharczyk
Copy link
Contributor

What would be the usage of db_snapshot?

Like this?

[relaychain]
default_image = "docker.io/paritypr/polkadot-debug:master"
default_command = "polkadot"
default_args = [ "-lparachain=debug" ]

chain = "rococo-local"

  [[relaychain.nodes]]
  name = "alice"
  validator = true
  db_snapshot = "https://storage.googleapis.com/zombienet-db-snaps/chains-test-alice.tgz"
  
  [[relaychain.nodes]]
  name = "bob"
  validator = true
  db_snapshot = "https://storage.googleapis.com/zombienet-db-snaps/chains-test-bob.tgz"

Maybe it would be good to include some examples, and also add a note about this feature do documentation?

@pepoviola
Copy link
Collaborator Author

What would be the usage of db_snapshot?

Like this?

[relaychain]
default_image = "docker.io/paritypr/polkadot-debug:master"
default_command = "polkadot"
default_args = [ "-lparachain=debug" ]

chain = "rococo-local"

  [[relaychain.nodes]]
  name = "alice"
  validator = true
  db_snapshot = "https://storage.googleapis.com/zombienet-db-snaps/chains-test-alice.tgz"
  
  [[relaychain.nodes]]
  name = "bob"
  validator = true
  db_snapshot = "https://storage.googleapis.com/zombienet-db-snaps/chains-test-bob.tgz"

Maybe it would be good to include some examples, and also add a note about this feature do documentation?

Yes, you can also use like this

[relaychain]
default_image = "docker.io/paritypr/polkadot-debug:master"
default_command = "polkadot"
default_args = [ "-lparachain=debug" ]
default_db_snapshot = "https://storage.googleapis.com/zombienet-db-snaps/chains-test.tgz"

chain = "rococo-local"

  [[relaychain.nodes]]
  name = "alice"
  validator = true

  [[relaychain.nodes]]
  name = "bob"
  validator = true

I will update the docs in a follow up pr.

bob: is up

# check balance
alice: js-script ./check-balance.js with "alice" return is 900000999940423862 within 200 seconds
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: we could also check that block height is equal to the height from db.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, but in this case I saved a small db with a few blocks but with a transfer to check the balance.
Thanks!

Copy link
Contributor

@michalkucharczyk michalkucharczyk left a comment

Choose a reason for hiding this comment

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

fails for podman provider.

@pepoviola
Copy link
Collaborator Author

fails for podman provider.

Can you share the error please?

@michalkucharczyk
Copy link
Contributor

michalkucharczyk commented Nov 17, 2022

fails for podman provider.

Can you share the error please?

The error is caused by this: #604 (comment)

Error message:

Error: Command failed with exit code 125: podman -c cd /tmp/zombie-6fb1cc5d_-1858348-hcgAgBX105OF/alice/data/chains && tar -xzvf db.tgz
Error: missing command 'podman COMMAND'
Try 'podman --help' for more information.
    at makeError (/snapshot/javascript/node_modules/execa/lib/error.js:60:11)
    at handlePromise (/snapshot/javascript/node_modules/execa/index.js:118:26)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  shortMessage: 'Command failed with exit code 125: podman -c cd /tmp/zombie-6fb1cc5d_-1858348-hcgAgBX105OF/alice/data/chains && tar -xzvf db.tgz',
  command: 'podman -c cd /tmp/zombie-6fb1cc5d_-1858348-hcgAgBX105OF/alice/data/chains && tar -xzvf db.tgz',
  escapedCommand: 'podman -c "cd /tmp/zombie-6fb1cc5d_-1858348-hcgAgBX105OF/alice/data/chains && tar -xzvf db.tgz"',
  exitCode: 125,
  signal: undefined,
  signalDescription: undefined,
  stdout: '',
  stderr: "Error: missing command 'podman COMMAND'\n" +
    "Try 'podman --help' for more information.",
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false
}
Error: Command failed with exit code 125: podman -c cd /tmp/zombie-6fb1cc5d_-1858348-hcgAgBX105OF/alice/data/chains && tar -xzvf db.tgz
Error: missing command 'podman COMMAND'
Try 'podman --help' for more information.
    at makeError (/snapshot/javascript/node_modules/execa/lib/error.js:60:11)
    at handlePromise (/snapshot/javascript/node_modules/execa/index.js:118:26)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  shortMessage: 'Command failed with exit code 125: podman -c cd /tmp/zombie-6fb1cc5d_-1858348-hcgAgBX105OF/alice/data/chains && tar -xzvf db.tgz',
  command: 'podman -c cd /tmp/zombie-6fb1cc5d_-1858348-hcgAgBX105OF/alice/data/chains && tar -xzvf db.tgz',
  escapedCommand: 'podman -c "cd /tmp/zombie-6fb1cc5d_-1858348-hcgAgBX105OF/alice/data/chains && tar -xzvf db.tgz"',
  exitCode: 125,
  signal: undefined,
  signalDescription: undefined,
  stdout: '',
  stderr: "Error: missing command 'podman COMMAND'\n" +
    "Try 'podman --help' for more information.",
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false
}

@pepoviola
Copy link
Collaborator Author

@michalkucharczyk podman fixed

image

@pepoviola pepoviola merged commit a122723 into main Nov 17, 2022
@pepoviola pepoviola deleted the from-db-snapshot branch November 17, 2022 16:58
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