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

feat: added new workflow to prune old images #88

Merged
merged 16 commits into from
Jan 29, 2024
Merged

feat: added new workflow to prune old images #88

merged 16 commits into from
Jan 29, 2024

Conversation

JTaeuber
Copy link
Member

@JTaeuber JTaeuber commented Jan 25, 2024

Motivation

Relates to #80

Changes

Added a new workflow to prune old images of packages sparrow and charts/sparrow.

The workflow is configured to prune all images older than 7 days that start with 'commit-' or end in 'SNAPSHOT-...' for the sparrow package.

For the charts/sparrow package it will prune all images older than 7 days that end in 'commit-...'.

It runs daily at midnight (could be changed if wanted).

It is still configured to dry-run just to be sure. This should be changed once we're sure nothings going to break.

For additional information look at the commits.

Tests done

I've tested the workflow in dry-run in a fork I made and it worked accordingly.

No stable version or version under 7 days was marked for pruning.

https://github.com/JTaeuber/sparrow/actions/runs/7642146860
This is the Test of the Workflow without keeping the images younger than 7 days for the charts/sparrow package, so you can see what it would prune if they were older than 7 days.

TODO

  • I've assigned this PR to myself
  • I've labeled this PR correctly

@JTaeuber JTaeuber self-assigned this Jan 25, 2024
@JTaeuber JTaeuber added feature Introduces a new feature housekeeping good first issue Entry-level task, ideal for new contributors labels Jan 25, 2024
.github/workflows/prune.yml Outdated Show resolved Hide resolved
.github/workflows/prune.yml Outdated Show resolved Hide resolved
.github/workflows/prune.yml Outdated Show resolved Hide resolved
.github/workflows/prune.yml Outdated Show resolved Hide resolved
Copy link
Contributor

@y-eight y-eight left a comment

Choose a reason for hiding this comment

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

LGTM

.github/workflows/prune.yml Outdated Show resolved Hide resolved
prune-untagged: true
prune-tags-regexes: |
^commit-
SNAPSHOT-.*$
Copy link
Member

Choose a reason for hiding this comment

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

After the first prune we can remove this regex because our new images don't follow this naming pattern anymore.

Copy link
Member

Choose a reason for hiding this comment

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

The regex is unnecessary. We just want to remove old images, no matter what naming convention they used. Let's just remove it altogether.

Copy link
Member

@lvlcn-t lvlcn-t Jan 26, 2024

Choose a reason for hiding this comment

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

Then we'd also remove our stable release images because git tags != image tags

Copy link
Member

Choose a reason for hiding this comment

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

Totally right, my bad 😅

Copy link
Member

@lvlcn-t lvlcn-t left a comment

Choose a reason for hiding this comment

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

LGTM, don't forget to turn off the dryrun before merging.

Additionally after merging create a PR to resolve my conversation

@lvlcn-t lvlcn-t merged commit 3f5416b into caas-team:main Jan 29, 2024
3 of 6 checks passed
@JTaeuber JTaeuber deleted the feat/AddNewWorkflowForPruningOldImages branch January 29, 2024 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Introduces a new feature good first issue Entry-level task, ideal for new contributors housekeeping
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants