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

Removing custom dask_gateway from qhub and idle_timeout for dask clusters to 30 min #1151

Merged
merged 4 commits into from
Mar 22, 2022
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
1 change: 0 additions & 1 deletion .github/workflows/image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ jobs:
- jupyterlab
- jupyterhub
- dask-worker
- dask-gateway
steps:
- name: 'Checkout Infrastructure'
uses: actions/checkout@main
Expand Down
9 changes: 4 additions & 5 deletions docs/source/installation/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ local:
## Terraform state

Terraform manages the state of all the deployed resources via
[backends](https://www.terraform.io/docs/language/settings/backends/index.html). Terraform
[backends](https://www.terraform.io/language/settings/backends). Terraform
requires storing the state in order to keep track of the names, ids,
and states of deployed resources. The simplest approach is storing the
state on the local filesystem but isn't recommended and isn't the
Expand All @@ -459,7 +459,7 @@ default of QHub. `terraform_state` is either `remote`, `existing` or
control the state of the cluster `local` via tfstate file (not
recommended), on an already `existing` terraform state store or
remotely and auto creating the terraform state store. See [terraform
remote state](https://www.terraform.io/docs/language/state/index.html)
remote state](https://www.terraform.io/language/state/remote)
docs. If you are doing anything other than testing we highly recommend
`remote` unless you know what you are doing.

Expand Down Expand Up @@ -495,15 +495,14 @@ terraform_state:
Default images are to the default image run if not specified in a
profile (described in the next section). The `jupyterhub` key controls
the jupyterhub image run. These control the docker image used to run
JupyterHub, the default JupyterLab image, the default Dask worker
image, and Dask Gateway docker image.
JupyterHub, the default JupyterLab image, and the default Dask worker
image.

```yaml
default_images:
jupyterhub: "quansight/qhub-jupyterhub:v||QHUB_VERSION||"
jupyterlab: "quansight/qhub-jupyterlab:v||QHUB_VERSION||"
dask_worker: "quansight/qhub-dask-worker:v||QHUB_VERSION||"
dask_gateway: "quansight/qhub-dask-gateway:v||QHUB_VERSION||"
```

## Storage
Expand Down
2 changes: 0 additions & 2 deletions docs/source/installation/existing.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,6 @@ default_images:
jupyterhub: quansight/qhub-jupyterhub:v0.3.13
jupyterlab: quansight/qhub-jupyterlab:v0.3.13
dask_worker: quansight/qhub-dask-worker:v0.3.13
dask_gateway: quansight/qhub-dask-gateway:v0.3.13
conda_store: quansight/conda-store-server:v0.3.3
storage:
conda_store: 60Gi
shared_filesystem: 100Gi
Expand Down
1 change: 0 additions & 1 deletion qhub/initialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
"jupyterhub": f"quansight/qhub-jupyterhub:{qhub_image_tag}",
"jupyterlab": f"quansight/qhub-jupyterlab:{qhub_image_tag}",
"dask_worker": f"quansight/qhub-dask-worker:{qhub_image_tag}",
"dask_gateway": f"quansight/qhub-dask-gateway:{qhub_image_tag}",
},
"storage": {"conda_store": "60Gi", "shared_filesystem": "100Gi"},
"theme": {
Expand Down
1 change: 0 additions & 1 deletion qhub/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ class DefaultImages(Base):
jupyterhub: str
jupyterlab: str
dask_worker: str
dask_gateway: str


# =========== Authentication ==============
Expand Down
3 changes: 0 additions & 3 deletions qhub/stages/input_vars.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,6 @@ def stage_07_kubernetes_services(stage_outputs, config):
.get("extraEnv", [])
),
# dask-gateway
"dask-gateway-image": _split_docker_image_name(
config["default_images"]["dask_gateway"]
),
"dask-worker-image": _split_docker_image_name(
config["default_images"]["dask_worker"]
),
Expand Down
50 changes: 0 additions & 50 deletions qhub/template/image/Dockerfile.dask-gateway

This file was deleted.

10 changes: 0 additions & 10 deletions qhub/template/image/docker-bake.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,13 @@
"group": {
"default": {
"targets": [
"dask-gateway",
"dask-worker",
"jupyterhub",
"jupyterlab"
]
}
},
"target": {
"dask-gateway": {
"context": "./",
"dockerfile": "Dockerfile.dask-gateway",
"tags": [
"docker.io/quansight/qhub-dask-gateway:${TAG}",
"ghcr.io/quansight/qhub-dask-gateway:${TAG}",
"quay.io/quansight/qhub-dask-gateway:${TAG}"
]
},
"dask-worker": {
"context": "./",
"dockerfile": "Dockerfile.dask-worker",
Expand Down
10 changes: 0 additions & 10 deletions qhub/template/stages/07-kubernetes-services/dask_gateway.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@ variable "dask-worker-image" {
})
}

variable "dask-gateway-image" {
description = "Dask worker image"
type = object({
name = string
tag = string
})
}

variable "dask-gateway-profiles" {
description = "Dask Gateway profiles to expose to user"
default = []
Expand All @@ -32,8 +24,6 @@ module "dask-gateway" {
external-url = var.endpoint

cluster-image = var.dask-worker-image
gateway-image = var.dask-gateway-image
controller-image = var.dask-gateway-image

general-node-group = var.node_groups.general
worker-node-group = var.node_groups.worker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,38 +32,3 @@ def dask_gateway_config(path="/var/lib/dask-gateway/config.json"):

c.KubeController.proxy_web_entrypoint = "websecure"
c.KubeController.proxy_tcp_entrypoint = "tcp"


# override default make_ingressroute to add tls cert resolver
def make_ingressroute(self, cluster_name, namespace):
route = f"{self.proxy_prefix}/clusters/{namespace}.{cluster_name}/"
return {
"apiVersion": "traefik.containo.us/v1alpha1",
"kind": "IngressRoute",
"metadata": {
"labels": self.get_labels(cluster_name, "dask-scheduler"),
"annotations": self.common_annotations,
"name": f"dask-{cluster_name}",
},
"spec": {
"entryPoints": [self.proxy_web_entrypoint],
"routes": [
{
"kind": "Rule",
"match": f"PathPrefix(`{route}`)",
"services": [
{
"name": self.make_service_name(cluster_name),
"namespace": namespace,
"port": 8787,
}
],
"middlewares": self.proxy_web_middlewares,
}
],
"tls": {},
},
}


c.KubeController.make_ingressroute = make_ingressroute
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def dask_gateway_config(path="/var/lib/dask-gateway/config.json"):
)
c.KubeClusterConfig.image_pull_policy = config["cluster"]["image_pull_policy"]
c.KubeClusterConfig.environment = config["cluster"]["environment"]
c.KubeClusterConfig.idle_timeout = config["cluster"]["idle_timeout"]

c.KubeClusterConfig.scheduler_cores = config["cluster"]["scheduler_cores"]
c.KubeClusterConfig.scheduler_cores_limit = config["cluster"]["scheduler_cores_limit"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ variable "cluster" {
worker_extra_container_config = any
worker_extra_pod_config = any
# additional fields
idle_timeout = number
image_pull_policy = string
environment = map(string)
})
Expand All @@ -163,6 +164,7 @@ variable "cluster" {
worker_extra_container_config = {}
worker_extra_pod_config = {}
# additional fields
idle_timeout = 1800 # 30 minutes
image_pull_policy = "IfNotPresent"
environment = {}
}
Expand Down
4 changes: 4 additions & 0 deletions qhub/upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,10 @@ def _version_specific_upgrade(
if "conda_store" in config["default_images"]:
del config["default_images"]["conda_store"]

# Remove dask_gateway image from default_images
if "dask_gateway" in config["default_images"]:
del config["default_images"]["dask_gateway"]

# Create root password
default_password = "".join(
secrets.choice(string.ascii_letters + string.digits) for i in range(16)
Expand Down