Brev.dev, inc of San Francisco, California, USA has been acquired by NVIDIA Corporation of Santa Clara, California, USA on July 2024

Learn more
BlogPricing

Dev Environments

How to use SCP with Brev

Tyler Fong

April 5, 20245 min read

What is SCP?

SCP, or Secure Copy Protocol, is a network protocol that enables secure file transfers between a local host and a remote host. Whether you wanna copy a script or datasets, SCP can be used to transfer these files to your remote development machine.

Using SCP With Brev

Prerequisites

In order to use scp, you'll need to have a running instances. For this tutorial, I'll have two running instances named: hf-lora-diffusion-be619e and awesome-gpu-name-testing

Install the Brev CLI and log in. This process will automatically set up your SSH configuration for Brev, which is necessary for SCP to function properly with your Brev account.

brew install brevdev/homebrew-brev/brev
brev login

You can verify that it’s set up correctly by running:

brev ls

You should see your running instances like so:

img

Once this is done, your ready to use SCP!

Running the command

The general format for the scp command on your local machine is as follows:

scp <local-file-path> <brev-instance-name>:<remote-file-path>

Example:

scp ./test.json awesome-gpu-name:/home/ubuntu

In this example, we copied a file called test.json from our current local directory to the home directory of our Host machine.

You can verify that your file exists on the remote machine by sshing into your host machine by running the following:

If your container is not built

brev shell <brev-instance-name>

If your container is built

brev shell <brev-instance-name> --host

If you want to transfer files into the Container/Jupyter Notebook in your machine you'll, need to change <remote-file-path> from /home/ubuntu to /home/ubuntu/verb-workspace like such.

Container SCP Caveats

For almost all cases /home/ubuntu/verb-workspace is the remote file path where the container mounts. However, this is not the case if the vm uses a custom container which will come from some of our featured notebooks.

You’ll be able to check if your instance is using a custom container from your instances list:

img

Instead of denoting the python and cuda version, it's a name of an image from a docker registery.

If you want to copy files to the custom container, change <remote-file-path> from /home/ubuntu/verb-workspace to /root/verb-workspace like such:

scp ./test.json hf-lora-diffusion-be619e:/root/verb-workspace

That’s it! You’re now all set to use SCP with Brev! Happy Building!

Previous
Brev.dev to easily create, use, and pause Lambda cloud instances