From 170584e86d124f372dd60d641d07757249e01a68 Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Thu, 13 Jun 2024 15:09:10 +0200 Subject: [PATCH] fix: migration of ethereum-package to ethpandaops (#2489) ## Description Migration of ethereum-package to ethpandaops --------- Co-authored-by: Gyanendra Mishra --- cli/cli/commands/package/init_cmd/init_cmd.go | 2 +- .../git_package_content_provider_test.go | 10 +++---- ...package_replace_options_repository_test.go | 4 +-- .../commons/yaml_parser/kurtosis_yaml_test.go | 2 +- docs/docs/cli-reference/run.md | 4 +-- docs/docs/get-started/quickstart.md | 2 +- .../how-to-full-mev-with-eth2-package.md | 26 ++++++++--------- docs/docs/guides/how-to-local-eth-testnet.md | 14 ++++----- .../ci_tests/simple_arg_test/main.star | 4 +-- .../startosis_simple_script.star | 13 +++++---- .../starlark/image-build-package/main.star | 6 ++-- .../main.star | 5 +++- .../child-package/file.star | 5 +++- .../parent-package/main.star | 1 + .../package1/main.star | 5 +++- .../package2/file.star | 1 + .../local-sample-dependency-package/main.star | 2 ++ .../regular-replace/main.star | 11 ++++--- .../replace-with-local/main.star | 11 ++++--- .../main.star | 19 ++++++++---- .../replace-with-no-main-branch/main.star | 11 ++++--- .../without-replace/main.star | 11 ++++--- .../multiple-artifacts-directory/main.star | 29 ++++++++++--------- .../upload-file-generic-package/main.star | 12 ++------ .../upload-file/upload-file-package/main.star | 9 ++---- 25 files changed, 124 insertions(+), 95 deletions(-) diff --git a/cli/cli/commands/package/init_cmd/init_cmd.go b/cli/cli/commands/package/init_cmd/init_cmd.go index abf796ddeb..f15af5de37 100644 --- a/cli/cli/commands/package/init_cmd/init_cmd.go +++ b/cli/cli/commands/package/init_cmd/init_cmd.go @@ -21,7 +21,7 @@ const ( alwaysCreateExecutablePackage = true - validPackageNameExample = "github.com/kurtosis-tech/ethereum-package" + validPackageNameExample = "github.com/ethpandaops/ethereum-package" ) // InitCmd we only fill in the required struct fields, hence the others remain nil diff --git a/core/server/api_container/server/startosis_engine/startosis_packages/git_package_content_provider/git_package_content_provider_test.go b/core/server/api_container/server/startosis_engine/startosis_packages/git_package_content_provider/git_package_content_provider_test.go index 85fe185a33..a5ac4cceca 100644 --- a/core/server/api_container/server/startosis_engine/startosis_packages/git_package_content_provider/git_package_content_provider_test.go +++ b/core/server/api_container/server/startosis_engine/startosis_packages/git_package_content_provider/git_package_content_provider_test.go @@ -269,8 +269,8 @@ func TestGitPackageProvider_GetContentFromAbsoluteLocatorWithCommit(t *testing.T githubAuthProvider := NewGitHubPackageAuthProvider(githubAuthDir) provider := NewGitPackageContentProvider(packageDir, packageTmpDir, githubAuthProvider, nil) - absoluteLocatorStr := "github.com/kurtosis-tech/ethereum-package/src/package_io/input_parser.star" - commitHash := "da55be84861e93ce777076e545abee35ff2d51ce" + absoluteLocatorStr := "github.com/ethpandaops/ethereum-package/src/package_io/input_parser.star" + commitHash := "fcaa2c23301c0f7012301fe019a75b0fa369961b" absoluteLocatorWithCommit := startosis_packages.NewPackageAbsoluteLocator(absoluteLocatorStr, commitHash) @@ -466,13 +466,13 @@ func TestGetAbsoluteLocator_AnotherPackageWithCommitReplaceSucceeds(t *testing.T packageId := "github.com/kurtosis-tech/sample-startosis-load/sample-package" parentModuleId := "github.com/kurtosis-tech/sample-startosis-load/sample-package/main.star" - maybeRelativeLocator := "github.com/kurtosis-tech/ethereum-package/src/package_io/input_parser.star" + maybeRelativeLocator := "github.com/ethpandaops/ethereum-package/src/package_io/input_parser.star" packageReplaceOptions := map[string]string{ - "github.com/kurtosis-tech/ethereum-package": "github.com/kurtosis-tech/ethereum-package@da55be84861e93ce777076e545abee35ff2d51ce", + "github.com/ethpandaops/ethereum-package": "github.com/ethpandaops/ethereum-package@da55be84861e93ce777076e545abee35ff2d51ce", } absoluteLocator, err := provider.GetAbsoluteLocator(packageId, parentModuleId, maybeRelativeLocator, packageReplaceOptions) - expectedAbsoluteLocator := "github.com/kurtosis-tech/ethereum-package/src/package_io/input_parser.star" + expectedAbsoluteLocator := "github.com/ethpandaops/ethereum-package/src/package_io/input_parser.star" require.Nil(t, err) require.Equal(t, expectedAbsoluteLocator, absoluteLocator.GetLocator()) } diff --git a/core/server/api_container/server/startosis_engine/startosis_packages/git_package_content_provider/package_replace_options_repository_test.go b/core/server/api_container/server/startosis_engine/startosis_packages/git_package_content_provider/package_replace_options_repository_test.go index f21ed220ed..3501fa43cf 100644 --- a/core/server/api_container/server/startosis_engine/startosis_packages/git_package_content_provider/package_replace_options_repository_test.go +++ b/core/server/api_container/server/startosis_engine/startosis_packages/git_package_content_provider/package_replace_options_repository_test.go @@ -10,7 +10,7 @@ import ( var allPackageReplaceOptionsForTest = map[string]string{ "github.com/kurtosis-tech/sample-dependency-package": "github.com/kurtosis-tech/another-sample-dependency-package", - "github.com/kurtosis-tech/ethereum-package": "github.com/another-org/ethereum-package", + "github.com/ethpandaops/ethereum-package": "github.com/another-org/ethereum-package", } func TestSaveAnGet_Success(t *testing.T) { @@ -41,7 +41,7 @@ func TestSaveAnGet_OverwriteSuccess(t *testing.T) { expectedReplacePackageOptions := map[string]string{ "github.com/kurtosis-tech/sample-dependency-package": "github.com/kurtosis-tech/random-package", "github.com/kurtosis-tech/avalanche-package": "github.com/another-org/avalanche-package", - "github.com/kurtosis-tech/ethereum-package": "github.com/another-org/ethereum-package", + "github.com/ethpandaops/ethereum-package": "github.com/another-org/ethereum-package", } existingReplacePackageOptions, err := repository.Get() diff --git a/core/server/commons/yaml_parser/kurtosis_yaml_test.go b/core/server/commons/yaml_parser/kurtosis_yaml_test.go index f2a4243a11..9cb1352080 100644 --- a/core/server/commons/yaml_parser/kurtosis_yaml_test.go +++ b/core/server/commons/yaml_parser/kurtosis_yaml_test.go @@ -18,7 +18,7 @@ description: | Some words to describe the package. replace: github.com/kurtosis-tech/sample-dependency-package: github.com/kurtosis-tech/another-sample-dependency-package - github.com/kurtosis-tech/ethereum-package: github.com/my-forked/ethereum-package + github.com/ethpandaops/ethereum-package: github.com/my-forked/ethereum-package `) sampleInCorrectKeyYaml = []byte(`incorrect_name_key: github.com/test/test`) sampleDuplicatedReplaceKeyYaml = []byte(` diff --git a/docs/docs/cli-reference/run.md b/docs/docs/cli-reference/run.md index b22fe0010b..38675acc2a 100644 --- a/docs/docs/cli-reference/run.md +++ b/docs/docs/cli-reference/run.md @@ -80,11 +80,11 @@ run(plan, some_parameter = struct(some_property = "Property value")) 1. The `--args-file` flag can be used to send in a YAML/JSON file, from a local file through the filepath or from remote using the URL, as an argument to the Kurtosis Package. Note that if you pass in package arguments as CLI arguments and via the flag, the CLI arguments will be the one used. For example: ```bash - kurtosis run github.com/kurtosis-tech/ethereum-package --args-file "devnet-5.yaml" + kurtosis run github.com/ethpandaops/ethereum-package --args-file "devnet-5.yaml" ``` or ```bash - kurtosis run github.com/kurtosis-tech/ethereum-package --args-file "https://www.myhost.com/devnet-5.json" + kurtosis run github.com/ethpandaops/ethereum-package --args-file "https://www.myhost.com/devnet-5.json" ``` 1. The `--dry-run` flag can be used to print the changes proposed by the script without executing them diff --git a/docs/docs/get-started/quickstart.md b/docs/docs/get-started/quickstart.md index 3b0c84ebe4..19c4edcba9 100644 --- a/docs/docs/get-started/quickstart.md +++ b/docs/docs/get-started/quickstart.md @@ -251,7 +251,7 @@ Now that you've use the Kurtosis CLI to run a package, inspect the resulting env [cassandra-package-example]: https://github.com/kurtosis-tech/cassandra-package [go-test-example]: https://github.com/kurtosis-tech/awesome-kurtosis/tree/main/quickstart/go-test [ts-test-example]: https://github.com/kurtosis-tech/awesome-kurtosis/tree/main/quickstart/ts-test -[ethereum-package]: https://github.com/kurtosis-tech/ethereum-package/ +[ethereum-package]: https://github.com/ethpandaops/ethereum-package/ [homepage]: get-started.md diff --git a/docs/docs/guides/how-to-full-mev-with-eth2-package.md b/docs/docs/guides/how-to-full-mev-with-eth2-package.md index 2f19bdf061..33e0bd6951 100644 --- a/docs/docs/guides/how-to-full-mev-with-eth2-package.md +++ b/docs/docs/guides/how-to-full-mev-with-eth2-package.md @@ -8,29 +8,29 @@ sidebar_position: 12 :::tip Here are some quick short-cuts for folks who would prefer: -* To get going right away: install Kurtosis & Docker and then run: `kurtosis run github.com/kurtosis-tech/ethereum-package '{"mev_type": "full"}'` -* To dive into the code example: visit the repository [here](https://github.com/kurtosis-tech/ethereum-package). -* Not to run this package on their local machine: try it out on the [Kurtosis playground](https://gitpod.io/?autoStart=true&editor=code#https://github.com/kurtosis-tech/ethereum-package) +* To get going right away: install Kurtosis & Docker and then run: `kurtosis run github.com/ethpandaops/ethereum-package '{"mev_type": "full"}'` +* To dive into the code example: visit the repository [here](https://github.com/ethpandaops/ethereum-package). +* Not to run this package on their local machine: try it out on the [Kurtosis playground](https://gitpod.io/?autoStart=true&editor=code#https://github.com/ethpandaops/ethereum-package) ::: -We're elated to share that the [`ethereum-package`](https://github.com/kurtosis-tech/ethereum-package) now supports the Flashbot's implementation of [Proposer-Builder Separation (PBS)](https://ethereum.org/en/roadmap/pbs/) using [MEV-Boost](https://boost.flashbots.net) protocol. +We're elated to share that the [`ethereum-package`](https://github.com/ethpandaops/ethereum-package) now supports the Flashbot's implementation of [Proposer-Builder Separation (PBS)](https://ethereum.org/en/roadmap/pbs/) using [MEV-Boost](https://boost.flashbots.net) protocol. This milestone marks a huge step forward in the journey towards a full, in-protocol PBS implementation for Proof-of-Stake Ethereum as developers across the ecosystem now have a way to instantiate fully functioning testnets to validate functionality, behvaior, and scales across all client combinations with a Builder API implementation (Flashbots', in this case). Keep reading to learn [how it all works](#brief-overview-of-the-architecture) & [how to get started with the `ethereum-package`](#quickstart). #### Why `ethereum-package`? -As a reminder, the [`ethereum-package`](https://github.com/kurtosis-tech/ethereum-package) is a reproducible and portable environment definition that should be used to bootstrap & deploy private testnets. The package will function the exact same way locally or in the cloud over Docker or Kubernetes, supports all major Execution Layer (EL) and Consensus Layer (CL) client implementations, and can be scaled to whatever size your team needs - limited only by your underlying hardware/backend. +As a reminder, the [`ethereum-package`](https://github.com/ethpandaops/ethereum-package) is a reproducible and portable environment definition that should be used to bootstrap & deploy private testnets. The package will function the exact same way locally or in the cloud over Docker or Kubernetes, supports all major Execution Layer (EL) and Consensus Layer (CL) client implementations, and can be scaled to whatever size your team needs - limited only by your underlying hardware/backend. #### What if I only want the MEV parts? And if that wasn't enough, Kurtosis environment definitions (known as [Packages](https://docs.kurtosis.com/advanced-concepts/packages/)) are entirely composable, meaning you can define and build-your-own private testnet using only the parts you need and with the option of adding your own services (e.g. MEV searcher tools). Feel free to check out the following [code example](https://github.com/kurtosis-tech/2-el-cl-mev-package/blob/main/main.star). ## Brief overview of the architecture -Explicitly, the [`ethereum-package`](https://github.com/kurtosis-tech/ethereum-package) supports two modes: `full-mev` and `mock-mev`. +Explicitly, the [`ethereum-package`](https://github.com/ethpandaops/ethereum-package) supports two modes: `full-mev` and `mock-mev`. The former mode is valuable for validating behavior between the protocol and out-of-protocol middle-ware infrastructure (e.g. searchers, relayer) and instantiates [`mev-boost`](https://github.com/flashbots/mev-boost), [`mev-relay`](https://github.com/flashbots/mev-boost-relay), [`mev-flood`](https://github.com/flashbots/mev-flood) and Flashbot's Geth-based block builder called [`mev-builder`](https://github.com/flashbots/builder). The latter mode will only spin up [`mev-boost`](https://github.com/flashbots/mev-boost) and a [`mock-builder`](https://github.com/marioevz/mock-builder), which is useful for testing in-protocol behavior like testing if clients are able to call the relayer for a payload via `mev-boost`, reject invalid payloads, or trigger the [circuit breaker](https://hackmd.io/@ralexstokes/BJn9N6Thc) to ensure functionality of the beacon chain. -The `ethereum-package` with MEV emulation are already in use by client teams to help uncover bugs (examples [here](https://github.com/prysmaticlabs/prysm/pull/12736) and [here](https://github.com/NethermindEth/nethermind/commit/4d805769159dc0717aa1ba38cc3ebc53f9a375cf)). +The `ethereum-package` with MEV emulation are already in use by client teams to help uncover bugs (examples [here](https://github.com/prysmaticlabs/prysm/pull/12736) and [here](https://github.com/NethermindEth/nethermind/commit/4d805769159dc0717aa1ba38cc3ebc53f9a375cf)). Everything you see below in the architecture diagram gets configured, initialized, and bootstrapped together by Kurtosis. @@ -45,11 +45,11 @@ Everything you see below in the architecture diagram gets configured, initialize :::note Quick aside on what `mev-flood` does: -Once the network is online, `mev-flood` will deploy UniV2 smart contracts, provision liquidity on UniV2 pairs, & begin to send a constant stream of UniV2 swap transactions to the network's public mempool. Depending on the mode you're running, either the `mock-builder` or Flashbot's `mev-builder`, the transactions will be bundled into payloads for downstream use by the relayer or by validators themselves. It is important to note that `mev-flood` will only be initialized with the `full-mev` set up and will send transactions with a non-zero block value. Read more about [`mev-flood` here](https://github.com/flashbots/mev-flood). +Once the network is online, `mev-flood` will deploy UniV2 smart contracts, provision liquidity on UniV2 pairs, & begin to send a constant stream of UniV2 swap transactions to the network's public mempool. Depending on the mode you're running, either the `mock-builder` or Flashbot's `mev-builder`, the transactions will be bundled into payloads for downstream use by the relayer or by validators themselves. It is important to note that `mev-flood` will only be initialized with the `full-mev` set up and will send transactions with a non-zero block value. Read more about [`mev-flood` here](https://github.com/flashbots/mev-flood). ::: ## Quickstart -Leveraging the [`ethereum-package`](https://github.com/kurtosis-tech/ethereum-package) is simple. In this short quickstart, you will: +Leveraging the [`ethereum-package`](https://github.com/ethpandaops/ethereum-package) is simple. In this short quickstart, you will: 1. Install Docker & Kurtosis locally. 2. Configure your network using a `.yaml` file. 3. Run a single command to launch your network with `full MEV`. @@ -92,7 +92,7 @@ You will use the above file by passing it in at runtime, effectively enabling yo #### Launch the network with `full MEV` Great! You're now ready to bring up your own network. Simply run: ```bash -kurtosis run --enclave eth-network github.com/kurtosis-tech/ethereum-package "$(cat ~/ethereum-package-params.yaml)" +kurtosis run --enclave eth-network github.com/ethpandaops/ethereum-package "$(cat ~/ethereum-package-params.yaml)" ``` Kurtosis will then begin to spin up your private Ethereum testnet with `full MEV`. You will see a stream of text get printed in your terminal as Kurtosis begins to generate genesis files, configure the Ethereum nodes, launch a Grafana and Prometheus instance, and bootstrap the network together with the full suite of MEV products from Flashbots. In ~2 minutes, you should see the following output at the end: ```bash @@ -179,14 +179,14 @@ Next, you'll see a section dedicated to [Files Artifacts](https://docs.kurtosis. Lastly, there is a section called `User Services` which display the number of services (running in Docker containers) that make up your network. You will notice that there are 2 Ethereum nodes, each with a `MEV-Boost` instance spun up & connected to it. In addition to this, you will see the rest of the Flashbots MEV infrastructure including the `mev-relay` suite of services (read more about the `mev-relay` services [here](https://github.com/flashbots/mev-boost-relay/blob/main/ARCHITECTURE.md)) and `mev-flood`. By default, the `ethereum-package` also comes with supporting services which include a fork monitor, redis, postgres, grafana, prometheus, a transaction spammer, a testnet-verifier, and the services used to generate genesis data. Both of the Redis and Postgres instances are required for `mev-relay` to function properly. Each of these services are running in Docker containers inside your local enclave & Kurtosis has automatically mapped each container port to your machine's ephemeral ports for seamless interaction with the services running in your enclave. -#### Visit the website to see registered validators and delivered payloads +#### Visit the website to see registered validators and delivered payloads Now that your network is online, you can visit the relay website using the local port mapped to that endpoint. For this example, it will be `127.0.0.1:62930`, but it will be different for you. ![flashbots-website](/img/guides/full-mev-flashbots-website.png) The screenshot above is what the website looks like after the 4th epoch. You can see that all 128 validators (2 nodes, each with 64 validators) are registered. The table below will display recently delivered and verified payloads from `mev-relay` to the `mev-boost` sidecar on each node. -And there you have it! You've now spun up a private Ethereum testnet over Docker with the Flashbot's implementation of PBS! +And there you have it! You've now spun up a private Ethereum testnet over Docker with the Flashbot's implementation of PBS! ## Roadmap The inclusion of a Proposer Builder Separation (PBS) implemention was in support of the Ethereum Foundation's efforts to validate functionality and behavior in end-to-end testing (between in-protocol and out-of-protocol infrastructure), as well as the functionality of the beacon chain for in-protocol code paths (e.g. can clients: call for payloads reject invalid payloads, and trigger the circuit breaker when necessary). @@ -205,7 +205,7 @@ The `ethereum-package` is available for anyone to use, will work the same way on You saw first-hand how packages, effectively environment definitions, are written once and then can be used by anyone in a very trivial way to reproduce the environment. This accelerates developer velocity by enabling engineers to spend less time on configuring and setting up development and testing frameworks, and more time instead on building the unique features and capabilities for their projects. -Additionally, we hope you also enjoyed the parameterizability aspect of Kurtosis Packages. By changing the `ethereum-package-params.yaml`, you can get a fine-tune your testnet however you see fit. +Additionally, we hope you also enjoyed the parameterizability aspect of Kurtosis Packages. By changing the `ethereum-package-params.yaml`, you can get a fine-tune your testnet however you see fit. We hope this guide was helpful and we'd love to hear from you. Please don't hesitate to share with us what went well, and what didn't, using [`kurtosis feedback`](../cli-reference/feedback.md) from the CLI to file an issue in our [Github](https://github.com/kurtosis-tech/eth-kurtosis/issues) or post your question in our [Github Discussions](https://github.com/kurtosis-tech/kurtosis/discussions). diff --git a/docs/docs/guides/how-to-local-eth-testnet.md b/docs/docs/guides/how-to-local-eth-testnet.md index e13646c0c3..89e3626f6d 100644 --- a/docs/docs/guides/how-to-local-eth-testnet.md +++ b/docs/docs/guides/how-to-local-eth-testnet.md @@ -11,7 +11,7 @@ sidebar_position: 10 This guide walks you through the process of instantiating a configurable local Ethereum testnet, deploying a smart contract to it, and using the testnet to run tests against your dApp. This guide is designed for dApp developers who want to develop and test their dApps locally against different network configurations before deploying to a live testnet or the mainnet. In this guide, you will: -* Instantiate a local Ethereum testnet with the [`ethereum-package`](https://github.com/kurtosis-tech/ethereum-package) using [Kurtosis](https://github.com/kurtosis-tech/kurtosis), +* Instantiate a local Ethereum testnet with the [`ethereum-package`](https://github.com/ethpandaops/ethereum-package) using [Kurtosis](https://github.com/kurtosis-tech/kurtosis), * Connect your Hardhat dApp development environment to the local testnet to compile, deploy, and test a dApp, and * Configure the local testnet, including parameters like number of nodes and specific EL/CL client pairings, to enable development and testing workflows against various network configurations. @@ -32,13 +32,13 @@ Before you proceed, make sure you have: To spin up a local Ethereum testnet, run: ```bash -kurtosis --enclave local-eth-testnet run github.com/kurtosis-tech/ethereum-package +kurtosis --enclave local-eth-testnet run github.com/ethpandaops/ethereum-package ``` :::info This command names your network: "local-eth-testnet” using the `--enclave` flag. ::: -Kurtosis will print the steps its taking under the hood as it works to interpret, validate, and then execute the instructions. At the end, you should see an output that resembles the following: +Kurtosis will print the steps its taking under the hood as it works to interpret, validate, and then execute the instructions. At the end, you should see an output that resembles the following: ```bash INFO[2023-04-04T18:09:44-04:00] ====================================================== INFO[2023-04-04T18:09:44-04:00] || Created enclave: local-eth-testnet || @@ -81,7 +81,7 @@ Congratulations! You used Kurtosis to instantiate a local Ethereum testnet, with ### Review -In this section, you executed a command that directed Kurtosis to use the [`ethereum-package` hosted remotely on GitHub](https://github.com/kurtosis-tech/ethereum-package) to spin up a local Ethereum testnet within a Kurtosis [Enclave](https://docs.kurtosis.com/advanced-concepts/enclaves/). Inside your enclave, you will find both "file artifacts" and "user services". +In this section, you executed a command that directed Kurtosis to use the [`ethereum-package` hosted remotely on GitHub](https://github.com/ethpandaops/ethereum-package) to spin up a local Ethereum testnet within a Kurtosis [Enclave](https://docs.kurtosis.com/advanced-concepts/enclaves/). Inside your enclave, you will find both "file artifacts" and "user services". The [File Artifacts](https://docs.kurtosis.com/advanced-concepts/files-artifacts/) in your enclave include all the data generated and utilized to bootstrap the EL and CL clients. The data was created using the `prelaunch-data-generator` service built from this [Docker image](https://github.com/ethpandaops/ethereum-genesis-generator) @@ -114,7 +114,7 @@ localnet: { url: 'http://127.0.0.1:<$YOUR_PORT>',// TODO: REPLACE $YOUR_PORT WITH THE PORT OF A NODE URI PRODUCED BY THE ETH NETWORK KURTOSIS PACKAGE // These are private keys associated with prefunded test accounts created by the ethereum-package -// +// accounts: [ "ef5177cd0b6b21c87db5a0bf35d4084a8a57a9d6a064f86d51ac85f2b873a4e2", "48fcc39ae27a0e8bf0274021ae6ebd8fe4a0e12623d61464c498900b28feb567", @@ -139,7 +139,7 @@ The output should look something like this: 0x1F6298457C5d76270325B724Da5d1953923a6B88 has balance 10000000000000000000000000 ``` -This confirms that Hardhat is using your local testnet and detects the pre-funded accounts created by the `ethereum-package`. +This confirms that Hardhat is using your local testnet and detects the pre-funded accounts created by the `ethereum-package`. ### Deploy and test your dApp locally With the dApp development environment fully connected to the local Ethereum testnet, you can now run development and testing workflows against your dApp using the local testnet. @@ -245,7 +245,7 @@ The `network_params` struct configures the network settings that are used to cre Save your edited params file in any directory you wish (in the example below, it is saved to the desktop) and then use it to run your Kurtosis package by running: ```bash -kurtosis clean -a && kurtosis run --enclave local-eth-testnet github.com/kurtosis-tech/ethereum-package --args-file ~/eth-network-params.yaml +kurtosis clean -a && kurtosis run --enclave local-eth-testnet github.com/ethpandaops/ethereum-package --args-file ~/eth-network-params.yaml ``` :::TIP Note that the `kurtosis clean -a` command is used here to instruct Kurtosis to destroy the old testnet and its contents before starting a new one up. diff --git a/internal_testsuites/starlark/ci_tests/simple_arg_test/main.star b/internal_testsuites/starlark/ci_tests/simple_arg_test/main.star index 0aad9238d0..324cc454df 100644 --- a/internal_testsuites/starlark/ci_tests/simple_arg_test/main.star +++ b/internal_testsuites/starlark/ci_tests/simple_arg_test/main.star @@ -1,3 +1,3 @@ def run(plan, args): - plan.verify(args["name"], "==", "John Doe") - plan.print(args["name"]) \ No newline at end of file + plan.verify(args["name"], "==", "John Doe") + plan.print(args["name"]) diff --git a/internal_testsuites/starlark/ci_tests/simple_no_arg_test/startosis_simple_script.star b/internal_testsuites/starlark/ci_tests/simple_no_arg_test/startosis_simple_script.star index f68f50421a..e839bc840c 100644 --- a/internal_testsuites/starlark/ci_tests/simple_no_arg_test/startosis_simple_script.star +++ b/internal_testsuites/starlark/ci_tests/simple_no_arg_test/startosis_simple_script.star @@ -4,16 +4,19 @@ DATASTORE_PORT_ID = "grpc" DATASTORE_PORT_NUMBER = 1323 DATASTORE_PORT_PROTOCOL = "TCP" + def run(plan, args): plan.verify(str(args), "==", "{}") plan.print("Adding service " + DATASTORE_SERVICE_NAME + ".") config = ServiceConfig( - image = DATASTORE_IMAGE, - ports = { - DATASTORE_PORT_ID: PortSpec(number = DATASTORE_PORT_NUMBER, transport_protocol = DATASTORE_PORT_PROTOCOL) - } + image=DATASTORE_IMAGE, + ports={ + DATASTORE_PORT_ID: PortSpec( + number=DATASTORE_PORT_NUMBER, transport_protocol=DATASTORE_PORT_PROTOCOL + ) + }, ) - plan.add_service(name = DATASTORE_SERVICE_NAME, config = config) + plan.add_service(name=DATASTORE_SERVICE_NAME, config=config) plan.print("Service " + DATASTORE_SERVICE_NAME + " deployed successfully.") diff --git a/internal_testsuites/starlark/image-build-package/main.star b/internal_testsuites/starlark/image-build-package/main.star index bfd01a0167..6551143295 100644 --- a/internal_testsuites/starlark/image-build-package/main.star +++ b/internal_testsuites/starlark/image-build-package/main.star @@ -7,9 +7,9 @@ def run(plan, args): build_context_dir="./", build_args={ "BUILD_ARG": "VALUE", - } + }, ), - ) + ), ) plan.add_service( @@ -20,5 +20,5 @@ def run(plan, args): build_context_dir="./test", build_file="test.Dockerfile", ) - ) + ), ) diff --git a/internal_testsuites/starlark/local-absolute-locators/block-package-local-absolute-locator/main.star b/internal_testsuites/starlark/local-absolute-locators/block-package-local-absolute-locator/main.star index de57dcc7b5..9d9ac4b33c 100644 --- a/internal_testsuites/starlark/local-absolute-locators/block-package-local-absolute-locator/main.star +++ b/internal_testsuites/starlark/local-absolute-locators/block-package-local-absolute-locator/main.star @@ -1,5 +1,8 @@ # This import should fail because we're importing a file within the package -file = import_module("github.com/kurtosis-tech/block-package-local-absolute-locator/file.star") +file = import_module( + "github.com/kurtosis-tech/block-package-local-absolute-locator/file.star" +) + def run(plan): pass diff --git a/internal_testsuites/starlark/local-absolute-locators/locator-in-child-package-points-to-parent-package/child-package/file.star b/internal_testsuites/starlark/local-absolute-locators/locator-in-child-package-points-to-parent-package/child-package/file.star index 08b3c92b5f..5ceccab78d 100644 --- a/internal_testsuites/starlark/local-absolute-locators/locator-in-child-package-points-to-parent-package/child-package/file.star +++ b/internal_testsuites/starlark/local-absolute-locators/locator-in-child-package-points-to-parent-package/child-package/file.star @@ -1,5 +1,8 @@ # This import should be allowed because it's loaded in the child package -file_in_parent = import_module("github.com/kurtosis-tech/parent-package/file-in-parent.star") +file_in_parent = import_module( + "github.com/kurtosis-tech/parent-package/file-in-parent.star" +) + def run(plan): plan.print(file_in_parent.FOO) diff --git a/internal_testsuites/starlark/local-absolute-locators/locator-in-child-package-points-to-parent-package/parent-package/main.star b/internal_testsuites/starlark/local-absolute-locators/locator-in-child-package-points-to-parent-package/parent-package/main.star index ffb8220df9..e1c5245d9b 100644 --- a/internal_testsuites/starlark/local-absolute-locators/locator-in-child-package-points-to-parent-package/parent-package/main.star +++ b/internal_testsuites/starlark/local-absolute-locators/locator-in-child-package-points-to-parent-package/parent-package/main.star @@ -1,6 +1,7 @@ # This import should not fail because we're importing a file from another package file = import_module("github.com/kurtosis-tech/child-package/file.star") + def run(plan): file.run(plan) pass diff --git a/internal_testsuites/starlark/local-absolute-locators/subpackages-in-same-repository/package1/main.star b/internal_testsuites/starlark/local-absolute-locators/subpackages-in-same-repository/package1/main.star index 8ffbb610a3..127d2fabfb 100644 --- a/internal_testsuites/starlark/local-absolute-locators/subpackages-in-same-repository/package1/main.star +++ b/internal_testsuites/starlark/local-absolute-locators/subpackages-in-same-repository/package1/main.star @@ -1,5 +1,8 @@ # This import should not fail because we're importing a file from another package on same repository -file = import_module("github.com/kurtosis-tech/subpackages-in-same-repository/package2/file.star") +file = import_module( + "github.com/kurtosis-tech/subpackages-in-same-repository/package2/file.star" +) + def run(plan): file.run(plan) diff --git a/internal_testsuites/starlark/local-absolute-locators/subpackages-in-same-repository/package2/file.star b/internal_testsuites/starlark/local-absolute-locators/subpackages-in-same-repository/package2/file.star index cc23ed4a98..4babaedaac 100644 --- a/internal_testsuites/starlark/local-absolute-locators/subpackages-in-same-repository/package2/file.star +++ b/internal_testsuites/starlark/local-absolute-locators/subpackages-in-same-repository/package2/file.star @@ -1,4 +1,5 @@ FOO = "bar" + def run(plan): plan.print(FOO) diff --git a/internal_testsuites/starlark/packages-with-replace/local-sample-dependency-package/main.star b/internal_testsuites/starlark/packages-with-replace/local-sample-dependency-package/main.star index 76590dbc1f..3a5ba50bf0 100644 --- a/internal_testsuites/starlark/packages-with-replace/local-sample-dependency-package/main.star +++ b/internal_testsuites/starlark/packages-with-replace/local-sample-dependency-package/main.star @@ -1,5 +1,6 @@ MSG = "msg-loaded-from-local-dependency" + def run(plan, args): plan.print("Local sample dependency package loaded.") @@ -7,5 +8,6 @@ def run(plan, args): return msg_to_return + def get_msg(): return MSG diff --git a/internal_testsuites/starlark/packages-with-replace/regular-replace/main.star b/internal_testsuites/starlark/packages-with-replace/regular-replace/main.star index a8766934b9..b84c350d70 100644 --- a/internal_testsuites/starlark/packages-with-replace/regular-replace/main.star +++ b/internal_testsuites/starlark/packages-with-replace/regular-replace/main.star @@ -1,4 +1,6 @@ -dependency = import_module("github.com/kurtosis-tech/sample-dependency-package/main.star") +dependency = import_module( + "github.com/kurtosis-tech/sample-dependency-package/main.star" +) EXPECTED_MSG_FROM_MAIN = "dependency-loaded-from-main" EXPECTED_MSG_FROM_ANOTHER_SAMPLE_MAIN = "another-dependency-loaded-from-main" @@ -6,6 +8,7 @@ EXPECTED_MSG_FROM_ANOTHER_SAMPLE_MAIN = "another-dependency-loaded-from-main" MSG_ORIGIN_MAIN = "main" MSG_ORIGIN_ANOTHER_SAMPLE_MAIN = "another-main" + def run(plan, message_origin=MSG_ORIGIN_MAIN): plan.print("Regular replace package loaded.") @@ -19,9 +22,9 @@ def run(plan, message_origin=MSG_ORIGIN_MAIN): expected_msg = "" plan.verify( - value = expected_msg, - assertion = "==", - target_value = msg_from_dependency, + value=expected_msg, + assertion="==", + target_value=msg_from_dependency, ) return diff --git a/internal_testsuites/starlark/packages-with-replace/replace-with-local/main.star b/internal_testsuites/starlark/packages-with-replace/replace-with-local/main.star index 481d4a1675..66bf2dd476 100644 --- a/internal_testsuites/starlark/packages-with-replace/replace-with-local/main.star +++ b/internal_testsuites/starlark/packages-with-replace/replace-with-local/main.star @@ -1,4 +1,6 @@ -dependency = import_module("github.com/kurtosis-tech/sample-dependency-package/main.star") +dependency = import_module( + "github.com/kurtosis-tech/sample-dependency-package/main.star" +) EXPECTED_MSG_FROM_MAIN = "dependency-loaded-from-main" EXPECTED_MSG_FROM_LOCAL_PACKAGE_MAIN = "msg-loaded-from-local-dependency" @@ -6,6 +8,7 @@ EXPECTED_MSG_FROM_LOCAL_PACKAGE_MAIN = "msg-loaded-from-local-dependency" MSG_ORIGIN_MAIN = "main" MSG_ORIGIN_LOCAL_DEPENDENCY = "local" + def run(plan, message_origin=MSG_ORIGIN_MAIN): plan.print("Replace with local package loaded.") @@ -19,9 +22,9 @@ def run(plan, message_origin=MSG_ORIGIN_MAIN): expected_msg = "" plan.verify( - value = expected_msg, - assertion = "==", - target_value = msg_from_dependency, + value=expected_msg, + assertion="==", + target_value=msg_from_dependency, ) return diff --git a/internal_testsuites/starlark/packages-with-replace/replace-with-module-in-directory/main.star b/internal_testsuites/starlark/packages-with-replace/replace-with-module-in-directory/main.star index c2a97c59d1..8db6c8c8ed 100644 --- a/internal_testsuites/starlark/packages-with-replace/replace-with-module-in-directory/main.star +++ b/internal_testsuites/starlark/packages-with-replace/replace-with-module-in-directory/main.star @@ -1,11 +1,18 @@ -internal_dependency = import_module("github.com/kurtosis-tech/sample-dependency-package/directory/internal-module.star") +internal_dependency = import_module( + "github.com/kurtosis-tech/sample-dependency-package/directory/internal-module.star" +) -EXPECTED_MSG_FROM_INTERNAL_MODULE_MAIN = "dependency-loaded-from-internal-module-in-main-branch" -EXPECTED_MSG_FROM_ANOTHER_PACKAGE_INTERNAL_MODULE_MAIN = "another-dependency-loaded-from-internal-module-in-main-branch" +EXPECTED_MSG_FROM_INTERNAL_MODULE_MAIN = ( + "dependency-loaded-from-internal-module-in-main-branch" +) +EXPECTED_MSG_FROM_ANOTHER_PACKAGE_INTERNAL_MODULE_MAIN = ( + "another-dependency-loaded-from-internal-module-in-main-branch" +) MSG_ORIGIN_FROM_SAMPLE = "sample" MSG_ORIGIN_FROM_ANOTHER_SAMPLE = "another-sample" + def run(plan, message_origin=MSG_ORIGIN_FROM_SAMPLE): plan.print("Replace with module in directory sample package loaded.") @@ -19,9 +26,9 @@ def run(plan, message_origin=MSG_ORIGIN_FROM_SAMPLE): expected_msg = "" plan.verify( - value = expected_msg, - assertion = "==", - target_value = msg_from_dependency, + value=expected_msg, + assertion="==", + target_value=msg_from_dependency, ) return diff --git a/internal_testsuites/starlark/packages-with-replace/replace-with-no-main-branch/main.star b/internal_testsuites/starlark/packages-with-replace/replace-with-no-main-branch/main.star index 11d6f76042..2355a103b8 100644 --- a/internal_testsuites/starlark/packages-with-replace/replace-with-no-main-branch/main.star +++ b/internal_testsuites/starlark/packages-with-replace/replace-with-no-main-branch/main.star @@ -1,4 +1,6 @@ -dependency = import_module("github.com/kurtosis-tech/sample-dependency-package/main.star") +dependency = import_module( + "github.com/kurtosis-tech/sample-dependency-package/main.star" +) EXPECTED_MSG_FROM_MAIN = "dependency-loaded-from-main" EXPECTED_MSG_FROM_BRANCH = "dependency-loaded-from-test-branch" @@ -6,6 +8,7 @@ EXPECTED_MSG_FROM_BRANCH = "dependency-loaded-from-test-branch" MSG_ORIGIN_MAIN = "main" MSG_ORIGIN_BRANCH = "branch" + def run(plan, message_origin=MSG_ORIGIN_MAIN): plan.print("Replace with no main branch package loaded.") @@ -19,9 +22,9 @@ def run(plan, message_origin=MSG_ORIGIN_MAIN): expected_msg = "" plan.verify( - value = expected_msg, - assertion = "==", - target_value = msg_from_dependency, + value=expected_msg, + assertion="==", + target_value=msg_from_dependency, ) return diff --git a/internal_testsuites/starlark/packages-with-replace/without-replace/main.star b/internal_testsuites/starlark/packages-with-replace/without-replace/main.star index e9a1fd8bde..2f30f0a65d 100644 --- a/internal_testsuites/starlark/packages-with-replace/without-replace/main.star +++ b/internal_testsuites/starlark/packages-with-replace/without-replace/main.star @@ -1,9 +1,12 @@ -dependency = import_module("github.com/kurtosis-tech/sample-dependency-package/main.star") +dependency = import_module( + "github.com/kurtosis-tech/sample-dependency-package/main.star" +) EXPECTED_MSG_FROM_MAIN = "dependency-loaded-from-main" MSG_ORIGIN_MAIN = "main" + def run(plan, message_origin=MSG_ORIGIN_MAIN): plan.print("Without replace package loaded.") @@ -15,9 +18,9 @@ def run(plan, message_origin=MSG_ORIGIN_MAIN): expected_msg = "" plan.verify( - value = expected_msg, - assertion = "==", - target_value = msg_from_dependency, + value=expected_msg, + assertion="==", + target_value=msg_from_dependency, ) return diff --git a/internal_testsuites/starlark/service-directory/multiple-artifacts-directory/main.star b/internal_testsuites/starlark/service-directory/multiple-artifacts-directory/main.star index 0a9c4ea475..5086e88e89 100644 --- a/internal_testsuites/starlark/service-directory/multiple-artifacts-directory/main.star +++ b/internal_testsuites/starlark/service-directory/multiple-artifacts-directory/main.star @@ -1,5 +1,6 @@ SERVICE_NAME = "service-example" + def run(plan, args={}): artifact_name_1 = plan.upload_files("./folder-1/file-1.txt") artifact_name_2 = plan.upload_files("./folder-2/file-2.txt") @@ -10,27 +11,29 @@ def run(plan, args={}): image="alpine:latest", cmd=["/bin/sh", "-c", "sleep 999"], files={ - "/files": Directory( - artifact_names=[artifact_name_1,artifact_name_2] - ) + "/files": Directory(artifact_names=[artifact_name_1, artifact_name_2]) }, ), ) plan.exec( service_name=SERVICE_NAME, - recipe=ExecRecipe([ - "/bin/sh", - "-c", - "cat /files/file-1.txt", - ]) + recipe=ExecRecipe( + [ + "/bin/sh", + "-c", + "cat /files/file-1.txt", + ] + ), ) plan.exec( service_name=SERVICE_NAME, - recipe=ExecRecipe([ - "/bin/sh", - "-c", - "cat /files/file-2.txt", - ]) + recipe=ExecRecipe( + [ + "/bin/sh", + "-c", + "cat /files/file-2.txt", + ] + ), ) diff --git a/internal_testsuites/starlark/upload-file/upload-file-generic-package/main.star b/internal_testsuites/starlark/upload-file/upload-file-generic-package/main.star index 03550f1520..b86dfa427d 100644 --- a/internal_testsuites/starlark/upload-file/upload-file-generic-package/main.star +++ b/internal_testsuites/starlark/upload-file/upload-file-generic-package/main.star @@ -1,5 +1,6 @@ SERVICE_NAME = "service-example" + def run(plan, args={}): url = "github.com/kurtosis-tech/minimal-grpc-server/golang/scripts/build.sh" artifact_name_1 = plan.upload_files(url) @@ -8,14 +9,7 @@ def run(plan, args={}): SERVICE_NAME, config=ServiceConfig( image="alpine:latest", - cmd=["/bin/sh", - "-c","ls /files && sleep 9999"], - files={ - "/files": Directory( - artifact_names=[artifact_name_1] - ) - }, + cmd=["/bin/sh", "-c", "ls /files && sleep 9999"], + files={"/files": Directory(artifact_names=[artifact_name_1])}, ), ) - - diff --git a/internal_testsuites/starlark/upload-file/upload-file-package/main.star b/internal_testsuites/starlark/upload-file/upload-file-package/main.star index 80536d3484..eff37df884 100644 --- a/internal_testsuites/starlark/upload-file/upload-file-package/main.star +++ b/internal_testsuites/starlark/upload-file/upload-file-package/main.star @@ -1,4 +1,3 @@ - # The test using this package will generate a 90MB file and place it at the root of this package # named large-file.bin. This file is generated on the spot to avoid checking it into GitHub def run(plan, args): @@ -11,16 +10,14 @@ def run(plan, args): name="dummy", config=ServiceConfig( image="docker/getting-started", - files={ - "/home/file/": large_file_artifact_id - } - ) + files={"/home/file/": large_file_artifact_id}, + ), ) result = plan.exec( service_name="dummy", recipe=ExecRecipe( command=["sh", "-c", "md5sum /home/file/large-file.bin | awk '{print $1}'"] - ) + ), ) expected_file_hash = args["file_hash"]