Install a self-hosted NVCF stack on one local k3d cluster, register that cluster with the control plane, and confirm that the local deployment is healthy.
This quickstart uses a single k3d cluster named ncp-local, fake GPUs, and
local route hostnames. It is for local development and validation only. For a
remote deployment, or for separate control-plane and GPU clusters, use
Helmfile Installation and
Self-Managed Clusters.
Run the commands from the NVCF repository root unless a step says otherwise.
The nvcf-cli self-hosted up command runs on your workstation. It does not run
inside Kubernetes.
Clone the public repository before you start:
git clone https://github.com/nvidia/nvcf.git
cd nvcfBefore you start, install and prepare:
- Docker running on your workstation
k3dv5.x or laterkubectlhelm>= 3.14helmfile>= 1.0. Usehelmfile>= 1.5.0 with Helm 4.helm-diffpluginnvcf-clion yourPATH. See Installation to build it from the repository or download it from NGC.- An NGC API key with access to the NVCF chart and image registry
- The NGC organization and team slugs for that registry access
Use these install helpers if you do not already have the local tools.
Install Docker from the [Docker installation guide](https://docs.docker.com/get-started/get-docker/). After Docker starts, verify that the CLI can reach it:docker versionbrew install k3d kubectl helm helmfile
k3d version
kubectl version --client
helm version
helmfile versionFor other systems, use the official installation guides: k3d, kubectl, Helm, and Helmfile.
Install the Helm plugin used by Helmfile:if helm version --short | grep -q '^v4'; then
helm plugin install https://github.com/databus23/helm-diff --verify=false
else
helm plugin install https://github.com/databus23/helm-diff
fi
helm plugin listSee the helm-diff installation instructions for offline or Helm 4 installation options.
Run these commands from the NVCF repository root:./setup.sh
bazel build //src/clis/nvcf-cli:nvcf-cli
mkdir -p "${HOME}/.local/bin"
install -m 0755 \
bazel-bin/src/clis/nvcf-cli/nvcf-cli_/nvcf-cli \
"${HOME}/.local/bin/nvcf-cli"
export PATH="${HOME}/.local/bin:${PATH}"
nvcf-cli versionFor the packaged CLI release, see Installation.
self-hosted up defaults to --env local and supports only the single local
k3d layout. It requires a current k3d-* kube context.
Export the registry credentials used by the local cluster bootstrap:
export NGC_API_KEY="<ngc-api-key>"
export SAMPLE_NGC_ORG="<ngc-org>"
export SAMPLE_NGC_TEAM="<ngc-team>"Create the single-cluster local topology:
make -C tools/ncp-local-cluster build-and-deploy-cluster
kubectl config use-context k3d-ncp-local
kubectl config current-contextExpected output:
k3d-ncp-local
Add these entries to /etc/hosts on the workstation running the CLI if they do
not already resolve:
127.0.0.1 api.localhost
127.0.0.1 api-keys.localhost
127.0.0.1 sis.localhost
127.0.0.1 invocation.localhost
Use the local CLI configuration that points commands at the local routes:
export NVCF_CLI_CONFIG=deploy/stacks/self-managed/nvcf-cli-local.yamlLog in to the NGC container registry:
helm registry login nvcr.io -u '$oauthtoken' -p "${NGC_API_KEY}"Create the local secrets files used by the control-plane and compute-plane stacks:
cp deploy/stacks/self-managed/secrets/secrets.yaml.template \
deploy/stacks/self-managed/secrets/local-secrets.yaml
BASE64_CRED="$(printf '%s' "\$oauthtoken:${NGC_API_KEY}" | base64 | tr -d '\n')"
sed -i.bak "s|REPLACE_WITH_BASE64_DOCKER_CREDENTIAL|${BASE64_CRED}|g" \
deploy/stacks/self-managed/secrets/local-secrets.yaml
rm deploy/stacks/self-managed/secrets/local-secrets.yaml.bakCheck local tools and Kubernetes access:
nvcf-cli --config "${NVCF_CLI_CONFIG}" self-hosted check --preRun the local install:
nvcf-cli --config "${NVCF_CLI_CONFIG}" self-hosted up \
--control-plane-stack=deploy/stacks/self-managed \
--compute-plane-stack=deploy/stacks/nvcf-compute-plane \
--env=local \
--cluster-name=ncp-local \
--nca-id=nvcf-default \
--region=us-west-1 \
--icms-url=http://sis.localhost:8080 \
--refresh-tokenExpected result: the final screen reports a successful install, a registered cluster, and a healthy backend.
The command installs the control plane, mints CLI authentication, registers `ncp-local`, installs the compute-plane components, and waits for the `NVCFBackend` health check to report healthy.Run the full self-hosted health checks:
nvcf-cli --config "${NVCF_CLI_CONFIG}" self-hosted check --all \
--cluster-name=ncp-localInspect the local Kubernetes resources:
kubectl get pods -A
kubectl get httproute -A
kubectl get nvcfbackends -AExpected result: the CLI checks do not report failed checks, and the
ncp-local NVCFBackend reports healthy.
Create a function from the load_tester_supreme sample image in the registry
organization and team you exported earlier:
nvcf-cli --config "${NVCF_CLI_CONFIG}" function create \
--name quickstart-load-tester-supreme \
--image "nvcr.io/${SAMPLE_NGC_ORG}/${SAMPLE_NGC_TEAM}/load_tester_supreme:0.0.8" \
--inference-url /echo \
--inference-port 8000 \
--health-uri /health \
--health-port 8000 \
--health-timeout PT30SDeploy the function to the local fake GPU backend:
nvcf-cli --config "${NVCF_CLI_CONFIG}" function deploy create \
--gpu H100 \
--instance-type NCP.GPU.H100_8x \
--backend ncp-local \
--regions us-west-1 \
--min-instances 1 \
--max-instances 1 \
--timeout 900Generate an API key for invocation:
nvcf-cli --config "${NVCF_CLI_CONFIG}" api-key generate \
--description quickstart-load-tester-supreme \
--scopes invoke_function,list_functions,queue_details,list_functions_detailsInvoke the sample function:
nvcf-cli --config "${NVCF_CLI_CONFIG}" function invoke \
--request-body '{"message":"quickstart-echo","repeats":1}' \
--timeout 120 \
--poll-duration 5Expected result: the invocation response contains quickstart-echo.
For other local fake GPU configurations, choose a --gpu and
--instance-type that match the discovered node labels and GPU count.
Remove the sample function deployment and function:
nvcf-cli --config "${NVCF_CLI_CONFIG}" function deploy remove
nvcf-cli --config "${NVCF_CLI_CONFIG}" function deleteRemove the compute-plane components:
nvcf-cli --config "${NVCF_CLI_CONFIG}" self-hosted uninstall \
--compute-plane \
--cluster-name ncp-local \
--compute-plane-stack=deploy/stacks/nvcf-compute-planeRemove the control plane:
nvcf-cli --config "${NVCF_CLI_CONFIG}" self-hosted uninstall \
--control-plane \
--control-plane-stack=deploy/stacks/self-managedDestroy the local k3d cluster:
make -C tools/ncp-local-cluster destroyIf the quickstart fails, start with Troubleshooting.
Common local k3d issues:
-
sis.localhostmust resolve from the workstation runningnvcf-cli. -
kubectl config current-contextmust printk3d-ncp-local. -
lookup api-keys.nvcf.nvidia.com: no such hostmeans the CLI is using the hosted default endpoint. Run commands with--config "${NVCF_CLI_CONFIG}"from this quickstart. -
node inotify limits below NVCA minimumsmeans the local k3d nodes need higher Linuxfs.inotifylimits. This does not change your macOS shell limits. From the repository root, applytools/ncp-local-cluster/apps/node-tuning/node-tuning.yaml, wait for thenode-tuningDaemonSet in thekube-systemnamespace, then rerunnvcf-cli --config "${NVCF_CLI_CONFIG}" self-hosted check --pre:kubectl apply -f tools/ncp-local-cluster/apps/node-tuning/node-tuning.yaml kubectl -n kube-system rollout status ds/node-tuning --timeout=5m
For non-local clusters, see Node inotify limits.
- Local Development for local k3d variants and cleanup commands.
- Helmfile Installation for remote or manual control-plane installs.
- Self-Managed Clusters for registering GPU clusters outside the local quickstart.
src/clis/nvcf-cli/examples/in this repository for sample CLI input files.