Skip to content

build: cdi manual - #23069

Merged
crazy-max merged 1 commit into
docker:mainfrom
crazy-max:build-cdi
Jul 21, 2025
Merged

build: cdi manual#23069
crazy-max merged 1 commit into
docker:mainfrom
crazy-max:build-cdi

Conversation

@crazy-max

@crazy-maxcrazy-max commented Jul 11, 2025

Copy link
Copy Markdown
Member

Description

Adds CDI page to build section.

Related issues or tickets

Reviews

  • Technical review
  • Editorial review
  • Product review

@github-actionsgithub-actionsBot added the area/build Relates to Dockerfiles or docker build command label Jul 11, 2025
@netlify

netlifyBot commented Jul 11, 2025

Copy link
Copy Markdown

Deploy Preview for docsdocker ready!

NameLink
🔨 Latest commit2944e33
🔍 Latest deploy loghttps://app.netlify.com/projects/docsdocker/deploys/687dfe2438aeb60008489e20
😎 Deploy Previewhttps://deploy-preview-23069--docsdocker.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@crazy-max
crazy-maxforce-pushed the build-cdi branch 5 times, most recently from 5465608 to 4ef0c39CompareJuly 11, 2025 11:43
@crazy-max
crazy-max marked this pull request as ready for review July 11, 2025 11:51
@ArthurFlag

Copy link
Copy Markdown
Contributor

Could you edit this line to

SECRETS_SCAN_OMIT_PATHS = "public/contribute/file-conventions/index.html,public/content/manuals/build/building/cdi.html"

?

@github-actionsgithub-actionsBot added the area/release Relates to CI or deployment label Jul 11, 2025
Comment threadnetlify.toml Outdated
@crazy-max

crazy-max commented Jul 11, 2025

Copy link
Copy Markdown
MemberAuthor

Thanks looks good now but do you know why it is happening? Looking at the logs: https://app.netlify.com/projects/docsdocker/deploys/6870f8f33387050008ca7b11

1:45:06 PM: ❯ Scanning complete. 8540 file(s) scanned. Secrets scanning found 0 instance(s) of secrets and 1 instance(s) of likely secrets in build output or repo code.
1:45:06 PM: ​
1:45:06 PM: "LS0t***" detected as a likely secret:
1:45:06 PM: found value at line 719 in public/build/building/cdi/index.html
1:45:06 PM: ​
1:45:06 PM: To prevent exposing secrets, the build will fail until these likely secret values are not found in build output or repo files.
1:45:06 PM: ​
1:45:06 PM: If these are expected, use SECRETS_SCAN_SMART_DETECTION_OMIT_VALUES, or SECRETS_SCAN_SMART_DETECTION_ENABLED to prevent detecting.
1:45:06 PM: ​
1:45:06 PM: For more information on secrets scanning, see the Netlify Docs: https://ntl.fyi/configure-secrets-scanning
1:45:06 PM: ​
1:45:06 PM: Secrets scanning detected secrets in files during build. 1:45:06 PM: ────────────────────────────────────────────────────────────────

It says cdi page contains LS0t*** as secret but I don't have any occurrence like this.

@ArthurFlag

Copy link
Copy Markdown
Contributor

The LST0 issue is the one we had a few weeks ago: it comes from codeblocks that we convert into Base64 for the copy button, so one of your codeblocks contains that string once converted 🙃

@crazy-max

Copy link
Copy Markdown
MemberAuthor

The LST0 issue is the one we had a few weeks ago: it comes from codeblocks that we convert into Base64 for the copy button, so one of your codeblocks contains that string once converted 🙃

Ah I see but still wonder why just file-conventions and cdi pages are affected and not others using codeblocks?

@crazy-max
crazy-maxforce-pushed the build-cdi branch 2 times, most recently from b0fd26d to 3153d21CompareJuly 11, 2025 16:09
@thaJeztah

Copy link
Copy Markdown
Member

Ah I see but still wonder why just file-conventions and cdi pages are affected and not others using codeblocks?

I guess just "luck" if the script base64 encodes the content of the codeblock (before styling).

@thaJeztah

Copy link
Copy Markdown
Member

Did a quick check; LS0t is --- (base64 encoded)

Comment threadcontent/manuals/build/building/cdi.md Outdated

@ArthurFlagArthurFlag left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great stuff. The troubleshooting in the middle of it will be super useful for AI scrapers 👍

Comment threadcontent/manuals/build/building/cdi.md Outdated
Comment threadcontent/manuals/build/building/cdi.md Outdated

@thaJeztahthaJeztah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks like I started writing some comments that I didn't submit yet 😂

Comment threadcontent/manuals/build/building/cdi.md Outdated
cdiVersion: "0.6.0"
kind: "vendor1.com/device"
devices:
- name: foo

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Perhaps we could use some name like my-device instead of foo (probably also for the filename and env-var)

Comment on lines +75 to +95
GC Policy rule#0:
All: false
Filters: type==source.local,type==exec.cachemount,type==source.git.checkout
Keep Duration: 48h0m0s
Max Used Space: 658.9MiB
GC Policy rule#1:
All: false
Keep Duration: 1440h0m0s
Reserved Space: 4.657GiB
Max Used Space: 953.7MiB
Min Free Space: 2.794GiB
GC Policy rule#2:
All: false
Reserved Space: 4.657GiB
Max Used Space: 953.7MiB
Min Free Space: 2.794GiB
GC Policy rule#3:
All: true
Reserved Space: 4.657GiB
Max Used Space: 953.7MiB
Min Free Space: 2.794GiB

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Perhaps we should omit these in the example output, as they're not really relevant for this manual, e.g.;

Suggested change
GC Policy rule#0:
All: false
Filters: type==source.local,type==exec.cachemount,type==source.git.checkout
Keep Duration: 48h0m0s
Max Used Space: 658.9MiB
GC Policy rule#1:
All: false
Keep Duration: 1440h0m0s
Reserved Space: 4.657GiB
Max Used Space: 953.7MiB
Min Free Space: 2.794GiB
GC Policy rule#2:
All: false
Reserved Space: 4.657GiB
Max Used Space: 953.7MiB
Min Free Space: 2.794GiB
GC Policy rule#3:
All: true
Reserved Space: 4.657GiB
Max Used Space: 953.7MiB
Min Free Space: 2.794GiB
# ...

Comment threadcontent/manuals/build/building/cdi.md Outdated
Comment threadcontent/manuals/build/building/cdi.md Outdated
Comment threadcontent/manuals/build/building/cdi.md
Comment threadcontent/manuals/build/building/cdi.md Outdated
Now let's create a container builder named `gpubuilder` using Buildx:

```console
$ docker buildx create --name gpubuilder --driver-opt "image=crazymax/buildkit:v0.23.2-ubuntu-nvidia" --bootstrap

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We probably want to have this somewhere more "official" I guess (not a blocker); how complicated is this image to build? Would it be an option to add the Dockerfile here (if it's just 2 .. 3 steps)?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Yes it will be in the future, this is tracked in moby/buildkit#5944.

Would it be an option to add the Dockerfile here (if it's just 2 .. 3 steps)?

It's the BuildKit Dockerfile so not an option 😅

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Gotcha! I was hoping it could be some COPY --from=buildkit-bin ... to compose the image, but based on a different base image.

Definitely not a blocker!

Comment threadcontent/manuals/build/building/cdi.md Outdated
title: Container Device Interface (CDI)
weight: 60
description: Using CDI to access GPUs and other devices in your builds
keywords: build, buildkit, buildx, guide, tutorial, cdi, device, gpu, nvidia, cuda, amd, rocm

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks like vale may need to be taught some of these acronyms (nvidia, coda ..) or would it be because they're lowercase here?

@crazy-maxcrazy-maxJul 15, 2025

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

I think keywords should be excluded from Vale analysis or at least don't check casing

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We need to revisit our Vale configuration to include a few more terms to the "allowlist". Yea, excluding metadata could be a good option.

@crazy-max
crazy-maxforce-pushed the build-cdi branch 2 times, most recently from 19103b6 to 266606aCompareJuly 18, 2025 12:03
Comment on lines +215 to +219
> [!NOTE]
> If you are creating a container builder on WSL, you need to ensure that
> [Docker Desktop](../../desktop/_index.md) is installed and [WSL 2 GPU Paravirtualization](../../desktop/features/gpu.md#prerequisites)
> is enabled. Buildx v0.26+ is also required to mount the WSL libraries in the
> container.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Added this section related to docker/buildx#3320

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Removed this part for now as this will happen in the next 0.27 milestone.

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
@crazy-max
crazy-max merged commit 284b194 into docker:mainJul 21, 2025
14 of 15 checks passed
@crazy-max
crazy-max deleted the build-cdi branch July 21, 2025 09:12
@crazy-maxcrazy-max mentioned this pull request Jul 21, 2025
3 tasks
@crazy-maxcrazy-max mentioned this pull request Aug 25, 2025
3 tasks
aevesdocker pushed a commit that referenced this pull request Aug 26, 2025
follow-up
#23069 (comment)
## Related issues or tickets
* docker/buildx#3320
## Reviews
<!-- Notes for reviewers here -->
<!-- List applicable reviews (optionally @tag reviewers) -->
- [ ] Technical review
- [ ] Editorial review
- [ ] Product review
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/buildRelates to Dockerfiles or docker build commandarea/releaseRelates to CI or deployment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@crazy-max@ArthurFlag@thaJeztah@thompson-shaun@usha-mandya