Open jab opened 2 months ago
@nlewo any ideas?
It could be because of
tmpfs 795M 4.0K 795M 1% /run/user/0
@jab Could you try by setting the TMPDIR
env variable to /tmp
before running devenv container run processes
(i don't know if devenv modifies this env variable)?
If this doesn't help, it would be nice to run some commands with the upstream Skopeo to know if this issue is related to nix2container or Skopeo. For instance, something such as:
nix run nixpkgs#skopeo -- copy docker://alpine docker-daemon://alpine
@nlewo Same I/O error after setting TMPDIR:
hello-nix-image-py-webapp on main is 📦 v0.1 via 🐍 v3.11.8 via ❄️ impure (devenv-shell-env) on ☁️ (us-east-1)
❯ echo $TMPDIR
/tmp
hello-nix-image-py-webapp on main is 📦 v0.1 via 🐍 v3.11.8 via ❄️ impure (devenv-shell-env) on ☁️ (us-east-1)
❯ devenv container run processes
• Building processes container ...
• Failed to get cachix caches due to evaluation error
/nix/store/h4jb5kr247b6jhpkd4pj8yrinprmlf48-image-processes.json
✔ Building processes container in 16.4s.
• Copying processes container ...• Failed to get cachix caches due to evaluation error
• Running /nix/store/7xni5x8sln4nhrbkx4lhc60k5n87yxj4-copy-container /nix/store/h4jb5kr247b6jhpkd4pj8yrinprmlf48-image-processes.json docker-daemon:
Copying container /nix/store/h4jb5kr247b6jhpkd4pj8yrinprmlf48-image-processes.json to docker-daemon:processes:latest
Getting image source signatures
Copying blob eacd0e38112a done |
Copying blob 5a199d0ce155 done |
FATA[0224] writing blob: io: read/write on closed pipe
✔ Copying processes container in 227.7s.
Error: × Failed to copy container
As for further testing, I wonder if you might be able to try to reproduce this yourself so you could have a faster feedback loop as you try various things to debug this. (I specifically waited till devenv reached 1.0 before I gave it another try since I'm unfortunately a bit too short on time right now to spend a lot of time debugging stuff like this -- wish I could help more right now!)
wow, the size of a layer is 6GB: it takes few minutes on my laptop to be sent to the Docker deamon but it starts successfully:
devenv container run processes
• Building processes container ...
• Using Cachix: devenv
/nix/store/8nbp6bmwbna3vcs0wvyf0k0jkrb9llrc-image-processes.json
✔ Building processes container in 20.2s.
• Running /nix/store/7xni5x8sln4nhrbkx4lhc60k5n87yxj4-copy-container /nix/store/8nbp6bmwbna3vcs0wvyf0k0jkrb9llrc-image-processes.json docker-daemon:
Copying container /nix/store/8nbp6bmwbna3vcs0wvyf0k0jkrb9llrc-image-processes.json to docker-daemon:processes:latest
Getting image source signatures
Copying blob eacd0e38112a done |
Copying blob 75d94c1b557f done |
Copying config 60a5a6cc0f done |
Writing manifest to image destination
✔ Copying processes container in 483.9s.
^[2WARNING: pre-commit-hooks.nix: git command not found; skipping installation.
{"level":"warn","error":"open /env/.config/process-compose/settings.yaml: no such file or directory","time":"2024-04-02T20:30:06Z","message":"Error reading settings file /env/.config/process-compose/settings.yaml"}
✔ Running processes container in 21.5s.
So, i'm pretty sure it is an issue related to the storage available on your machine...
If you have the SSH to the machine, it would be nice to df -h
during the image copy to see if your storage available space decrease.
(Haven't had time yet to log back into the machine but) some quick thoughts in the meantime:
My df -h
output above indicated 7.2G free on /
. Does it make sense then that this would not be enough to copy a 6G image (e.g. is 2x the size of the image required)?
Are you checking the current amount of space available before attempting the copy to make sure there is enough, and if not, erroring early? ("Error: This operation requires XYZ available space but only ABC is available.")
Why is a devenv.nix that basically just enables Python along with a "hello world" Python module (note: no dependencies other than the Python standard library) resulting in such an enormous container image?
Describe the bug
I just followed the https://devenv.sh/containers/ docs to try to build and run a container for (essentially a "hello world") Python webapp using devenv for the first time. After picking up the fix for #1083, I can now build a container, but trying to run it fails with an I/O error during the copy step, and doesn't tell me what to do to fix it.
I checked and it's not a matter of running out of space on the disk:
To reproduce
The repo I reproduced this in is here: https://github.com/jab/hello-nix-image-py-webapp
I reproduced this in an x86_64 NixOS environment running recently-updated nixos-unstable:
Version
devenv 1.0.1 (x86_64-linux)