Skip to content

add script to backup csv #240

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

Merged
merged 15 commits into from
Jul 11, 2025
Merged

add script to backup csv #240

merged 15 commits into from
Jul 11, 2025

Conversation

nammn
Copy link
Collaborator

@nammn nammn commented Jul 8, 2025

Summary

This pull request introduces a new script and corresponding Evergreen tasks to backup digest-pinned images from a ClusterServiceVersion (CSV) YAML file to Quay.io. The changes include adding a Python script to perform the backup process, new Evergreen tasks to execute the script, and a new build variant for these tasks.

New Evergreen tasks and build variant:

  • .evergreen.yml: Added three new tasks (backup_csv_images_dry_run, backup_csv_images_limit_3, and backup_csv_images_all) to run the backup script with different options, and created a new build variant (backup_csv_images) to group these tasks under the "Backup CSV Images" workflow. [1] [2]

New Python script for image backup:

  • scripts/dev/release/backup_csv_images.py: Added a comprehensive Python script to parse a CSV file, extract digest-pinned images, and back them up to Quay.io using a new tag format (_openshift_<mck_version>). The script supports dry-run mode, logging, and limiting the number of images to back up.

Proof of Work

https://parsley.mongodb.com/evergreen/mongodb_kubernetes_backup_csv_images_backup_csv_images_all_patch_5710105f0347aed651ce63e6b37f06051caa634a_686e4ee749d2610007d96aaa_25_07_09_11_13_48/0/task?bookmarks=0,11182&shareLine=3143
Screenshot 2025-07-09 at 14 10 21

Screenshot 2025-07-09 at 14 10 33

Checklist

  • Have you linked a jira ticket and/or is the ticket in the title?
  • Have you checked whether your jira ticket required DOCSP changes?
  • Have you checked for release_note changes?

Reminder (Please remove this when merging)

  • Please try to Approve or Reject Changes the PR, keep PRs in review as short as possible
  • Our Short Guide for PRs: Link
  • Remember the following Communication Standards - use comment prefixes for clarity:
    • blocking: Must be addressed before approval.
    • follow-up: Can be addressed in a later PR or ticket.
    • q: Clarifying question.
    • nit: Non-blocking suggestions.
    • note: Side-note, non-actionable. Example: Praise
    • --> no prefix is considered a question


If dry_run is True, only log the command and return None.
"""
logger.info(f"[DRY RUN] Executing: {' '.join(cmd)}" if dry_run else f"Executing: {' '.join(cmd)}")
Copy link
Contributor

Choose a reason for hiding this comment

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

let's not add [DRY RUN] if it's not a dry run

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

if its not a dry_run we are running this

 else f"Executing: {' '.join(cmd)}")

or do you mean we shouldn't use the ternary operator?

Copy link
Contributor

@lsierant lsierant left a comment

Choose a reason for hiding this comment

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

Awesome work!

@nammn nammn marked this pull request as ready for review July 9, 2025 12:05
@nammn nammn requested a review from a team as a code owner July 9, 2025 12:05
@nammn nammn requested review from SimonBaeumer and anandsyncs July 9, 2025 12:05
@nammn nammn merged commit 6f986ef into master Jul 11, 2025
35 checks passed
@nammn nammn deleted the backup_csv branch July 11, 2025 09:02
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