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

Allow moby-buildx version to be specified in devcontainer.json #838

Merged

Conversation

sayhiben
Copy link
Contributor

@sayhiben sayhiben commented Feb 9, 2024

Fixes #837

@sayhiben sayhiben requested a review from a team as a code owner February 9, 2024 23:52
@sayhiben
Copy link
Contributor Author

sayhiben commented Feb 9, 2024

@microsoft-github-policy-service agree company="Rover.com"

@sayhiben
Copy link
Contributor Author

sayhiben commented Feb 9, 2024

I think I also need to bump the version here, but I'm unsure if you'd consider this a minor or patch bump

@sayhiben
Copy link
Contributor Author

sayhiben commented Feb 9, 2024

The idea here being that folks can use "mobyBuildxVersion": "0.12.0-ubuntu20.04u1" to resolve the current package manifest mismatch through downgrading buildx to a known-good version. This patch will still require that consumers update their devcontainer.json files, so perhaps temporarily pinning would be a better immediate fix?

Copy link
Member

@samruddhikhandale samruddhikhandale left a comment

Choose a reason for hiding this comment

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

Thank you for the quick fix, left some feedback

src/docker-in-docker/README.md Outdated Show resolved Hide resolved
src/docker-in-docker/install.sh Outdated Show resolved Hide resolved
src/docker-in-docker/install.sh Outdated Show resolved Hide resolved
src/docker-in-docker/install.sh Outdated Show resolved Hide resolved
src/docker-in-docker/install.sh Outdated Show resolved Hide resolved
- Specify mobyBuildxVersion in devcontainer-feature.json with pinned and commented default value
- Bump minor version
- Leverage default value in install.sh
- Only set buildx_version_suffix when installing moby
@sayhiben
Copy link
Contributor Author

Ah, looks like I need to handle different distributions. Give me a few more mins

@sayhiben
Copy link
Contributor Author

@samruddhikhandale Let's see what GHA has to say about the latest commit. It's a little ugly since it's effectively the same implementation as the suffix-finding code for the docker engine version, but hopefully these can all get a refactor into a common function later ?

@sayhiben
Copy link
Contributor Author

@samruddhikhandale Whoops, had an extra line that'll make the current workflow runs likely fail. Just pushed again

@samruddhikhandale
Copy link
Member

@sayhiben would be interested in making similar changes once this PR gets approved to

@samruddhikhandale Let's see what GHA has to say about the latest commit. It's a little ugly since it's effectively the same implementation as the suffix-finding code for the docker engine version, but hopefully these can all get a refactor into a common function later ?

Yep, this is alright for now, I can refactor it when I remove the default value.
Seems like the tests are passing 🎉

I'll merge this PR when all tests are green. Thank you so much, we appreciate it 👏

@samruddhikhandale samruddhikhandale merged commit 91ac774 into devcontainers:main Feb 10, 2024
111 checks passed
@radiantspace
Copy link

radiantspace commented Feb 12, 2024

Hey, not sure that is same issue or not, but I'm trying to apply the fix (for docker-in-docker feature) and specify moby-buildx version but get errors about package size mismatch when I do so. Relevant logs:

#15 14.67 Reading package lists...2024-02-12 14:23:46.153Z: 
#15 15.43 W: Failed to fetch mirror+file:/etc/apt/mirrorlist.txt/dists/focal/InRelease  Could not resolve 'packages.service.github.net'
#15 15.43 W: Some index files failed to download. They have been ignored, or old ones used instead.
#15 15.47 Reading package lists...2024-02-12 14:23:46.894Z: 
2024-02-12 14:23:47.043Z: #15 16.23 Building dependency tree...
#15 16.36 Reading state information...
2024-02-12 14:23:47.162Z: #15 16.48 The following additional packages will be installed:
2024-02-12 14:23:47.293Z: #15 16.48   libdevmapper1.02.1 moby-containerd moby-runc moby-tini
#15 16.48 Recommended packages:
#15 16.48   dmsetup apparmor kmod
#15 16.53 The following NEW packages will be installed:
#15 16.53   libdevmapper1.02.1 moby-buildx moby-cli moby-containerd moby-engine
#15 16.53   moby-runc moby-tini
#15 16.57 0 upgraded, 7 newly installed, 0 to remove and 0 not upgraded.
2024-02-12 14:23:47.294Z: #15 16.57 Need to get 135 MB of archives.
#15 16.57 After this operation, 363 MB of additional disk space will be used.
#15 16.57 Get:1 https://packages.microsoft.com/ubuntu/20.04/prod focal/main amd64 moby-buildx amd64 0.12.1-ubuntu20.04u1 [34.1 MB]
#15 16.57 Err:1 https://packages.microsoft.com/ubuntu/20.04/prod focal/main amd64 moby-buildx amd64 0.12.1-ubuntu20.04u1
#15 16.57   File has unexpected size (34152700 != 34091250). Mirror sync in progress? [IP: 13.80.99.124 443]
#15 16.57   Hashes of expected file:
#15 16.57    - SHA256:0d1c7ac216d2a7d825b6fb0dbdec0f81d88540f1cc074d77abf4c0e7988f3e03
#15 16.57    - Filesize:34091250 [weak]
#15 16.61 Get:2 https://packages.microsoft.com/ubuntu/20.04/prod focal/main amd64 moby-cli amd64 24.0.9-ubuntu20.04u1 [15.6 MB]
2024-02-12 14:23:47.401Z: #15 16.70 Get:3 https://packages.microsoft.com/ubuntu/20.04/prod focal/main amd64 moby-runc amd64 1.1.12-ubuntu20.04u1 [6680 kB]
#15 16.72 Get:4 http://archive.ubuntu.com/ubuntu focal/main amd64 libdevmapper1.02.1 amd64 2:1.02.167-1ubuntu1 [127 kB]
2024-02-12 14:23:47.552Z: #15 16.74 Get:5 https://packages.microsoft.com/ubuntu/20.04/prod focal/main amd64 moby-containerd amd64 1.6.28-ubuntu20.04u1 [45.9 MB]
2024-02-12 14:23:47.680Z: #15 17.00 Get:6 https://packages.microsoft.com/ubuntu/20.04/prod focal/main amd64 moby-tini amd64 0.19.0-ubuntu20.04u1 [350 kB]
2024-02-12 14:23:47.825Z: #15 17.00 Get:7 https://packages.microsoft.com/ubuntu/20.04/prod focal/main amd64 moby-engine amd64 24.0.9-ubuntu20.04u1 [32.2 MB]
#15 17.14 E: Failed to fetch https://packages.microsoft.com/ubuntu/20.04/prod/pool/main/m/moby-buildx/moby-buildx_0.12.1-ubuntu20.04u1_amd64.deb  File has unexpected size (34152700 != 34091250). Mirror sync in progress? [IP: 13.80.99.124 443]
#15 17.14    Hashes of expected file:
#15 17.14     - SHA256:0d1c7ac216d2a7d825b6fb0dbdec0f81d88540f1cc074d77abf4c0e7988f3e03
#15 17.14     - Filesize:34091250 [weak]
#15 17.14 E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
#15 17.14 Fetched 101 MB in 1s (167 MB/s)2024-02-12 14:23:47.826Z: 
2024-02-12 14:23:47.976Z: #15 17.14 (!) Packages for moby not available in OS ubuntu focal (amd64). To resolve, either: (1) set feature option '"moby": false' , or (2) choose a compatible OS version (eg: 'ubuntu-20.04').
#15 17.14 ERROR: Feature "Docker (Docker-in-Docker)" (docker-in-docker) failed to install! Look at the documentation at ********/devcontainers/features/tree/main/src/docker-in-docker for help troubleshooting this error.
2024-02-12 14:23:48.578Z: #15 ERROR: process "/bin/sh -c cp -ar /tmp/build-features-src/docker-in-docker_0 /tmp/dev-container-features  && chmod -R 0755 /tmp/dev-container-features/docker-in-docker_0  && cd /tmp/dev-container-features/docker-in-docker_0  && chmod +x ./devcontainer-features-install.sh  && ./devcontainer-features-install.sh  && rm -rf /tmp/dev-container-features/docker-in-docker_0" did not complete successfully: exit code: 1
2024-02-12 14:23:48.660Z: ------

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.

Ubuntu:focal + latest docker-in-docker feature fails to prebuild due to Moby package validation issue
3 participants