Skip to content

Commit

Permalink
Merge pull request #316 from grycap/devel
Browse files Browse the repository at this point in the history
Devel
  • Loading branch information
micafer authored Jun 28, 2022
2 parents c1f85ad + 8525b0b commit 258c2c1
Show file tree
Hide file tree
Showing 11 changed files with 196 additions and 77 deletions.
2 changes: 1 addition & 1 deletion app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
class Settings:
def __init__(self, config):
"""Creator function."""
self.version = "2.3.0"
self.version = "2.4.0"
self.toscaDir = config.get('TOSCA_TEMPLATES_DIR', '') + "/"
self.toscaParamsDir = config.get('TOSCA_PARAMETERS_DIR', '') + "/"
self.imUrl = config['IM_URL']
Expand Down
Binary file added app/static/images/kubeapps-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 0 additions & 7 deletions tosca-templates/dask.prometeus.yaml

This file was deleted.

57 changes: 0 additions & 57 deletions tosca-templates/dask.yaml

This file was deleted.

16 changes: 16 additions & 0 deletions tosca-templates/daskhub.parameters.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
inputs:
dask_password:
tab: Dask Data

jupyterhub_token:
tab: Dask Data

dask_version:
tab: Dask Data

jupyterhub_image_name:
tab: Dask Data

tabs:
- Dask Data

89 changes: 89 additions & 0 deletions tosca-templates/daskhub.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
tosca_definitions_version: tosca_simple_yaml_1_0

imports:
- ec3_custom_types: https://raw.githubusercontent.com/grycap/ec3/tosca/tosca/custom_types.yaml

metadata:
name: Daskhub
display_name: Launch Daskhub on top of a Kubernetes Virtual Cluster
icon: images/dask.png
parents:
- kubernetes.yaml

description: TOSCA template for launching Daskhub on top of a Kubernetes Virtual Cluster.

topology_template:

inputs:

dask_password:
type: string
description: Password for the Simple auth method in the Gateway
default: dask_pass
dask_version:
type: string
description: Daskhub version
default: 2022.5.0
constraints:
- valid_values: [ "2022.5.0", "2022.4.1", "2022.3.0", "2022.2.1" ]
jupyterhub_token:
type: string
description: Jupyterhub auth token
default: 11a8120f55c6992d819b9b33ef825120d9a752f738fca1d659c06b436053cd02
jupyterhub_image_name:
type: string
description: Jupyterhub singleuser image
default: jupyterhub/k8s-singleuser-sample
constraints:
- valid_values: [ "jupyterhub/k8s-singleuser-sample", "pangeo/pangeo-notebook", "guillaumeeb/pangeo-ml-notebook" ]

node_templates:

dask:
type: tosca.nodes.indigo.Helm.Chart
properties:
namespace: daskhub
repository_name: dask
repository_url: "https://helm.dask.org"
name: daskhub
values_file: |
jupyterhub:
proxy:
service:
type: ClusterIP
scheduling:
podPriority:
enabled: true
userPlaceholder:
# Specify three dummy user pods will be used as placeholders
replicas: 1
userScheduler:
enabled: true
singleuser:
serviceAccountName: daskkubernetes
dask-gateway:
enabled: false
gateway:
auth:
type: simple
dask-kubernetes:
enabled: true
jupyterhub:
hub:
baseUrl: /jupyterhub/
ingress:
enabled: true
annotations: { kubernetes.io/ingress.class: nginx }
values:
jupyterhub.singleuser.image.name: { get_input: jupyterhub_image_name }
jupyterhub.singleuser.image.tag: latest
jupyterhub.proxy.secretToken: { get_input: jupyterhub_token }
dask-gateway.gateway.auth.simple.password: { get_input: dask_password }
requirements:
- host: front
- dependency: lrms_front_end

outputs:
pangeo_jupyter_hub_url:
value: { concat: [ 'https://', get_attribute: [ front, public_address, 0 ], '/jupyterhub/' ] }

9 changes: 9 additions & 0 deletions tosca-templates/docker.parameters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ inputs:
driver_version:
tab: Docker Data

git_repo:
tab: Docker Data

git_branch:
tab: Docker Data

git_folder:
tab: Docker Data

tabs:
- Docker Data

18 changes: 18 additions & 0 deletions tosca-templates/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,21 @@ topology_template:
description: NVIDIA Driver version to install
default: "510"

git_repo:
type: string
description: Git repository to clone and perform a docker-compose up
default: ""

git_branch:
type: string
description: Git repository branch to clone and perform a docker-compose up
default: "master"

git_folder:
type: string
description: Subfolder in the Git repository to clone and perform a docker-compose up
default: ""

node_templates:

docker:
Expand All @@ -48,4 +63,7 @@ topology_template:
inputs:
docker_nvidia_support: { get_input: nvidia_support }
docker_nvidia_driver_version: { get_input: driver_version }
docker_compose_git: { get_input: git_repo }
compose_folder: { get_input: git_folder }
repo_branch: { get_input: git_branch }

60 changes: 60 additions & 0 deletions tosca-templates/kubeapps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
tosca_definitions_version: tosca_simple_yaml_1_0

imports:
- ec3_custom_types: https://raw.githubusercontent.com/grycap/ec3/tosca/tosca/custom_types.yaml

metadata:
name: Kubeapps
display_name: Launch Kubeapps on top of a Kubernetes Virtual Cluster
icon: images/kubeapps-logo.png
parents:
- kubernetes.yaml

description: TOSCA template for launching Kubeapps on top of a Kubernetes Virtual Cluster.

topology_template:

node_templates:

kubeapps:
type: tosca.nodes.indigo.Helm.Chart
properties:
namespace: kubeapps
repository_name: bitnami
repository_url: "https://charts.bitnami.com/bitnami"
name: kubeapps
values:
ingress.enabled: "false"
requirements:
- host: front
- dependency: lrms_front_end

kubeapps_ingress:
type: tosca.nodes.indigo.KubernetesObject
properties:
spec: |
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: kubeapps
namespace: kubeapps
annotations:
kubernetes.io/ingress.class: nginx
spec:
rules:
- http:
paths:
- path: /kubeapps
backend:
service:
name: kubeapps
port:
number: 80
pathType: Prefix
requirements:
- host: lrms_front_end

outputs:
kubeapps_endpoint:
value: { concat: [ 'https://', get_attribute: [ front, public_address, 0 ], '/kubeapps/' ] }

3 changes: 0 additions & 3 deletions tosca-templates/kubernetes.parameters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ inputs:
cri_runtime:
tab: Kubernetes Data

install_kubeapps:
tab: Kubernetes Data

kube_nvidia_support:
tab: Kubernetes Data

Expand Down
12 changes: 3 additions & 9 deletions tosca-templates/kubernetes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ metadata:
icon: images/kubernetes.png
order: 5
childs:
- kubeapps.yml
- minio.yaml
- argo.yaml
- influxdb.yaml
- kubernetes_elastic.yaml
- daskhub.yaml

description: TOSCA template for launching a Kubernetes Virtual Cluster.

Expand Down Expand Up @@ -85,12 +87,6 @@ topology_template:
default: "docker"
constraints:
- valid_values: [ docker, containerd ]
install_kubeapps:
type: boolean
description: Flag to set the kubeapps UI to be installed
default: true
constraints:
- valid_values: [ true, false ]
kube_nvidia_support:
type: boolean
description: Flag to add NVIDIA support
Expand Down Expand Up @@ -129,7 +125,7 @@ topology_template:
admin_username: kubeuser
install_nfs_client: true
admin_token: { get_input: admin_token }
install_kubeapps: { get_input: install_kubeapps }
install_kubeapps: false
version: { get_input: kube_version }
nvidia_support: { get_input: kube_nvidia_support }
cert_manager: { get_input: kube_cert_manager }
Expand Down Expand Up @@ -199,7 +195,5 @@ topology_template:
value: { concat: [ 'https://', get_attribute: [ front, public_address, 0 ], '/dashboard/' ] }
api_endpoint:
value: { concat: [ 'https://', get_attribute: [ front, public_address, 0 ], ':6443' ] }
kubeapps_endpoint:
value: { concat: [ 'https://', get_attribute: [ front, public_address, 0 ], '/kubeapps/' ] }
kubeconfig:
value: { get_attribute: [ front, ansible_output, lrms_front_end_front_conf_front, tasks, kube_conf, output ] }

0 comments on commit 258c2c1

Please sign in to comment.