Skip to content
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

fix: Properly collect Python dependencies during image build. Next attempt at build cache #47

Merged
merged 59 commits into from
Oct 7, 2024

Conversation

hostcc
Copy link
Owner

@hostcc hostcc commented Sep 10, 2024

  • Dockerfile: fixed installing Python package dependencies
  • Dockerfile: restructured to minimize chances of cache invalidation
  • Github Actions: switched to registry cache for Docker build, as gha might reduce hit ratio (see Best way to cache multi-stage + multi-platform image builds docker/buildx#1382 for details)
  • Github Actions: to improve caching the image for each platform is built separately, single buildx invocation with multiple platforms doesn't result in proper caching (see the link above for details)
  • Github Actions: added step to test resulting images

…tempt to build cache

* `Dockerfile`: fixed installing Python package dependencies
  (should use same `pip install --root...`)
* Github Actions: switched to `registry` cache for Docker build, as
  `gha` one didn't result in any hits
@hostcc hostcc added the bug Something isn't working label Sep 10, 2024
@hostcc hostcc self-assigned this Sep 10, 2024
Copy link

Please retry analysis of this Pull-Request directly on SonarCloud

1 similar comment
Copy link

Please retry analysis of this Pull-Request directly on SonarCloud

  platform, utilizing separate build cache - previously a single step
  build all target platform didn't use the cache resulting in very long
  build time
Copy link

Copy link

Please retry analysis of this Pull-Request directly on SonarCloud

  potentially it could lead to build cache not being utilized
Copy link

Please retry analysis of this Pull-Request directly on SonarCloud

1 similar comment
Copy link

Please retry analysis of this Pull-Request directly on SonarCloud

  since there is a known issue it might prevent utilizing the cache
Copy link

Please retry analysis of this Pull-Request directly on SonarCloud

Copy link

  `build-push-action`, since version couldn't be determined when using
  default Git context for the action
Copy link

Copy link

Please retry analysis of this Pull-Request directly on SonarCloud

* Github Actions: pass version override via `VERSION` build arg instead
  of environment variable when building the Docker image
Copy link

Please retry analysis of this Pull-Request directly on SonarCloud

Copy link

Please retry analysis of this Pull-Request directly on SonarCloud

Copy link

Please retry analysis of this Pull-Request directly on SonarCloud

Copy link

  the image tag being built, the prefix will be the version
Copy link

Please retry analysis of this Pull-Request directly on SonarCloud

1 similar comment
Copy link

Please retry analysis of this Pull-Request directly on SonarCloud

Copy link

sonarqubecloud bot commented Oct 7, 2024

Please retry analysis of this Pull-Request directly on SonarCloud

hostcc added 2 commits October 7, 2024 14:50
  produced by `docker/metadata-action` as JSON, so
  they could be handled by `github-action-matrix-outputs-write`
Copy link

sonarqubecloud bot commented Oct 7, 2024

hostcc added 2 commits October 7, 2024 15:04
  for tags and annotations via JSON representation
  (`docker/metadata-action`, `json` output)
  tags/annotations/digests considering nested JSON structure
Copy link

sonarqubecloud bot commented Oct 7, 2024

  Docker image metadata has been moved to separate jobs,
  since those don't need to be matrix ones
Copy link

sonarqubecloud bot commented Oct 7, 2024

  in `{value: <digest>}` object each, so later
  those could be dereferenced using `.*.value` syntax
Copy link

sonarqubecloud bot commented Oct 7, 2024

Please retry analysis of this Pull-Request directly on SonarCloud

Copy link

sonarqubecloud bot commented Oct 7, 2024

hostcc added 2 commits October 7, 2024 20:47
  construct arguments for `docker buildx imagetools create`
  command - should be easier compared to `jq` and alike
Copy link

sonarqubecloud bot commented Oct 7, 2024

Please retry analysis of this Pull-Request directly on SonarCloud

  `docker buildx imagetools create` command -
   should use `tag` and `annotation` instead of `tags` and `annotations`
Copy link

sonarqubecloud bot commented Oct 7, 2024

Please retry analysis of this Pull-Request directly on SonarCloud

Copy link

sonarqubecloud bot commented Oct 7, 2024

hostcc added 2 commits October 7, 2024 21:19
  manufest, as annotations aren't supported there -
  instead, there are added to each image built
Copy link

sonarqubecloud bot commented Oct 7, 2024

hostcc added 2 commits October 7, 2024 22:17
  operation at a time, otherwise GHCR responds with
  403 when multiple tags are provided to `buildx imagetools create`.
Copy link

sonarqubecloud bot commented Oct 7, 2024

Please retry analysis of this Pull-Request directly on SonarCloud

Copy link

sonarqubecloud bot commented Oct 7, 2024

@hostcc hostcc merged commit 4d6d9ce into master Oct 7, 2024
18 of 20 checks passed
@hostcc hostcc deleted the fix/python-deps-build-cache branch October 7, 2024 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant