Work with Any Git Repository
Overview
You can clone any Git repository into AI Workbench and it will set up a project for you.
If the repository does not have a .project/spec.yaml file, AI Workbench detects this during the clone and prompts you to select a base image.
It then scaffolds a default specification file so you can start working immediately.
Cloning a non-project is the recommended way to bring an existing repository into AI Workbench.
You do not need to manually create configuration files before cloning. AI Workbench handles the initial setup and you can customize the specification afterward.
You can also create a specification file manually before cloning.
This gives you full control over the initial configuration, including layout, packages, and resource settings. This approach is useful if you need a specific setup from the first build or if you are preparing a repository for others to clone.
Key Concepts
Specification File:
The .project/spec.yaml file that defines how AI Workbench builds and configures the project container.
Non-Project Clone:
Cloning a repository that does not have a .project/spec.yaml file.
AI Workbench detects this, prompts you to select a base image, and scaffolds the specification.
Base Container Image:
A pre-built Docker image that provides the foundation for the project environment (OS, tools, frameworks).
Clone a Non-project
Step One: Get the repository URL.
If the repository is private, it must come from GitHub, GitLab or a self-hosted GitLab instance that you have access to. This requires you to have the relevant integration configured.
If it is public, it can come from any Git platform.
Step Two: Open a location and clone using the URL.
- Select Location Manager > Location Card
- Select Clone Project
- Enter Clone Project > Git Repository URL > followed by the repository URL
- (optional) Alter the default path on disk Clone Project > Path
- Select Clone Project > Clone
Step Three: Select Clone or Clone and Detach.
Clone keeps the remote origin. Use this if you want to pull upstream changes.
Clone and Detach removes the remote origin and history. Use this if you want to push changes to your own account.
Step Four: Select a base image.
AI Workbench detects that the repository does not have a .project/spec.yaml file and prompts you to pick a base image.
Select one of the base images and proceed.
Success: The project tab opens and the container starts building with the scaffolded specification.
AI Workbench looks for configuration files at the top level of the repository during the build.
If the repository has requirements.txt, apt.txt, preBuild.bash, or postBuild.bash files, they are used during the build and may require you to handle conflicts.
If these files are not at the top level, the container builds with no issues.
The scaffolded spec.yaml provides a minimal working configuration.
You can edit it to add packages, GPU resources, secrets, mounts, and other features.
See the Add Optional Features to Your Project section below.
Manually Create a Project Specification
Creating a specification manually gives you full control over the project configuration before cloning.
This is useful when you need a specific setup from the first build or when preparing a repository for others to clone. Only a few fields are required: version information, base container image details, and a project mount.
Step One: Create the directory structure.
-
Navigate to your repository root directory
-
Create the recommended directory structure:
Step Two: Create the minimal spec.yaml file.
-
Create a minimal
spec.yamlfile with this template: -
Edit the file to customize these required fields:
meta.name- Lowercase alphanumeric with hyphens (e.g.,my-ml-project)meta.image- Should match patternproject-<name>(e.g.,project-my-ml-project)meta.description- Brief description of your projectmeta.createdOn- ISO 8601 timestamp with current date and timeenvironment.base.registry- Container registry (e.g.,nvcr.io,docker.io)environment.base.image- Base container image with tag (choose from NGC catalog)environment.base.name- Human-readable container nameenvironment.base.description- Brief description of the containerenvironment.base.os_distro- Must match the actual OS distribution in your base container (e.g.,ubuntu,centos)environment.base.os_distro_release- Must match the actual OS release in your base container (e.g.,"22.04","20.04")
Step Three: Commit and push the .project directory.
-
Stage and commit the new directory:
-
Ensure the repository is accessible (public or with appropriate credentials)
Step Four: Clone the repository in AI Workbench.
- Select Location Manager > Location Card
- Select Clone Project
- Enter Clone Project > Git Repository URL > followed by your repository URL
- Select Clone Project > Clone
- AI Workbench reads the
spec.yamlfile and builds the container
Success: The project appears in the Location Manager and the container builds successfully.
NVIDIA-provided base images from nvcr.io have proper labels that minimize configuration effort. You still need to specify the OS distribution and release to match the actual container. Custom containers need additional Docker labels for full AI Workbench integration. See Use a Custom Container Image for custom container requirements.
The nvwb validate project-spec command checks basic syntax and structure.
However, it does not catch all errors and has known limitations.
The most reliable test is to push your repository and clone it with AI Workbench.
Add Optional Features to Your Project
The minimal specification is functional, but you can add optional features as needed.
Start simple and add complexity only when required. Each addition should serve a specific purpose for your project.
Customize project layout for different storage needs.
The minimal specification includes a standard layout with code, models, data, and scratch directories.
Modify the layout section to change storage backends for different directories.
Storage options: git (regular), gitlfs (large files), gitignore (excluded).
Each layout entry requires type and storage fields.
Add package dependencies with helper files.
Create these files in the project root, alongside the .project directory:
requirements.txt- Python packages (one per line)apt.txt- System packages (one per line)preBuild.bash- Runs before container buildpostBuild.bash- Runs after container buildonStart.bash- Runs each time the project container starts
See Manage Packages for package details and Use the onStart.bash Script for startup-script guidance.
Configure GPU and memory resources.
Add resources section to execution:
Both gpu.requested and sharedMemoryMB are optional.
See Configure GPU Settings for Project Container for hardware configuration.
Add environment secrets for API keys.
Add secrets section to execution:
Only variable is required; description is optional but recommended.
Add volume mounts for shared storage.
Add additional mounts to execution.mounts:
Each mount requires type and target (absolute path with trailing slash).
The project mount is always required.
For complete field documentation, see:
- AI Workbench Project Specification - Full specification reference
- Manage Packages - Package management
- Manage Runtime Settings - Mounts and variables
Related Topics
- AI Workbench Project Specification - Full specification reference
- The Project Specification - Understanding the spec file
- Use a Custom Container Image - Using custom container images
- Manage Packages - Managing packages
- Use the preBuild.bash Script - Pre-build scripts
- Use the postBuild.bash Script - Post-build scripts
- Configure GPU Settings for Project Container - GPU configuration