[#193] Enable integration tests in Forgejo Actions #193

Merged
alexvanin merged 3 commits from potyarkin/frostfs-http-gw:feature/integration-in-ci into master 2025-01-23 06:37:02 +00:00
Member

After some changes to our CI runner infra (TrueCloudLab/frostfs-infra#177) we can now launch nested OCI containers in Forgejo Actions. restic CI already makes use of testcontainers. Let's do it here too.

Current implementation gets things done (we did not execute integration tests in CI before) but is suboptimal. There exists a potential to reduce run time from ~5.5 minutes to ~3.5 minutes, but I'm not sure when/if we'll get there.

@alexvanin, what do you think? I suggest either to merge this as is (with 5.5 minute run time) or to tweak job trigger conditions to run this job less often (e.g. on pushes to master only instead of for each PR)

WIP journal
  • Green check mark https://git.frostfs.info/TrueCloudLab/frostfs-http-gw/actions/runs/1551/jobs/3
  • Clone old aio container versions from Docker Hub to git.frostfs.info.
    Our CI runner environment is ephemeral, there is no chance that image cache will ever be reused. I suggest we pull over fast LAN from git.frostfs.info instead of attempting to pile CI caches on top of Docker caches.
  • Switch image tags in integration_test.go to use our selfhosted registry
  • Evaluate other ways to make this job faster.
    Reference points:
    - First green job took ~7 minutes (pulling all images from Docker Hub, no cache)
    - Integration tests on my laptop take ~2.5 minutes (warm image cache: all hits, cold go cache: no hits)
    - CI runner using registry at git.frostfs.info finishes in 5.5 minutes with cold image cache, in 3.5 minutes with warm image cache (logs for both measurements)
After some changes to our CI runner infra (https://git.frostfs.info/TrueCloudLab/frostfs-infra/issues/177) we can now launch nested OCI containers in Forgejo Actions. [restic CI](https://git.frostfs.info/TrueCloudLab/restic/pulls/3) already makes use of testcontainers. Let's do it here too. Current implementation gets things done (we did not execute integration tests in CI before) but is suboptimal. There exists a potential to reduce run time from ~5.5 minutes to ~3.5 minutes, but I'm not sure when/if we'll get there. @alexvanin, what do you think? I suggest either to merge this as is (with [5.5 minute](https://git.frostfs.info/TrueCloudLab/frostfs-http-gw/actions/runs/1576/jobs/3) run time) or to tweak job trigger conditions to run this job less often (e.g. on pushes to master only instead of for each PR) <details><summary>WIP journal</summary> - [x] Green check mark ✅ https://git.frostfs.info/TrueCloudLab/frostfs-http-gw/actions/runs/1551/jobs/3 - [x] Clone old aio container versions from Docker Hub to git.frostfs.info. Our CI runner environment is ephemeral, there is no chance that image cache will ever be reused. I suggest we pull over fast LAN from git.frostfs.info instead of attempting to pile CI caches on top of Docker caches. - [x] Switch image tags in `integration_test.go` to use our selfhosted registry - [x] Evaluate other ways to make this job faster. Reference points: - [First green job](https://git.frostfs.info/TrueCloudLab/frostfs-http-gw/actions/runs/1551/jobs/3) took ~7 minutes (pulling all images from Docker Hub, no cache) - Integration tests on my laptop take ~2.5 minutes (warm image cache: all hits, cold go cache: no hits) - CI runner using registry at git.frostfs.info finishes in 5.5 minutes with cold image cache, in 3.5 minutes with warm image cache ([logs for both measurements](https://git.frostfs.info/TrueCloudLab/frostfs-http-gw/actions/runs/1571/jobs/3)) </details>
potyarkin added 1 commit 2025-01-21 08:10:03 +00:00
[#193] Enable integration tests in Forgejo Actions
Some checks failed
/ DCO (pull_request) Successful in 32s
/ Vulncheck (pull_request) Successful in 46s
/ Builds (pull_request) Successful in 1m11s
/ OCI image (pull_request) Successful in 1m18s
/ Lint (pull_request) Successful in 1m49s
/ Tests (pull_request) Successful in 52s
/ Integration tests (pull_request) Failing after 1m1s
1e82f64dfd
Signed-off-by: Vitaliy Potyarkin <v.potyarkin@yadro.com>
potyarkin added 1 commit 2025-01-21 08:43:33 +00:00
[#193] Update testcontainers to v0.35.0
All checks were successful
/ DCO (pull_request) Successful in 27s
/ Vulncheck (pull_request) Successful in 44s
/ Builds (pull_request) Successful in 1m9s
/ OCI image (pull_request) Successful in 1m27s
/ Lint (pull_request) Successful in 2m18s
/ Tests (pull_request) Successful in 52s
/ Integration tests (pull_request) Successful in 6m52s
856e0ecf40
Signed-off-by: Vitaliy Potyarkin <v.potyarkin@yadro.com>
Author
Member

Saving registry sync script for future reference:

#!/bin/bash
set -xeuo pipefail
for version in "1.2.7" "1.3.0" "1.5.0" "1.6.5"
do
    podman pull "docker.io/truecloudlab/frostfs-aio:$version"
    podman push "docker.io/truecloudlab/frostfs-aio:$version" "git.frostfs.info/truecloudlab/frostfs-aio:$version"
    podman image rm "docker.io/truecloudlab/frostfs-aio:$version"
done
Saving registry sync script for future reference: ```bash #!/bin/bash set -xeuo pipefail for version in "1.2.7" "1.3.0" "1.5.0" "1.6.5" do podman pull "docker.io/truecloudlab/frostfs-aio:$version" podman push "docker.io/truecloudlab/frostfs-aio:$version" "git.frostfs.info/truecloudlab/frostfs-aio:$version" podman image rm "docker.io/truecloudlab/frostfs-aio:$version" done ```
potyarkin added 1 commit 2025-01-21 10:01:43 +00:00
[#193] Use selfhosted image registry instead of Docker Hub
All checks were successful
/ DCO (pull_request) Successful in 30s
/ Builds (pull_request) Successful in 1m1s
/ Vulncheck (pull_request) Successful in 1m13s
/ OCI image (pull_request) Successful in 1m30s
/ Lint (pull_request) Successful in 1m54s
/ Tests (pull_request) Successful in 57s
/ Integration tests (pull_request) Successful in 5m48s
/ Vulncheck (push) Successful in 55s
/ Builds (push) Successful in 1m8s
/ OCI image (push) Successful in 1m23s
/ Lint (push) Successful in 3m4s
/ Tests (push) Successful in 1m2s
/ Integration tests (push) Successful in 5m42s
a7617514d3
Existing AIO image tags referenced from our integration tests were
manually synced to git.frostfs.info prior to this change.

Signed-off-by: Vitaliy Potyarkin <v.potyarkin@yadro.com>
potyarkin added 1 commit 2025-01-21 10:15:32 +00:00
debug: Measure tests run time with hot image cache
Some checks failed
/ DCO (pull_request) Failing after 33s
/ Vulncheck (pull_request) Successful in 53s
/ Builds (pull_request) Successful in 1m14s
/ OCI image (pull_request) Successful in 1m24s
/ Lint (pull_request) Successful in 1m47s
/ Tests (pull_request) Successful in 56s
/ Integration tests (pull_request) Failing after 6m38s
803c6b74da
Signed-off-by: Vitaliy Potyarkin <v.potyarkin@yadro.com>
potyarkin force-pushed feature/integration-in-ci from 803c6b74da to 27c40ff43c 2025-01-21 11:14:52 +00:00 Compare
potyarkin force-pushed feature/integration-in-ci from 27c40ff43c to c2c46e332f 2025-01-21 11:24:45 +00:00 Compare
potyarkin force-pushed feature/integration-in-ci from c2c46e332f to a7617514d3 2025-01-21 11:36:44 +00:00 Compare
potyarkin changed title from WIP: [#193] Enable integration tests in Forgejo Actions to [#193] Enable integration tests in Forgejo Actions 2025-01-21 11:51:10 +00:00
requested reviews from storage-services-developers, storage-services-committers, alexvanin 2025-01-21 11:51:30 +00:00
dkirillov approved these changes 2025-01-22 09:27:39 +00:00
alexvanin approved these changes 2025-01-23 06:36:54 +00:00
alexvanin merged commit a7617514d3 into master 2025-01-23 06:37:02 +00:00
alexvanin deleted branch feature/integration-in-ci 2025-01-23 06:37:03 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-http-gw#193
No description provided.