-
Notifications
You must be signed in to change notification settings - Fork 119
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
Adds neptune plugin example #1723
Adds neptune plugin example #1723
Conversation
Signed-off-by: Thomas J. Fan <[email protected]>
Signed-off-by: Thomas J. Fan <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Requesting changes since I think there are a few references to weights & biases that should be Neptune instead (but let me know if not!)
examples/neptune_plugin/README.md
Outdated
.. tags:: Integration, Data, Metrics, Intermediate | ||
``` | ||
|
||
Neptune is the MLOps stack component for experiment tracking. It offers a single place to log, compare, store, and collaborate on experiments and models. This plugin enables seamless use of Neptune within Flyte by configuring links between the two platforms. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would link to Neptune docs here (assuming that's https://docs.neptune.ai/)
examples/neptune_plugin/README.md
Outdated
pip install flytekitplugins-neptune | ||
``` | ||
|
||
To enable dynamic log links, add plugin to Flyte's configuration file: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To enable dynamic log links, add plugin to Flyte's configuration file: | |
To enable dynamic log links, add the plugin to Flyte's configuration file: |
# %% [markdown] | ||
# (neptune_example)= | ||
# | ||
# # Neptune Example |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# # Neptune Example | |
# # Neptune example |
from flytekitplugins.neptune import neptune_init_run | ||
|
||
# %% [markdown] | ||
# First, we specify the neptune project that we will use with Neptune |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# First, we specify the neptune project that we will use with Neptune | |
# First, we specify the Neptune project that we will use with Neptune. |
|
||
# %% [mardkwon] | ||
# Next, we use `ImageSpec` to construct a container with the dependencies for our | ||
# XGBoost training task. Please set the `REGISTRY` to an registry that your cluster can access; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# XGBoost training task. Please set the `REGISTRY` to an registry that your cluster can access; | |
# XGBoost training task. Please set the `REGISTRY` to a registry that your cluster can access. |
# %% | ||
# Next, we use the `neptune_init_run` decorator to configure Flyte to train an XGBoost | ||
# model. The decorator requires an `api_key` secret to authenticate with Neptune and | ||
# the task definition needs to requests the same `api_key` secret. In the training |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# the task definition needs to requests the same `api_key` secret. In the training | |
# the task definition needs to request the same `api_key` secret. In the training |
# %% [markdown] | ||
# First, we specify the neptune project that we will use with Neptune | ||
# Please update `NEPTUNE_PROJECT` to the value associated with your account. | ||
WANDB_PROJECT = "username/project" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be NEPTUNE_PROJECT instead of WANDB_PROJECT?
secret_requests=[api_key], | ||
requests=Resources(cpu="2", mem="4Gi"), | ||
) | ||
@neptune_init_run(project=WANDB_PROJECT, secret=api_key) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If WANDB_PROJECT is changed above, this should also be updated.
|
||
|
||
# %% | ||
# With Flyte's dynamic workflows, we scale up multiple training jobs with different |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# With Flyte's dynamic workflows, we scale up multiple training jobs with different | |
# With Flyte's dynamic workflows, we can scale up multiple training jobs with different |
Signed-off-by: Thomas J. Fan <[email protected]>
Signed-off-by: Thomas J. Fan <[email protected]>
…ne_plugin_docs Signed-off-by: Thomas J. Fan <[email protected]>
Signed-off-by: Thomas J. Fan <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a few typos, see comments
# [Flyte's Secrets manager](https://docs.flyte.org/en/latest/user_guide/productionizing/secrets.html). | ||
api_key = Secret(key="neptune-api-token", group="neptune-api-group") | ||
|
||
# %% [mardkwon] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mardkwon -> markdown
WANDB_PROJECT = "username/project" | ||
|
||
# %% [markdown] | ||
# W&B requires an API key to authenticate with their service. In the above example, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👆
Signed-off-by: Thomas J. Fan <[email protected]>
Signed-off-by: Thomas J. Fan <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved, but I see the monodocs build is failing due to a missing DocSearch API key. #1740 should fix that.
…ne_plugin_docs Signed-off-by: Thomas J. Fan <[email protected]>
Signed-off-by: Thomas J. Fan <[email protected]>
This PR adds documentation for the neptune plugin.