-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Artifacts and how to get them #5585
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
base: main
Are you sure you want to change the base?
Artifacts and how to get them #5585
Conversation
7682ec8 to
24326d6
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5585 +/- ##
==========================================
- Coverage 83.23% 83.23% -0.01%
==========================================
Files 277 277
Lines 29262 29262
==========================================
- Hits 24357 24356 -1
- Misses 4905 4906 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
1de4267 to
59fb38f
Compare
| ensure_ci_artifacts() { | ||
| if ! command -v aws >/dev/null; then | ||
| die "AWS CLI not installed, which is required for downloading artifacts for integration tests." | ||
| local artifacts=$1 |
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.
nit: please use singular and plural consistently. Also, it's not clear whether this is an S3 key, a URI, or something else
075b628 to
2b3c8b9
Compare
89f232b to
ccd1bd1
Compare
tools/ab_test.py
Outdated
| run_parser.add_argument( | ||
| "--artifacts-a", | ||
| help="Name of the artifacts directory in the build/artifacts to use for revision A test. If the directory does not exist, the name will be treated as S3 path and artifacts will be downloaded from there.", | ||
| # Type is string since it can be an s3 paht which if passed to `Path` constructor |
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.
Nit typo
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.
fixed
|
|
||
| ensure_ci_artifacts() { | ||
| if ! command -v aws >/dev/null; then | ||
| die "AWS CLI not installed, which is required for downloading artifacts for integration 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.
Did we mean to drop this? Seems like it still would be useful
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 think ok_or_die "Failed to download artifacts using awscli!" line serves same function here.
| cmd_set_current_artifacts() { | ||
| local artifacts=$1 | ||
| if [ -z $artifacts ]; then | ||
| say "No artifacts were specified" |
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.
Should the function bail out here?
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.
fixed
|
Side note it would be nice if we could fetch the artifacts inside docker, so we wouldn't need AWS cli on the host |
| them to the common s3 bucket.*\ | ||
| `A4:` Add your custom images to the `build/img` subdirectory in the Firecracker | ||
| source tree. This directory is bind-mounted in the container and used as a local | ||
| image cache. |
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.
Could we get a new section to show how to test with different artifacts
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.
added
49138bf to
eb6bbc3
Compare
Manciukic
left a comment
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.
Just a few more bits for small fixes and clarity.
| SUPPORTED_HOST_KERNELS = ["5.10", "6.1"] | ||
|
|
||
| IMG_DIR = Path(DEFAULT_TEST_SESSION_ROOT_PATH) / "img" | ||
| ARTIFACT_DIR = Path(DEFAULT_TEST_SESSION_ROOT_PATH) / "current_artifacts" |
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.
don't we need to read the current_artifacts file to set the ARTIFACT_DIR correctly?
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.
So this code is supposed to execute in the devctr, where artifacts are copied to /src/current_artifacts. I guess using same name for the directory with actual artifacts in the devctr and for link file outside devctr is confusing. I can change python code to use artifacts_dir for the name if you want.
tests/framework/defs.py
Outdated
| open(Path(LOCAL_BUILD_PATH) / "current_artifacts", "r", encoding="utf-8") | ||
| .read() |
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.
nit: a more compact way is to use read_text('utf-8') directly on the Path object. It also prevents the fd leak we have here.
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.
done
tools/devtool
Outdated
|
|
||
| if [ ! -z $FORCE_ARTIFACT_DOWNLOAD ]; then | ||
| say "Removing " $local_artifacts_path | ||
| rm -r $local_artifacts_path |
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.
should this also be -f (force)?
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.
added
| cp -ruvfL $(cat build/current_artifacts) /srv/current_artifacts | ||
| else | ||
| # The directory must exist for pytest to function | ||
| mkdir -p /srv/current_artifacts |
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.
why are we creating it as a dir if it's otherwise a file ?
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 is a file outside a devctr and a directory inside
| # File with a single line specifing the name of the | ||
| # currently used artifacts | ||
| LOCAL_ARTIFACTS_CURRENT_DIR_FILE="build/current_artifacts" | ||
| LOCAL_CURRENT_ARTIFACTS_LINK_PATH="build/current_artifacts" |
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.
nit: I wouldn't call it a link if it's not actually one
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.
changed
tools/devtool
Outdated
| echo " like 'download_ci_artifacts'. Alternatively it is possible to manually write local " | ||
| echo " path to artifacts directory into $LOCAL_CURRENT_ARTIFACTS_LINK_PATH file" | ||
| echo "" | ||
| echo " ensure_current_artifacts_are_set_up s3_uri/directory name" |
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 current name is inconsistent with the actual command cmd_ensure_current_artifacts_are_set.
Maybe this could have an easier-to-use name, like ensure_artifacts.
Btw, what's the process to update the local artifacts to the latest ones? It seems like it's currently a manual combination of commands. The quickest would be to delete the current_artifacts file and call ensure_artifacts.
Last nit, isn't the parameter optional?
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.
renamed to cmd_ensure_current_artifacts. Yes, updating is just removing either a current_artifacts or deleting whole artifacts dir would work too.
3965541 to
e446012
Compare
The snapshot version check was iterating over last several FC versions pulled from S3, but it was unnecessary since there were no cross FC checks. Remove checks of old FC versions and only test the current version. Also remove fixup state from `setup-ci-artifacts.sh` since it is redundant now. Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
Instead of using fixed artifact path for a current FC version pull newest artifacts from S3. This way we can update them independently while keeping old versions around. Unfortunately there is no simple way to query newest added directory in S3, so do the next best thing of looking through all files in all directories and determining the `newest` directory be the `LastModified` status of files inside. Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
The old setup used `build/img` as the base directory for artifacts pulled from S3. In S3 the artifacts directory contains 1 subdirectory per architecture (x86_64 and aarch64). This was causing final local artifacts path to be `build/img/x86_64` or `build/img/aarch64`. This commit changes the structure a to have a separate `build/artifacts` directory with subdirectories containing different versions of artifacts. The path to currently used artifacts will be placed in `build/current_artifacts` file. This make is easy to switch between multiple versions of artifacts without a need to delete/download them. This also opens a door for A/B testing of artifacts. Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
Downloading artifacts is a separate step that should not mess with currently selected artifacts. Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
Modify `download_ci_artifacts` to accept artifacts paths as input and download by passing these paths to `ensure_ci_artifacts`. `ensure_ci_artifacts` will default to latest s3 artifacts if no args were provided. `--force` still works and only deletes specified artifacts. Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
Add arguments names for binary paths for ab_test.py Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
Update `ab_test.py` with ability to accept custom artifacts for A and B runs. Additionally update `pipeline_perf.py` as well. Now REVISION_A_ARTIFACTS and REVISION_B_ARTIFACTS environment variables specify custom artifacts which will be used in A/B test Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
Some tests like style checks do not require artifacts to be present. Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
There is no reason for style check to download artifacts Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
Add missing descriptions for additional arguments Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
The command is used internally in the `devtool` to make sure there are at lest some current artifacts set up. This behaviour is also required in the popular docker test, so convert it to a callable command. Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
Add `--artifacts` option to `devtool test` to simplify changing between different sets of artifacts. Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
- rename ensure_current_artifacts_are_set_up to ensure_current_artifacts to shorten a name a bit - rename LOCAL_ARTIFACTS_CURRENT_DIR_FILE to LOCAL_CURRENT_ARTIFACTS_FILE to make name more descriptive - Simplify logs regarding artifacts status - remove ` symbols from cmd_help as bash was interpreting them as actual commands to execute - other minor renamings Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
e446012 to
5e9524c
Compare
Changes
devtoolpull latest artifacts from s3Reason
Artifacts are rebuilt periodically now, so update our tools to be able to pull latest ones.
Additionally, while we are at it, add ability to download and switch between multiple
artifacts. This also opened a path for A/B tests of artifacts as well.
License Acceptance
By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license. For more information on following Developer
Certificate of Origin and signing off your commits, please check
CONTRIBUTING.md.PR Checklist
tools/devtool checkbuild --allto verify that the PR passesbuild checks on all supported architectures.
tools/devtool checkstyleto verify that the PR passes theautomated style checks.
how they are solving the problem in a clear and encompassing way.
in the PR.
CHANGELOG.md.Runbook for Firecracker API changes.
integration tests.
TODO.rust-vmm.