-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GitHub actions: restore and load images if specified for test
In case when we want to run test suite against newly build EVE from PR we don't want to store it dockerhub, because it just takes up the space and bandwitdth of dockerhub. This patch introduces option to cache docker images and load them for testing Signed-off-by: Pavel Abramov <[email protected]>
- Loading branch information
1 parent
9611e40
commit f2b1535
Showing
2 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,21 @@ | ||
# Github Actions | ||
|
||
Eden is a part of testing infrastructure of EVE and it's integrated in EVE CI/CD pipelines. EVE uses [test.yml](https://github.com/lf-edge/eden/blob/master/.github/workflows/test.yml) reusable workflow to run eden tests against specific EVE version in PR. | ||
Eden reusable workflows are running using [BuildJet](https://buildjet.com/for-github-actions) runners provided by LF-EDGE. They provide both Arm and x86_64 architectures. | ||
|
||
## About runners | ||
Eden reusable workflow (`test.yml`) is running using [BuildJet](https://buildjet.com/for-github-actions) runners provided by LF-EDGE. They provide both Arm and x86_64 architectures. | ||
Currently we are provided with 4vCPU/16GBs of RAM and 8vCPU/32GBs of RAM runners. Maximum CPUs running in parallel is 64 for x86_64, that means with 4vCPUs we can have 16 jobs running in parallel. | ||
In case one wants to run eden workflows locally in their own fork, `runner` and `repo` input variables for reusable workflow should be specified. | ||
|
||
## Using GitHub Cache to run `test.yml` with custom EVE build | ||
Check failure on line 10 in docs/github-actions.md
|
||
Sometimes you want to run tests in your CI/CD with EVE version, which is not published on Dockerhub, | ||
for instance, when you have pull request to master. Eden [will](https://github.com/lf-edge/eden/blob/ed507793968a2005212d589d6c3d88824783a9a7/pkg/utils/container.go#L175-L178) prefer local image over pulling from Dockerhub. That means if you load image before running tests it will work with local image. For workflow `test.yml` you can use `eve_image_cache_key` parameter | ||
|
||
### Why GitHub Cache and `eve_image_cache_key` parameter? | ||
Check failure on line 14 in docs/github-actions.md
|
||
In order to pass objects between jobs you need to either use cache or artifacts. Artifacts are published and stored for 90 days, cache is not published and GitHub deletes previous entries if total amount of cache is more than 10GBs. Artifacts also rebuild each time. | ||
|
||
Unfortunately, you can't add additional steps before invoking reusable workflow, otherwise we could have just do `docker load` before invoking tests workflow. | ||
|
||
In order to restore cache from test workflow, you need key to restore this cache from and what files exactly you want to restore. There are [wildcards](https://github.com/actions/toolkit/tree/main/packages/glob) to restore all the files from cache, but you will need to access this file afterwards, so that's why `eve_image_cache` parameter is needed. | ||
|
||
**Important note:** Image you store in GitHub Cache should be the same specified in `eve_image`. |