-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Update SimNet test to the new format #4051
Conversation
|
@TriplEight we need to keep this brunch after the merge because of https://github.com/paritytech/polkadot/pull/4051/files#diff-037ea159eb0a7cb0ac23b851e66bee30fb838ee8d0d99fa331a1ba65283d37f7R577 |
| VAULT_SERVER_URL: "https://vault.parity-mgmt-vault.parity.io" | ||
| VAULT_AUTH_PATH: "gitlab-parity-io-jwt" | ||
| VAULT_AUTH_ROLE: "cicd_gitlab_parity_${CI_PROJECT_NAME}" | ||
| SIMNET_IMAGE: "europe-west3-docker.pkg.dev/parity-simnet/simnet-images/simnet:v14" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to avoid creating a new PR for updating just simnet version I suggest sticking with the previous plan and using SIMNET_REF var which can be easily edited in the GitLab project's variables.
Currently, it's on v8, so I'm guessing it should be changed in the follow-up PR, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The intention was to create a new PR for each version of simnet.
I would prefer to see a green pipeline when we change the version of simnet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
then let's don't forget to remove those vars form gitlab UI
| --image="PARACHAINSIMAGE=${PARACHAINS_IMAGE_NAME}:${PARACHAINS_IMAGE_TAG}" | ||
| --image="SYNTHIMAGE=${PARACHAINS_IMAGE_NAME}:${PARACHAINS_IMAGE_TAG}" | ||
| --image="COLIMAGE=${COLLATOR_IMAGE_NAME}:${COLLATOR_IMAGE_TAG}" | ||
| --image="SCRIPTSIMAGE=${SIMNET_IMAGE}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This variables renaming is a bit misleading you know. Doesn't explain anything, just adds more complication.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me explain this interaction (CI running simnet tests, using SimNet) in more details. Every tests set (aka test suit) from the point of view of CI is defined by 2 things:
- List of docker images, that are required to run tests from this test suit. Every image has its name, that used inside tests, and the value for the image (path with version), that needs to be provided by CI in launch arguments
- List of tags, that specifies every test case. Here, i think, the example will be more illustrative. Currently there is only one test suit in Polkadot: test suit with parachains test case. This test case has tags [smoketest, all]. This means, that the developer of this test case assumed, that this test would be run with every smoke test. So it's critical enough and not very-very long. CI runs parachains test suit and says to SimNet, that it wants to run all tests with tag "smoketest" from this test suit. These tags is the attempt to formalize different situations, that we have, when we run simnet tests (for every commit, for every PR, nightly, something else).
You can also have a look, how these two things look like in test suit description file: https://github.com/paritytech/polkadot/pull/4051/files#diff-9e9392f954fd30ebfc3ca84586ab4eb8547ae1ed4bf52cca7e3df8006807c9b6R3
We did have all these substances (required images, tags) before. But they were not explicitly formalized. That made the addition of new tests problematic. I hope with this new format to make CI<->SimNet interactions more clear.
It's good, that you raised this question. It would be great, if other people from CI team also have a look at it. This type of infrastructure (automation of tests automation) is pretty new for me. So every feedback is appreciated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can also have a look, how these two things look like in test suit description file: https://github.com/paritytech/polkadot/pull/4051/files#diff-9e9392f954fd30ebfc3ca84586ab4eb8547ae1ed4bf52cca7e3df8006807c9b6R3
This is why I thought it's better to skip renaming the variables and maybe even avoid mentioning them in the script's arguments since they're already mentioned in the test spec.
But I thought you're about to substitute the whole bash script invocation with a CLI binary, right? So if this is close, it's OK to leave a little mess here and come up with the optimizations later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not renaming. Inside image flag we provide key-value pairs for all images, required for the tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is too much of unnecessary stuff to keep in mind while using simnet anyway, this requires a simplification.
If this re-renaming the variables, you can also name it a key-value pair, will not be addressed in the next PR, either removed from flags or configs or named similarly throughout the repo, I'm not OK with accepting this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am a bit confused. Please let us know what you find difficult to understand and a suggestion how to improve it.
We don't pretend that simnet is very simple to use, but on the other hand it's not more difficult then other tools
we use, let's say helm for example.
If we look at how we use helm to add dynamic values to charts, it is very similar with what we are doing:
https://gitlab.parity.io/parity/simnet/-/blob/master/.maintain/k8s-resources/gitlab/install-runner-polkadot-simnet.sh
helm upgrade polkadot-simnet-gitlab-runner gitlab/gitlab-runner \
--install \
--namespace gitlab-simnet-ci \
--values values-polkadot.yaml \
--set runnerRegistrationToken="${GITLAB_RUNNER_GLOBAL_TOKEN}"
If we would need to set another secret for this helm chart, we would have to use the --set flag one more time.
With the new config, we require to run simnet with 3 flags in total, that repeat for different values
--gh-remote-dir = place from where to download config of the tests
--tag = which test case(s)
--image = required image(s) for this test
if you look at the content of the file that describes the network:
https://github.com/paritytech/polkadot/blob/387950f5cddcef94cdc516ade6d2a485fb5ea051/simnet_tests/parachains/configs/simple_rococo_testnet.toml
it looks very similar with a definition of a kubernetes pod file, which requires an image to run.
Those images needs to be dynamic, because they are the images that are being tested.
To specify dynamic content in CI we have 2 options that I can think of:
- Import image name from environment variable (which is what we are doing)
- Edit the network config file with search and replace for the image names before calling simnet
Do you think it would help to replace --image with --env to make more specific that is an environment variable that is being set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Discussed these changes offline with Denis)
|
bot merge |
|
Error: Approval by "Project Owners" is only attempted if other means defined in the criteria for merge are not satisfied first. The following errors might have affected the outcome of this attempt:
Merge failed. Check out the criteria for merge. If you're not meeting the approval count, check if the approvers are members of substrateteamleads or core-devs. |
|
bot merge |
|
Error: Approval by "Project Owners" is only attempted if other means defined in the criteria for merge are not satisfied first. The following errors might have affected the outcome of this attempt:
Merge failed. Check out the criteria for merge. If you're not meeting the approval count, check if the approvers are members of substrateteamleads or core-devs. |
Uh oh!
There was an error while loading. Please reload this page.