Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sharing exp: document studio.token #4470

Merged
merged 1 commit into from
Apr 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions content/docs/command-reference/exp/push.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ to see experiments in the remote.
This command will also try to `dvc push` all <abbr>cached</abbr> data associated
with the experiments to [remote storage], unless `--no-cache` is used.

If `studio.token` config or `DVC_STUDIO_TOKEN` environment variable is set, DVC
will notify Studio about new experiments, and display a Studio project URL to
view experiments.
skshetry marked this conversation as resolved.
Show resolved Hide resolved
[Get the token](https://studio.iterative.ai/user/_/profile?section=accessToken)
or check
[this guide on how to create an access token](/doc/studio/user-guide/projects-and-experiments/live-metrics-and-plots#set-up-an-access-token).

## Options

- `-A`, `--all-commits` - push all experiments in the repository (overrides
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ This requires a 2-step process:

## Set up an access token

Iterative Studio uses access tokens to authorize [DVCLive] to send live updates
to the metrics and plots. The access token must be present in any request that
sends data to the Iterative Studio ingestion endpoint. Requests with missing or
incorrect access tokens are rejected with an appropriate HTTP error code and
error message.
Iterative Studio uses access tokens to authorize DVC and [DVCLive] to send
experiments and live updates to the metrics and plots. The access token must be
present in any request that sends data to the Iterative Studio ingestion
endpoint. Requests with missing or incorrect access tokens are rejected with an
appropriate HTTP error code and error message.
Comment on lines +15 to +19
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that the access token is used by dvc too, I think we need to rewrite this page or extract it out.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is a good point.
Probably outside the scope of the P.R. and better to be discussed in #4440

I would perhaps not touch this introduction for now and leave the page to be only about live updates

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should at least mention "to send experiments" here as we are redirecting here for setup instructions. Let me know what you think (that's the only change here btw).

Copy link
Contributor

@daavoo daavoo Apr 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should at least mention "to send experiments" here as we are redirecting here for setup instructions. Let me know what you think (that's the only change here btw).

I am ok with merging this as it is.

we are redirecting here for setup instructions

As you mentioned, what we probably need to do is to extract the info, for example having something like a connect to Studio page that doesn't get into the downstream use case (live updates, exp push, etc.), and use that page for cross reference

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks okay to me for now. I'm a little hesitant to say we need another page just for how to setup an access token. Feels like it creates more friction for live sharing. @tapadipti PTAL and add any thoughts you have.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tapadipti Do we have `any of the other env variables mentioned in this guide? For customers who have on-prem Studio, how do they know how to configure live metrics and plots?

Copy link
Member Author

@skshetry skshetry Apr 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little hesitant to say we need another page just for how to setup an access token.

yeah, I think it's simple enough that we don't need to have a separate page. If we need it, it might be a UX problem. (For 1, I get confused between Settings page and Profile page in Viewer).


### Create and manage access token

Expand All @@ -29,14 +29,14 @@ handy if you suspect that your account security may have been compromised.

### Provide access token to experiment

DVCLive expects the access token to be set in the `STUDIO_TOKEN` environment
DVCLive expects the access token to be set in the `DVC_STUDIO_TOKEN` environment
variable.

If you are running the experiment locally, you can set this environment variable
when submitting the training job.

```cli
$ STUDIO_TOKEN=**** dvc exp run
$ DVC_STUDIO_TOKEN=**** dvc exp run
```

If you are running the experiment as part of a CI job, a secure way to provide
Expand All @@ -49,7 +49,7 @@ example below).
steps:
- name: Train model
env:
STUDIO_TOKEN: ${{ secrets.STUDIO_TOKEN }}
DVC_STUDIO_TOKEN: ${{ secrets.DVC_STUDIO_TOKEN }}
```

## Send and view live metrics and plots
Expand Down
20 changes: 20 additions & 0 deletions content/docs/user-guide/project-structure/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ within:
- [`plots`](#plots) - options for configuring `dvc plots`.
- [`state`](#state) - see [Internal directories and files][internals] to learn
more about the state database.
- [`studio`](#studio) - options for configuring
[Iterative Studio](https://studio.iterative.ai/) token
- [`index`](#index) - see [Internal directories and files][internals] to learn
more about remote index files.

Expand Down Expand Up @@ -378,6 +380,24 @@ Composition].

<details>

## studio

- `studio.token` - Studio access token to use. When this is set, DVC uses this
skshetry marked this conversation as resolved.
Show resolved Hide resolved
to notify Studio of new experiments. For security reasons, we advise setting
token to either a local or a global config. This can also be specified through
`DVC_STUDIO_TOKEN` environment variable.

[Get the token](https://studio.iterative.ai/user/_/profile?section=accessToken)
or check
[this guide on how to create an access token](/doc/studio/user-guide/projects-and-experiments/live-metrics-and-plots#set-up-an-access-token).

- `studio.url` - URL of Studio to use (in case of self-hosted Studio instance).
skshetry marked this conversation as resolved.
Show resolved Hide resolved
This can also be specified through `DVC_STUDIO_URL` environment variable.

</details>

<details>

## index

- `index.dir` - specify a custom location for the directory where remote index
Expand Down