Skip to content

Conversation

sschuberth
Copy link
Member

Please ensure that your pull request adheres to our contribution guidelines. Thank you!

@sschuberth sschuberth changed the title Batect vs gha container Remove the unmaintained Batect in favor of using a GitHub action container Nov 13, 2023
@heliocastro heliocastro self-requested a review November 13, 2023 19:49
@sschuberth sschuberth force-pushed the batect-vs-gha-container branch from 033fe4a to 51c941c Compare November 13, 2023 19:55
Copy link

codecov bot commented Nov 13, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (46de195) 67.16% compared to head (dbec174) 67.16%.
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #7853   +/-   ##
=========================================
  Coverage     67.16%   67.16%           
  Complexity     2049     2049           
=========================================
  Files           357      357           
  Lines         17158    17158           
  Branches       2461     2461           
=========================================
  Hits          11525    11525           
  Misses         4611     4611           
  Partials       1022     1022           
Flag Coverage Δ
funTest-docker 66.25% <ø> (ø)
funTest-non-docker 33.96% <ø> (ø)
test 36.98% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sschuberth sschuberth force-pushed the batect-vs-gha-container branch 2 times, most recently from 6d43493 to 1642c7b Compare November 14, 2023 15:34
@sschuberth sschuberth force-pushed the batect-vs-gha-container branch 12 times, most recently from 3f05358 to cfb007f Compare November 17, 2023 15:17
@sschuberth sschuberth marked this pull request as ready for review November 17, 2023 16:13
@sschuberth sschuberth requested review from a team as code owners November 17, 2023 16:13
@sschuberth
Copy link
Member Author

In my comparisons, this new approach reduces the funTest-docker runtime by at least ~10 minutes.

Copy link
Member

@mnonnenmacher mnonnenmacher Nov 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit message: "Docherfile" -> "Dockerfile"

The downside is that Dockerfile changes and e.g. package manager changes depending on it cannot be performed in the same commit / PR as the image first needs to get published.

Doesn't this introduce a serious issue if e.g. a tool version in Docker is upgraded and any test failures caused by this only appear in a random other PR later on? This probably also creates the risk that we make broken releases.

I thought with the new setup building the Docker image is a lot faster, as most of the images can be reused from the registry, and that only Batect was blocking us from using the registry. E.g. if the Python version is upgraded only the Python image needs to be rebuilt, and if nothing is changed in Docker the build should be very fast?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this introduce a serious issue if e.g. a tool version in Docker is upgraded and any test failures caused by this only appear in a random other PR later on?

Yes, that's a valid point. To solve this, we should probably do something like this in the PR:

  1. Pull the current snapshot image.
  2. (Re-)build the Docker image from source on the worker node, which should be fast due to stage image / layer caching, if not a lot has changed in the Dockerfile itself.
  3. Run functional tests against the local Docker image.
  4. Push the Docker image as the new snapshot if everything succeeded.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Batect was blocking us from using the registry.

Not that it matters now anymore as Batect became unmaintained, but Batect was not blocking us from using the registry. Batect just made it hard / impossible to benefit from stage image / layer caching in conjunction with the docker/build-push-action.

E.g. if the Python version is upgraded only the Python image needs to be rebuilt, and if nothing is changed in Docker the build should be very fast?

That's my understanding as well, but I haven't verified it.

@sschuberth sschuberth force-pushed the batect-vs-gha-container branch 2 times, most recently from b674490 to 586bd69 Compare November 17, 2023 18:16
@sschuberth

This comment was marked as resolved.

@sschuberth sschuberth force-pushed the batect-vs-gha-container branch from 586bd69 to 6842840 Compare November 18, 2023 17:27
@sschuberth sschuberth added the on hold Pull requests that cannot currently be merged label Nov 20, 2023
Instead of using Batect with the committed `Dockerfile-legacy`, use a
GitHub action container based on the most recent Docker image published
from the `main` branch to run functional tests. This should speed up the
test run as the Docker image does not need to be built on every run.

The downside is that `Dockerfile` changes and e.g. package manager changes
depending on it cannot be performed in the same commit / PR as the image
first needs to get published.

Signed-off-by: Sebastian Schuberth <[email protected]>
@heliocastro heliocastro force-pushed the batect-vs-gha-container branch from 6842840 to dbec174 Compare January 26, 2024 11:02
@sschuberth
Copy link
Member Author

@heliocastro please don't force-push to branches owned by others without discussing this first! Not even if it's a simple rebase.

Copy link
Contributor

@heliocastro heliocastro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This solution is better since we are not anymore relying on two different codebases for Docker.
With the introduction of multiarch, debugging test issues will be a not be easy task, as now images from legacy and main are really disconnected.

@heliocastro
Copy link
Contributor

@heliocastro please don't force-push to branches owned by others without discussing this first! Not even if it's a simple rebase.

Sorry for that. I didn't think that would be an issue.

@sschuberth
Copy link
Member Author

I didn't think that would be an issue.

It breaks my checks which of my local branches are not in-sync with the remotes.

@mnonnenmacher
Copy link
Member

As discussed on Slack I am approving that now despite my concerns as @heliocastro committed to making another PR that runs the functional tests with an image that matches the PR again.

@sschuberth sschuberth removed the on hold Pull requests that cannot currently be merged label Jan 26, 2024
@sschuberth sschuberth merged commit c0a9b4e into main Jan 26, 2024
@sschuberth sschuberth deleted the batect-vs-gha-container branch January 26, 2024 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants