diff --git a/.github/dependabot.yml b/.github/dependabot.yml index c37ee58b..ae17d9d3 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -9,7 +9,7 @@ updates: - package-ecosystem: "devcontainers" directory: "/" schedule: - interval: "weekly" + interval: "monthly" commit-message: prefix: "build" groups: @@ -21,7 +21,7 @@ updates: - package-ecosystem: "github-actions" directory: "/" schedule: - interval: "weekly" + interval: "monthly" commit-message: prefix: "build" @@ -29,7 +29,7 @@ updates: - package-ecosystem: "docker" directory: "/apps/cogstack-jupyter-hub" schedule: - interval: "weekly" + interval: "monthly" registries: - dockerhub commit-message: @@ -43,7 +43,7 @@ updates: - package-ecosystem: "uv" directory: "/apps/cogstack-jupyter-hub" schedule: - interval: "weekly" + interval: "monthly" commit-message: prefix: "build(jupyter)" groups: diff --git a/README.md b/README.md index ef3b2422..24604519 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ See the latest documentation on [Readthedocs](https://docs.cogstack.org/en/lates Cohort definition tooling with NL2DSL and web UI - + CogStack Dashboards Demo
CogStack Dashboards Demo
diff --git a/cogstack-dashboards-demo/.gitignore b/apps/cogstack-dashboards-demo/.gitignore similarity index 100% rename from cogstack-dashboards-demo/.gitignore rename to apps/cogstack-dashboards-demo/.gitignore diff --git a/cogstack-dashboards-demo/LICENSE b/apps/cogstack-dashboards-demo/LICENSE similarity index 100% rename from cogstack-dashboards-demo/LICENSE rename to apps/cogstack-dashboards-demo/LICENSE diff --git a/cogstack-dashboards-demo/README.md b/apps/cogstack-dashboards-demo/README.md similarity index 100% rename from cogstack-dashboards-demo/README.md rename to apps/cogstack-dashboards-demo/README.md diff --git a/cogstack-dashboards-demo/data/.gitkeep b/apps/cogstack-dashboards-demo/data/.gitkeep similarity index 100% rename from cogstack-dashboards-demo/data/.gitkeep rename to apps/cogstack-dashboards-demo/data/.gitkeep diff --git a/cogstack-dashboards-demo/figures/clusters.png b/apps/cogstack-dashboards-demo/figures/clusters.png similarity index 100% rename from cogstack-dashboards-demo/figures/clusters.png rename to apps/cogstack-dashboards-demo/figures/clusters.png diff --git a/cogstack-dashboards-demo/figures/disorder_per_age.png b/apps/cogstack-dashboards-demo/figures/disorder_per_age.png similarity index 100% rename from cogstack-dashboards-demo/figures/disorder_per_age.png rename to apps/cogstack-dashboards-demo/figures/disorder_per_age.png diff --git a/cogstack-dashboards-demo/figures/disorder_per_gender.png b/apps/cogstack-dashboards-demo/figures/disorder_per_gender.png similarity index 100% rename from cogstack-dashboards-demo/figures/disorder_per_gender.png rename to apps/cogstack-dashboards-demo/figures/disorder_per_gender.png diff --git a/cogstack-dashboards-demo/figures/handpicked_co_occurrences.png b/apps/cogstack-dashboards-demo/figures/handpicked_co_occurrences.png similarity index 100% rename from cogstack-dashboards-demo/figures/handpicked_co_occurrences.png rename to apps/cogstack-dashboards-demo/figures/handpicked_co_occurrences.png diff --git a/cogstack-dashboards-demo/figures/presence.png b/apps/cogstack-dashboards-demo/figures/presence.png similarity index 100% rename from cogstack-dashboards-demo/figures/presence.png rename to apps/cogstack-dashboards-demo/figures/presence.png diff --git a/cogstack-dashboards-demo/figures/subject.png b/apps/cogstack-dashboards-demo/figures/subject.png similarity index 100% rename from cogstack-dashboards-demo/figures/subject.png rename to apps/cogstack-dashboards-demo/figures/subject.png diff --git a/cogstack-dashboards-demo/figures/time.png b/apps/cogstack-dashboards-demo/figures/time.png similarity index 100% rename from cogstack-dashboards-demo/figures/time.png rename to apps/cogstack-dashboards-demo/figures/time.png diff --git a/cogstack-dashboards-demo/figures/top_level_concepts.png b/apps/cogstack-dashboards-demo/figures/top_level_concepts.png similarity index 100% rename from cogstack-dashboards-demo/figures/top_level_concepts.png rename to apps/cogstack-dashboards-demo/figures/top_level_concepts.png diff --git a/cogstack-dashboards-demo/requirements.txt b/apps/cogstack-dashboards-demo/requirements.txt similarity index 100% rename from cogstack-dashboards-demo/requirements.txt rename to apps/cogstack-dashboards-demo/requirements.txt diff --git a/cogstack-dashboards-demo/sample_access_scripts/python_os_access.py b/apps/cogstack-dashboards-demo/sample_access_scripts/python_os_access.py similarity index 100% rename from cogstack-dashboards-demo/sample_access_scripts/python_os_access.py rename to apps/cogstack-dashboards-demo/sample_access_scripts/python_os_access.py diff --git a/cogstack-dashboards-demo/sample_access_scripts/sample_curl_command.sh b/apps/cogstack-dashboards-demo/sample_access_scripts/sample_curl_command.sh similarity index 100% rename from cogstack-dashboards-demo/sample_access_scripts/sample_curl_command.sh rename to apps/cogstack-dashboards-demo/sample_access_scripts/sample_curl_command.sh diff --git a/cogstack-dashboards-demo/staging_scripts/co_occurence_generator.py b/apps/cogstack-dashboards-demo/staging_scripts/co_occurence_generator.py similarity index 100% rename from cogstack-dashboards-demo/staging_scripts/co_occurence_generator.py rename to apps/cogstack-dashboards-demo/staging_scripts/co_occurence_generator.py diff --git a/cogstack-dashboards-demo/staging_scripts/co_occurence_hand_selected.py b/apps/cogstack-dashboards-demo/staging_scripts/co_occurence_hand_selected.py similarity index 100% rename from cogstack-dashboards-demo/staging_scripts/co_occurence_hand_selected.py rename to apps/cogstack-dashboards-demo/staging_scripts/co_occurence_hand_selected.py diff --git a/cogstack-dashboards-demo/staging_scripts/disorder_codes.py b/apps/cogstack-dashboards-demo/staging_scripts/disorder_codes.py similarity index 100% rename from cogstack-dashboards-demo/staging_scripts/disorder_codes.py rename to apps/cogstack-dashboards-demo/staging_scripts/disorder_codes.py diff --git a/cogstack-dashboards-demo/staging_scripts/disorders_per_age.py b/apps/cogstack-dashboards-demo/staging_scripts/disorders_per_age.py similarity index 100% rename from cogstack-dashboards-demo/staging_scripts/disorders_per_age.py rename to apps/cogstack-dashboards-demo/staging_scripts/disorders_per_age.py diff --git a/cogstack-dashboards-demo/staging_scripts/disorders_per_sex.py b/apps/cogstack-dashboards-demo/staging_scripts/disorders_per_sex.py similarity index 100% rename from cogstack-dashboards-demo/staging_scripts/disorders_per_sex.py rename to apps/cogstack-dashboards-demo/staging_scripts/disorders_per_sex.py diff --git a/cogstack-dashboards-demo/staging_scripts/patients_per_disorder.py b/apps/cogstack-dashboards-demo/staging_scripts/patients_per_disorder.py similarity index 100% rename from cogstack-dashboards-demo/staging_scripts/patients_per_disorder.py rename to apps/cogstack-dashboards-demo/staging_scripts/patients_per_disorder.py diff --git a/cogstack-dashboards-demo/staging_scripts/top_level_codes.py b/apps/cogstack-dashboards-demo/staging_scripts/top_level_codes.py similarity index 100% rename from cogstack-dashboards-demo/staging_scripts/top_level_codes.py rename to apps/cogstack-dashboards-demo/staging_scripts/top_level_codes.py diff --git a/cogstack-dashboards-demo/visualisation_scripts/generate_meta_images.py b/apps/cogstack-dashboards-demo/visualisation_scripts/generate_meta_images.py similarity index 100% rename from cogstack-dashboards-demo/visualisation_scripts/generate_meta_images.py rename to apps/cogstack-dashboards-demo/visualisation_scripts/generate_meta_images.py diff --git a/cogstack-dashboards-demo/visualisation_scripts/pca_co_occurence.py b/apps/cogstack-dashboards-demo/visualisation_scripts/pca_co_occurence.py similarity index 100% rename from cogstack-dashboards-demo/visualisation_scripts/pca_co_occurence.py rename to apps/cogstack-dashboards-demo/visualisation_scripts/pca_co_occurence.py diff --git a/cogstack-dashboards-demo/visualisation_scripts/vis_disorder_per_age.py b/apps/cogstack-dashboards-demo/visualisation_scripts/vis_disorder_per_age.py similarity index 100% rename from cogstack-dashboards-demo/visualisation_scripts/vis_disorder_per_age.py rename to apps/cogstack-dashboards-demo/visualisation_scripts/vis_disorder_per_age.py diff --git a/cogstack-dashboards-demo/visualisation_scripts/vis_disorder_per_gender.py b/apps/cogstack-dashboards-demo/visualisation_scripts/vis_disorder_per_gender.py similarity index 100% rename from cogstack-dashboards-demo/visualisation_scripts/vis_disorder_per_gender.py rename to apps/cogstack-dashboards-demo/visualisation_scripts/vis_disorder_per_gender.py diff --git a/cogstack-dashboards-demo/visualisation_scripts/vis_top_codes.py b/apps/cogstack-dashboards-demo/visualisation_scripts/vis_top_codes.py similarity index 100% rename from cogstack-dashboards-demo/visualisation_scripts/vis_top_codes.py rename to apps/cogstack-dashboards-demo/visualisation_scripts/vis_top_codes.py diff --git a/cogstack-dashboards-demo/visualisation_scripts/visualise_co_occurence.py b/apps/cogstack-dashboards-demo/visualisation_scripts/visualise_co_occurence.py similarity index 100% rename from cogstack-dashboards-demo/visualisation_scripts/visualise_co_occurence.py rename to apps/cogstack-dashboards-demo/visualisation_scripts/visualise_co_occurence.py diff --git a/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/.helmignore b/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/.helmignore deleted file mode 100644 index 9d315138..00000000 --- a/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/.helmignore +++ /dev/null @@ -1,10 +0,0 @@ -# Common VCS directories -.git/ -.gitignore - -# IDE files -.vscode/ -.idea/ - -# macOS -.DS_Store diff --git a/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/Chart.yaml b/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/Chart.yaml deleted file mode 100644 index 33532eae..00000000 --- a/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/Chart.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: v2 -name: cogstack-jupyterhub -description: Helm chart for deploying CogStack JupyterHub -type: application -version: 0.1.0 -appVersion: "2.2.3" diff --git a/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/README.md b/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/README.md deleted file mode 100644 index 01c1a1cb..00000000 --- a/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/README.md +++ /dev/null @@ -1,38 +0,0 @@ -# cogstack-jupyterhub Helm Chart - -This chart deploys the CogStack JupyterHub service and mirrors the current Docker Compose setup: - -- loads `env/general.env` and `env/jupyter.env` -- mounts `jupyterhub_config.py`, `userlist`, and `teamlist` -- mounts TLS/cookie files used by JupyterHub -- mounts `/var/run/docker.sock` for DockerSpawner - -## Install using repo env files - -From the repository root: - -```bash -helm upgrade --install cogstack-jupyterhub ./charts/cogstack-jupyterhub \ - --namespace cogstack --create-namespace \ - --set envFiles.useBundled=false \ - --set hubFiles.useBundled=false \ - --set securityFiles.useBundled=false \ - --set-file envFiles.jupyter=env/jupyter.env \ - --set-file envFiles.general=env/general.env \ - --set-file hubFiles.jupyterhubConfig=config/jupyterhub_config.py \ - --set-file hubFiles.userlist=config/userlist \ - --set-file hubFiles.teamlist=config/teamlist \ - --set-file securityFiles.cookieSecret=config/jupyterhub_cookie_secret \ - --set-file securityFiles.tlsKey=security/nifi.key \ - --set-file securityFiles.tlsCert=security/nifi.pem -``` - -## Bundled file mode - -By default, the chart contains copies of current repo files under `charts/cogstack-jupyterhub/files/*`. -If you leave `*.useBundled=true`, Helm will use those bundled copies. - -## Notes - -- This chart keeps DockerSpawner behavior, so it mounts the host Docker socket. -- For multi-node/production Kubernetes, migrating to KubeSpawner is strongly recommended. diff --git a/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/files/config/jupyterhub_config.py b/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/files/config/jupyterhub_config.py deleted file mode 100755 index 543850b0..00000000 --- a/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/files/config/jupyterhub_config.py +++ /dev/null @@ -1,457 +0,0 @@ -# Configuration file for jupyter-hub -# source : https://github.com/jupyterhub/jupyterhub-deploy-docker/blob/main/basic-example/jupyterhub_config.py - -import os -import sys -import docker -import dockerspawner -import traceback -import logging -#import traitlets -from jupyterhub.auth import LocalAuthenticator -from nativeauthenticator import NativeAuthenticator -from traitlets.config import Config -from oauthenticator.generic import GenericOAuthenticator - - -class LocalNativeAuthenticator(NativeAuthenticator, LocalAuthenticator): - pass - - -DOCKER_NOTEBOOK_IMAGE = os.getenv("JUPYTER_HUB_SINGLEUSER_DOCKER_NOTEBOOK_IMAGE", - "cogstacksystems:jupyterhub/singleuser:latest") - -# JupyterHub requires a single-user instance of the Notebook server, so we -# default to using the `start-singleuser.sh` script included in the -# jupyter/docker-stacks *-notebook images as the Docker run command when -# spawning containers. Optionally, you can override the Docker run command -# using the JUPYTER_HUB_DOCKER_SPAWN_CMD environment variable. -SPAWN_CMD = os.environ.get("JUPYTER_HUB_DOCKER_SPAWN_CMD", "start-singleuser.py") - -# Connect containers to this Docker network -# IMPORTANT, THIS MUST MATCH THE NETWORK DECLARED in "services.yml", by default: "cogstack-net" -NETWORK_NAME = os.environ.get("JUPYTER_HUB_DOCKER_NETWORK_NAME", "cogstack-net") - -# The IP address or hostname of the JupyterHub container in the Docker network -HUB_CONTAINER_IP_OR_NAME = os.environ.get("JUPYTER_HUB_DOCKER_CONTAINER_NAME", "cogstack-jupyter-hub") - -# The timeout in seconds after which the idle notebook container will be shutdown - 7 days -NOTEBOOK_IDLE_TIMEOUT = int(os.environ.get("DOCKER_NOTEBOOK_IDLE_TIMEOUT", str(7 * 24 * 60 * 60))) - -SELECT_NOTEBOOK_IMAGE_ALLOWED = str(os.environ.get("JUPYTERHUB_DOCKER_SELECT_NOTEBOOK_IMAGE_ALLOWED", "false")).lower() - -RUN_IN_DEBUG_MODE = str(os.environ.get("JUPYTERHUB_DOCKER_NOTEBOOK_DEBUG_MODE", "false")).lower() - -ENABLE_OIDC_AUTH = str(os.environ.get("JUPYTERHUB_DOCKER_ENABLE_OIDC_AUTH", "false")).lower() - -# Explicitly set notebook directory because we"ll be mounting a host volume to -# it. Most jupyter/docker-stacks *-notebook images run the Notebook server as -# user `jovyan`, and set the notebook directory to `/home/jovyan/work`. -# We follow the same convention. -NOTEBOOK_DIR = os.environ.get("JUPYTER_HUB_DOCKER_NOTEBOOK_DIR", "/home/jovyan/work") -SHARED_CONTENT_DIR = os.environ.get("JUPYTER_HUB_DOCKER_SHARED_DIR", "/home/jovyan/scratch") -#WORK_DIR = os.environ.get("DOCKER_JUPYTER_WORK_DIR", "/lab/workspaces/auto-b/tree/" + str(NOTEBOOK_DIR.split("/")[-1])) -WORK_DIR = "/lab/" - -ENV_PROXIES = { - "HTTP_PROXY": os.environ.get("HTTP_PROXY", ""), - "HTTPS_PROXY": os.environ.get("HTTPS_PROXY", ""), - "NO_PROXY": ",".join(list(filter(len, os.environ.get("NO_PROXY", "").split(",") + [HUB_CONTAINER_IP_OR_NAME]))), - "http_proxy": os.environ.get("HTTP_PROXY", os.environ.get("http_proxy", "")), - "https_proxy": os.environ.get("HTTPS_PROXY", os.environ.get("https_proxy", "")), - "no_proxy": ",".join(list(filter(len, os.environ.get("no_proxy", "").split(",") + [HUB_CONTAINER_IP_OR_NAME]))), -} - -os.environ["NO_PROXY"] = "" -os.environ["no_proxy"] = "" -os.environ["HTTP_PROXY"] = "" -os.environ["HTTPS_PROXY"] = "" -os.environ["http_proxy"] = "" -os.environ["https_proxy"] = "" - -c: Config = get_config() - -# Spawn containers from this image -# Either use the CoGstack one from the repo which is huge and contains all the stuff needed or, -# use the default official one which is clean. -c.DockerSpawner.image = DOCKER_NOTEBOOK_IMAGE - -c.DockerSpawner.use_internal_ip = True -c.DockerSpawner.network_name = NETWORK_NAME -# Pass the network name as argument to spawned containers -c.DockerSpawner.extra_host_config = {"network_mode": NETWORK_NAME} - -# # Mount the real users Docker volume on the host to the notebook user"s -# # notebook directory in the container -c.DockerSpawner.volumes = {"jupyterhub-user-{username}": NOTEBOOK_DIR, "jupyter-hub-shared-scratch": SHARED_CONTENT_DIR} - -# Remove containers once they are stopped -c.DockerSpawner.remove = False - -if SELECT_NOTEBOOK_IMAGE_ALLOWED == "true": - # c.DockerSpawner.image_whitelist has been deprecated for allowed_images - c.DockerSpawner.allowed_images = { - "minimal": "jupyterhub/singleuser:latest", - "cogstack": "cogstacksystems/jupyter-singleuser:latest", - "cogstack-gpu": "cogstacksystems/jupyter-singleuser-gpu:latest" - } - # https://github.com/jupyterhub/dockerspawner/issues/423 - c.DockerSpawner.remove = True - -if RUN_IN_DEBUG_MODE == "true": - # For debugging arguments passed to spawned containers - c.DockerSpawner.debug = True - c.Spawner.debug = True - # Enable debug-logging of the single-user server - c.LocalProcessSpawner.debug = True - - -# Spawn single-user servers as Docker containers -class DockerSpawner(dockerspawner.DockerSpawner): - def start(self): - # username is self.user.name - self.volumes = {"jupyterhub-user-{}".format(self.user.name): NOTEBOOK_DIR} - - # Mount the real users Docker volume on the host to the notebook user"s - # # notebook directory in the container - #self.volumes = {f"jupyterhub-user-{self.user.name}": NOTEBOOK_DIR, "jupyter-hub-shared-scratch": SHARED_CONTENT_DIR} - - if self.user.name not in whitelist: - whitelist.add(self.user.name) - with open(userlist_path, "a") as f: - f.write("\n") - f.write(self.user.name) - - if self.user.name in list(team_map.keys()): - for team in team_map[self.user.name]: - team_dir_path = os.path.join(SHARED_CONTENT_DIR, team) - self.volumes["jupyterhub-team-{}".format(team)] = { - "bind": team_dir_path, - "mode": "rw", # or ro for read-only - } - - # this is a temporary fix, need to actually check permissions - self.mem_limit = RESOURCE_ALLOCATION_USER_RAM_LIMIT - self.post_start_cmd = "chmod -R 777 " + SHARED_CONTENT_DIR - - return super().start() - - -def pre_spawn_hook(spawner: DockerSpawner): - #username = spawner.user.name - #spawner.environment["GREETING"] = f"Hello {username}" - try: - for key, value in ENV_PROXIES.items(): - spawner.environment[str(key)] = str(value) - with open("/home/jovyan/test.txt", "w+") as f: - for key, value in ENV_PROXIES.items(): - f.write("export" + " " + str(key) + "=" + str(value) + "\n") - except Exception: - traceback.print_exc() - - -""" - def pre_spawn_hook(spawner): - username = str(spawner.user.name).lower() - try: - pwd.getpwnam(username) - except KeyError: - subprocess.check_call(["useradd", "-ms", "/bin/bash", username]) -""" - -c.Spawner.default_url = WORK_DIR -c.Spawner.pre_spawn_hook = pre_spawn_hook - -#c.Spawner.ip = "127.0.0.1" - -# This is buggy, setting the HTTP(s)_PROXY & NO_PROXY variables via pre/post -# spawn hook is better -#c.Spawner.environment = ENV_PROXIES - -# AUTHENTICATION -#c.Authenticator.allowed_users = {"admin"} -c.Authenticator.admin_users = admin = {"admin"} - -# By default all users that make sign up on Native Authenticator -# need an admin approval so they can actually log in the system. -c.Authenticator.open_signup = False - -c.NotebookApp.allow_root = False - -c.LocalAuthenticator.create_system_users = True -c.SystemdSpawner.dynamic_users = True -c.PAMAuthenticator.admin_groups = {"wheel"} -c.Authenticator.allowed_users = whitelist = set() - -#c.Authenticator.manage_groups = True -#c.Authenticator.allow_all = True - -curr_dir = os.path.dirname(__file__) - -# Get active users -userlist_path = os.path.join(curr_dir, "userlist") -teamlist_path = os.path.join(curr_dir, "teamlist") - -# Resource allocation env vars -# RAM - GB of ram, CPU - num of cores -RESOURCE_ALLOCATION_USER_CPU_LIMIT = os.environ.get("JUPYTER_HUB_SINGLEUSER_RESOURCE_ALLOCATION_USER_CPU_LIMIT", "2") -RESOURCE_ALLOCATION_USER_RAM_LIMIT = os.environ.get("JUPYTER_HUB_SINGLEUSER_RESOURCE_ALLOCATION_USER_RAM_LIMIT", "2.0G") -RESOURCE_ALLOCATION_ADMIN_CPU_LIMIT = os.environ.get("JUPYTER_HUB_SINGLEUSER_RESOURCE_ALLOCATION_ADMIN_CPU_LIMIT", "2") -RESOURCE_ALLOCATION_ADMIN_RAM_LIMIT = os.environ.get("JUPYTER_HUB_SINGLEUSER_RESOURCE_ALLOCATION_ADMIN_RAM_LIMIT", "4.0G") - - -def per_user_limit(role): - ram_limits = {"user": (int(RESOURCE_ALLOCATION_USER_CPU_LIMIT), RESOURCE_ALLOCATION_USER_RAM_LIMIT), - "admin": (int(RESOURCE_ALLOCATION_ADMIN_CPU_LIMIT), RESOURCE_ALLOCATION_ADMIN_RAM_LIMIT)} - return ram_limits.get(role) - - -# Spawn single-user servers as Docker containers -c.JupyterHub.spawner_class = DockerSpawner - -# set DockerSpawner args -c.DockerSpawner.extra_create_kwargs = {"user": "root"} -c.DockerSpawner.args = [ - "--allow-root", - "--NotebookApp.token=''", -] - -c.DockerSpawner.cmd = [SPAWN_CMD] if isinstance(SPAWN_CMD, str) else SPAWN_CMD - -c.DockerSpawner.notebook_dir = NOTEBOOK_DIR - -with open(userlist_path) as f: - for line in f: - if not line: - continue - parts = line.split() - # in case of newline at the end of userlist file - if len(parts) >= 1: - name = str(parts[0]).lower() - role = "user" - - if (len(parts) > 1): - role = parts[1] - whitelist.add(name) - if len(parts) > 1 and role == "admin": - admin.add(name) - - c.Spawner.mem_limit = c.SwarmSpawner.mem_limit = c.DockerSpawner.mem_limit = per_user_limit(role)[1] - c.Spawner.cpu_limit = c.SwarmSpawner.cpu_limit = c.DockerSpawner.cpu_limit = per_user_limit(role)[0] - - c.Spawner.cpu_guarantee = c.SwarmSpawner.cpu_guarantee = c.DockerSpawner.cpu_guarantee = 1 - c.Spawner.mem_guarantee = c.SwarmSpawner.mem_guarantee = c.DockerSpawner.mem_guarantee = "1.0G" - - prev_conf = c.DockerSpawner.extra_host_config - prev_conf.update({"mem_limit": c.DockerSpawner.mem_limit}) - - c.DockerSpawner.extra_host_config = prev_conf - -# Get team memberships -team_map = {user: set() for user in whitelist} -with open(teamlist_path) as f: - for line in f: - if not line: - continue - parts = line.split() - if len(parts) > 1: - team = parts[0] - members = set(parts[1:]) - for member in members: - team_map[member].add(team) - -gpu_support_enabled = os.environ.get("JUPYTERHUB_DOCKER_ENABLE_GPU_SUPPORT", "false") - -if gpu_support_enabled.lower() == "true": - c.DockerSpawner.extra_host_config = { - "device_requests": [ - docker.types.DeviceRequest( - count=-1, - capabilities=[["gpu", "utility", "compute", "video"]] - ), - ], - } - -c.DockerSpawner.environment = { - "GRANT_SUDO": "1", - "UID": "0", # workaround https://github.com/jupyter/docker-stacks/pull/420, -} - -c.DockerSpawner.environment.update(ENV_PROXIES) - -# Alternative, use: "nativeauthenticator.NativeAuthenticator" -#c.JupyterHub.authenticator_class = LocalNativeAuthenticator - -if ENABLE_OIDC_AUTH == "true": - # Use Generic OAuth with Keycloak - c.JupyterHub.authenticator_class = GenericOAuthenticator - - # Automatically redirect to OAuth provider (skip login button) - c.Authenticator.auto_login = True - - # Keycloak configuration - c.GenericOAuthenticator.client_id = os.environ.get("JUPYTERHUB_OAUTH_CLIENT_ID", "cogstack-jupyterhub") - c.GenericOAuthenticator.client_secret = os.environ.get("JUPYTERHUB_OAUTH_CLIENT_SECRET", "") - c.GenericOAuthenticator.oauth_callback_url = os.environ.get( - "JUPYTERHUB_OAUTH_CALLBACK_URL", - "https://localhost:8888/hub/oauth_callback" - ) - - # Keycloak endpoints - # Browser-accessible URL - keycloak_url_public = os.environ.get("JUPYTERHUB_KEYCLOAK_URL_PUBLIC", "http://keycloak.cogstack.localhost") - # Internal container URL (for backend token exchange) - keycloak_url_internal = os.environ.get("JUPYTERHUB_KEYCLOAK_URL_INTERNAL", "http://keycloak:8080") - realm = os.environ.get("JUPYTERHUB_KEYCLOAK_REALM", "cogstack-realm") - - # authorize_url is accessed by the browser, so use public URL - c.GenericOAuthenticator.authorize_url = f"{keycloak_url_public}/realms/{realm}/protocol/openid-connect/auth" - # token_url and userdata_url are accessed by JupyterHub backend, so use internal URL - c.GenericOAuthenticator.token_url = f"{keycloak_url_internal}/realms/{realm}/protocol/openid-connect/token" - c.GenericOAuthenticator.userdata_url = f"{keycloak_url_internal}/realms/{realm}/protocol/openid-connect/userinfo" - - c.GenericOAuthenticator.username_claim = "preferred_username" - - # Require users to be in specific Keycloak groups - c.GenericOAuthenticator.manage_groups = True - c.GenericOAuthenticator.allowed_groups = ["jupyterhub-users", "juypterhub-admins"] - c.GenericOAuthenticator.claim_groups_key = "groups" - - # Map Keycloak roles to JupyterHub admin - c.GenericOAuthenticator.admin_groups = ["jupyterhub-admins"] - - c.GenericOAuthenticator.scope = ["openid", "profile", "email", "groups"] - - # Allow all authenticated users (or restrict with allowed_groups above) - # c.GenericOAuthenticator.allow_all = True -else: - c.FirstUseAuthenticator.create_users = True - c.JupyterHub.authenticator_class = "firstuseauthenticator.FirstUseAuthenticator" - -# User containers will access hub by container name on the Docker network -c.JupyterHub.ip = "0.0.0.0" -c.JupyterHub.hub_ip = "0.0.0.0" -c.JupyterHub.hub_connect_ip = HUB_CONTAINER_IP_OR_NAME - -jupyter_hub_port = int(os.environ.get("JUPYTERHUB_INTERNAL_PORT", 8888)) -jupyter_hub_proxy_api_port = int(os.environ.get("JUPYTERHUB_INTERNAL_PROXY_API_PORT", 8887)) -jupyter_hub_ssl_port = int(os.environ.get("JUPYTERHUB_SSL_PORT", 443)) -jupyter_hub_proxy_url = str(os.environ.get("JUPYTERHUB_PROXY_API_URL", "http://127.0.0.1:")) - -c.ConfigurableHTTPProxy.api_url = jupyter_hub_proxy_url + str(jupyter_hub_proxy_api_port) -# c.JupyterHub.hub_connect_url = f"https://{HUB_CONTAINER_IP_OR_NAME}:{jupyter_hub_ssl_port}" -# c.DockerSpawner.hub_connect_url = c.JupyterHub.hub_connect_url - -# ideally a private network address -# c.JupyterHub.proxy_api_ip = "10.0.1.4" -# c.JupyterHub.proxy_api_port = jupyter_hub_proxy_api_port - -# TLS config -c.JupyterHub.port = jupyter_hub_ssl_port -c.JupyterHub.ssl_key = os.environ.get("JUPYTERHUB_SSL_KEY", "/srv/jupyterhub/security/nifi.key") -c.JupyterHub.ssl_cert = os.environ.get("JUPYTERHUB_SSL_CERT", "/srv/jupyterhub/security/nifi.pem") - -# Persist hub data on volume mounted inside container -data_dir = os.environ.get("JUPYTERHUB_DATA_VOLUME_CONTAINER", "") - -c.JupyterHub.cookie_secret_file = data_dir + "jupyterhub_cookie_secret" - -c.JupyterHub.services = [] - -if NOTEBOOK_IDLE_TIMEOUT > 0: - c.JupyterHub.services.append({ - "name": "idle-culler", - "admin": True, - "command": [ - sys.executable, - "-m", "jupyterhub_idle_culler", - f"--timeout={NOTEBOOK_IDLE_TIMEOUT}", - "--url=http://127.0.0.1:8081/hub/api", - ], - }) - -#------------------------------------------------------------------------------ -# Application(SingletonConfigurable) configuration -#------------------------------------------------------------------------------ -# This is an application. - -c.JupyterHub.pid_file = "/srv/jupyterhub/jupyter_hub.pid" -c.ConfigurableHTTPProxy.pid_file = "/srv/jupyterhub/jupyter_hub_proxy.pid" - -# The date format used by logging formatters for %(asctime)s -# Default: "%Y-%m-%d %H:%M:%S" -# c.Application.log_datefmt = "%Y-%m-%d %H:%M:%S" - -# The Logging format template -# Default: "[%(name)s]%(highlevel)s %(message)s" -# c.Application.log_format = "[%(name)s]%(highlevel)s %(message)s" - -jupyter_log_level = os.environ.get("JUPYTERHUB_LOG_LEVEL", "INFO") - -# Set the log level by value or name. -# Choices: any of [0, 10, 20, 30, 40, 50, "DEBUG", "INFO", "WARN", "ERROR", "CRITICAL"] -# Default: INFO -c.Application.log_level = jupyter_log_level - -# Instead of starting the Application, dump configuration to stdout -# Default: False -# c.Application.show_config = False - -# Instead of starting the Application, dump configuration to stdout (as JSON) -# Default: False -# c.Application.show_config_json = False - -# Let"s start with the least privilege, especially on a single host having limited resources -c.JupyterHub.allow_named_servers = False - -# Timeout (in seconds) to wait for spawners to initialize -# -# Checking if spawners are healthy can take a long time if many spawners are -# active at hub start time. -# -# If it takes longer than this timeout to check, init_spawner will be left to -# complete in the background and the http server is allowed to start. -# -# A timeout of -1 means wait forever, which can mean a slow startup of the Hub -# but ensures that the Hub is fully consistent by the time it starts responding -# to requests. This matches the behavior of jupyterhub 1.0. -# -# .. versionadded: 1.1.0 -# Default: 10 -c.JupyterHub.init_spawners_timeout = 720 - -# Timeout (in seconds) before giving up on a spawned HTTP server -# -# Once a server has successfully been spawned, this is the amount of time we -# wait before assuming that the server is unable to accept connections. -# Default: 30 -c.Spawner.http_timeout = 720 - -# Timeout (in seconds) before giving up on starting of single-user server. -# -# This is the timeout for start to return, not the timeout for the server to -# respond. Callers of spawner.start will assume that startup has failed if it -# takes longer than this. start should return when the server process is started -# and its location is known. -# Default: 60 -c.Spawner.start_timeout = 720 - - -#------------------------------------------------------------------------------ -# LocalProcessSpawner configuration -#------------------------------------------------------------------------------ - -# A Spawner that just uses Popen to start local processes as users. -# -# Requires users to exist on the local system. -# -# This is the default spawner for JupyterHub. - -# Seconds to wait for process to halt after SIGINT before proceeding to SIGTERM -c.LocalProcessSpawner.interrupt_timeout = 120 - -# Seconds to wait for process to halt after SIGKILL before giving up -c.LocalProcessSpawner.kill_timeout = 120 - -# Seconds to wait for process to halt after SIGTERM before proceeding to SIGKILL -c.LocalProcessSpawner.term_timeout = 120 diff --git a/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/files/config/jupyterhub_cookie_secret b/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/files/config/jupyterhub_cookie_secret deleted file mode 100644 index de06abd0..00000000 --- a/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/files/config/jupyterhub_cookie_secret +++ /dev/null @@ -1 +0,0 @@ -e91801df470c99061e3272f058a3ecb79b0e852cc3181069c8d333fc4d749394 diff --git a/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/files/config/teamlist b/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/files/config/teamlist deleted file mode 100755 index bfbfa72c..00000000 --- a/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/files/config/teamlist +++ /dev/null @@ -1 +0,0 @@ -cogstack_sharing admin cogstack_user \ No newline at end of file diff --git a/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/files/config/userlist b/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/files/config/userlist deleted file mode 100755 index 364a6e51..00000000 --- a/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/files/config/userlist +++ /dev/null @@ -1,2 +0,0 @@ -admin admin -cogstack_user \ No newline at end of file diff --git a/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/templates/NOTES.txt b/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/templates/NOTES.txt deleted file mode 100644 index 4ca6415e..00000000 --- a/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/templates/NOTES.txt +++ /dev/null @@ -1,22 +0,0 @@ -CogStack JupyterHub has been deployed. - -Service name: - {{ include "cogstack-jupyterhub.fullname" . }} - -Port forward: - kubectl -n {{ .Release.Namespace }} port-forward svc/{{ include "cogstack-jupyterhub.fullname" . }} 8888:{{ .Values.service.port }} - -Recommended install command to use repository env/config files directly: - helm upgrade --install {{ .Release.Name }} {{ .Chart.Name }} \ - --namespace {{ .Release.Namespace }} --create-namespace \ - --set envFiles.useBundled=false \ - --set hubFiles.useBundled=false \ - --set securityFiles.useBundled=false \ - --set-file envFiles.jupyter=env/jupyter.env \ - --set-file envFiles.general=env/general.env \ - --set-file hubFiles.jupyterhubConfig=config/jupyterhub_config.py \ - --set-file hubFiles.userlist=config/userlist \ - --set-file hubFiles.teamlist=config/teamlist \ - --set-file securityFiles.cookieSecret=config/jupyterhub_cookie_secret \ - --set-file securityFiles.tlsKey=security/nifi.key \ - --set-file securityFiles.tlsCert=security/nifi.pem diff --git a/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/templates/_helpers.tpl b/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/templates/_helpers.tpl deleted file mode 100644 index 00f8b68d..00000000 --- a/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/templates/_helpers.tpl +++ /dev/null @@ -1,59 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{- define "cogstack-jupyterhub.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{- define "cogstack-jupyterhub.fullname" -}} -{{- if .Values.fullnameOverride -}} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- $name := default .Chart.Name .Values.nameOverride -}} -{{- if contains $name .Release.Name -}} -{{- .Release.Name | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} -{{- end -}} -{{- end -}} - -{{- define "cogstack-jupyterhub.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{- define "cogstack-jupyterhub.labels" -}} -helm.sh/chart: {{ include "cogstack-jupyterhub.chart" . }} -{{ include "cogstack-jupyterhub.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end -}} - -{{- define "cogstack-jupyterhub.selectorLabels" -}} -app.kubernetes.io/name: {{ include "cogstack-jupyterhub.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end -}} - -{{- define "cogstack-jupyterhub.serviceAccountName" -}} -{{- if .Values.serviceAccount.create -}} -{{- default (include "cogstack-jupyterhub.fullname" .) .Values.serviceAccount.name -}} -{{- else -}} -{{- default "default" .Values.serviceAccount.name -}} -{{- end -}} -{{- end -}} - -{{- define "cogstack-jupyterhub.envConfigMapName" -}} -{{- printf "%s-env-files" (include "cogstack-jupyterhub.fullname" .) -}} -{{- end -}} - -{{- define "cogstack-jupyterhub.hubConfigMapName" -}} -{{- printf "%s-hub-config" (include "cogstack-jupyterhub.fullname" .) -}} -{{- end -}} - -{{- define "cogstack-jupyterhub.secretName" -}} -{{- if .Values.securityFiles.existingSecret -}} -{{- .Values.securityFiles.existingSecret -}} -{{- else -}} -{{- printf "%s-hub-secrets" (include "cogstack-jupyterhub.fullname" .) -}} -{{- end -}} -{{- end -}} diff --git a/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/templates/configmap-env-files.yaml b/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/templates/configmap-env-files.yaml deleted file mode 100644 index 5c7872c6..00000000 --- a/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/templates/configmap-env-files.yaml +++ /dev/null @@ -1,26 +0,0 @@ -{{- if and (not .Values.envFiles.useBundled) (eq (trim .Values.envFiles.jupyter) "") }} -{{- fail "envFiles.jupyter is required when envFiles.useBundled=false" }} -{{- end }} -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ include "cogstack-jupyterhub.envConfigMapName" . }} - labels: - {{- include "cogstack-jupyterhub.labels" . | nindent 4 }} -data: - general.env: | -{{- if ne (trim .Values.envFiles.general) "" }} -{{- .Values.envFiles.general | nindent 4 }} -{{- else if .Values.envFiles.useBundled }} -{{- .Files.Get "files/env/general.env" | nindent 4 }} -{{- else }} - # optional -{{- end }} - jupyter.env: | -{{- if ne (trim .Values.envFiles.jupyter) "" }} -{{- .Values.envFiles.jupyter | nindent 4 }} -{{- else if .Values.envFiles.useBundled }} -{{- .Files.Get "files/env/jupyter.env" | nindent 4 }} -{{- else }} - # required when useBundled=false -{{- end }} diff --git a/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/templates/configmap-hub-files.yaml b/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/templates/configmap-hub-files.yaml deleted file mode 100644 index ee42054d..00000000 --- a/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/templates/configmap-hub-files.yaml +++ /dev/null @@ -1,34 +0,0 @@ -{{- if and (not .Values.hubFiles.useBundled) (eq (trim .Values.hubFiles.jupyterhubConfig) "") }} -{{- fail "hubFiles.jupyterhubConfig is required when hubFiles.useBundled=false" }} -{{- end }} -{{- if and (not .Values.hubFiles.useBundled) (eq (trim .Values.hubFiles.userlist) "") }} -{{- fail "hubFiles.userlist is required when hubFiles.useBundled=false" }} -{{- end }} -{{- if and (not .Values.hubFiles.useBundled) (eq (trim .Values.hubFiles.teamlist) "") }} -{{- fail "hubFiles.teamlist is required when hubFiles.useBundled=false" }} -{{- end }} -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ include "cogstack-jupyterhub.hubConfigMapName" . }} - labels: - {{- include "cogstack-jupyterhub.labels" . | nindent 4 }} -data: - jupyterhub_config.py: | -{{- if ne (trim .Values.hubFiles.jupyterhubConfig) "" }} -{{- .Values.hubFiles.jupyterhubConfig | nindent 4 }} -{{- else }} -{{- .Files.Get "files/config/jupyterhub_config.py" | nindent 4 }} -{{- end }} - userlist: | -{{- if ne (trim .Values.hubFiles.userlist) "" }} -{{- .Values.hubFiles.userlist | nindent 4 }} -{{- else }} -{{- .Files.Get "files/config/userlist" | nindent 4 }} -{{- end }} - teamlist: | -{{- if ne (trim .Values.hubFiles.teamlist) "" }} -{{- .Values.hubFiles.teamlist | nindent 4 }} -{{- else }} -{{- .Files.Get "files/config/teamlist" | nindent 4 }} -{{- end }} diff --git a/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/templates/deployment.yaml b/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/templates/deployment.yaml deleted file mode 100644 index 22c00538..00000000 --- a/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/templates/deployment.yaml +++ /dev/null @@ -1,152 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "cogstack-jupyterhub.fullname" . }} - labels: - {{- include "cogstack-jupyterhub.labels" . | nindent 4 }} -spec: - replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - {{- include "cogstack-jupyterhub.selectorLabels" . | nindent 6 }} - template: - metadata: - labels: - {{- include "cogstack-jupyterhub.selectorLabels" . | nindent 8 }} - {{- with .Values.podLabels }} - {{- toYaml . | nindent 8 }} - {{- end }} - annotations: - checksum/env-files: {{ include (print $.Template.BasePath "/configmap-env-files.yaml") . | sha256sum }} - checksum/hub-files: {{ include (print $.Template.BasePath "/configmap-hub-files.yaml") . | sha256sum }} - checksum/hub-secret: {{ include (print $.Template.BasePath "/secret-hub-files.yaml") . | sha256sum }} - {{- with .Values.podAnnotations }} - {{- toYaml . | nindent 8 }} - {{- end }} - spec: - serviceAccountName: {{ include "cogstack-jupyterhub.serviceAccountName" . }} - {{- with .Values.podSecurityContext }} - securityContext: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - containers: - - name: hub - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - {{- with .Values.securityContext }} - securityContext: - {{- toYaml . | nindent 12 }} - {{- end }} - command: - - {{ .Values.runtime.shell | quote }} - - -lc - args: - - | - set -eo pipefail - if [ -f /etc/cogstack/env/general.env ]; then - set -a - source /etc/cogstack/env/general.env - set +a - fi - if [ -f /etc/cogstack/env/jupyter.env ]; then - set -a - source /etc/cogstack/env/jupyter.env - set +a - fi - exec {{ .Values.runtime.command }} -f {{ .Values.runtime.configPath }} - ports: - - name: https - containerPort: {{ .Values.service.targetPort }} - protocol: TCP - {{- $extraEnv := .Values.extraEnv | default (dict) }} - {{- if gt (len $extraEnv) 0 }} - env: - {{- range $key := keys $extraEnv | sortAlpha }} - - name: {{ $key }} - value: {{ index $extraEnv $key | quote }} - {{- end }} - {{- end }} - volumeMounts: - - name: env-files - mountPath: /etc/cogstack/env - readOnly: true - - name: hub-config - mountPath: /srv/jupyterhub/jupyterhub_config.py - subPath: jupyterhub_config.py - readOnly: true - - name: hub-config - mountPath: /srv/jupyterhub/userlist - subPath: userlist - readOnly: true - - name: hub-config - mountPath: /srv/jupyterhub/teamlist - subPath: teamlist - readOnly: true - - name: hub-secret - mountPath: /srv/jupyterhub/security - readOnly: true - - name: hub-secret - mountPath: /srv/jupyterhub/jupyterhub_cookie_secret - subPath: jupyterhub_cookie_secret - readOnly: true - - name: hub-data - mountPath: /srv/jupyterhub - - name: shared-scratch - mountPath: /home/jovyan/scratch - {{- if .Values.dockerSocket.enabled }} - - name: docker-socket - mountPath: /var/run/docker.sock - {{- end }} - {{- with .Values.resources }} - resources: - {{- toYaml . | nindent 12 }} - {{- end }} - volumes: - - name: env-files - configMap: - name: {{ include "cogstack-jupyterhub.envConfigMapName" . }} - defaultMode: 0444 - - name: hub-config - configMap: - name: {{ include "cogstack-jupyterhub.hubConfigMapName" . }} - defaultMode: 0444 - - name: hub-secret - secret: - secretName: {{ include "cogstack-jupyterhub.secretName" . }} - defaultMode: 0400 - - name: hub-data - {{- if .Values.persistence.hub.enabled }} - persistentVolumeClaim: - claimName: {{ default (printf "%s-hub" (include "cogstack-jupyterhub.fullname" .)) .Values.persistence.hub.existingClaim }} - {{- else }} - emptyDir: {} - {{- end }} - - name: shared-scratch - {{- if .Values.persistence.scratch.enabled }} - persistentVolumeClaim: - claimName: {{ default (printf "%s-scratch" (include "cogstack-jupyterhub.fullname" .)) .Values.persistence.scratch.existingClaim }} - {{- else }} - emptyDir: {} - {{- end }} - {{- if .Values.dockerSocket.enabled }} - - name: docker-socket - hostPath: - path: {{ .Values.dockerSocket.hostPath }} - type: Socket - {{- end }} - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} diff --git a/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/templates/ingress.yaml b/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/templates/ingress.yaml deleted file mode 100644 index 4179244f..00000000 --- a/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/templates/ingress.yaml +++ /dev/null @@ -1,35 +0,0 @@ -{{- if .Values.ingress.enabled -}} -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: {{ include "cogstack-jupyterhub.fullname" . }} - labels: - {{- include "cogstack-jupyterhub.labels" . | nindent 4 }} - {{- with .Values.ingress.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: - {{- if .Values.ingress.className }} - ingressClassName: {{ .Values.ingress.className }} - {{- end }} - {{- with .Values.ingress.tls }} - tls: - {{- toYaml . | nindent 4 }} - {{- end }} - rules: - {{- range .Values.ingress.hosts }} - - host: {{ .host | quote }} - http: - paths: - {{- range .paths }} - - path: {{ .path }} - pathType: {{ .pathType }} - backend: - service: - name: {{ include "cogstack-jupyterhub.fullname" $ }} - port: - number: {{ $.Values.service.port }} - {{- end }} - {{- end }} -{{- end }} diff --git a/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/templates/pvc-hub.yaml b/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/templates/pvc-hub.yaml deleted file mode 100644 index bb0a2463..00000000 --- a/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/templates/pvc-hub.yaml +++ /dev/null @@ -1,17 +0,0 @@ -{{- if and .Values.persistence.hub.enabled (not .Values.persistence.hub.existingClaim) }} -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: {{ include "cogstack-jupyterhub.fullname" . }}-hub - labels: - {{- include "cogstack-jupyterhub.labels" . | nindent 4 }} -spec: - accessModes: - {{- toYaml .Values.persistence.hub.accessModes | nindent 4 }} - {{- if .Values.persistence.hub.storageClassName }} - storageClassName: {{ .Values.persistence.hub.storageClassName | quote }} - {{- end }} - resources: - requests: - storage: {{ .Values.persistence.hub.size | quote }} -{{- end }} diff --git a/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/templates/pvc-scratch.yaml b/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/templates/pvc-scratch.yaml deleted file mode 100644 index a7666cd6..00000000 --- a/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/templates/pvc-scratch.yaml +++ /dev/null @@ -1,17 +0,0 @@ -{{- if and .Values.persistence.scratch.enabled (not .Values.persistence.scratch.existingClaim) }} -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: {{ include "cogstack-jupyterhub.fullname" . }}-scratch - labels: - {{- include "cogstack-jupyterhub.labels" . | nindent 4 }} -spec: - accessModes: - {{- toYaml .Values.persistence.scratch.accessModes | nindent 4 }} - {{- if .Values.persistence.scratch.storageClassName }} - storageClassName: {{ .Values.persistence.scratch.storageClassName | quote }} - {{- end }} - resources: - requests: - storage: {{ .Values.persistence.scratch.size | quote }} -{{- end }} diff --git a/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/templates/secret-hub-files.yaml b/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/templates/secret-hub-files.yaml deleted file mode 100644 index b3bcae47..00000000 --- a/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/templates/secret-hub-files.yaml +++ /dev/null @@ -1,37 +0,0 @@ -{{- if not .Values.securityFiles.existingSecret }} -{{- if and (not .Values.securityFiles.useBundled) (eq (trim .Values.securityFiles.cookieSecret) "") }} -{{- fail "securityFiles.cookieSecret is required when securityFiles.useBundled=false and no existingSecret is set" }} -{{- end }} -{{- if and (not .Values.securityFiles.useBundled) (eq (trim .Values.securityFiles.tlsKey) "") }} -{{- fail "securityFiles.tlsKey is required when securityFiles.useBundled=false and no existingSecret is set" }} -{{- end }} -{{- if and (not .Values.securityFiles.useBundled) (eq (trim .Values.securityFiles.tlsCert) "") }} -{{- fail "securityFiles.tlsCert is required when securityFiles.useBundled=false and no existingSecret is set" }} -{{- end }} -apiVersion: v1 -kind: Secret -metadata: - name: {{ include "cogstack-jupyterhub.secretName" . }} - labels: - {{- include "cogstack-jupyterhub.labels" . | nindent 4 }} -type: Opaque -stringData: - jupyterhub_cookie_secret: | -{{- if ne (trim .Values.securityFiles.cookieSecret) "" }} -{{- .Values.securityFiles.cookieSecret | nindent 4 }} -{{- else }} -{{- .Files.Get "files/config/jupyterhub_cookie_secret" | nindent 4 }} -{{- end }} - nifi.key: | -{{- if ne (trim .Values.securityFiles.tlsKey) "" }} -{{- .Values.securityFiles.tlsKey | nindent 4 }} -{{- else }} -{{- .Files.Get "files/security/nifi.key" | nindent 4 }} -{{- end }} - nifi.pem: | -{{- if ne (trim .Values.securityFiles.tlsCert) "" }} -{{- .Values.securityFiles.tlsCert | nindent 4 }} -{{- else }} -{{- .Files.Get "files/security/nifi.pem" | nindent 4 }} -{{- end }} -{{- end }} diff --git a/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/templates/service.yaml b/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/templates/service.yaml deleted file mode 100644 index e7e135b4..00000000 --- a/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/templates/service.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ include "cogstack-jupyterhub.fullname" . }} - labels: - {{- include "cogstack-jupyterhub.labels" . | nindent 4 }} - {{- with .Values.service.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: - type: {{ .Values.service.type }} - selector: - {{- include "cogstack-jupyterhub.selectorLabels" . | nindent 4 }} - ports: - - name: https - port: {{ .Values.service.port }} - targetPort: {{ .Values.service.targetPort }} - protocol: TCP diff --git a/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/templates/serviceaccount.yaml b/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/templates/serviceaccount.yaml deleted file mode 100644 index 94b59f79..00000000 --- a/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/templates/serviceaccount.yaml +++ /dev/null @@ -1,12 +0,0 @@ -{{- if .Values.serviceAccount.create }} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ include "cogstack-jupyterhub.serviceAccountName" . }} - labels: - {{- include "cogstack-jupyterhub.labels" . | nindent 4 }} - {{- with .Values.serviceAccount.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -{{- end }} diff --git a/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/values.yaml b/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/values.yaml deleted file mode 100644 index 859a75d7..00000000 --- a/apps/cogstack-jupyter-hub/charts/cogstack-jupyterhub/values.yaml +++ /dev/null @@ -1,90 +0,0 @@ -replicaCount: 1 - -image: - repository: cogstacksystems/jupyter-hub - tag: "2.2.3" - pullPolicy: IfNotPresent - -imagePullSecrets: [] -nameOverride: "" -fullnameOverride: "" - -serviceAccount: - create: false - annotations: {} - name: "" - -podAnnotations: {} -podLabels: {} -podSecurityContext: {} -securityContext: - runAsUser: 0 - runAsGroup: 0 - -resources: {} - -nodeSelector: {} -tolerations: [] -affinity: {} - -extraEnv: {} - -service: - type: ClusterIP - port: 8888 - targetPort: 443 - annotations: {} - -ingress: - enabled: false - className: "" - annotations: {} - hosts: - - host: jupyterhub.local - paths: - - path: / - pathType: Prefix - tls: [] - -persistence: - hub: - enabled: true - existingClaim: "" - storageClassName: "" - accessModes: - - ReadWriteOnce - size: 10Gi - scratch: - enabled: true - existingClaim: "" - storageClassName: "" - accessModes: - - ReadWriteOnce - size: 10Gi - -dockerSocket: - enabled: true - hostPath: /var/run/docker.sock - -envFiles: - useBundled: true - general: "" - jupyter: "" - -hubFiles: - useBundled: true - jupyterhubConfig: "" - userlist: "" - teamlist: "" - -securityFiles: - useBundled: true - existingSecret: "" - cookieSecret: "" - tlsKey: "" - tlsCert: "" - -runtime: - shell: /bin/bash - command: jupyterhub - configPath: /srv/jupyterhub/jupyterhub_config.py diff --git a/apps/ocr-service/charts/ocr-service/.helmignore b/apps/ocr-service/charts/ocr-service/.helmignore deleted file mode 100644 index 8d8e609d..00000000 --- a/apps/ocr-service/charts/ocr-service/.helmignore +++ /dev/null @@ -1,4 +0,0 @@ -# Patterns to ignore when building packages. -.DS_Store -.git/ -.gitignore diff --git a/apps/ocr-service/charts/ocr-service/Chart.yaml b/apps/ocr-service/charts/ocr-service/Chart.yaml deleted file mode 100644 index 9e491fe8..00000000 --- a/apps/ocr-service/charts/ocr-service/Chart.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: v2 -name: ocr-service -description: Helm chart for deploying the CogStack OCR service -type: application -version: 0.2.0 -appVersion: "1.0.9" diff --git a/apps/ocr-service/charts/ocr-service/README.md b/apps/ocr-service/charts/ocr-service/README.md deleted file mode 100644 index fd5854ac..00000000 --- a/apps/ocr-service/charts/ocr-service/README.md +++ /dev/null @@ -1,82 +0,0 @@ -# ocr-service Helm Chart - -Deploys the CogStack OCR service as a Kubernetes `Deployment` + `Service`, with optional `HorizontalPodAutoscaler` (HPA). - -## Install - -```bash -helm install ocr-service ./charts/ocr-service -``` - -Repo shortcut: - -```bash -make helm-install -``` - -### Install with values overlays - -```bash -helm upgrade --install ocr-service ./charts/ocr-service \ - -f ./my-values.yaml -``` - -Text-only profile: - -```bash -helm upgrade --install ocr-service ./charts/ocr-service \ - -f ./charts/ocr-service/values-text-only.yaml -``` - -Repo shortcut: - -```bash -make helm-install-text-only -``` - -Notes: -- Use normal Helm value layering; later `-f` files override earlier ones. -- Put runtime OCR settings under `env`. -- For existing Kubernetes-managed env sources, use `extraEnvFrom` with `secretRef` or `configMapRef`. -- The repo `env/*.env` files remain for local shell and Docker flows; the Helm chart now uses YAML values only. -- Use `HELM_ARGS` with the make targets for namespace or values overrides, for example `make helm-install HELM_ARGS='-n ocr --create-namespace'`. - -Example custom overlay: - -```yaml -image: - tag: "1.0.9" - -env: - OCR_SERVICE_TESSERACT_LANG: "eng" - OCR_SERVICE_CPU_THREADS: "1" - OCR_SERVICE_CONVERTER_THREADS: "1" -``` - -## Upgrade - -```bash -helm upgrade ocr-service ./charts/ocr-service -``` - -## Key values - -- `image.repository` / `image.tag`: container image to run. -- `env`: OCR service environment variables. -- `extraEnvFrom`: import additional env vars from a `Secret` or `ConfigMap`. -- `tmp.*`: writable `emptyDir` mount for `/ocr_service/tmp`. -- `probes.*`: startup/readiness/liveness probe settings. -- `autoscaling.enabled`: enable/disable HPA. - -## Enable HPA - -```yaml -autoscaling: - enabled: true - minReplicas: 2 - maxReplicas: 10 - targetCPUUtilizationPercentage: 75 - targetMemoryUtilizationPercentage: 80 -``` - -HPA requires Kubernetes metrics (usually `metrics-server`) in the cluster. diff --git a/apps/ocr-service/charts/ocr-service/templates/NOTES.txt b/apps/ocr-service/charts/ocr-service/templates/NOTES.txt deleted file mode 100644 index 853ee25c..00000000 --- a/apps/ocr-service/charts/ocr-service/templates/NOTES.txt +++ /dev/null @@ -1,7 +0,0 @@ -1. Get the application URL by running these commands: - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "ocr-service.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME {{ .Values.service.port }}:{{ .Values.service.targetPort }} - -2. Check health and readiness: - curl -sS http://127.0.0.1:{{ .Values.service.port }}/api/health - curl -sS http://127.0.0.1:{{ .Values.service.port }}/api/ready diff --git a/apps/ocr-service/charts/ocr-service/templates/_helpers.tpl b/apps/ocr-service/charts/ocr-service/templates/_helpers.tpl deleted file mode 100644 index 264ea879..00000000 --- a/apps/ocr-service/charts/ocr-service/templates/_helpers.tpl +++ /dev/null @@ -1,60 +0,0 @@ -{{/* -Expand the name of the chart. -*/}} -{{- define "ocr-service.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Create a default fully qualified app name. -*/}} -{{- define "ocr-service.fullname" -}} -{{- if .Values.fullnameOverride }} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- $name := default .Chart.Name .Values.nameOverride }} -{{- if contains $name .Release.Name }} -{{- .Release.Name | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} -{{- end }} -{{- end }} -{{- end }} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "ocr-service.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Common labels. -*/}} -{{- define "ocr-service.labels" -}} -helm.sh/chart: {{ include "ocr-service.chart" . }} -{{ include "ocr-service.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} - -{{/* -Selector labels. -*/}} -{{- define "ocr-service.selectorLabels" -}} -app.kubernetes.io/name: {{ include "ocr-service.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end }} - -{{/* -Create the name of the service account to use. -*/}} -{{- define "ocr-service.serviceAccountName" -}} -{{- if .Values.serviceAccount.create }} -{{- default (include "ocr-service.fullname" .) .Values.serviceAccount.name }} -{{- else }} -{{- default "default" .Values.serviceAccount.name }} -{{- end }} -{{- end }} diff --git a/apps/ocr-service/charts/ocr-service/templates/deployment.yaml b/apps/ocr-service/charts/ocr-service/templates/deployment.yaml deleted file mode 100644 index 1f83340c..00000000 --- a/apps/ocr-service/charts/ocr-service/templates/deployment.yaml +++ /dev/null @@ -1,117 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -{{- $env := .Values.env | default dict }} -metadata: - name: {{ include "ocr-service.fullname" . }} - labels: - {{- include "ocr-service.labels" . | nindent 4 }} -spec: - {{- if not .Values.autoscaling.enabled }} - replicas: {{ .Values.replicaCount }} - {{- end }} - selector: - matchLabels: - {{- include "ocr-service.selectorLabels" . | nindent 6 }} - template: - metadata: - labels: - {{- include "ocr-service.selectorLabels" . | nindent 8 }} - {{- with .Values.podLabels }} - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.podAnnotations }} - annotations: - {{- toYaml . | nindent 8 }} - {{- end }} - spec: - serviceAccountName: {{ include "ocr-service.serviceAccountName" . }} - automountServiceAccountToken: {{ .Values.podAutomountServiceAccountToken }} - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - securityContext: - {{- toYaml .Values.podSecurityContext | nindent 8 }} - containers: - - name: {{ include "ocr-service.name" . }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - ports: - - name: http - containerPort: {{ .Values.service.targetPort }} - protocol: TCP - securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} - {{- if or $env .Values.extraEnv }} - env: - {{- range $key := keys $env | sortAlpha }} - - name: {{ $key }} - value: {{ index $env $key | quote }} - {{- end }} - {{- with .Values.extraEnv }} - {{- toYaml . | nindent 12 }} - {{- end }} - {{- end }} - {{- with .Values.extraEnvFrom }} - envFrom: - {{- toYaml . | nindent 12 }} - {{- end }} - {{- if .Values.probes.startup.enabled }} - startupProbe: - httpGet: - path: {{ .Values.probes.startup.path }} - port: http - periodSeconds: {{ .Values.probes.startup.periodSeconds }} - timeoutSeconds: {{ .Values.probes.startup.timeoutSeconds }} - failureThreshold: {{ .Values.probes.startup.failureThreshold }} - {{- end }} - {{- if .Values.probes.readiness.enabled }} - readinessProbe: - httpGet: - path: {{ .Values.probes.readiness.path }} - port: http - initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }} - periodSeconds: {{ .Values.probes.readiness.periodSeconds }} - timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }} - failureThreshold: {{ .Values.probes.readiness.failureThreshold }} - {{- end }} - {{- if .Values.probes.liveness.enabled }} - livenessProbe: - httpGet: - path: {{ .Values.probes.liveness.path }} - port: http - initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }} - periodSeconds: {{ .Values.probes.liveness.periodSeconds }} - timeoutSeconds: {{ .Values.probes.liveness.timeoutSeconds }} - failureThreshold: {{ .Values.probes.liveness.failureThreshold }} - {{- end }} - resources: - {{- toYaml .Values.resources | nindent 12 }} - {{- if .Values.tmp.enabled }} - volumeMounts: - - name: ocr-tmp - mountPath: {{ .Values.tmp.mountPath }} - {{- end }} - {{- if .Values.tmp.enabled }} - volumes: - - name: ocr-tmp - emptyDir: - {{- if .Values.tmp.emptyDir.medium }} - medium: {{ .Values.tmp.emptyDir.medium | quote }} - {{- end }} - {{- if .Values.tmp.emptyDir.sizeLimit }} - sizeLimit: {{ .Values.tmp.emptyDir.sizeLimit }} - {{- end }} - {{- end }} - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} diff --git a/apps/ocr-service/charts/ocr-service/templates/hpa.yaml b/apps/ocr-service/charts/ocr-service/templates/hpa.yaml deleted file mode 100644 index a50c356c..00000000 --- a/apps/ocr-service/charts/ocr-service/templates/hpa.yaml +++ /dev/null @@ -1,32 +0,0 @@ -{{- if .Values.autoscaling.enabled }} -apiVersion: autoscaling/v2 -kind: HorizontalPodAutoscaler -metadata: - name: {{ include "ocr-service.fullname" . }} - labels: - {{- include "ocr-service.labels" . | nindent 4 }} -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: {{ include "ocr-service.fullname" . }} - minReplicas: {{ .Values.autoscaling.minReplicas }} - maxReplicas: {{ .Values.autoscaling.maxReplicas }} - metrics: - {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} - - type: Resource - resource: - name: cpu - target: - type: Utilization - averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} - {{- end }} - {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - - type: Resource - resource: - name: memory - target: - type: Utilization - averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} - {{- end }} -{{- end }} diff --git a/apps/ocr-service/charts/ocr-service/templates/service.yaml b/apps/ocr-service/charts/ocr-service/templates/service.yaml deleted file mode 100644 index 096f5de3..00000000 --- a/apps/ocr-service/charts/ocr-service/templates/service.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ include "ocr-service.fullname" . }} - labels: - {{- include "ocr-service.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} - selector: - {{- include "ocr-service.selectorLabels" . | nindent 4 }} - ports: - - name: http - port: {{ .Values.service.port }} - targetPort: {{ .Values.service.targetPort }} - protocol: TCP diff --git a/apps/ocr-service/charts/ocr-service/templates/serviceaccount.yaml b/apps/ocr-service/charts/ocr-service/templates/serviceaccount.yaml deleted file mode 100644 index e0831f57..00000000 --- a/apps/ocr-service/charts/ocr-service/templates/serviceaccount.yaml +++ /dev/null @@ -1,13 +0,0 @@ -{{- if .Values.serviceAccount.create -}} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ include "ocr-service.serviceAccountName" . }} - labels: - {{- include "ocr-service.labels" . | nindent 4 }} - {{- with .Values.serviceAccount.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -automountServiceAccountToken: {{ .Values.serviceAccount.automount }} -{{- end }} diff --git a/apps/ocr-service/charts/ocr-service/values-text-only.yaml b/apps/ocr-service/charts/ocr-service/values-text-only.yaml deleted file mode 100644 index c66edeae..00000000 --- a/apps/ocr-service/charts/ocr-service/values-text-only.yaml +++ /dev/null @@ -1,2 +0,0 @@ -env: - OCR_SERVICE_OPERATION_MODE: "NO_OCR" diff --git a/apps/ocr-service/charts/ocr-service/values.yaml b/apps/ocr-service/charts/ocr-service/values.yaml deleted file mode 100644 index f4341c05..00000000 --- a/apps/ocr-service/charts/ocr-service/values.yaml +++ /dev/null @@ -1,123 +0,0 @@ -replicaCount: 1 - -image: - repository: cogstacksystems/cogstack-ocr-service - tag: "1.0.9" - pullPolicy: IfNotPresent - -imagePullSecrets: [] -nameOverride: "" -fullnameOverride: "" - -serviceAccount: - create: false - automount: false - annotations: {} - name: "" - -podAutomountServiceAccountToken: false - -podAnnotations: {} -podLabels: {} - -podSecurityContext: - fsGroup: 10001 - fsGroupChangePolicy: OnRootMismatch - -securityContext: - runAsNonRoot: true - runAsUser: 10001 - runAsGroup: 10001 - allowPrivilegeEscalation: false - readOnlyRootFilesystem: false - capabilities: - drop: - - ALL - -service: - type: ClusterIP - port: 8090 - targetPort: 8090 - -resources: - limits: - cpu: "1" - memory: 1Gi - requests: - cpu: 500m - memory: 512Mi - -autoscaling: - enabled: false - minReplicas: 1 - maxReplicas: 5 - targetCPUUtilizationPercentage: 75 - targetMemoryUtilizationPercentage: 80 - -tmp: - enabled: true - mountPath: /ocr_service/tmp - emptyDir: - medium: "" - sizeLimit: 1Gi - -probes: - startup: - enabled: true - path: /api/ready - periodSeconds: 10 - timeoutSeconds: 5 - failureThreshold: 90 - readiness: - enabled: true - path: /api/ready - initialDelaySeconds: 20 - periodSeconds: 10 - timeoutSeconds: 5 - failureThreshold: 6 - liveness: - enabled: true - path: /api/health - initialDelaySeconds: 30 - periodSeconds: 30 - timeoutSeconds: 5 - failureThreshold: 3 - -env: - OCR_SERVICE_HOST: "0.0.0.0" - OCR_SERVICE_PORT: "8090" - OCR_SERVICE_WORKER_CLASS: "sync" - OCR_WEB_SERVICE_WORKERS: "1" - OCR_SERVICE_LOG_LEVEL: "20" - OCR_SERVICE_DEBUG_MODE: "false" - OCR_SERVICE_OPERATION_MODE: "OCR" - OCR_SERVICE_CPU_THREADS: "1" - OCR_SERVICE_CONVERTER_THREADS: "1" - OCR_SERVICE_TESSERACT_LANG: "eng" - OCR_SERVICE_TESSERACT_TIMEOUT: "30" - OCR_SERVICE_TESSERACT_NICE: "-18" - OCR_SERVICE_TESSERACT_CUSTOM_CONFIG_FLAGS: "" - OCR_SERVICE_IMAGE_DPI: "200" - OCR_SERVICE_LIBRE_OFFICE_PROCESS_TIMEOUT: "20" - OCR_SERVICE_GUNICORN_LOG_FILE_PATH: "-" - OCR_SERVICE_GUNICORN_LOG_LEVEL: "info" - OCR_SERVICE_GUNICORN_MAX_REQUESTS_JITTER: "5000" - OCR_SERVICE_GUNICORN_MAX_REQUESTS: "50000" - OCR_SERVICE_GUNICORN_TIMEOUT: "300" - OCR_SERVICE_GUNICORN_GRACEFUL_TIMEOUT: "30" - OCR_TMP_DIR: "/ocr_service/tmp" - OMP_THREAD_LIMIT: "1" - -# Prefer standard Helm values overlays instead of passing raw `.env` files. -# The repo `env/*.env` files are for local shell and Docker workflows, not Helm. -# Example: -# helm upgrade --install ocr-service ./charts/ocr-service \ -# -f ./charts/ocr-service/values-text-only.yaml \ -# -f ./my-values.yaml - -extraEnv: [] -extraEnvFrom: [] - -nodeSelector: {} -tolerations: [] -affinity: {} diff --git a/cogstack-dashboards-demo/data/SNOMED/.gitkeep b/cogstack-dashboards-demo/data/SNOMED/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/cogstack-dashboards-demo/data/co_occurrences/.gitkeep b/cogstack-dashboards-demo/data/co_occurrences/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/docs/docs/cogstack-ce/reference.md b/docs/docs/cogstack-ce/reference.md index d6fe15eb..97dfc18e 100644 --- a/docs/docs/cogstack-ce/reference.md +++ b/docs/docs/cogstack-ce/reference.md @@ -67,7 +67,7 @@ On install, the CogStack CE provisioner: - Loads example documents - Imports premade dashboards -The dashboards and data used here were first defined in [cogstack-dashboards-demo](https://github.com/CogStack/cogstack-platform/tree/main/cogstack-dashboards-demo). +The dashboards and data used here were first defined in [cogstack-dashboards-demo](https://github.com/CogStack/cogstack-platform/tree/main/apps/cogstack-dashboards-demo). ## Architecture Details