Skip to content

Use latest directory commit timestamp as tag#286

Merged
qmonnet merged 3 commits intocilium:masterfrom
Artyop:pr/fix-image-tag-renovate
Aug 5, 2024
Merged

Use latest directory commit timestamp as tag#286
qmonnet merged 3 commits intocilium:masterfrom
Artyop:pr/fix-image-tag-renovate

Conversation

@Artyop
Copy link
Copy Markdown
Contributor

@Artyop Artyop commented Jul 12, 2024

This commit change the way of tagging image, from using git-lfs-tree sha256 to using directory's last commit timestamp. It will permit renovate to sort versions and update properly new images, where renovate wasn't able to do so before due to its inability to sort SHAs.
The git log command, when given a specific directory in parameter, retrieve the last commit were changes were made in said directory. This means that we can ensure different image versions same as used to be with git-tree.
Renovate can sort versions from left to right, using a timestamp as a tag value allows it to retrieve the latest version deployed with ease.

Fixes #285

@Artyop Artyop requested a review from a team as a code owner July 12, 2024 15:05
@Artyop Artyop requested a review from borkmann July 12, 2024 15:05
@Artyop Artyop changed the title Signed-off-by: Anto <[email protected]> Use latest directory commit timestamp as tag Jul 12, 2024
@Artyop Artyop force-pushed the pr/fix-image-tag-renovate branch 4 times, most recently from 38d4a0a to e79d616 Compare July 16, 2024 08:30
@Artyop Artyop requested review from a team as code owners July 16, 2024 08:30
@Artyop Artyop force-pushed the pr/fix-image-tag-renovate branch from e79d616 to d579daa Compare July 16, 2024 08:51
@Artyop
Copy link
Copy Markdown
Contributor Author

Artyop commented Jul 16, 2024

Bit of an issue with libc version while creating the images it seems
ImportError: /lib64/libc.so.6: version `GLIBC_2.34' not found (required by /lib64/libgcc_s.so.1)` when trying to use dnf for anything other than an install, looking into it

@sayboras
Copy link
Copy Markdown
Member

sayboras commented Jul 17, 2024

Can you rebase with main branch to pick up #281 to avoid any surprise?

@Artyop Artyop force-pushed the pr/fix-image-tag-renovate branch from 6bb158e to b665af2 Compare July 17, 2024 09:19
@Artyop
Copy link
Copy Markdown
Contributor Author

Artyop commented Jul 17, 2024

Rebased from main branch, checking for the key issue on the iptables-20.04-image

@sayboras
Copy link
Copy Markdown
Member

checking for the key issue on the iptables-20.04-image

iptables-20.04-image might not be used anymore, as we moved to snapshot build for specific iptables version.

#287

@sayboras
Copy link
Copy Markdown
Member

#287 is merged, so you might need to rebase again 😅 , good news is no need to check for key issue 🔑

@Artyop
Copy link
Copy Markdown
Contributor Author

Artyop commented Jul 17, 2024

#287 is merged, so you might need to rebase again 😅 , good news is no need to check for key issue 🔑

well that sounds like a good deal to me!

Artyop added 2 commits July 17, 2024 14:31
This commit change the way of tagging image, from using git-lfs-tree sha256 to using directory's last commit timestamp.
It will permit renovate to sort versions and update properly new images, where renovate wasn't able to do so before due to its inability to sort SHAs.

Signed-off-by: Antony Reynaud <[email protected]>
Redhat ubi8:8.9-1136 dnf was generating issue to perform remove of gcc and make.
Bumping redhat version to ubi8/ubi (from https://catalog.redhat.com/software/base-images) fixed it.

Signed-off-by: Antony Reynaud <[email protected]>
@Artyop Artyop force-pushed the pr/fix-image-tag-renovate branch from b665af2 to 63ec437 Compare July 17, 2024 12:31
Copy link
Copy Markdown
Contributor

@michi-covalent michi-covalent left a comment

Choose a reason for hiding this comment

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

it might still be useful to have commit sha as a part of the tag (like $timestamp-$sha or something) so that it's easy to see which commit the image got built from.

This commit adds the short commit after the timestamp.
Will help to know which commit the image version will be coming from.

Signed-off-by: Antony Reynaud <[email protected]>
@Artyop
Copy link
Copy Markdown
Contributor Author

Artyop commented Jul 31, 2024

@michi-covalent added the short commit right after the timestamp separated with a "-", let me know if it sounds good for you
(tested it, renovate seems to be ok with it)

Copy link
Copy Markdown
Contributor

@michi-covalent michi-covalent left a comment

Choose a reason for hiding this comment

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

🥰

@qmonnet qmonnet merged commit 353d2d8 into cilium:master Aug 5, 2024
Artyop added a commit to Artyop/image-tools that referenced this pull request Aug 5, 2024
Following the pr cilium#286, update of the readme about how the
tagging mechanic works

Signed-off-by: Antony Reynaud <[email protected]>
Artyop added a commit to Artyop/image-tools that referenced this pull request Aug 7, 2024
Following the pr cilium#286, update of the readme about how the
tagging mechanic works

Signed-off-by: Antony Reynaud <[email protected]>
tklauser pushed a commit that referenced this pull request Aug 7, 2024
Following the pr #286, update of the readme about how the
tagging mechanic works

Signed-off-by: Antony Reynaud <[email protected]>
HadrienPatte added a commit to cilium/cilium that referenced this pull request Aug 17, 2025
The image-tools repository switched to a timestamp based versioning
scheme for its images with
cilium/image-tools#286 in order to allow
renovate to start managing the updates of those images. But renovate is
not able to properly manage those as it does not recognize their
versioning scheme.

This PR adds a a renovate package rule for those images with a custom
[versioning](https://docs.renovatebot.com/modules/versioning/) config.

I tested it in a test repo and renovate managed to detect the dependency
and update it:

<img width="735" height="186" alt="image" src="https://github.com/user-attachments/assets/b53554df-d851-477d-96e6-a304c67ccff0" />

Signed-off-by: Hadrien Patte <[email protected]>
github-merge-queue bot pushed a commit to cilium/cilium that referenced this pull request Aug 20, 2025
The image-tools repository switched to a timestamp based versioning
scheme for its images with
cilium/image-tools#286 in order to allow
renovate to start managing the updates of those images. But renovate is
not able to properly manage those as it does not recognize their
versioning scheme.

This PR adds a a renovate package rule for those images with a custom
[versioning](https://docs.renovatebot.com/modules/versioning/) config.

I tested it in a test repo and renovate managed to detect the dependency
and update it:

<img width="735" height="186" alt="image" src="https://github.com/user-attachments/assets/b53554df-d851-477d-96e6-a304c67ccff0" />

Signed-off-by: Hadrien Patte <[email protected]>
@joestringer
Copy link
Copy Markdown
Member

Hi, could this have broken the way that we ensure tags are unique based on the content of the image?

This month, after merging b6afb9d and 3e3093f, the existing tag 1755531540-60ee83e was overwritten instead of generating a new tag. This seems to be the first time that changes in the repository did not generate a new tag. One of the surprising aspects is that the suffix is 60ee83e and not b6afb9d, despite the new version of the script intending to include a short commit hash in the tag.

image

@joestringer
Copy link
Copy Markdown
Member

I tracked back to this PR by checking when we changed the scheme for the docker tags, however now I think a bit more it's clear that this couldn't have introduced such a breakage as this change was made over a year ago and we only encountered problems in the last few weeks. I'll search for a newer PR that may have broken the behavior more recently.

@HadrienPatte
Copy link
Copy Markdown
Member

HadrienPatte commented Sep 16, 2025

👋 The issue we're experiencing is described in more details in #385 (and there's a pending fix for cilium/cilium in cilium/cilium#41710)

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.

Bug: renovate is unable to track image updates (unsupported/unversioned value)

8 participants