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

Support unpacking Docker images #11

Merged
merged 2 commits into from
Dec 28, 2024
Merged

Support unpacking Docker images #11

merged 2 commits into from
Dec 28, 2024

Conversation

ben-z
Copy link
Member

@ben-z ben-z commented Dec 28, 2024

This PR introduces the unpack URL param to unpack uploaded packages using https://github.com/WATonomous/docker-unpack . This is an alternative to #8 .

@ben-z
Copy link
Member Author

ben-z commented Dec 28, 2024

cc @alexboden I deployed and tested this manually:

docker pull ghcr.io/watonomous/infra-config:master
docker save ghcr.io/watonomous/infra-config:master > /tmp/provisioner.tar

curl -XPOST --form "file=@/tmp/provisioner.tar;filename=provisioner-test-ben" 'cvmfs-ephemeral.cluster.watonomous.ca/app/repos/cvmfs-ephemeral.cluster.watonomous.ca?overwrite=true&unpack=true'

apptainer exec --writable-tmpfs --containall --fakeroot --no-home --bind ../infra-config:/infra-config:ro --bind ../infra-config/outputs:/infra-config/outputs --pwd /infra-config /cvmfs/cvmfs-ephemeral.cluster.watonomous.ca/provisioner-test-ben bash

curl took 33 seconds on thor-slurm1. After the folder appeared in /cvmfs/, starting the container took 5 seconds ish. I ran a command ./kubernetes/run.sh k9s -A, and it took about 3 seconds to show me the password prompt.

Overall I think it's going to be an improvement because we eliminate downloading and loading the docker cache, and start the container right away.

@ben-z
Copy link
Member Author

ben-z commented Dec 28, 2024

A future improvement is to be able to stream uploading the file. Currently, if we do docker save ... | curl -XPOST --form "file=@-;filename=..., we get an out of memory error. This is because CURL buffers the entire stdin stream in memory before performing the request. We can change the server to support streaming the body instead of using formdata to speed this up. Then we can build and upload at the same time:

docker build ... | curl ...

Tracking this in #12

@ben-z ben-z merged commit 4216557 into main Dec 28, 2024
1 check passed
@ben-z ben-z deleted the benz/unpack branch December 28, 2024 17:55
@ben-z ben-z mentioned this pull request Dec 29, 2024
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.

1 participant