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

Adds neptune plugin for experiment tracking #2686

Merged
merged 13 commits into from
Aug 26, 2024

Conversation

thomasjpfan
Copy link
Member

Why are the changes needed?

This PR adds a Neptune.ai plugin for experiment tracking. This is similar to the Comet and Weights & Biases plugin.

What changes were proposed in this pull request?

This PR adds a neptune_init_run decorator that starts a Neptune Run. Given the Neptune integration with third party libraries passes the run object around, this PR injects the neptune_run object into current_context().

How was this patch tested?

This PR includes unit tests. I also ran the example in flyteorg/flytesnacks#1723:

Screenshot 2024-08-15 at 2 24 08 PM

Docs link

[

](flyteorg/flytesnacks#1723)

Signed-off-by: Thomas J. Fan <[email protected]>
Copy link

codecov bot commented Aug 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 50.73%. Comparing base (83b90fa) to head (fa6b350).
Report is 4 commits behind head on master.

❗ There is a different number of reports uploaded between BASE (83b90fa) and HEAD (fa6b350). Click for more details.

HEAD has 3 uploads less than BASE
Flag BASE (83b90fa) HEAD (fa6b350)
5 2
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #2686       +/-   ##
===========================================
- Coverage   78.69%   50.73%   -27.97%     
===========================================
  Files         187      192        +5     
  Lines       19257    19425      +168     
  Branches     4029     3805      -224     
===========================================
- Hits        15155     9855     -5300     
- Misses       3404     9065     +5661     
+ Partials      698      505      -193     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Thomas J. Fan <[email protected]>
pingsutw
pingsutw previously approved these changes Aug 20, 2024
Signed-off-by: Thomas J. Fan <[email protected]>
eapolinario
eapolinario previously approved these changes Aug 20, 2024
def neptune_init_run(
project: str,
secret: Union[Secret, Callable],
host: str = "https://app.neptune.ai",

Choose a reason for hiding this comment

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

Is there any particular reason host has to be passed explicitly?
This can be extracted from the NEPTUNE_API_TOKEN

json.loads(base64.b64decode(os.getenv("NEPTUNE_API_TOKEN")).decode("utf-8"))["api_url"]

Copy link
Member Author

Choose a reason for hiding this comment

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

In a IRL conversation with @SiddhantSadangi, we discussed how this is a limitation of Flyte and dynamic log links.

Context: The Flyte UI needs to know the host URL during registration time. There are two options:

  1. Have the host passed in explicitly (this PR)
  2. Force users to have NEPTUNE_API_TOKEN defined during registration time.

Signed-off-by: Thomas J. Fan <[email protected]>
Signed-off-by: Thomas J. Fan <[email protected]>
Signed-off-by: Thomas J. Fan <[email protected]>
Signed-off-by: Thomas J. Fan <[email protected]>
Comment on lines 73 to 74
assert run_mock["Flyte Execution ID"] == host_name
assert run_mock["Flyte Execution URL"] == execution_url
Copy link
Collaborator

Choose a reason for hiding this comment

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

need to update these assertions.

Signed-off-by: Thomas J. Fan <[email protected]>
@thomasjpfan thomasjpfan enabled auto-merge (squash) August 26, 2024 16:29
@thomasjpfan thomasjpfan disabled auto-merge August 26, 2024 16:29
@thomasjpfan thomasjpfan merged commit 64c56f8 into flyteorg:master Aug 26, 2024
101 of 103 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants