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

Added support for tasks under scheduling . #168

Merged
merged 2 commits into from
May 22, 2024
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [3.2.0] - 2024-05-22
### Added
- Added support for `Task` in Ocean AKS `Scheduling` model.

## [3.1.0] - 2024-05-17
### Added
- Added support for `GpuType` in Ocean AKS `Filters` model.
Expand Down
68 changes: 66 additions & 2 deletions docs/models/ocean/azure.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,81 @@ __Arguments__
- __is_enabled__: bool
- __time_windows__: List[str]

<h2 id="spotinst_sdk2.models.ocean.azure.ClusterRoll">ClusterRoll</h2>

```python
ClusterRoll(
self,
batch_min_healthy_percentage: int = 'd3043820717d74d9a17694c176d39733',
batch_size_percentage: int = 'd3043820717d74d9a17694c176d39733',
comment: str = 'd3043820717d74d9a17694c176d39733',
respect_pdb: bool = 'd3043820717d74d9a17694c176d39733',
respect_restrict_scale_down: bool = 'd3043820717d74d9a17694c176d39733',
vng_ids: typing.List[str] = 'd3043820717d74d9a17694c176d39733')
```

__Arguments__

- __batch_min_healthy_percentage__: int
- __batch_size_percentage__: int
- __comment__: str
- __respect_pdb__: bool
- __respect_restrict_scale_down__: bool
- __vng_ids__: List[str]

<h2 id="spotinst_sdk2.models.ocean.azure.Parameters">Parameters</h2>

```python
Parameters(self,
cluster_roll: ClusterRoll = 'd3043820717d74d9a17694c176d39733'
)
```

__Arguments__

- __cluster_roll__: ClusterRoll

<h2 id="spotinst_sdk2.models.ocean.azure.TaskType">TaskType</h2>

```python
TaskType(cls, value, names=None, *, module, qualname, type, start)
```
An enumeration.
<h3 id="spotinst_sdk2.models.ocean.azure.TaskType.cluster_roll">cluster_roll</h3>


<h2 id="spotinst_sdk2.models.ocean.azure.Task">Task</h2>

```python
Task(self,
cron_expression: str = 'd3043820717d74d9a17694c176d39733',
is_enabled: bool = 'd3043820717d74d9a17694c176d39733',
parameters: Parameters = 'd3043820717d74d9a17694c176d39733',
task_type: TaskType = 'd3043820717d74d9a17694c176d39733')
```

__Arguments__

- __cron_expression__: str
- __is_enabled__: bool
- __parameters__: Parameters
- __task_type__: TaskType

<h2 id="spotinst_sdk2.models.ocean.azure.Scheduling">Scheduling</h2>

```python
Scheduling(
self,
shutdown_hours: ShutdownHours = 'd3043820717d74d9a17694c176d39733')
self,
shutdown_hours: ShutdownHours = 'd3043820717d74d9a17694c176d39733',
tasks:
typing.List[spotinst_sdk2.models.ocean.azure.Task] = 'd3043820717d74d9a17694c176d39733'
)
```

__Arguments__

- __shutdown_hours__: ShutdownHours
- __tasks__: List[Task]

<h2 id="spotinst_sdk2.models.ocean.azure.Health">Health</h2>

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PyYaml==6.0.1
requests==2.31.0
requests==2.32.0
pydoc-markdown==2.1.3
mock==5.1.0
pytest==7.4.4
87 changes: 77 additions & 10 deletions spotinst_sdk2/models/ocean/azure/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,16 +120,83 @@ def __init__(
self.time_windows = time_windows


class ClusterRoll:
"""
# Arguments
batch_min_healthy_percentage: int
batch_size_percentage: int
comment: str
respect_pdb: bool
respect_restrict_scale_down: bool
vng_ids: List[str]
"""

def __init__(
self,
batch_min_healthy_percentage: int = none,
batch_size_percentage: int = none,
comment: str = none,
respect_pdb: bool = none,
respect_restrict_scale_down: bool = none,
vng_ids: List[str] = none):
self.batch_min_healthy_percentage = batch_min_healthy_percentage
self.batch_size_percentage = batch_size_percentage
self.comment = comment
self.respect_pdb = respect_pdb
self.respect_restrict_scale_down = respect_restrict_scale_down
self.vng_ids = vng_ids


class Parameters:
"""
# Arguments
cluster_roll: ClusterRoll
"""

def __init__(
self,
cluster_roll: ClusterRoll = none):
self.cluster_roll = cluster_roll


class TaskType(Enum):
cluster_roll = "clusterRoll"


class Task:
"""
# Arguments
cron_expression: str
is_enabled: bool
parameters: Parameters
task_type: TaskType
"""

def __init__(
self,
cron_expression: str = none,
is_enabled: bool = none,
parameters: Parameters = none,
task_type: TaskType = none):
self.cron_expression = cron_expression
self.is_enabled = is_enabled
self.parameters = parameters
self.task_type = task_type


class Scheduling:
"""
# Arguments
shutdown_hours: ShutdownHours
tasks: List[Task]
"""

def __init__(
self,
shutdown_hours: ShutdownHours = none):
shutdown_hours: ShutdownHours = none,
tasks: List[Task] = none):
self.shutdown_hours = shutdown_hours
self.tasks = tasks
# endregion

# region Health
Expand Down Expand Up @@ -336,16 +403,16 @@ class VmType(Enum):


class GpuType(Enum):
nvidia_tesla_v100 = "nvidia-tesla-v100"
nvidia_tesla_v100 = "nvidia-tesla-v100"
amd_radeon_instinct_mi25 = "amd-radeon-instinct-mi25"
nvidia_a10 = "nvidia-a10"
nvidia_tesla_a100 = "nvidia-tesla-a100"
nvidia_tesla_k80 = "nvidia-tesla-k80"
nvidia_tesla_m60 = "nvidia-tesla-m60"
nvidia_tesla_p100 = "nvidia-tesla-p100"
nvidia_tesla_p40 = "nvidia-tesla-p40"
nvidia_tesla_t4 = "nvidia-tesla-t4"
nvidia_tesla_h100 = "nvidia-tesla-h100"
nvidia_a10 = "nvidia-a10"
nvidia_tesla_a100 = "nvidia-tesla-a100"
nvidia_tesla_k80 = "nvidia-tesla-k80"
nvidia_tesla_m60 = "nvidia-tesla-m60"
nvidia_tesla_p100 = "nvidia-tesla-p100"
nvidia_tesla_p40 = "nvidia-tesla-p40"
nvidia_tesla_t4 = "nvidia-tesla-t4"
nvidia_tesla_h100 = "nvidia-tesla-h100"


class Filters:
Expand Down