orangeqs.juice.orchestration.settings#
Configuration fort the OrangeQS Juice orchestrator.
Module Contents#
Classes#
Settings for data folder locations on the host system. |
|
Settings for the target mount locations of standard folders. |
|
Settings for Podman containerization. |
|
Settings for containerization. |
|
Port Forwarding configuration for a container. |
|
Settings for the [Unit] section of the systemd service of a container. |
|
Settings for the [Service] section of the systemd service of a container. |
|
Settings for the systemd service of a container. |
|
Settings for spawning a container. |
|
Settings for building a container image. |
|
Settings for a single bucket of InfluxDB2 Instance. |
|
Settings for an instance of influxDB2. |
|
Settings for configuring Telegraf outputs. |
|
Partial settings for a container. |
|
Base class for environment settings. |
|
Settings for a |
|
Common environments used by services and JupyterHub. |
|
Settings for the main Hub of a JupyterHub instance. |
|
Settings for the single-user servers spawned by the Hub. |
|
Top-level settings for a JupyterHub instance managed by Juice. |
|
Settings for a OrangeQS Juice service. |
|
Settings for the installation of OrangeQS Juice. |
Functions#
Attempt to find an installation source of the Juice Python package. |
Data#
Path to the bundled wheel file of the OrangeQS Juice package as part of the system package. Note that this file does not necessarily exist, for example in development installations. |
|
Union type for all types of environment settings supported by OrangeQS Juice. |
API#
- orangeqs.juice.orchestration.settings.BUNDLED_WHEEL_PATH#
None
Path to the bundled wheel file of the OrangeQS Juice package as part of the system package. Note that this file does not necessarily exist, for example in development installations.
- class orangeqs.juice.orchestration.settings.DataFolderSettings(/, **data: Any)#
Bases:
orangeqs.juice.settings.BaseConfigurableSettings for data folder locations on the host system.
- model_config#
‘ConfigDict(…)’
- lib_data: str#
‘/var/lib/juice/lib’
Folder containing source code for Python packages for editable installs.
- user_data: str#
‘/var/lib/juice/user’
Folder containing the home directories of all users.
The home directories are stored in
./{username}subfolders.
‘/var/lib/juice/user/shared’
Folder containing shared data for all users.
This is mounted as
~/sharedin the container by default.
‘/var/run/juice’
Shared runtime data folder.
This is where shared runtime data is stored, such as service info and kernel specs. Even though this folder contains service-specific secrets, for now this folder is shared with all users and OrangeQS Juice services.
This is mounted as
/var/run/juicein the container by default.
- class orangeqs.juice.orchestration.settings.ContainerFolderSettings(/, **data: Any)#
Bases:
orangeqs.juice.settings.BaseConfigurableSettings for the target mount locations of standard folders.
‘~/shared’
The mount path of the shared data folder in the container.
‘~/shared/lib’
The mount path of the shared lib folder in the container.
- class orangeqs.juice.orchestration.settings.PodmanSettings(/, **data: Any)#
Bases:
orangeqs.juice.settings.BaseConfigurableSettings for Podman containerization.
- class orangeqs.juice.orchestration.settings.ContainerizationSettings(/, **data: Any)#
Bases:
orangeqs.juice.settings.BaseConfigurableSettings for containerization.
- container_type: Literal[orangeqs.juice.orchestration.settings.ContainerizationSettings.podman]#
‘podman’
- podman: orangeqs.juice.orchestration.settings.PodmanSettings#
‘Field(…)’
- class orangeqs.juice.orchestration.settings.PortMapping(/, **data: Any)#
Bases:
orangeqs.juice.settings.BaseConfigurablePort Forwarding configuration for a container.
- class orangeqs.juice.orchestration.settings.SystemdUnitSettings(/, **data: Any)#
Bases:
orangeqs.juice.settings.BaseConfigurableSettings for the [Unit] section of the systemd service of a container.
Each field corresponds to an option in the
[Unit]section of a systemd service. See https://www.freedesktop.org/software/systemd/man/latest/systemd.unit.html#%5BUnit%5D%20Section%20Options for more info.
- class orangeqs.juice.orchestration.settings.SystemdServiceSettings(/, **data: Any)#
Bases:
orangeqs.juice.settings.BaseConfigurableSettings for the [Service] section of the systemd service of a container.
Each field corresponds to an option in the
[Service]section of a systemd service. See https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html#Options for more info.- restart: Literal[no, on-success, on-failure, on-abnormal, on-watchdog, on-abort, always, None]#
None
- class orangeqs.juice.orchestration.settings.SystemdSettings(/, **data: Any)#
Bases:
orangeqs.juice.settings.BaseConfigurableSettings for the systemd service of a container.
- unit: orangeqs.juice.orchestration.settings.SystemdUnitSettings#
‘Field(…)’
- service: orangeqs.juice.orchestration.settings.SystemdServiceSettings#
‘Field(…)’
- class orangeqs.juice.orchestration.settings.ContainerSettings(/, **data: Any)#
Bases:
orangeqs.juice.settings.BaseConfigurableSettings for spawning a container.
- port_forwarding: list[orangeqs.juice.orchestration.settings.PortMapping]#
‘Field(…)’
- systemd: orangeqs.juice.orchestration.settings.SystemdSettings#
‘SystemdSettings(…)’
- update(other: orangeqs.juice.orchestration.settings.PartialContainerSettings) None#
Update this instance in-place with additional container setting.
- class orangeqs.juice.orchestration.settings.BuildSettings(/, **data: Any)#
Bases:
orangeqs.juice.settings.BaseConfigurableSettings for building a container image.
- systemd: orangeqs.juice.orchestration.settings.SystemdSettings#
‘Field(…)’
- update(other: orangeqs.juice.orchestration.settings.PartialContainerSettings) None#
Update this instance in-place with additional build settings.
- class orangeqs.juice.orchestration.settings.InfluxDB2BucketDescription(/, **data: Any)#
Bases:
orangeqs.juice.settings.BaseConfigurableSettings for a single bucket of InfluxDB2 Instance.
- class orangeqs.juice.orchestration.settings.InfluxDB2InstanceSettings(/, **data: Any)#
Bases:
orangeqs.juice.settings.BaseConfigurableSettings for an instance of influxDB2.
- buckets: dict[str, orangeqs.juice.orchestration.settings.InfluxDB2BucketDescription]#
‘Field(…)’
- container: orangeqs.juice.orchestration.settings.ContainerSettings#
‘ContainerSettings(…)’
- class orangeqs.juice.orchestration.settings.TelegrafSettings(/, **data: Any)#
Bases:
orangeqs.juice.settings.BaseConfigurableSettings for configuring Telegraf outputs.
- class orangeqs.juice.orchestration.settings.PartialContainerSettings(/, **data: Any)#
Bases:
orangeqs.juice.settings.BaseConfigurablePartial settings for a container.
- port_forwarding: list[orangeqs.juice.orchestration.settings.PortMapping]#
‘Field(…)’
List of port mappings for the container.
- class orangeqs.juice.orchestration.settings.BaseEnvironmentSettings(/, **data: Any)#
Bases:
orangeqs.juice.orchestration.settings.ContainerFolderSettingsBase class for environment settings.
- container: orangeqs.juice.orchestration.settings.PartialContainerSettings#
‘Field(…)’
Additional settings for the container of an environment.
These settings are merged on top of the default settings generated for the environment. These settings are applied both to the build container and the runtime container.
- orangeqs.juice.orchestration.settings.UvSourcesType#
None
- class orangeqs.juice.orchestration.settings.UvEnvironmentSettings(/, **data: Any)#
Bases:
orangeqs.juice.orchestration.settings.BaseEnvironmentSettingsSettings for a
uv-based environment in Juice.- sources: orangeqs.juice.orchestration.settings.UvSourcesType#
‘Field(…)’
- pyproject_toml_extra: dict[str, Any] | str#
‘Field(…)’
Extra configuration for the generated
pyproject.tomlfile of the environment.Accepts both raw TOML as a multiline string or a dictionary representing parsed TOML that is merged into the generated
pyproject.tomlfile.This can be used to add extra fields to the
pyproject.tomlfile, such as[tool.uv.index]entries to configure additional package indexes.
- system_packages: list[str]#
‘Field(…)’
List of system packages to install in the environment container.
These packages will be installed using
dnf install.
- extra_dockerfile_lines: list[str]#
‘Field(…)’
List of extra lines to add to the generated Dockerfile for this environment.
These lines will be added exactly as provided into the Dockerfile. This means that for example commands should be prepended with RUN, e.g. RUN mkdir -p /some/directory. These lines are executed in the context of the root user before the Python packages of the environment are installed, after the base image is set and the system packages are installed.
- orangeqs.juice.orchestration.settings.EnvironmentSettings#
None
Union type for all types of environment settings supported by OrangeQS Juice.
Currently only supports
UvEnvironmentSettings.
- class orangeqs.juice.orchestration.settings.EnvironmentsSettings(/, **data: Any)#
Bases:
orangeqs.juice.settings.BaseConfigurableCommon environments used by services and JupyterHub.
- default: orangeqs.juice.orchestration.settings.EnvironmentSettings#
‘Field(…)’
The default environment to use for services and JupyterHub.
This environment is used when a service or JupyterHub does not specify its own environment. To specify an environment for a specific service or JupyterHub, set the
environmentfield in the respective settings. The format is the same as this field.
- class orangeqs.juice.orchestration.settings.JupyterHubMainHubSettings(/, **data: Any)#
Bases:
orangeqs.juice.settings.BaseConfigurableSettings for the main Hub of a JupyterHub instance.
- config_file: str#
‘jupyterhub_config.py’
File containing the JupyterHub configuration, rendered by Juice orchestration.
- singleuser_config_file: str#
‘jupyter_singleuser_config.py’
File containing the Jupyter Server configuration for singleuser containers.
- authenticator_class: Literal[shared-password, pam, gitlab]#
‘pam’
The authenticator class to use for JupyterHub.
Depending on the the authenticator class, the following contents are expected in the
secrets_file. By default this file is at/etc/juice/jupyterhub/secrets.env.'shared-password':JUICE_JUPYTERHUB_SHARED_PASSWORD=<password for all users> JUICE_JUPYTERHUB_ADMIN_PASSWORD=<admin password>
'pam': No additional secrets required.'gitlab':JUPYTERHUB_OAUTH_APP_ID=<OAuth application ID> JUPYTERHUB_OAUTH_APP_SECRET=<OAuth application secret> # Should not have a trailing slash, e.g. https://gitlab.com JUPYTERHUB_OAUTH_GITLAB_URL=<GitLab instance URL> # ID of the group whose members are allowed to log in, e.g. `54`. JUPYTERHUB_OAUTH_GITLAB_GROUP=<Allowed GitLab group>
- user_max_idle_timeout: int#
1800
The maximum idle time (in seconds) for singleuser servers before culled.
- class orangeqs.juice.orchestration.settings.JupyterHubSingleUserServerSettings(/, **data: Any)#
Bases:
orangeqs.juice.orchestration.settings.ContainerFolderSettingsSettings for the single-user servers spawned by the Hub.
- environment: orangeqs.juice.orchestration.settings.EnvironmentSettings#
None
The environment to use for singleuser servers.
Defaults to
environments.defaultif not specified. When overriding the environment, be aware that it does not inherit from the default environment!This environment will always have
jupyterhub,jupyterlabandjupyter-server-proxyadded as dependencies automatically.
- class orangeqs.juice.orchestration.settings.JupyterHubInstanceSettings(/, **data: Any)#
Bases:
orangeqs.juice.settings.BaseConfigurableTop-level settings for a JupyterHub instance managed by Juice.
- main_hub: orangeqs.juice.orchestration.settings.JupyterHubMainHubSettings#
‘Field(…)’
- singleuser: orangeqs.juice.orchestration.settings.JupyterHubSingleUserServerSettings#
‘Field(…)’
- property build: orangeqs.juice.orchestration.settings.BuildSettings#
Generate build service settings.
- property container: orangeqs.juice.orchestration.settings.ContainerSettings#
Generate Jupyterhub Container settings.
- class orangeqs.juice.orchestration.settings.ServiceSettings(/, **data: Any)#
Bases:
orangeqs.juice.settings.BaseConfigurableSettings for a OrangeQS Juice service.
- environment: orangeqs.juice.orchestration.settings.EnvironmentSettings#
None
The environment definition to use for the service.
Defaults to
environments.defaultif not specified. When overriding the environment, be aware that it does not inherit from the default environment!
- entrypoint: str#
‘orangeqs.juice.service:IPythonService’
Class to use as the entrypoint for the service.
Uses the format
<module>:<class>.
- class orangeqs.juice.orchestration.settings.OrchestrationSettings(/, **data: Any)#
Bases:
orangeqs.juice.settings.ConfigurableSettings for the installation of OrangeQS Juice.
Warning
Note that this is the only configuration file which can only be loaded from
/etc/juice/config! This configuration file can thus only be modified by the system administrator, and not from the lab repository or extensions.- environments: orangeqs.juice.orchestration.settings.EnvironmentsSettings#
‘Field(…)’
Common environments used by services and JupyterHub.
- data_folder: orangeqs.juice.orchestration.settings.DataFolderSettings#
‘Field(…)’
Settings for data folder locations on the host system.
- services: dict[str, orangeqs.juice.orchestration.settings.ServiceSettings]#
‘Field(…)’
Collection of OrangeQS Juice services to run.
The key corresponds to the name of the service.
- containerization: orangeqs.juice.orchestration.settings.ContainerizationSettings#
‘Field(…)’
- influxdb2: orangeqs.juice.orchestration.settings.InfluxDB2InstanceSettings#
‘Field(…)’
- jupyterhub: orangeqs.juice.orchestration.settings.JupyterHubInstanceSettings#
‘Field(…)’
Configuration for the JupyterHub instance managed by Juice.
- property telegraf: orangeqs.juice.orchestration.settings.TelegrafSettings#
Generate Telegraf settings.
- orangeqs.juice.orchestration.settings.juice_install_source() tuple[Literal[editable, wheel, release], str] | None#
Attempt to find an installation source of the Juice Python package.
If the package is installed in editable mode, it will return the path to the source directory. Otherwise it will look for a wheel file in common locations (part of the system package). If running a released version, it will return the dependency specifier.
Returns#
(tuple or None): If a suitable source is found, returns tuple of the source type (“editable”, “wheel” or “release”) and the path to the source. If no suitable source is found, returns None.