📖
Build AI Documentation
  • Welcome!
  • Getting Started
  • Hardware Selection & Payment
  • Onboarding
  • Environment Setup
    • Logging in to your VM
    • Code & Env Setup
  • Training
    • On Virtual Machines
    • On Managed Kubernetes
  • Batched inference
    • On Virtual Machines
    • On Managed Kubernetes
  • Partners
    • Run House (ML Ops)
Powered by GitBook
On this page
  • Code Setup
  • Environment Setup
  1. Environment Setup

Code & Env Setup

PreviousLogging in to your VMNextOn Virtual Machines

Last updated 9 months ago

Code Setup

In general, there are three workflows you can use to edit code and run it on the cluster:

  1. Sign on through the Terminal and use an editor like emacs, vim, or nano to edit code directly in the terminal on the cluster.

  2. Edit your code locally and then copy it up to the cluster using either , , or pushing to a remote repo that is cloned on the cluster.

  3. Sign onto the cluster through an editor like VS code, and edit your files directly on the cluster compute.

Here, we walk through workflow #3. However, if you are running into latency problems interacting with the cluster through VS code directly, you may consider using workflow #2.

  1. Clone your code repo.

  2. Type the name of your repo.

Your repo will then be setup on the cluster.

Environment Setup

You can use any environment management strategy you prefer. Our example below shows how to set up a environment.

  1. Create a new environment.

# Standard environment creation:
$ conda create --name <environment-name>

# If you want to setup the environment in a particular location, use this instead:
$ conda create --prefix /path/to/environment/directory
  1. Activate your environment.

# For the fist setup method above:
$ conda activate <environment-name>

# For the second setup method above:
$ conda activate /path/to/environment/directory
# This will make sure packages are installed in your environment
(environment-name)$ conda install pip
  1. Install any packages you need to run your code. For example, if you have a requirements file:

(environment-name)$ pip install -r requirements.txt

Now you are ready to run your jobs. Before submitting a job to the cluster, make sure your environment is activated. Alternately, you can activate your environment in your job script.

Setup .

pip
scp
rsync
conda