# Projects
A cnvrg project is the space where everything related to a specific machine learning (ML) problem or domain resides. You can work and collaborate on projects.
A project can include files, workspaces, experiments, flows, apps and dashboards, serving, artifacts, models, and even research papers.
The topics in this page:
# Project Creation
You can create a project in cnvrg using the web UI, cnvrg CLI, or SDK.
Using the cnvrg web UI
Complete the following steps to create a project within the cnvrg UI:
Navigate to the Projects tab and click Start Project.
Enter a title for the project and click Create.
The project is added and the project dashboard is displayed.
Using the cnvrg CLI
With cnvrg CLI commands, you can create either an empty project or a project linked to an existing folder.
Create an empty cnvrg project
Run the following command to create an empty cnvrg project:
cnvrg new <project-name>
Running the
cnvrg new
CLI command creates a default project tree:total 16 drwxr-xr-x 8 256B Jul 14 23:58 . drwxr-xr-x 8 256B Jul 14 23:58 .. drwxr-xr-x 4 128B Jul 14 23:58 .cnvrg -rw-r--r-- 1 139B Jul 14 23:58 .cnvrgignore -rw-r--r-- 1 404B Jul 14 23:58 README.md drwxr-xr-x 2 64B Jul 14 23:58 models drwxr-xr-x 2 64B Jul 14 23:58 notebooks drwxr-xr-x 5 160B Jul 14 23:58 src
The new cnvrg project is now created and you can make changes in your local directory.
To sync changes between the online project and your local repository use the
cnvrg sync
command:cnvrg sync
Create a cnvrg project and link it to an existing folder
Complete the following steps to create a cnvrg project and link it to a folder:
- Navigate into the folder.
- From there, run the
cnvrg link
command:
cnvrg link [--title='project_name'] --sync
For more information on the
cnvrg link
command, see the cnvrg CLI documentation.
Using the SDK
For instructions on creating a project using the SDK, see the SDK documentation.
# Main Project Screen
The main project screen shows a summary of your project, including the number of: experiments run, active endpoints, active workspaces, and active apps. Also included is a feed of all activity in the project.
On the left, the main project screen presents tabs for easy access to information such as project research and files.
From this screen, you can start or access a running workspace and link your project to a Git repository.
# Files
cnvrg offers out-of-the-box version control for your project. With the simple drag-and-drop UI or the cnvrg CLI, you can have your project files (code, artifacts) automatically tracked and versioned.
cnvrg automatically creates new commits for experiments and workspaces syncs and tracks all your project files. When connected to Git, only the designated output
folder is synced and managed by cnvrg.
# Change commits
To view a different commit, click the Files tab of a project and then the Version menu. Then, select a different commit. You can also change commits while viewing a specific file.
# File viewer
cnvrg has inline support for rendering a viewing of the following file types:
- Images
- CSVs
- Scripts (Python, R, txt, .sh, yaml, etc.)
- Static Jupyter Notebooks
Simply navigate to the file inside the Files tab and click it to view it.
# File version comparisons
As cnvrg is tracking multiple versions of your files, you can compare the difference between saved versions using the Diff button. This is beneficial for comparing scripts and Jupyter Notebooks.
Complete the following steps to compare the difference between two versions of the same file:
- Navigate to the file you want to compare.
- In the Version drop-down list, select the version to compare against.
- Click Diff on the second version's page.
cnvrg compares the selected version and the current version and highlights all the changes.
# Diff for scripts and text files
When comparing scripts, cnvrg places the scripts alongside each other and highlights the deletions and additions.
# Diff for static Jupyter Notebooks
When comparing Jupyter Notebooks, cnvrg aligns each cell alongside the corresponding previous version and highlights deletions and additions. Markdown and Code Cells are designated as well.
# Branches
When working on a workspace or from your local environment (PyCharm and others), all changes are pushed to the master
branch using cnvrg version control.
Every experiment run creates its own separate branch for the changes it makes. For example, if you run two experiments in parallel, with the same start_commit
, they both create two different end_commits
. This way, you ensure everything is tracked and no conflicts or unnecessary merges are made.
TIP
Use the .cnvrgignore
file to ignore files that you don't want to be synced to the platform.
# Syncing
To sync your project to cnvrg, run the following command:
cnvrg sync
TIP
Find more information for using the CLI with your project here.
# Project Settings
For each project, cnvrg provides the option to configure many different settings. Access the project settings using the Settings tab on your project's sidebar. Descriptions for each section are provided below.
# General Settings
The following General settings can be configured:
- Name: Enter the name of the project (Note: You cannot change the name after the project is created.)
- Description: Enter the description of the project.
- Privacy: Use the drop-down arrow to set the project as private or public.
- Delete Project: Click the Delete Project button to delete the project (Warning: You cannot recover deleted projects.)
# Collaborators
Making collaboration simpler is a key goal in cnvrg's mission. As such, every project in cnvrg can have different members. Projects are private by default and only their collaborators can access them.
To view, add, or remove collaborators from your project, click the Settings tab of the project and then click the Collaborators tab.
TIP
More details on how collaboration works in cnvrg can be found here.
# Add a collaborator
Complete the following steps to add a collaborator to the project:
- Go to Project > Settings > Collaborators.
- Click the Add Collaborator drop-down list.
- Enter the username or email of the person to add or select the user from the list.
- Click Save.
cnvrg adds the user as a collaborator on the project.
# Remove a collaborator
Complete the following steps to remove a collaborator from the project:
- Go to Project > Settings > Collaborators.
- Click the Remove button next to the user to remove.
cnvrg removes the user from the project.
NOTE
Administrators in your organization have access to all projects, without being added as a collaborator.
# Git Integration
cnvrg has native integration with Git. Leveraging this feature allows you to use an external Git repository to track your code and files while using cnvrg to track your data science resources such as models and experiments.
When integrating a cnvrg project with Git, cnvrg automatically clones your Git project before starting your job. You can specify a branch and commit when starting a workspace, experiment, flow task, or endpoint. Any artifacts and assets that are created during the job (like models, datasets, and plots) are stored using cnvrg's file system and are associated with the job for future reference.
# Linking your Git repo with a cnvrg project
Go to your project Settings tab and click the Git Integration tab. Here, set the Git Repo and the Git Branch. Specify whether the repo is private.
There are two ways to authenticate cnvrg with Git for your private repositories:
- SSH public and private key pair (done per project)
- OAuth token (done per user)
TIP
You cannot link an empty Git repository. Ensure you have a branch before connecting.
# SSH public and private key pair
Generate an SSH public and private key pair. The public key is given to the Git repository and the private key is entered into cnvrg. Make sure you do not create a key that uses a password.
Click the Git Integration tab of your project settings. Click Private Repo and then enter your SSH private key in the corresponding box.
Ensure the private key does not include a passphrase and it is entered with the following format:
-----BEGIN RSA PRIVATE KEY-----
...
-----END RSA PRIVATE KEY-----
Click Save. Your project now clones your private Git repository when running jobs.
Here are several links to instructions from major Git services providing instructions to generate SSH keys:
You must generate a new pair for every Git repository you are linking with cnvrg.
WARNING
When you enter the Git repo link in the project settings, use the SSH format.
# OAuth token
You can authenticate your cnvrg account with your Git account using an OAuth token by adding it to your cnvrg account settings.
Navigate to your cnvrg account settings. Enter the OAuth token in the corresponding Git Access Token field. Click Save. Now your cnvrg account can access all the same Git repositories that your Git account has access to.
You still need to link the cnvrg project to the Git repository in its Settings. Navigate to the Git Integration tab in the project settings to do so.
Here are links from major Git services providing instructions to generate OAuth tokens:
TIP
This gives your cnvrg account access to the same private repos your Git account has access to.
WARNING
When you enter the Git repo link in the project settings, use the https://
.
# Saving artifacts when using Git
To track a job's artifacts (such as notebook checkpoints and experiment outputs), you must indicate to cnvrg where to locate the artifacts your code produces.
When running the job, indicate to cnvrg the directory where your code is saving the files to. The default is output
in the project's home directory.
For example, if your code saves outputs like this:
model.save_weights('artifacts/model.weights')
Then, select artifacts
as your output folder.
WARNING
Ensure the output directory matches the one specified in your code, otherwise cnvrg cannot track your artifacts.
# Environment
This section is where important Environment variables are configured. Ensure there are no spaces before or after any entries. Optionally, you may use the defaults to define the Image and Compute selections.
The following Environment variables can be configured:
- Image: Add a default Docker image to your project.
- Compute: Set a default compute template(s) to run your jobs on.
- Command To Execute: Set a default command for experiments in the project.
- Working Directory: Set the default working directory for experiments. The command to be executed is called inside the selected working directory.
- Environment Variables: Set key value pairs to be exported as environment variables when a job is started.
- Run TensorBoard automatically: If enabled, the TensorBoard starts running automatically when a job starts.
- Restart when idle: Disable or enable to restart cnvrg experiments that haven't printed new logs for more than a predefined time (the default is 60 minutes).
- Autosync: Turn off or on to perform periodic automatic syncs.
- Sync Time: Set the duration between each automatic sync.
- On Spot Termination: If set to on, when you lose access to a spot, cnvrg syncs the experiment and restarts it on-demand.
- Use single deploy api key: Use one set of keys when publishing endpoints in the project.
- Email notifications: Set the default settings for whether to send email notifications when an experiment finishes successfully or encounters an error.
# Project Secrets
Secrets are encrypted environment variables that are created in your project and are attached to each job run in the project.
# Creating a secret
In your project Settings tab, click the Secrets tab. Here, click + Add New and add the Secret key and Secret value. Then click the Submit button.
The following rules apply to secret keys and values:
- Secret keys can contain only alphanumeric characters ([a-z], [A-Z], [0-9]) or underscores (_). Spaces are not allowed.
- Secret keys cannot start with a number.
- Secret keys must be unique.
- Secret values are limited to 253 characters.
# Accessing your secrets
Secrets are available in every job you run in the project's environment variables:
- For jobs executed on a Kubernetes cluster, their secrets are mounted as Kubernetes Secrets
- For jobs executed on a machine, their secrets are mounted as Docker environment variables
For example, in Python code you can access a secret key named "AWS_ACCESS_KEY" in the following way:
import os
os.environ.get("AWS_ACCESS_KEY")
NOTE
Updating environment variables and secrets doesn't affect running jobs, only new and restarted jobs.
# Webhooks
Webhooks settings in cnvrg provides a method to augment or alter the behavior of a webpage or webapp using custom callbacks. These callbacks may be maintained, modified, and managed by third-party users and developers who may not necessarily be affiliated with the originating website or application.
The Webhooks section also provides the ability to configure Slack integration and specify the name of a Slack channel to receive real-time alerts on experiments, as discussed next.
# Slack Integration
cnvrg includes the capability to send experiment notifications to a Slack user or channel. This can help users keep updated with the status of their running experiments.
Datasets →