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

Stage CNI (and harvester) images if avaliable for airgap #6275

Merged
merged 4 commits into from
Jul 22, 2024

Conversation

dereknola
Copy link
Contributor

@dereknola dereknola commented Jul 2, 2024

Proposed Changes

  • For the supported CNIs, if images are found in the artifact path, automatically move to the agent images directory, removing a manual step the user would need to perform.

Types of Changes

Verification

Create two folder with the following contents:

derek@degion:~$ ls ./rke2-artifacts
rke2-images.linux-amd64.tar.zst  rke2.linux-amd64.tar.gz  sha256sum-amd64.txt

derek@degion:~$ ls ./rke2-artifacts-with-extra/
rke2-images-canal.linux-amd64.tar.zst   rke2-images-harvester.linux-amd64.tar.gz  rke2.linux-amd64.tar.gz
rke2-images-flannel.linux-amd64.tar.gz  rke2-images.linux-amd64.tar.zst           sha256sum-amd64.txt

Run the installer on both:

root@degion:/home/derek/rancher/rke2# INSTALL_RKE2_ARTIFACT_PATH=/home/derek/rke2-artifacts sh install.sh
[INFO]  staging local checksums from /home/derek/rke2-artifacts2/sha256sum-amd64.txt
[INFO]  staging zst airgap image tarball from /home/derek/rke2-artifacts/rke2-images.linux-amd64.tar.zst
[INFO]  staging tarball from /home/derek/rke2-artifacts/rke2.linux-amd64.tar.gz
[INFO]  verifying airgap tarball
[INFO]  installing airgap tarball to /var/lib/rancher/rke2/agent/images
[INFO]  verifying tarball
[INFO]  unpacking tarball file to /usr/local
root@degion:/home/derek/rancher/rke2# INSTALL_RKE2_ARTIFACT_PATH=/home/derek/rke2-artifacts-with-extra sh install.sh
[INFO]  staging local checksums from /home/derek/rke2-artifacts-with-extra/sha256sum-amd64.txt
[INFO]  staging zst airgap image tarball from /home/derek/rke2-artifacts-with-extra/rke2-images.linux-amd64.tar.zst
[INFO]  staging tarball from /home/derek/rke2-artifacts-with-extra/rke2.linux-amd64.tar.gz
[INFO]  verifying airgap tarball
[INFO]  installing airgap tarball to /var/lib/rancher/rke2/agent/images
[INFO]  Installing airgap image from /home/derek/rke2-artifacts-with-extra/rke2-images-canal.linux-amd64.tar.zst
[INFO]  Installing airgap image from /home/derek/rke2-artifacts-with-extra/rke2-images-flannel.linux-amd64.tar.gz
[INFO]  Installing airgap image from /home/derek/rke2-artifacts-with-extra/rke2-images-harvester.linux-amd64.tar.gz
[INFO]  verifying tarball
[INFO]  unpacking tarball file to /usr/local

Testing

Linked Issues

#6308

User-Facing Change


Further Comments

Signed-off-by: Derek Nola <derek.nola@suse.com>
@dereknola dereknola requested a review from a team as a code owner July 2, 2024 17:11
install.sh Outdated Show resolved Hide resolved
Signed-off-by: Derek Nola <derek.nola@suse.com>
Signed-off-by: Derek Nola <derek.nola@suse.com>
@dereknola
Copy link
Contributor Author

I have swapped this out for a single find command with nice printing

root@degion:/home/derek/rancher/rke2# INSTALL_RKE2_ARTIFACT_PATH=/home/derek/rke2-artifacts sh install.sh
[INFO]  staging local checksums from /home/derek/rke2-artifacts/sha256sum-amd64.txt
[INFO]  staging zst airgap image tarball from /home/derek/rke2-artifacts/rke2-images.linux-amd64.tar.zst
[INFO]  staging tarball from /home/derek/rke2-artifacts/rke2.linux-amd64.tar.gz
[INFO]  verifying airgap tarball
[INFO]  installing airgap tarball to /var/lib/rancher/rke2/agent/images
[INFO]  installing airgap image from /home/derek/rke2-artifacts/rke2-images-flannel.linux-amd64.tar.gz
[INFO]  installing airgap image from /home/derek/rke2-artifacts/rke2-images-harvester.linux-amd64.tar.gz
[INFO]  installing airgap image from /home/derek/rke2-artifacts/rke2-images-canal.linux-amd64.tar.zst
[INFO]  verifying tarball
[INFO]  unpacking tarball file to /usr/local

I moved away from doing it in stage_local_airgap_tarball because that temporarily stages the image tarball for checksum validation. The install will not continue if that checksum does not match. We want to maintain this functionality. Instead we now move the other airgap images only if the above image checksum match passes. Since we don't have checksums for theses images, we just assume they are fine.

@dereknola dereknola changed the title Stage CNI images if avaliable for airgap Stage CNI (and harvester) images if avaliable for airgap Jul 11, 2024
install.sh Outdated Show resolved Hide resolved
We don't use fine in the install script
Signed-off-by: Derek Nola <derek.nola@suse.com>
Copy link

@alknopfler alknopfler left a comment

Choose a reason for hiding this comment

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

LGTM

@dereknola dereknola merged commit 26d7649 into rancher:master Jul 22, 2024
1 check passed
@dereknola dereknola deleted the airgap_cp_cnis branch July 30, 2024 20:09
iamsarthakk pushed a commit to iamsarthakk/rke2 that referenced this pull request Aug 19, 2024
* Stage CNI images if avaliable for airgap

Signed-off-by: Derek Nola <derek.nola@suse.com>
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.

None yet

4 participants