Skip to content

Conversation

@bjorn-amd
Copy link
Collaborator

@bjorn-amd bjorn-amd commented Dec 10, 2025

Description

This snapshots a kind cluster by compressing everything from the /var directory into /var_snapshot.tar.gz and saving the container as a new image. Restore works in reverse, that it remaps a snapshotted container to the kind cluster, extracts /var_snapshot.tar.gz into /var and restarts the cluster.

time bash ./test/scripts/setup_kind.sh --skip-static 
...
Cluster is ready!
bash ./test/scripts/setup_kind.sh --skip-static  65.64s user 40.88s system 22% cpu 7:48.99 total
time sh -c "kind create cluster --name kaiwo-test --config ../kind/kind-test-cluster.yaml && ./restore_kind.sh 0.1"
...
Restore complete!
sh -c   2.89s user 6.39s system 8% cpu 1:53.02 total

(note that the restore doesn't do any network traffic in this example, it will take longer when images need to be downloaded)

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist:

  • My code follows the style guidelines of this project. See contributing-guidelines.md
  • Existing workload examples run to completion after my changes (if applicable)
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@bjorn-amd bjorn-amd closed this Dec 10, 2025
@bjorn-amd bjorn-amd force-pushed the feature/kind-snapshot branch from b45786c to 9e91ff7 Compare December 10, 2025 09:37
@bjorn-amd bjorn-amd reopened this Dec 10, 2025
Copy link
Collaborator

@AVSuni AVSuni left a comment

Choose a reason for hiding this comment

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

Thanks for this. Looks great! Some ideas for improving:

  • Let's create a GHA job for making the snapshot. This should only run when something changes under dependencies directory and is pushed to main. The built images should be pushed to registry. snapshot_kind.sh should only ever be run in CI.
  • restore_kind.sh should pull from registry
  • restore_kind.sh should work the same in CI and locally

@AVSuni AVSuni requested a review from williamanzen December 11, 2025 12:30
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