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

Add execution configuration helper #141

Merged
merged 2 commits into from
Jan 7, 2025
Merged

Add execution configuration helper #141

merged 2 commits into from
Jan 7, 2025

Conversation

teroyks
Copy link
Contributor

@teroyks teroyks commented Jan 3, 2025

Resolves #140

Allow fetching basic execution information (such as the ID of the currently running execution) more easily (and without having to know where and how the configuration is stored).

Only return some very basic information for now – more info, and other helpers besides fetching the configuration, may be added later, if/when they are needed.

Documentation to be added in a separate PR.

Usage

import valohai

execution_config = valohai.execution().config
print(f"Execution ID: {execution_config.id}")
print(f"Execution title: {execution_config.title}")
print(f"Execution counter: {execution_config.counter}")

Allow fetching basic execution information (such as the ID of the
currently running execution) more easily (and without having to know
where and how the configuration is stored).

Only return some very basic information for now -- more info, and other
helpers besides fetching the configuration may be added later, if/when
they are needed.
@teroyks teroyks added the enhancement New feature or request label Jan 3, 2025
@teroyks teroyks self-assigned this Jan 3, 2025
@teroyks teroyks requested review from hylje and tokkoro January 3, 2025 11:11
@teroyks teroyks marked this pull request as ready for review January 3, 2025 11:12
More in line with other modules, imported from the `valohai` module as
`execution`:

```
import valohai
config = valohai.execution().config
```
@teroyks teroyks requested a review from hylje January 3, 2025 13:41
Copy link
Contributor

@hylje hylje left a comment

Choose a reason for hiding this comment

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

very convenient helper with tests included

@hylje hylje merged commit 93794bc into master Jan 7, 2025
5 checks passed
@hylje hylje deleted the tero/execution/config branch January 7, 2025 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add helper for fetching the execution ID
2 participants