Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

dagshub_storage.md 3.2 KB

You have to be logged in to leave a comment. Sign In

DagsHub Storage

What is it?

DagsHub's Onboard Storage is an HTTP remote cache for DVC{target=_blank}. Every repository has it, and everyone can use it without having a degree in DevOps and a billing account in a cloud provider. This means you can easily store and version your data and models alongside your code.

How does it work?

The same way you get a git remote URL for your git repository. You create a repository, and it automatically provides you with a DVC remote URL. When pushing or pulling data from this URL, you use your existing DagsHub credentials (via HTTPS basic authentication).

This means you automatically get the same access control as the normal code git repository - public repo data is publicly readable, but only maintainers of the project can push data or read data from a private repo. Just setup your DagsHub DVC remote, and start working!

Setting up DagsHub as remote

  1. Go to your repository homepage.

  2. Copy your DVC remote URL:

    Screenshot

  3. Enter a terminal in your project.

  4. Add a dvc remote

    dvc remote add origin --local <--dvc-remote-url-->
    

That's it! You're all set to pull the repository data!

Pushing files or using a private repo

  1. Set the DVC remote to use basic auth

    dvc remote modify origin --local auth basic
    

    !!! info "Why --local?" Everything you configure without --local will end up in the .dvc/config file, which is tracked by git, and appear in you repository. Personal info like authentication details should always be kept local.

  2. Set your credentials

    dvc remote modify origin --local user <--user-->
    dvc remote modify origin --local ask_password true
    

    ??? tip "Use access tokens instead of filling in your password" Important Note: Using this method for authentication without following instructions closely might result in pushing your password or access token to a public repository. Please use it with caution.

     ---
    
     If you prefer not to enter your password every time you push to your DVC remote, or you are using a service machine which is not interactive, you can use this alternative setup.
    
     1. Create an access token in the [tokens settings menu](https://dagshub.com/user/settings/tokens). Immediately after creating it, you will be shown an access token. Copy it.
    
     2. Set your credentials:
           ```bash
           dvc remote modify origin --local user <--user-->
           dvc remote modify origin --local password <--access token-->
           ```
    
     **Note:** if you already typed `dvc remote modify origin --local ask_password true` you will need to unset this by typing `dvc remote modify origin --local --unset ask_password`
    

That's it! You can now pull data from your remote cache

Pull data

dvc pull -r origin

Push data

  1. First, make sure you are using DVC{target=_blank} version 1.10 or greater

  2. Then you can run:

    dvc push -r origin
    
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...