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

Cache poisoning issue. #347

Closed
nigelgbanks opened this issue Aug 2, 2024 · 3 comments
Closed

Cache poisoning issue. #347

nigelgbanks opened this issue Aug 2, 2024 · 3 comments

Comments

@nigelgbanks
Copy link
Contributor

          Hmmmm I'm not getting the same results from a fresh build?
  • Reran make clean && make bake && make up

Check 1:

docker run --rm -d --name postgresql islandora/postgresql

docker exec -ti postgresql psql -U root postgres
psql (16.3)
Type "help" for help.

postgres=#

Check 2:

docker exec -ti postgresql bash

6f89c38c08af:/# postgres --version

postgres (PostgreSQL) 16.3

Originally posted by @g7morris in #346 (comment)

@nigelgbanks
Copy link
Contributor Author

Both versions have the same release of alpine.

/ $ cat /etc/alpine-release 
3.19.1

So it has more to do with when it was built then the cache actually being poisoned. The shame is that the Alpine package repository is changing without a change in it's version number...

@joecorall
Copy link
Contributor

joecorall commented Aug 2, 2024

Is it because we don't have base pinned to a specific tag? https://github.com/Islandora-Devops/isle-buildkit/blob/main/base/Dockerfile#L2

@nigelgbanks
Copy link
Contributor Author

It's pined here: https://github.com/Islandora-Devops/isle-buildkit/blob/main/docker-bake.hcl#L301

It's because the alpine repository isn't idempotent for a given release, like 3.19.1 (which I didn't realize before). They reserve the right to update packages like postgresql without changing the alpine repository version number. For example, to add security patches and whatnot. I'm not sure if we can prevent this sort of thing from happening. We could pin every alpine package like postgresql, and then the build would break when alpine updates a package, like so:

/ # apk add postgresql=16.2
ERROR: unable to select packages:
  postgresql16-16.3-r0:
    breaks: world[postgresql=16.2]

But at that point we're just making work for ourselves for little gain. The only upside is that for a specific commit, of isle-buildkit we guarantee it produces the 100% the same image or fails to build. Though if we leave things as is, it should always build, but there might be minor version changes between alpine packages when built.

While I strived to make isle-buildkit close to idempotent as possible, it's a losing battle considering the additional effort. And we may just have to accept it as is.

@nigelgbanks nigelgbanks closed this as not planned Won't fix, can't repro, duplicate, stale Aug 3, 2024
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

No branches or pull requests

2 participants