-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Furkan Türkal <[email protected]> Co-authored-by: Batuhan <[email protected]>
- Loading branch information
1 parent
1475185
commit d148625
Showing
9 changed files
with
188 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!--monopod:start--> | ||
# nvidia-container-toolkit | ||
| | | | ||
| - | - | | ||
| **OCI Reference** | `cgr.dev/chainguard/nvidia-container-toolkit` | | ||
|
||
|
||
* [View Image in Chainguard Academy](https://edu.chainguard.dev/chainguard/chainguard-images/reference/nvidia-container-toolkit/overview/) | ||
* [View Image Catalog](https://console.enforce.dev/images/catalog) for a full list of available tags. | ||
* [Contact Chainguard](https://www.chainguard.dev/chainguard-images) for enterprise support, SLAs, and access to older tags.* | ||
|
||
--- | ||
<!--monopod:end--> | ||
|
||
<!--overview:start--> | ||
The NVIDIA Container Toolkit allows users to build and run GPU accelerated containers. | ||
<!--overview:end--> | ||
|
||
<!--getting:start--> | ||
## Download this Image | ||
The image is available on `cgr.dev`: | ||
|
||
``` | ||
docker pull cgr.dev/chainguard/nvidia-container-toolkit:latest | ||
``` | ||
<!--getting:end--> | ||
|
||
<!--body:start--><!--body:end--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
terraform { | ||
required_providers { | ||
apko = { source = "chainguard-dev/apko" } | ||
} | ||
} | ||
|
||
module "accts" { | ||
source = "../../../tflib/accts" | ||
run-as = 0 # This image needs to run as root | ||
} | ||
|
||
variable "extra_repositories" { | ||
description = "The additional repositores to install from (e.g. extras)." | ||
default = ["https://packages.cgr.dev/extras"] | ||
} | ||
|
||
variable "extra_keyring" { | ||
description = "The additional keys to use (e.g. extras)." | ||
default = ["https://packages.cgr.dev/extras/chainguard-extras.rsa.pub"] | ||
} | ||
|
||
variable "extra_packages" { | ||
description = "Additional packages to install." | ||
type = list(string) | ||
default = [ | ||
"nvidia-container-toolkit", | ||
"nvidia-container-toolkit-nvidia-container-runtime", | ||
"nvidia-container-toolkit-nvidia-container-runtime-cdi", | ||
"nvidia-container-toolkit-nvidia-container-runtime-hook", | ||
"nvidia-container-toolkit-nvidia-container-runtime-legacy", | ||
"nvidia-container-toolkit-nvidia-ctk", | ||
"libnvidia-container", | ||
"nvidia-cuda-cudart-12", | ||
"nvidia-cuda-nvml-dev-12", | ||
] | ||
} | ||
|
||
output "config" { | ||
value = jsonencode({ | ||
contents = { | ||
packages = concat(var.extra_packages) | ||
repositories = concat(var.extra_repositories) | ||
keyring = concat(var.extra_keyring) | ||
} | ||
accounts = module.accts.block | ||
environment = { | ||
PATH = "/work:/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/cuda-12.3/", | ||
CUDA_VERSION = "12.3", | ||
LD_LIBRARY_PATH = "/usr/local/nvidia/lib:/usr/local/nvidia/lib64:/usr/lib/:/usr/lib64:/usr/local/cuda-12.3/include:/usr/local/cuda-12.3/lib:/usr/local/cuda-12.3/lib64:/usr/local/cuda-12.3/lib64/stubs" | ||
NVIDIA_VISIBLE_DEVICES = "all" | ||
NVIDIA_DRIVER_CAPABILITIES = "utility" | ||
NVIDIA_REQUIRE_CUDA = "cuda>=11.2 brand=tesla,driver>=418,driver<419 brand=tesla,driver>=440,driver<441 driver>=450" | ||
NVIDIA_DISABLE_REQUIRE = "true" | ||
}, | ||
entrypoint = { | ||
command = "nvidia-toolkit" | ||
} | ||
}) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
terraform { | ||
required_providers { | ||
oci = { source = "chainguard-dev/oci" } | ||
} | ||
} | ||
|
||
variable "target_repository" { | ||
description = "The docker repo into which the image and attestations should be published." | ||
} | ||
|
||
module "config" { source = "./config" } | ||
|
||
module "nvidia-container-toolkit" { | ||
source = "../../tflib/publisher" | ||
name = basename(path.module) | ||
target_repository = var.target_repository | ||
config = module.config.config | ||
|
||
# build-dev = true | ||
|
||
} | ||
|
||
# module "test" { | ||
# source = "./tests" | ||
# digest = module.nvidia-container-toolkit.image_ref | ||
# } | ||
|
||
resource "oci_tag" "latest" { | ||
# depends_on = [module.test] | ||
digest_ref = module.nvidia-container-toolkit.image_ref | ||
tag = "latest" | ||
} | ||
|
||
# resource "oci_tag" "latest-dev" { | ||
# depends_on = [module.test] | ||
# digest_ref = module.nvidia-container-toolkit.dev_ref | ||
# tag = "latest-dev" | ||
# } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: nvidia-container-toolkit | ||
image: cgr.dev/chainguard/nvidia-container-toolkit | ||
logo: https://storage.googleapis.com/chainguard-academy/logos/nvidia-container-toolkit.svg | ||
endoflife: "" | ||
console_summary: "Build and run containers leveraging NVIDIA GPUs" | ||
short_description: The NVIDIA Container Toolkit allows users to build and run GPU accelerated containers. | ||
compatibility_notes: "" | ||
readme_file: README.md | ||
upstream_url: https://github.com/NVIDIA/nvidia-container-toolkit | ||
keywords: | ||
- nvidia | ||
- gpu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -o errexit -o nounset -o errtrace -o pipefail -x | ||
|
||
# TODO: Implement this test. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
terraform { | ||
required_providers { | ||
oci = { source = "chainguard-dev/oci" } | ||
} | ||
} | ||
|
||
variable "digest" { | ||
description = "The image digest to run tests over." | ||
} | ||
|
||
// Invoke a script with the test. | ||
// $IMAGE_NAME is populated with the image name by digest. | ||
// TODO: Update or remove this test as appropriate. | ||
data "oci_exec_test" "manifest" { | ||
digest = var.digest | ||
script = "./EXAMPLE_TEST.sh" | ||
working_dir = path.module | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters