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

Use SpecCluster #162

Merged
merged 64 commits into from
Oct 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
7625d83
Use SpecCluster
jacobtomlinson Jul 10, 2019
73dfdbc
Remove timeouts and fix inits
jacobtomlinson Jul 10, 2019
c439230
Get address
jacobtomlinson Jul 10, 2019
f1422a4
Successfully start scheduler pod
jacobtomlinson Sep 13, 2019
0545c4b
Add scheduler service
jacobtomlinson Sep 14, 2019
d378acf
Add async k8s to env
jacobtomlinson Sep 14, 2019
73fc4e4
Tidying
jacobtomlinson Sep 14, 2019
b5b64e9
Remove service on close
jacobtomlinson Sep 14, 2019
3ecbc4a
First pass at fixing tests
jacobtomlinson Sep 14, 2019
9f3decf
Add mrocklin suggestions
jacobtomlinson Sep 17, 2019
c728e51
Do not await auth
jacobtomlinson Sep 19, 2019
e01ee66
Reduce testing resources
jacobtomlinson Sep 21, 2019
80f5e0b
Set default test image
jacobtomlinson Sep 21, 2019
50c7c9a
Some async test changes
jacobtomlinson Sep 21, 2019
8d455ff
Pull in test suites from dev branch and start getting passing
jacobtomlinson Sep 21, 2019
145ea23
Merge all test suites and all passing locally
jacobtomlinson Sep 23, 2019
01662d9
Configure kubedns from host
jacobtomlinson Sep 23, 2019
367c845
Add port to test service
jacobtomlinson Sep 23, 2019
c88c090
tweak route command
jacobtomlinson Sep 23, 2019
a1a8161
Debug kube dns server
jacobtomlinson Sep 23, 2019
4f59237
Debug dns resolution
jacobtomlinson Sep 23, 2019
5beacb3
Expand dns search
jacobtomlinson Sep 23, 2019
b73a46d
Look at contents of resolver base
jacobtomlinson Sep 23, 2019
0ae56da
Ensure kube-dns is enabled
jacobtomlinson Sep 23, 2019
1d5e7a3
Explore DNS config
jacobtomlinson Sep 23, 2019
1860b7a
Simplify docker DNS
jacobtomlinson Sep 23, 2019
12e79ca
Fix resolv ordering and search length
jacobtomlinson Sep 23, 2019
250c95c
Tidy dns lookup and add curl test to ensure service is routable
jacobtomlinson Sep 23, 2019
f4b9e7f
Print out the service info for completeness
jacobtomlinson Sep 23, 2019
db15875
Wait a bit for kube DNS to come alive
jacobtomlinson Sep 23, 2019
ab20655
Read back service info before continuing
jacobtomlinson Sep 24, 2019
fcf66f6
Add small sleep
jacobtomlinson Sep 24, 2019
55a3b52
Increase sleep
jacobtomlinson Sep 24, 2019
885bd4b
Remove sleep
jacobtomlinson Sep 24, 2019
1e596c7
Try again wiuth sleep
jacobtomlinson Sep 25, 2019
b20a6e2
Extending timeout
jacobtomlinson Sep 25, 2019
baf8b31
Remove duplicate test and give ipython widget more time
jacobtomlinson Sep 25, 2019
c2ac69c
Debig ipywidget and remove loops
jacobtomlinson Sep 25, 2019
0f15240
Fix ipython tests
jacobtomlinson Sep 25, 2019
462e0bb
Re-render widget on test
jacobtomlinson Sep 25, 2019
18a196c
Mark ipython display as xfail for now
jacobtomlinson Sep 25, 2019
5fc7e0e
Remove loop
jacobtomlinson Sep 26, 2019
4b2e18f
Make teardown sync
jacobtomlinson Sep 26, 2019
7cfb10f
Add retries to pod creation
jacobtomlinson Sep 26, 2019
37a54ee
Merge master
jacobtomlinson Sep 26, 2019
3692080
Remove properties that are now upstream
jacobtomlinson Sep 26, 2019
b0adb32
Timeout loadbalancer
jacobtomlinson Sep 27, 2019
305c62b
Attach pod labels to service and add services to cleanup
jacobtomlinson Sep 27, 2019
b687fb6
Remove todo for cleanup services
jacobtomlinson Sep 27, 2019
b987a9e
Add scheduler timeout
jacobtomlinson Sep 27, 2019
ce0001b
Removing sleep as hopefully dask/distributed#3104 has worked around t…
jacobtomlinson Oct 1, 2019
d9d6609
Make local scheduler the default
jacobtomlinson Oct 8, 2019
1afb85d
Fix scheduler options
jacobtomlinson Oct 8, 2019
ea0ff41
Remove local scheduler options
jacobtomlinson Oct 8, 2019
3ec0044
Test remote cluster logs
jacobtomlinson Oct 8, 2019
4026e50
Fix bad config
jacobtomlinson Oct 8, 2019
bf7f206
Tweak imports and docstrings
jacobtomlinson Oct 9, 2019
078b3dd
Add more config options
jacobtomlinson Oct 9, 2019
d490d5c
Docs changes and change TODOs to FIXMEs
jacobtomlinson Oct 9, 2019
0310a3f
Make scheduler port a constant
jacobtomlinson Oct 9, 2019
4bb8207
Bump required versions
jacobtomlinson Oct 9, 2019
ec2a06e
make security attribute public
jacobtomlinson Oct 9, 2019
7b5a02c
Change local_scheduler config option to deploy_mode
jacobtomlinson Oct 9, 2019
9b0f81e
Remove security from config and check if arg is correct type
jacobtomlinson Oct 9, 2019
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
54 changes: 36 additions & 18 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ jobs:
- run:
command: |
sudo -E minikube start --vm-driver=none --extra-config=kubelet.MaxPods=20
- run:
command: |
sudo -E minikube addons enable kube-dns
- run:
command: |
sudo -E minikube update-context
Expand All @@ -36,36 +39,51 @@ jobs:
- run:
command: |
sudo kubectl run circleci-example --image=nginx
sudo kubectl expose deployment circleci-example --port 80 --type=ClusterIP --name=circleci-example
- run:
command: |
sudo kubectl get deployment
sudo kubectl get service
- run:
command: |
KUBEDNS=`sudo kubectl get svc -o json kube-dns --namespace=kube-system | jq -r '.spec.clusterIP'`
echo "nameserver $KUBEDNS" | sudo tee -a /etc/resolvconf/resolv.conf.d/head > /dev/null
echo "search default.svc.cluster.local svc.cluster.local cluster.local" | sudo tee -a /etc/resolvconf/resolv.conf.d/base > /dev/null
echo "options ndots:5" | sudo tee -a /etc/resolvconf/resolv.conf.d/base > /dev/null
sudo resolvconf -u
- run:
command: |
until nslookup circleci-example.default; do
sleep 1
done
curl circleci-example.default
- run:
name: install miniconda
command: |
if [ ! -d "/home/circleci/miniconda" ]; then
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
bash miniconda.sh -b -p $HOME/miniconda
export PATH="$HOME/miniconda/bin:$PATH"
conda config --set always_yes yes --set changeps1 no
fi
sudo chown -R $USER.$USER $HOME
if [ ! -d "/home/circleci/miniconda" ]; then
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
bash miniconda.sh -b -p $HOME/miniconda
export PATH="$HOME/miniconda/bin:$PATH"
conda config --set always_yes yes --set changeps1 no
fi
sudo chown -R $USER.$USER $HOME
- run:
name: configure conda
command: |
export PATH="$HOME/miniconda/bin:$PATH"
if [ ! -d "/home/circleci/miniconda/envs/dask-kubernetes-test" ]; then
conda update -q conda
conda env create -f ci/environment-${PYTHON}.yml --name=${ENV_NAME}
source activate ${ENV_NAME}
pip install --no-deps --quiet -e .
fi
conda env list
conda list ${ENV_NAME}
export PATH="$HOME/miniconda/bin:$PATH"
if [ ! -d "/home/circleci/miniconda/envs/dask-kubernetes-test" ]; then
conda update -q conda
conda env create -f ci/environment-${PYTHON}.yml --name=${ENV_NAME}
source activate ${ENV_NAME}
pip install --no-deps --quiet -e .
fi
conda env list
conda list ${ENV_NAME}
- run:
name: build docker
command: |
# eval $(minikube docker-env)
docker build -t daskdev/dask:dev docker/
# eval $(minikube docker-env)
docker build -t daskdev/dask:dev docker/
- run:
command: |
# eval $(minikube docker-env)
Expand Down
8 changes: 5 additions & 3 deletions ci/environment-3.7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ dependencies:
- tornado >=5
- zict >=0.1.3
- pip:
- kubernetes==9
- git+https://github.com/dask/dask
- git+https://github.com/dask/distributed
- pytest-asyncio
- kubernetes==9
- kubernetes-asyncio==9
- git+https://github.com/dask/dask
- git+https://github.com/dask/distributed
2 changes: 1 addition & 1 deletion dask_kubernetes/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from . import config
from .auth import ClusterAuth, KubeAuth, KubeConfig, InCluster
from .core import KubeCluster
from .objects import make_pod_spec, make_pod_from_dict
from .objects import make_pod_spec, make_pod_from_dict, clean_pod_template

__all__ = [KubeCluster]

Expand Down
18 changes: 9 additions & 9 deletions dask_kubernetes/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""
import logging

import kubernetes
import kubernetes_asyncio as kubernetes

logger = logging.getLogger(__name__)

Expand All @@ -23,7 +23,7 @@ class ClusterAuth(object):

"""

def load(self):
async def load(self):
"""
Load Kubernetes configuration and set as default

Expand All @@ -35,7 +35,7 @@ def load(self):
raise NotImplementedError()

@staticmethod
def load_first(auth=None):
async def load_first(auth=None):
"""
Load the first valid configuration in the list *auth*. A single
configuration method can be passed.
Expand Down Expand Up @@ -67,7 +67,7 @@ def load_first(auth=None):
auth_exc = None
for auth_instance in auth:
try:
auth_instance.load()
await auth_instance.load()
except kubernetes.config.ConfigException as exc:
logger.debug(
"Failed to load configuration with %s method: %s",
Expand All @@ -90,7 +90,7 @@ class InCluster(ClusterAuth):
API via Kubernetes service discovery.
"""

def load(self):
async def load(self):
kubernetes.config.load_incluster_config()


Expand All @@ -116,8 +116,8 @@ def __init__(self, config_file=None, context=None, persist_config=True):
self.context = context
self.persist_config = persist_config

def load(self):
kubernetes.config.load_kube_config(
async def load(self):
await kubernetes.config.load_kube_config(
self.config_file, self.context, None, self.persist_config
)

Expand Down Expand Up @@ -161,8 +161,8 @@ def __init__(self, host, **kwargs):
setattr(config, key, value)
self.config = config

def load(self):
kubernetes.client.Configuration.set_default(self.config)
async def load(self):
await kubernetes.client.Configuration.set_default(self.config)


ClusterAuth.DEFAULT = [InCluster(), KubeConfig()]
Loading