Comments (11)
@profnandaa updated the issue description with the requested info.
from buildkit.
Yes, the documentation is missing the section on setting up proper CNIs. @profnandaa, my old guide contains setup steps for the CNI.
In short, we need to add to the docs instructions on downloading the CNI binaries, writing the config for the CNI and setting up the service to use the CNIs.
After the CNIs are set up, you can register buildkitd as a service using:
& "C:\Program Files\buildkit\buildkitd.exe" `
--register-service `
--service-name buildkitd `
--debug `
--containerd-worker=true `
--containerd-cni-config-path="C:\Program Files\containerd\cni\conf\0-containerd-nat.conf" `
--containerd-cni-binary-dir="C:\Program Files\containerd\cni\bin" `
--log-file="C:\Windows\Temp\containerd.log
# Make buildkitd dependent on containerd
sc.exe config buildkitd depend= containerd
You can remove the --debug
flag if you wish and set a proper path for the log. Also, you will need to adapt the path to the CNI config and CNI bin dir.. The above command removes the need for nssm
.
Edit: @profnandaa there are pre-built CNI binaries. We can add to the docs steps on downloading those. No need to build from source.
from buildkit.
Thank you @gabriel-samfira and @profnandaa
I used your guide and made modifications where needed and I got it to work.
Although, it looks to work inconsistently.
one run I'd get a working build, the next, I'd get failed to create shim task: hcs::CreateComputeSystem
and The requested operation for attach namespace failed: unknown
Containerd logs doesnt show anything promising that I can see with debugging turned on. Not sure if it's a containerd issue, CNI, or buildkit. But it's a work in progress!
from buildkit.
UPDATE: Seems like from buildkit end,
ipam
configs are not even needed (coz the network created already has the details?). I got it to working with only a minimal config like this.{ "cniVersion": "0.3.0", "name": "nat", "type": "nat" }
However, it fails when you add the wrong
ipam
details that don't match thenat
network created.
buildkit uses the containerd executor to spin up containers. We need to simply point it to the containerd CNI config and CNI dir and it should be fine.
from buildkit.
@gabriel-samfira -- sounds good. Sending in the documentation update. Will also add the part for registering builkitd
as a service, I'd left that in the initial documentation.
from buildkit.
Can share the sample repro dockerfile
using, and your platform and buildkit version details?
from buildkit.
Confirming the repro, DNS resolution issues too even when using curl.exe
. I suspect that this is to do with containerd CNI setup (which needs to be included in the documentation). Let me take a closer look at this tomorrow and get back.
/cc. @gabriel-samfira
from buildkit.
@ehuizar1028 -- seen a similar issue previously reported here containerd/containerd#5729 ; it's to do with the CNI, and perhaps around the CIDR config. I'm currently testing out various setups to make sure we have one definitive guide for setting this up. The guide should most likely live close to source at https://github.com/microsoft/windows-container-networking and linked from buildkit, containerd, etc. Working on that.
from buildkit.
@ehuizar1028 -- could you share with me the dump for your:
Get-HnsNetwork | where { $_.Name -eq 'nat' }
and the contents of your 'C:\Program Files\containerd\cni\conf\0-containerd-nat.conf'
; is their any mismatch in the CIDR (e.g. AddressPrefix=172.31.192.0/20
) vs what you have in your conf?
...
Subnets : {@{AdditionalParams=; AddressPrefix=172.31.192.0/20; Flags=0; GatewayAddress=172.31.192.1; Health=;
ID=E018ED9C-E2EE-42E6-AB2A-81EBFED99002; IpSubnets=System.Object[]; ObjectType=5; Policies=System.Object[]; State=0}}
....
from buildkit.
Thank you @gabriel-samfira and @profnandaa I used your guide and made modifications where needed and I got it to work.
Although, it looks to work inconsistently.
one run I'd get a working build, the next, I'd get
failed to create shim task: hcs::CreateComputeSystem
andThe requested operation for attach namespace failed: unknown
Containerd logs doesnt show anything promising that I can see with debugging turned on. Not sure if it's a containerd issue, CNI, or buildkit. But it's a work in progress!
try:
stop-service buildkitd
stop-service containerd
Get-HnsEndpoint | Remove-HnsEndpoint
start-service containerd
start-service buildkitd
and see if that fixes it. Containerd will recreate the network in HNS automatically.
from buildkit.
UPDATE:
Seems like from buildkit end, ipam
configs are not even needed (coz the network created already has the details?). I got it to working with only a minimal config like this.
{
"cniVersion": "0.3.0",
"name": "nat",
"type": "nat"
}
However, it fails when you add the wrong ipam
details that don't match the nat
network created.
from buildkit.
Related Issues (20)
- Refactor cache export interface HOT 2
- Incorrect DNS options with host networking when buildkit is run as docker-container on a host with systemd-resolved HOT 1
- WCOW: local and tar exporter to exclude known non-exportable files/dirs HOT 2
- ADD of remote file in Dockerfile causes occasional "digest mismatch" HOT 1
- New linting features not clearly documented HOT 2
- Build kit HOT 1
- [v0.14] performance regression on scanning contenthash paths HOT 3
- Update reportUnmatchedVariables to account for arguments declared via single-argument build-args in the style of ARG foo HOT 1
- rootless: overlayfs support check fails due to `failed to mount overlay: invalid argument` HOT 4
- v0.14.1 marked as pre-release HOT 1
- containerd: split runtime options definitions by OS HOT 2
- Huge performance difference for multi arch container builds between running buildkitd on the host or inside a container HOT 3
- Dockerfile: Mount the root `/proc/` into another directory HOT 6
- [v0.13+] unexpected permissions on COPY'd files HOT 9
- [v0.14] dockerfile: mkdir xxxx not a directory - with COPY --link HOT 4
- Automatic connect HOT 2
- Invalid `--add-host` in docker buildx HOT 6
- tests: add `frontend/dockerfile` integration tests to cover different path scenarios for COPY, etc.
- Add Deprecated Flag to the lint rules
- Lint test needing fix. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from buildkit.