Skip to content

Commit

Permalink
Add budget field to experiment spec (#264)
Browse files Browse the repository at this point in the history
* Add `budget` field to experiment spec

* Try fix tests
  • Loading branch information
epwalsh authored Jan 30, 2024
1 parent cef25da commit 0573044
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ use patch releases for compatibility fixes instead.

## Unreleased

### Added

- Added `budget` field to experiment spec.

## [v1.23.0](https://github.com/allenai/beaker-py/releases/tag/v1.23.0) - 2023-12-15

### Fixed
Expand Down
6 changes: 6 additions & 0 deletions beaker/data_model/experiment_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,12 @@ class ExperimentSpec(BaseModel, frozen=False):
Long-form explanation for an experiment.
"""

budget: Optional[str] = None
"""
The name of the budget account for your team.
See https://beaker-docs.apps.allenai.org/concept/budgets.html for more details.
"""

@field_validator("tasks")
def _validate_tasks(cls, v: List[TaskSpec]) -> List[TaskSpec]:
task_names = set()
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ dev = [
"types-PyYAML",
"black>=23.0,<24.0",
"isort>=5.12,<5.13",
"pytest",
"pytest<8.0",
"pytest-sphinx",
"flaky",
"twine>=1.11.0",
Expand Down
3 changes: 3 additions & 0 deletions tests/workspace_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,18 @@ def test_workspace_get_permissions(client: Beaker):
client.workspace.get_permissions()


@pytest.mark.skip("Requires admin credentials")
def test_workspace_grant_and_revoke_permissions(client: Beaker, alternate_user: Account):
client.workspace.grant_permissions(Permission.read, alternate_user)
client.workspace.revoke_permissions(alternate_user)


@pytest.mark.skip("Requires admin credentials")
def test_workspace_set_visibility(client: Beaker):
client.workspace.set_visibility(public=False)


@pytest.mark.skip("Requires admin credentials")
def test_workspace_set_visibility_archived(client: Beaker, archived_workspace_name: str):
client.workspace.set_visibility(public=False, workspace=archived_workspace_name)

Expand Down

0 comments on commit 0573044

Please sign in to comment.