Skip to content

Commit 133cef2

Browse files
Merge branch 'main' of github.com:dask/dask-kubernetes into shutdown-on-close
2 parents cec9b6a + 992bdea commit 133cef2

20 files changed

+251
-187
lines changed

.github/workflows/helmcluster.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
strategy:
2626
fail-fast: false
2727
matrix:
28-
python-version: ["3.8", "3.9", "3.10"]
28+
python-version: ["3.9", "3.10"]
2929
kubernetes-version: ["1.27.0"]
3030
include:
3131
- python-version: "3.10"

.github/workflows/kubecluster.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
strategy:
2626
fail-fast: false
2727
matrix:
28-
python-version: ["3.8", "3.9", "3.10"]
28+
python-version: ["3.9", "3.10"]
2929
kubernetes-version: ["1.27.0"]
3030
include:
3131
- python-version: "3.10"

.github/workflows/lint.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
- uses: actions/checkout@v2
99
- uses: actions/setup-python@v2
1010
with:
11-
python-version: "3.8"
11+
python-version: "3.10"
1212
- name: Install deps
1313
run: ./ci/install-deps.sh
1414
- uses: pre-commit/[email protected]

.github/workflows/operator.yaml

+3-2
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ jobs:
3535

3636
test:
3737
runs-on: ubuntu-latest
38-
timeout-minutes: 45
38+
timeout-minutes: 20
3939
strategy:
4040
fail-fast: false
4141
matrix:
42-
python-version: ["3.8", "3.9", "3.10"]
42+
python-version: ["3.9", "3.10"]
4343
kubernetes-version: ["1.27.0"]
4444
include:
4545
- python-version: "3.10"
@@ -63,6 +63,7 @@ jobs:
6363
env:
6464
KUBERNETES_VERSION: ${{ matrix.kubernetes-version }}
6565
TEST_ISTIO: "true"
66+
TEST_DASK_GATEWAY: "true"
6667
run: pytest dask_kubernetes/common dask_kubernetes/operator dask_kubernetes/aiopykube
6768
- name: Debug k8s resources
6869
if: always()

.github/workflows/release.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ jobs:
1010
- name: Checkout source
1111
uses: actions/checkout@v2
1212

13-
- name: Set up Python 3.8
13+
- name: Set up Python 3.10
1414
uses: actions/setup-python@v1
1515
with:
16-
python-version: 3.8
16+
python-version: "3.10"
1717

1818
- name: Install pypa/build and chartpress
1919
run: python -m pip install build wheel chartpress pyyaml

.readthedocs.yaml

+5-1
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,12 @@ sphinx:
1111

1212
formats: all
1313

14+
build:
15+
os: ubuntu-22.04
16+
tools:
17+
python: "3.10"
18+
1419
python:
15-
version: 3.8
1620
install:
1721
- method: pip
1822
path: .

README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Dask Kubernetes
2121
:target: https://anaconda.org/conda-forge/dask-kubernetes
2222
:alt: Conda Forge
2323

24-
.. image:: https://img.shields.io/badge/python%20support-3.8%7C3.9%7C3.10-blue
24+
.. image:: https://img.shields.io/badge/python%20support-3.9%7C3.10-blue
2525
:target: https://kubernetes.dask.org/en/latest/installing.html#supported-versions
2626
:alt: Python Support
2727

ci/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ghcr.io/dask/dask:latest
1+
FROM ghcr.io/dask/dask:latest-py3.10
22

33
# Install latest dev builds of Dask and Distributed
44
RUN pip install git+https://github.com/dask/distributed@main

dask_kubernetes/classic/tests/test_async.py

+1
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,7 @@ async def test_start_with_workers(k8s_cluster, pod_spec):
783783

784784

785785
@pytest.mark.asyncio
786+
@pytest.mark.xfail(reason="Flaky in CI and classic is deprecated anyway")
786787
async def test_adapt_delete(cluster, ns):
787788
"""
788789
testing whether KubeCluster.adapt will bring

dask_kubernetes/conftest.py

+46-40
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
import os
55
import subprocess
66
import tempfile
7+
import uuid
78

89
from kopf.testing import KopfRunner
910
from pytest_kind.cluster import KindCluster
1011

11-
from dask_kubernetes.common.utils import check_dependency, get_current_namespace
12+
from dask_kubernetes.common.utils import check_dependency
1213

1314
DIR = pathlib.Path(__file__).parent.absolute()
1415

@@ -60,50 +61,48 @@ def install_istio(k8s_cluster):
6061
)
6162

6263

63-
@pytest.fixture(scope="session")
64+
@pytest.fixture(autouse=True)
6465
def ns(k8s_cluster):
65-
return get_current_namespace()
66-
67-
68-
def run_generate(crd_path, patch_path, temp_path):
69-
subprocess.run(
70-
["k8s-crd-resolver", "-r", "-j", patch_path, crd_path, temp_path],
71-
check=True,
72-
env={**os.environ},
73-
)
66+
ns = "dask-k8s-pytest-" + uuid.uuid4().hex[:10]
67+
k8s_cluster.kubectl("create", "ns", ns)
68+
yield ns
69+
k8s_cluster.kubectl("delete", "ns", ns, "--wait=false", "--ignore-not-found=true")
7470

7571

7672
@pytest.fixture(scope="session", autouse=True)
7773
def install_gateway(k8s_cluster):
78-
check_dependency("helm")
79-
# To ensure the operator can coexist with Gateway
80-
subprocess.run(
81-
[
82-
"helm",
83-
"upgrade",
84-
"dask-gateway",
85-
"dask-gateway",
86-
"--install",
87-
"--repo=https://helm.dask.org",
88-
"--create-namespace",
89-
"--namespace",
90-
"dask-gateway",
91-
],
92-
check=True,
93-
env={**os.environ},
94-
)
95-
yield
96-
subprocess.run(
97-
[
98-
"helm",
99-
"delete",
100-
"--namespace",
101-
"dask-gateway",
102-
"dask-gateway",
103-
],
104-
check=True,
105-
env={**os.environ},
106-
)
74+
if bool(os.environ.get("TEST_DASK_GATEWAY", False)):
75+
check_dependency("helm")
76+
# To ensure the operator can coexist with Gateway
77+
subprocess.run(
78+
[
79+
"helm",
80+
"upgrade",
81+
"dask-gateway",
82+
"dask-gateway",
83+
"--install",
84+
"--repo=https://helm.dask.org",
85+
"--create-namespace",
86+
"--namespace",
87+
"dask-gateway",
88+
],
89+
check=True,
90+
env={**os.environ},
91+
)
92+
yield
93+
subprocess.run(
94+
[
95+
"helm",
96+
"delete",
97+
"--namespace",
98+
"dask-gateway",
99+
"dask-gateway",
100+
],
101+
check=True,
102+
env={**os.environ},
103+
)
104+
else:
105+
yield
107106

108107

109108
@pytest.fixture(scope="session", autouse=True)
@@ -112,6 +111,13 @@ def customresources(k8s_cluster):
112111
temp_dir = tempfile.TemporaryDirectory()
113112
crd_path = os.path.join(DIR, "operator", "customresources")
114113

114+
def run_generate(crd_path, patch_path, temp_path):
115+
subprocess.run(
116+
["k8s-crd-resolver", "-r", "-j", patch_path, crd_path, temp_path],
117+
check=True,
118+
env={**os.environ},
119+
)
120+
115121
for crd in ["daskcluster", "daskworkergroup", "daskjob", "daskautoscaler"]:
116122
run_generate(
117123
os.path.join(crd_path, f"{crd}.yaml"),

dask_kubernetes/operator/controller/tests/resources/failedjob.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ apiVersion: kubernetes.dask.org/v1
22
kind: DaskJob
33
metadata:
44
name: failed-job
5-
namespace: default
65
spec:
76
job:
87
spec:

dask_kubernetes/operator/controller/tests/resources/simplecluster.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ apiVersion: kubernetes.dask.org/v1
22
kind: DaskCluster
33
metadata:
44
name: simple
5-
namespace: default
65
labels:
76
test-label: "label-value"
87
annotations:

dask_kubernetes/operator/controller/tests/resources/simplejob.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ apiVersion: kubernetes.dask.org/v1
22
kind: DaskJob
33
metadata:
44
name: simple-job
5-
namespace: default
65
annotations:
76
test-annotation: "annotation-value"
87
"kopf.zalando.org/foobar": "should-not-be-propagated"

dask_kubernetes/operator/controller/tests/resources/simpleworkergroup.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ apiVersion: kubernetes.dask.org/v1
22
kind: DaskWorkerGroup
33
metadata:
44
name: simple-additional
5-
namespace: default
65
spec:
76
cluster: simple
87
worker:

0 commit comments

Comments
 (0)