Skip to content

Commit

Permalink
Bump prefect from 2.14.9 to 2.16.5 (#10)
Browse files Browse the repository at this point in the history
* Bump prefect from 2.14.9 to 2.16.5

Bumps [prefect](https://github.com/PrefectHQ/prefect) from 2.14.9 to 2.16.5.
- [Release notes](https://github.com/PrefectHQ/prefect/releases)
- [Changelog](https://github.com/PrefectHQ/prefect/blob/main/RELEASE-NOTES.md)
- [Commits](PrefectHQ/prefect@2.14.9...2.16.5)

---
updated-dependencies:
- dependency-name: prefect
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* infractl 0.0.4

* Prefect 2.16.5

* Update Prefect helm chart

* Fix default prefect image

* Fix test_flow_with_schedule

* Increase wait time for test_flow_async

* Warn if flow is not canceled

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pavel Chekin <[email protected]>
  • Loading branch information
dependabot[bot] and pbchekin authored May 23, 2024
1 parent 8e13f17 commit d3c3458
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 17 deletions.
4 changes: 2 additions & 2 deletions docs/infractl.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,11 @@ infractl.run(infractl.program('my_flow.py'), tags=['my_flow'])

## Schedule a flow

To specify a [schedule](https://docs.prefect.io/2.10.21/concepts/schedules/) for a flow:
To specify a [schedule](https://docs.prefect.io/latest/concepts/schedules/) for a flow:

```python
# This schedule will create flow runs for this deployment every day at midnight.
await infractl.run(infractl.program('my_flow.py'), schedule={'cron': '0 0 * * *'})
await infractl.run(infractl.program('my_flow.py'), cron='0 0 * * *')
```

## Customize a Kubernetes job
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "infractl"
version = "0.0.3"
version = "0.0.4"
description = "API driven Machine Learning suite"
license = {file = "LICENSE"}
readme = "README.md"
Expand All @@ -27,7 +27,7 @@ dependencies = [
"pydantic<2.0.0",
"python-docker",
"s3fs>=2023.9.2",
"prefect==2.14.9",
"prefect==2.16.5",
]

[project.urls]
Expand Down
4 changes: 2 additions & 2 deletions scripts/etc/kind/images.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ kubernetesui/dashboard:v2.6.0
minio/console:v0.20.3
minio/operator:v4.5.1
pbchekin/icl-jupyterhub:0.0.18
pbchekin/icl-prefect:2.14.3-py3.9-icl0.0.3
pbchekin/icl-prefect:2.16.5-py3.9-icl0.0.4
pbchekin/icl-ray:2.9.2-py39
prefecthq/prefect:2.14.3-python3.9
prefecthq/prefect:2.16.5-python3.9
quay.io/minio/minio:RELEASE.2022-05-26T05-48-41Z
registry.k8s.io/ingress-nginx/controller:v1.4.0@sha256:34ee929b111ffc7aa426ffd409af44da48e5a0eea1eb2207994d9e0c0882d143
2 changes: 1 addition & 1 deletion src/infractl/defaults.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""ICL defaults."""

PREFECT_IMAGE = 'pbchekin/icl-prefect:2.14.3-py3.9-icl0.0.3'
PREFECT_IMAGE = 'pbchekin/icl-prefect:2.16.5-py3.9-icl0.0.4'
2 changes: 1 addition & 1 deletion terraform/icl/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ variable "docker_registry_storage_size" {

variable "prefect_image_tag" {
description = "Tag of the official Prefect Docker image"
default = "2.14.3-python3.9"
default = "2.16.5-python3.9"
type = string
}

Expand Down
2 changes: 1 addition & 1 deletion terraform/modules/prefect/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ resource "helm_release" "prefect-server" {
server:
image:
prefectTag: "${var.image_tag}"
publicApiUrl: "${var.api_url == "" ? "http://prefect.${var.ingress_domain}/api" : var.api_url}"
prefectApiUrl: "${var.api_url == "" ? "http://prefect.${var.ingress_domain}/api" : var.api_url}"
service:
type: ClusterIP
ingress:
Expand Down
2 changes: 1 addition & 1 deletion terraform/modules/prefect/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ variable "agent_namespace" {

variable "chart_version" {
description = "Version of Prefect Helm chart"
default = "2023.09.07"
default = "2024.4.4201250"
type = string
}

Expand Down
2 changes: 1 addition & 1 deletion tests/integration/flows/flow3.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def flow3(first: str = 'Default Value', second: int = 0):
logger = get_run_logger()
logger.info(f'Parameters: {first=}, {second=}')
# test timeout
time.sleep(3)
time.sleep(5)
return first, second


Expand Down
14 changes: 8 additions & 6 deletions tests/integration/test_infractl.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import asyncio
import os
import time
import warnings
from io import StringIO

import pytest
Expand Down Expand Up @@ -120,25 +121,26 @@ async def test_flow_async(address):
program_run = await program.run(detach=True)
assert program_run.is_scheduled()

for i in range(60):
wait_sec = 120
for _ in range(wait_sec):
if program_run.is_running():
break
time.sleep(1)
await program_run.update()
else:
raise RuntimeError("the program has been in the planned state for too long")
raise RuntimeError(f'Program {program_run} is not running after {wait_sec}s')

await program_run.cancel()
print(f"program_run=")
assert program_run.is_cancelling()

for i in range(60):
wait_sec = 10
for _ in range(wait_sec):
if program_run.is_cancelled():
break
time.sleep(1)
await program_run.update()
else:
raise RuntimeError("the program has been in the planned state for too long")
warnings.warn(f'Program {program_run} is not cancelled after {wait_sec}s')


@pytest.mark.asyncio
Expand Down Expand Up @@ -174,7 +176,7 @@ async def test_flow_with_schedule(address):
infractl.program('flows/flow1.py'),
name='flow1-with-cron',
infrastructure=infrastructure,
schedule={'cron': '0 0 * * *'},
cron='0 0 * * *',
)


Expand Down

0 comments on commit d3c3458

Please sign in to comment.