Gradient Docs
Gradient HomeHelp DeskCommunitySign up free
Gradient Next
Gradient Next
  • About Gradient
  • Get Started
    • Quick Start
      • Install the Gradient CLI
    • Core Concepts
    • Organizing Projects
      • Secrets
      • Storing an API key as a Secret
    • Tutorials
      • Gradient Notebooks Tutorial
      • Gradient Workflows Tutorial
      • Gradient Deployments Tutorial
    • FAQ
    • Common Errors
  • Gradient Platform
    • Gradient Notebooks
      • Runtimes
      • Files and storage
      • Machines
      • Terminal
      • Shortcuts
      • Sharing
      • TensorBoard
      • Run on Gradient
    • Gradient Workflows
      • Basic operations
      • Understanding Inputs & Outputs
      • Workflow Spec
      • Gradient Actions
      • Environment Variables
      • Using YAML for Data Science
    • Gradient Deployments
      • Basic operations
      • Deployment Spec
  • Artifacts
    • Container Management
      • Custom Containers
    • Data
      • Versioned Data
        • Public Datasets Repository
        • Storage Providers
      • Persistent Storage
    • Models
      • Managing Models
        • Model Types & Metadata
        • Public Models
    • Code
    • Metrics
      • Push Metrics
      • View & Query Metrics
  • Gradient Cluster
    • Overview
      • Setup
        • Managed Private Clusters
        • Self-Hosted Clusters
          • Pre-installation steps
          • Gradient Installer CLI
          • Terraform
            • Pre-installation steps
            • Install on AWS
            • Install on bare metal / VMs
            • Install on NVIDIA DGX
          • Let's Encrypt DNS Providers
          • Updating your cluster
      • Usage
  • More
    • SDK
      • Projects Client
      • Models Client
      • Deployments Client
      • Workflows Client
      • SDK Examples
      • Full SDK Reference
    • Machine Types
      • Machine Tiers
      • Free Machines (Free Tier)
    • Your Account
      • Teams
        • Creating a Team
        • Upgrading to a Team Plan
      • Hotkeys
      • Billing & Subscriptions
        • Storage Billing
      • Public Profiles
    • Release notes
    • Roadmap
Powered by GitBook
On this page
  • Building a custom container
  • Build a Custom Container Locally
  • Getting started
  • Adding a Docker file to a working directory on your system
  • Building the Docker image
  • Pushing to Docker Hub
  • Requirements to use with Custom Notebooks
  • Bringing your Custom Container to Gradient
  • Notebooks
  • Workflows
  • Deployments
  1. Artifacts
  2. Container Management

Custom Containers

PreviousContainer ManagementNextData

Last updated 3 years ago

Building a custom container

The Custom Containers feature lets you pull your own image from a container registry e.g., Docker Hub. This section will help you prepare a custom Docker container and show you how to bring that Container into Gradient by creating either a Notebook, Workflow, or Deployment with your custom container.

ProTip! Using a Custom Container does not require building one from scratch. See this to access many freely available and up-to-date containers hosted on various container registries (e.g., , etc.).

Build a Custom Container Locally

Getting started

A computer with , , and NVIDIA Drivers installed (if you don’t have a Linux machine, use a !).

From that machine, you'll need to be logged into your account in the terminal. docker login -u <username> -p <password>

You can make your own Docker file from scratch (see "Requirements for for Custom Notebooks" below) or use another as a basis, such as this . For now, let's follow along this provided sample.

Adding a Docker file to a working directory on your system

First, clone the repo, and navigate to the corresponding directory in your terminal.

Open the Docker file into your IDE of choice, and make edits as necessary. The provided Docker file sample above pulls from DockerHub a Paperspace-made TensorFlow image designed to run TensorFlow 2.0 for GPUs on Gradient. You can do so with the FROM instruction.

Example: FROM docker.io/tensorflow/tensorflow:latest-gpu-jupyter

Once your Dockerfile is written, save it, and navigate back to the terminal.

Building the Docker image

Now that the Docker file is written, we can build the image by running:

docker build -t <Name of image>

For the example file above, you could enter:

docker build test-container

Once you have created the image, you need to tag it so that it can be added to Docker Hub. Tag the image using the image id, your Docker Hub username, and a name for the image in the following format:

docker tag <Image id> <Docker username>/test-container:<Tag>

Pushing to Docker Hub

Now that we have created and tagged out container, we can push it to Docker Hub for use with our Gradient resources. Use the following docker push command to do so:

docker push <Docker username>/test-container:<tag>

Requirements to use with Custom Notebooks

The following should be included in your Docker file to ensure the Notebook will set up and run properly.

  • Python: RUN apt-get update && apt-get install -y python3 python3-pip

  • If you don't specify a user, your container user will be 'root'

Bringing your Custom Container to Gradient

After you've pushed your custom container to Docker Hub, NGC, etc., or you found a public container that is already there, it's time to pull it into Gradient!

Notebooks

Workflows

Deployments

On the Choose Container step, navigate to the custom container tab and fill out the form. Note: A username and password must be provided for private Docker images.

Jupyter and all of Jupyter's dependencies: RUN pip install jupyterlab (For more details, see )

Click the advanced options toggle on the notebook create a notebook page. Follow the rest of the steps to create your Notebook by selecting your machine type, naming your notebook, and clicking Create.

Just specify the path of the container e.g., paperspace/gradient-sdk from within a Workflow step using image. Learn more .

article
Docker Hub
NGC
DockerCE
NVIDIA-docker
Paperspace Linux VM
Docker Hub
example
http://jupyter.org/install
here
here