Quickstart in CLI
This guide is a basic tutorial for getting started with NVIDIA AI Workbench. It will walk you through activating the context on your local system, creating a project, and launching a Jupyterlab application. It will also give you an idea of how to modify the environment, manage the container, create versions, and publish local work to GitHub.
You successfully installed the application on your local system.
You have configured your NGC API key and your GitHub credentials. You can verify this with the
nvwb list integrationscommand.
You have opened a new shell.
You have set the user.name and user.email in Git.
You are familiar with the user docs.
Here, you create a blank project using an available Default Base Image on NGC, open a Jupyter Notebook running in the container, print “Hello World!” and then make your first commit.
Check the available Contexts on your system. Since we have yet to add any Remote Contexts, the only Context available is the local system.
nvwb list contexts
The output will look like the following:
NAME │ DESCRIPTION │ HOSTNAME │ STATUS ────────┼────────────────────────────────┼───────────┼───────────────── local │ Default local context for │ localhost │ ⚫ Not Running │ working on 'mac' │ │
Run the following command to start the local context:
nvwb activate local
Your prompt will prepend (nvwb:local)
Create a Project by running the command below, following directions, and hitting Return:
nvwb create project
You will enter the name
<project_name>, a description, and select from one of the two available bases, Python Basic or Pytorch Basic.
Once the Project container is built, you can open the Project with the command:
nvwb open <project_name>
The directory will change to
~/nvidia-workbench/<project_name>will prepend to the prompt.
To open JupyterLab, run the following command and wait for a browser tab to open:
nvwb start jupyterlab [--no-gpus]Note
--no-gpusflag is only necessary if you used the Pytorch container and the local system does not have a GPU.
When JupyterLab is open, navigate to the
codedirectory in the browser, create a new notebook, print “Hello World!” and save the notebook.
To see that you`ve changed the Project state, run the following command:
The status is similar to a Git status, but it gives information about the state of the environment in addition to those files. In this case, you should see that you added a file.
Here, you will add some Python dependencies and rebuild the container to ensure they are available.
To add Python packages, open the
requirements.txtfile and enter the packages you want. Then, save the file.
To see that you`ve changed the Project state, run the status command:
You will see that you also modified a file and that the environment requires a Full Rebuild. That is because you changed your requirements.txt file, but the container hasn`t been rebuilt.
To rebuild the container, run the following command:
This triggers a container rebuild to install the dependencies; however, the current container is still running.
Once the container rebuild is completed, you can work in the new environment by stopping the running container and then starting JupyterLab again by:
nvwb stop jupyterlab nvwb start jupyterlab
You will see that you can import the packages added. Do that and then save the notebook.
The Project folder is available at
~/nvidia-workbench/<project_name>, and you can add code and data directly through your file browser into the
data folders in that directory.
Add some code and data that will work with the environment you have built through the selection of the Base Environment and Python dependencies you added.Note
You can do this by dragging and dropping in the file browser or copying or moving into the code and data folders.
In JupyterLab, adjust the paths for the code and data to work for the directory structure.
Save the changes.
After Steps 1 through 3, you have created a simple local Project. Now it is time to check the status, commit your work, and push it to GitHub.
Check the changes you`ve made to the Project by running the command:
You should see that you’ve modified a file and added files but that the environment does not require a rebuild.
Commit the changes by running the command below and hitting Return:
AI Workbench formulates the commit message for you.
Now, publish the Project to GitHub so you can store it or move it to a different system by running the following command:
nvwb publish https://github.com <user_name> privateNote
<user_name> is the user name associated with the GitHub account you authenticated to, while private keeps the repository private.
Now, go to
https://github.com/<user_name>/<project_name>to see the project.
Congrats, you are now ready to get started with NVIDIA AI Workbench!