|
| 1 | +from exasol.nb_connector.secret_store import Secrets |
| 2 | +from pathlib import Path |
| 3 | + |
| 4 | +LANGUAGE_ALIAS = "PYTHON3_TXAIE" |
| 5 | + |
| 6 | +LATEST_KNOWN_VERSION = "???" |
| 7 | + |
| 8 | +def deploy_licence(conf: Secrets, |
| 9 | + licence_file: Path = None, |
| 10 | + licence_content: str = None) -> None: |
| 11 | + """ |
| 12 | + Deploys the given license and saves its identifier to the secret store. The licence can either be |
| 13 | + defined by a path pointing to a licence file, or by the licence content given as a string. |
| 14 | + Parameters: |
| 15 | + conf: |
| 16 | + The secret store. |
| 17 | + licence_file: |
| 18 | + Path of a licence file. |
| 19 | + licence_content: |
| 20 | + Content of a licence given as a string. |
| 21 | +
|
| 22 | + """ |
| 23 | + pass |
| 24 | + |
| 25 | +def initialize_text_ai_extension(conf: Secrets, |
| 26 | + container_file: Path, |
| 27 | + version: str = LATEST_KNOWN_VERSION, |
| 28 | + language_alias: str = LANGUAGE_ALIAS, |
| 29 | + run_deploy_container: bool = True, |
| 30 | + run_deploy_scripts: bool = True, |
| 31 | + run_upload_models: bool = True, |
| 32 | + allow_override: bool = True) -> None: |
| 33 | + """ |
| 34 | + Depending on which flags are set, runs different steps to install Text-AI Extension in the DB. |
| 35 | + Possible steps: |
| 36 | +
|
| 37 | + * Call the Text-AI Extension's language container deployment API. |
| 38 | + Downloads the specified released version of the extension from ??? |
| 39 | + and uploads it to the BucketFS. |
| 40 | +
|
| 41 | + This function doesn't activate the language container. Instead, it gets the |
| 42 | + activation SQL using the same API and writes it to the secret store. The name |
| 43 | + of the key is defined in the ACTIVATION_KEY constant. |
| 44 | +
|
| 45 | + * Install default transformers models into |
| 46 | + the Bucketfs using Transformers Extensions upload model functionality. |
| 47 | +
|
| 48 | + * Install Text-AI specific scripts. |
| 49 | +
|
| 50 | + Parameters: |
| 51 | + conf: |
| 52 | + The secret store. The store must contain the DB connection parameters |
| 53 | + and the parameters of the BucketFS service. |
| 54 | + container_file: |
| 55 | + Path pointing to the locally stored Script Language Container file for the Text-AI Extension. |
| 56 | + version: |
| 57 | + Text-AI extension version. |
| 58 | + language_alias: |
| 59 | + The language alias of the extension's language container. |
| 60 | + run_deploy_container: |
| 61 | + If True runs deployment of the locally stored Script Language Container file for the Text-AI Extension. |
| 62 | + run_deploy_scripts: |
| 63 | + If True runs deployment of Text-AI Extension scripts. |
| 64 | + run_upload_models: |
| 65 | + If True uploads default Transformers models to the BucketFS. |
| 66 | + allow_override: |
| 67 | + If True allows overriding the language definition. |
| 68 | + """ |
| 69 | + pass |
0 commit comments