lima icon indicating copy to clipboard operation
lima copied to clipboard

Add hidden command to install the guest components

Open afbjorklund opened this issue 1 year ago • 10 comments

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:

  • #2000

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 avatar Nov 24 '23 07:11 afbjorklund

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 avatar Feb 24 '24 09:02 afbjorklund

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

afbjorklund avatar Mar 18 '24 18:03 afbjorklund

  • https://github.com/containerd/nerdctl/issues/2920

afbjorklund avatar Apr 07 '24 09:04 afbjorklund

Could you rebase to rerun the CI?

AkihiroSuda avatar Apr 22 '24 23:04 AkihiroSuda

ping @afbjorklund

AkihiroSuda avatar Apr 25 '24 23:04 AkihiroSuda

You can scope this out from the 0.22 release

afbjorklund avatar Apr 26 '24 06:04 afbjorklund

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 avatar Apr 28 '24 19:04 afbjorklund

Removed the rsync flag, since it is now useless when using temporary filenames.

afbjorklund avatar Jun 29 '24 07:06 afbjorklund

Needs some code to gunzip from a temporary location, in the case the lima-guestagent is compressed...

  • #2426

afbjorklund avatar Jun 29 '24 08:06 afbjorklund