Skip to content

Commit

Permalink
Do not pull daskdev/dask image for each test (#67)
Browse files Browse the repository at this point in the history
* Use imagePullPolicy IfNotPresent to make it possible to test local images

* Doc add imagePullPolicy to example pod spec in documentation
  • Loading branch information
ogrisel authored and mrocklin committed Apr 11, 2018
1 parent b850eb6 commit d6b3fc6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
8 changes: 7 additions & 1 deletion dask_kubernetes/tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ def ns():

@pytest.fixture
def pod_spec(image_name):
yield make_pod_spec(image=image_name)
yield make_pod_spec(
image=image_name,
extra_container_config={'imagePullPolicy': 'IfNotPresent'}
)


@pytest.fixture
Expand Down Expand Up @@ -166,6 +169,7 @@ def test_pod_from_yaml(image_name, loop, ns):
"1"
],
"image": image_name,
'imagePullPolicy': 'IfNotPresent',
"name": "dask-worker"
}]
}
Expand Down Expand Up @@ -205,6 +209,7 @@ def test_pod_from_dict(image_name, loop, ns):
'--death-timeout', '60'],
'command': None,
'image': image_name,
'imagePullPolicy': 'IfNotPresent',
'name': 'dask-worker',
}]
}
Expand Down Expand Up @@ -236,6 +241,7 @@ def test_pod_from_minimal_dict(image_name, loop, ns):
'--death-timeout', '60'],
'command': None,
'image': image_name,
'imagePullPolicy': 'IfNotPresent',
'name': 'worker'
}]
}
Expand Down
4 changes: 2 additions & 2 deletions dask_kubernetes/tests/test_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def test_extra_container_config(image_name, loop):
make_pod_spec(
image_name,
extra_container_config={
'imagePullPolicy': 'IfNotReady',
'imagePullPolicy': 'IfNotPresent',
'securityContext': {
'runAsUser': 0
}
Expand All @@ -43,7 +43,7 @@ def test_extra_container_config(image_name, loop):

pod = cluster.pod_template

assert pod.spec.containers[0].image_pull_policy == 'IfNotReady'
assert pod.spec.containers[0].image_pull_policy == 'IfNotPresent'
assert pod.spec.containers[0].security_context == {
'runAsUser': 0
}
Expand Down
1 change: 1 addition & 0 deletions doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Quickstart
restartPolicy: Never
containers:
- image: daskdev/dask:latest
imagePullPolicy: IfNotPresent
args: [dask-worker, --nthreads, '2', --no-bokeh, --memory-limit, 6GB, --death-timeout, '60']
name: dask
env:
Expand Down

0 comments on commit d6b3fc6

Please sign in to comment.