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

Add hidden command to install the guest components #2028

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

afbjorklund
Copy link
Member

@afbjorklund afbjorklund commented Nov 24, 2023

This will install the lima-guestagent in the instance.

It will install nerdctl-full.tgz, if it has been enabled.

Normally this is done by cidata, during the first boot...

Here it is just using scp and ssh, for convenience.


Workaround for:

Something like:

INFO[0000] Copying "/home/anders/lima/_output/share/lima/lima-guestagent.Linux-aarch64" to lima-raspberrypi 
lima-guestagent.Linux-aarch64              100%   36MB   2.2MB/s   00:16    
INFO[0016] Installing /tmp/lima-guestagent to /usr/local/bin/lima-guestagent 
INFO[0017] Attempting to download the nerdctl archive    arch=aarch64 digest="sha256:ea30ab544c057e3a0457194ecd273ffbce58067de534bdfaffe4edf3a4da6357" location="https://github.com/containerd/nerdctl/releases/download/v1.6.2/nerdctl-full-1.6.2-linux-arm64.tar.gz"
INFO[0017] Using cache "/home/anders/.cache/lima/download/by-url-sha256/21921213c0426e38e2f26d2844446767e2a19c0b6655c774f9e4adbb5c368d8f/data" 
INFO[0017] Copying "nerdctl-full-1.6.2-linux-arm64.tar.gz" to lima-raspberrypi 
data                                       100%  205MB   2.7MB/s   01:16    
INFO[0094] Installing /tmp/nerdctl-full.tgz in /usr/local 

It could have been a shell script.

But the code "knows" the paths...

@afbjorklund
Copy link
Member Author

This command is a replacement for cidata.iso, when not using cloud-init for provisioning.

It also saves having a copy of the lima-guestagent and nerdctl-full.tgz, in the instance dir...

44K /home/anders/.lima/raspberrypi/

The --rsync flag is mostly a workaround for slow networks and slow machines, and optional.


INFO[0000] Copying "/home/anders/lima/_output/share/lima/lima-guestagent.Linux-aarch64" to lima-raspberrypi 
lima-guestagent.Linux-aarch64
     39,059,456 100%  907.27kB/s    0:00:42 (xfr#1, to-chk=0/1)
INFO[0043] Installing /tmp/lima-guestagent to /usr/local/bin/lima-guestagent 
INFO[0045] Attempting to download the nerdctl archive    arch=aarch64 digest="sha256:4bf3e05c7203a1b86c84a506d022f7f4d2727143c8031cd5e4b78ef03f0fdcda" location="https://github.com/containerd/nerdctl/releases/download/v1.7.3/nerdctl-full-1.7.3-linux-arm64.tar.gz"
INFO[0045] Using cache "/home/anders/.cache/lima/download/by-url-sha256/7a01b636a74ea0365688ec93ad2f66cc2f010b7bd370dc55e7cad3c9b11fd012/data" 
INFO[0005] Copying "nerdctl-full-1.7.3-linux-arm64.tar.gz" to lima-raspberrypi 
data
    218,743,662 100%  705.43kB/s    0:05:02 (xfr#1, to-chk=0/1)
INFO[0310] Installing /tmp/nerdctl-full.tgz in /usr/local 
INFO[0000] Copying "/home/anders/lima/_output/share/lima/lima-guestagent.Linux-aarch64" to lima-raspberrypi 
lima-guestagent.Linux-aarch64
     39,059,456 100%  269.88MB/s    0:00:00 (xfr#1, to-chk=0/1)
INFO[0004] Installing /tmp/lima-guestagent to /usr/local/bin/lima-guestagent 
INFO[0007] Attempting to download the nerdctl archive    arch=aarch64 digest="sha256:4bf3e05c7203a1b86c84a506d022f7f4d2727143c8031cd5e4b78ef03f0fdcda" location="https://github.com/containerd/nerdctl/releases/download/v1.7.3/nerdctl-full-1.7.3-linux-arm64.tar.gz"
INFO[0007] Using cache "/home/anders/.cache/lima/download/by-url-sha256/7a01b636a74ea0365688ec93ad2f66cc2f010b7bd370dc55e7cad3c9b11fd012/data" 
INFO[0007] Copying "nerdctl-full-1.7.3-linux-arm64.tar.gz" to lima-raspberrypi 
data
    218,743,662 100%  317.02MB/s    0:00:00 (xfr#1, to-chk=0/1)
INFO[0046] Installing /tmp/nerdctl-full.tgz in /usr/local 

@afbjorklund
Copy link
Member Author

Rebased to lima v0.21.0, tested with nerdctl-full v1.7.5

@afbjorklund
Copy link
Member Author

AkihiroSuda
AkihiroSuda previously approved these changes Apr 22, 2024
Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

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

Thanks, and sorry for taking too long time to review

@AkihiroSuda AkihiroSuda added this to the v0.21.1 milestone Apr 22, 2024
@AkihiroSuda
Copy link
Member

Could you rebase to rerun the CI?

@AkihiroSuda
Copy link
Member

ping @afbjorklund

@afbjorklund
Copy link
Member Author

You can scope this out from the 0.22 release

@afbjorklund
Copy link
Member Author

Changed to use temporary filenames for the copy, and remove them after installation.

This makes the rsync flag less useful, so we need some other method to skip updates...

@afbjorklund

This comment was marked as resolved.

@afbjorklund

This comment was marked as resolved.

@afbjorklund afbjorklund marked this pull request as draft July 25, 2024 09:39
@afbjorklund afbjorklund force-pushed the guest-install branch 2 times, most recently from 0348ec6 to d2007e1 Compare August 31, 2024 16:31
@afbjorklund afbjorklund marked this pull request as ready for review August 31, 2024 18:02
@afbjorklund afbjorklund marked this pull request as draft September 1, 2024 09:19
@afbjorklund
Copy link
Member Author

This command is only needed when not using cidata.iso, so it goes together with PR #2000 (but it is stand-alone)

The user would still have to start the guestagent and containerd services, the command only installs the binaries.

This will install the lima-guestagent in the instance.

It will install nerdctl-full.tgz, if it has been enabled.

Signed-off-by: Anders F Björklund <[email protected]>
Signed-off-by: Anders F Björklund <[email protected]>
Signed-off-by: Anders F Björklund <[email protected]>
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.

2 participants