API Reference

exasol.nb_connector.secret_store

class exasol.nb_connector.secret_store.InvalidPassword[source]

Signal potentially incorrect master password.

class exasol.nb_connector.secret_store.Secrets(db_file: Path, master_password: str)[source]
close() None[source]
close_all() None[source]

Close all connections in cache and empty cache.

connection() Connection[source]

SQLite allows a connection to be used only by a single thread. In multi-threaded scenarios we therefore need to maintain a connection pool, containing a separate connection for each thread.

Potential exceptions: sqlcipher3.dbapi2.IntegrityError: UNIQUE constraint failed: secrets.key sqlcipher3.dbapi2.OperationalError: database is locked

get(key: str | AILabConfig, default_value: str | None = None) str | None[source]
items() Iterable[tuple[str, str]][source]

Iterator over keys and values akin to dict.items()

keys() Iterable[str][source]

Iterator over keys akin to dict.keys()

remove(key: str | AILabConfig) None[source]

Deletes the entry with the specified key if it exists. Doesn’t raise any exception if the key doesn’t exist.

save(key: str | AILabConfig, value: str) Secrets[source]

key represents a system, service, or application

values() Iterable[str][source]

Iterator over values akin to dict.values()

exasol.nb_connector

class exasol.nb_connector.ai_lab_config.AILabConfig(value)[source]

An enumeration.

accelerator = 39
aws_access_key_id = 25
aws_region = 24
aws_secret_access_key = 26
bfs_bucket = 17
bfs_connection_name = 41
bfs_encryption = 20
bfs_host_name = 12
bfs_internal_host_name = 14
bfs_internal_port = 15
bfs_model_subdir = 40
bfs_password = 19
bfs_port = 13
bfs_service = 16
bfs_user = 18
cert_vld = 8
client_cert = 10
client_key = 11
db_encryption = 7
db_host_name = 2
db_password = 6
db_port = 3
db_schema = 4
db_user = 5
disk_size = 22
huggingface_token = 23
itde_container = 27
itde_network = 29
itde_volume = 28
mem_size = 21
saas_account_id = 35
saas_database_id = 36
saas_database_name = 37
saas_token = 34
saas_url = 33
storage_backend = 38
te_hf_connection = 30
te_models_cache_dir = 31
trusted_ca = 9
txaie_models_cache_dir = 32
use_itde = 1
class exasol.nb_connector.ai_lab_config.Accelerator(value)[source]

An enumeration.

none = 'none'
nvidia = 'nvidia'
class exasol.nb_connector.ai_lab_config.StorageBackend(value)[source]

An enumeration.

onprem = 1
saas = 2

exasol.nb_connector.connections

exasol.nb_connector.itde_manager

class exasol.nb_connector.itde_manager.ItdeContainerStatus(value)[source]

An enumeration.

ABSENT = 0
READY = 7
RUNNING = 3
STOPPED = 1
VISIBLE = 5
exasol.nb_connector.itde_manager.bring_itde_up(conf: Secrets, env_info: EnvironmentInfo | None = None) None[source]

Launches the ITDE environment using its API. Sets hardcoded environment name, and Google name server address. Additionally, can set the following parameters with values collected from the secret store: - database port forwarding, - BucketFS port forwarding, - database memory size (the value is assumed to be the number of gigabytes), - database disk size (the value is assumed to be the number of gigabytes).

Optionally, an existing instance of the DockerDB can be used instead. In this case the EnvironmentInfo object must be provided.

The function connects the current container to the network of the container where the Docker DB is running.

The names of created docker container, docker volume and docker network will be saved in the provided secret store. They will be used by the function that takes down the environment.

The function saves the main AI-Lab configuration parameters, such as the DB and BucketFS connection parameters, in the secret store.

exasol.nb_connector.itde_manager.get_itde_status(conf: Secrets) ItdeContainerStatus[source]

Checks if the ITDE container exists and ready to be used. In the Docker Edition that means the ITDE is running and the AI-Lab container is connected to its network. In other editions it will just check that the ITDE is running.

Returns the container status.

The name of the container is taken from the provided secret store. If the name cannot be found there the function returns the status ABSENT.

exasol.nb_connector.itde_manager.restart_itde(conf: Secrets) None[source]

Starts an existing ITDE container if it’s not already running. In the Docker Edition connects the AI-Lab container to the Docker-DB network, unless it’s already connected to it.

For this function to work the container must exist. If it doesn’t a RuntimeError will be raised. Use the get_itde_status function to check if the container exists.

exasol.nb_connector.itde_manager.take_itde_down(conf: Secrets, stop_db: bool = True) None[source]

Shuts down the ITDE. The names of the docker container, docker volume and docker network are taken from the provided secret store. If the names are not found there no action is taken.

Stopping the DockerDB can be skipped by setting the stop_db parameter to False. This is a useful option in case the DockerDB has been provided externally.

exasol.nb_connector.script_language_container

exasol.nb_connector.github

class exasol.nb_connector.github.Project(value)[source]

Names of github projects to be retrieved. Values have to match github project names.

CLOUD_STORAGE_EXTENSION = 'cloud-storage-extension'
KAFKA_CONNECTOR_EXTENSION = 'kafka-connector-extension'
exasol.nb_connector.github.get_latest_version_and_jar_url(project: Project) tuple[str, str][source]

Retrieves the latest version of stable project release and url with jar file from the release.

Parameters:

project – name of the project

Returns:

tuple with version and url to retrieve the artefact.

exasol.nb_connector.github.retrieve_jar(project: Project, use_local_cache: bool = True, storage_path: Path | None = None) Path[source]

Returns latest jar file for the project, possibly using local cache.

Parameters:
  • project – project to be used

  • use_local_cache – should local cache be used or file always retrieved anew

  • storage_path – path to be used for downloading. If None, current directory will be used.

Returns:

path to the jar file on the local filesystem

exasol.nb_connector.language_container_activation

exasol.nb_connector.model_installation

exasol.nb_connector.text_ai_extension_wrapper

exasol.nb_connector.transformers_extension_wrapper

Functions and Classes in Other Packages

Looks for a specified file starting from the current directory upward the file hierarchy. Hence, the last place to find the file is the root.

Returns the full path of the file if found. Otherwise, raises a ValueError exception.