# Script-Languages-Container-Tool
## Overview
The Script-Languages-Container-Tool (exaslct) is the build tool for the script language container.
You can build, export and upload script-language container from so-called flavors
which are description how to build the script language container. You can find pre-defined flavors
in the [script-languages-release](https://github.com/exasol/script-languages-release) repository.
There we also described how you could customize these flavors to your needs.
<h1 align="center">Exasol Script Languages Container Tool</h1>
<p align="center">
Building script-language container for extending Exasol UDFs.
</p>
<p align="center">
<a href="https://github.com/exasol/script-languages-container-tool/actions/workflows/ci.yml">
<img src="https://github.com/exasol/script-languages-container-tool/actions/workflows/main.yml/badge.svg?branch=main" alt="Checks Main">
</a>
<a href="https://opensource.org/licenses/MIT">
<img src="https://img.shields.io/pypi/l/exasol-script-languages-container-tool" alt="License">
</a>
<a href="https://pypi.org/project/exasol-script-languages-container-tool/">
<img src="https://img.shields.io/pypi/dm/exasol-script-languages-container-tool" alt="Downloads">
</a>
<a href="https://pypi.org/project/exasol-script-languages-container-tool/">
<img src="https://img.shields.io/pypi/pyversions/exasol-script-languages-container-tool" alt="Supported Python Versions">
</a>
<a href="https://pypi.org/project/exasol-script-languages-container-tool/">
<img src="https://img.shields.io/pypi/v/exasol-script-languages-container-tool" alt="PyPi Package">
</a>
</p>
## In a Nutshell
### Prerequisites
**Note**: Since version 1.0.0 the "starter scripts" shipped with previous version, which pulled the `exaslct` docker container runtime, were removed. If you can't use Python3, you still can use our [AI-lab](https://github.com/exasol/ai-lab) which provides VM images, AMI images and a Docker images, all capable of building script-language-container.
#### For installation
In order to install this tool, your system needs to provide
the following prerequisites:
* Software
See [Dependencies](doc/dependencies.md)
#### For running
In order to use this tool, your system needs to fulfill the following prerequisites:
* Software
* Linux
* Python3 >= 3.10
* [Docker](https://docs.docker.com/) >= 17.05
* with support for [multi-stage builds required](https://docs.docker.com/develop/develop-images/multistage-build/)
* host volume mounts need to be allowed
* System Setup
* We recommend at least 50 GB free disk space on the partition
where Docker stores its images, on linux Docker typically stores
the images at /var/lib/docker.
* For the partition where the output directory (default: ./.build_output)
is located we recommend additionally at least 10 GB free disk space.
Further, prerequisites might be necessary for specific tasks. These are listed under the corresponding section.
### Installation
In general, it's good practice to install the package in a virtual environment, using `venv` or `Poetry`.
#### Pip via PyPi
```commandline
python3 -m pip install exasol-script-languages-container-tool
```
#### Pipx via Pypi
If you plan to use `exasol-script-languages-container-tool` on the command line only via the `exaslct` script, we suggest the installation via `pipx`:
```commandline
pipx install exasol-script-languages-container-tool
```
### Usage
For simplicity the following examples use the script version (`exaslct`), which will be installed together with the Python package. The script is just an alias for `python3 -m exasol.slc.tool.main`.
#### How to build an existing flavor?
Create the language container and export it to the local file system
```bash
exaslct export --flavor-path=flavors/<flavor-name> --export-path <export-path>
```
or deploy it directly to the BucketFS (both http and https are supported)
```bash
exaslct deploy --flavor-path=flavors/<flavor-name> --bucketfs-host <hostname-or-ip> --bucketfs-port <port> \
--bucketfs-user w --bucketfs-password <password> --bucketfs-name <bucketfs-name> \
--bucket <bucket-name> --path-in-bucket <path/in/bucket> --bucketfs-use-https 1
```
Once it is successfully deployed, it will print the ALTER SESSION statement
that can be used to activate the script language container in the database.
#### How to activate a script language container in the database
If you uploaded a container manually, you can generate the language activation statement with
```bash
exaslct generate-language-activation --flavor-path=flavors/<flavor-name> --bucketfs-name <bucketfs-name> \
--bucket-name <bucket-name> --path-in-bucket <path/in/bucket> --container-name <container-name>
```
where \<container-name> is the name of the uploaded archive without its file extension. To activate the language, execute the generated statement in your database session to activate the container for the current session or system wide.
This command will print a SQL statement to activate the language similar to the following one:
```bash
ALTER SESSION SET SCRIPT_LANGUAGES='<LANGUAGE_ALIAS>=localzmq+protobuf:///<bucketfs-name>/<bucket-name>/<path-in-bucket>/<container-name>?lang=<language>#buckets/<bucketfs-name>/<bucket-name>/<path-in-bucket>/<container-name>/exaudf/exaudfclient[_py3]';
```
**Please, refer to the [User Guide](doc/user_guide/user_guide.md) for more detailed information, how to use exalsct.**
## Features
* Build a script language container as docker images
* Export a script language container as an archive which can be used for extending Exasol UDFs
* Upload a script language container as an archive to the Exasol DB's BucketFS
* Generating the activation command for a script language container
* Can use Docker registries, such as Docker Hub, as a cache to avoid rebuilding image without changes
* Can push Docker images to Docker registries
* Run tests for you container against an Exasol DB (docker-db or external db)
## Table of Contents
### Information for Users
* [User Guide](doc/user_guide/user_guide.md)
* [Changelog](doc/changes/changelog.md)
## Information for Developers
* [Developer Guide](doc/developer_guide/developer_guide.md)
* [Dependencies](doc/dependencies.md)
Raw data
{
"_id": null,
"home_page": "https://github.com/exasol/script-languages-container-tool",
"name": "exasol-script-languages-container-tool",
"maintainer": null,
"docs_url": null,
"requires_python": "<4,>=3.10",
"maintainer_email": null,
"keywords": "exasol, udf, script-languages",
"author": "Torsten Kilias",
"author_email": "torsten.kilias@exasol.com",
"download_url": "https://files.pythonhosted.org/packages/39/e5/d06800cab61bbfc5ed423214fb0fa4ac5efbc8306da623e8289e8790aee2/exasol_script_languages_container_tool-1.0.0.tar.gz",
"platform": null,
"description": "# Script-Languages-Container-Tool\n\n## Overview\n\nThe Script-Languages-Container-Tool (exaslct) is the build tool for the script language container.\nYou can build, export and upload script-language container from so-called flavors\nwhich are description how to build the script language container. You can find pre-defined flavors\nin the [script-languages-release](https://github.com/exasol/script-languages-release) repository.\nThere we also described how you could customize these flavors to your needs.\n<h1 align=\"center\">Exasol Script Languages Container Tool</h1>\n\n<p align=\"center\">\nBuilding script-language container for extending Exasol UDFs.\n</p>\n\n<p align=\"center\">\n\n<a href=\"https://github.com/exasol/script-languages-container-tool/actions/workflows/ci.yml\">\n <img src=\"https://github.com/exasol/script-languages-container-tool/actions/workflows/main.yml/badge.svg?branch=main\" alt=\"Checks Main\">\n</a>\n<a href=\"https://opensource.org/licenses/MIT\">\n <img src=\"https://img.shields.io/pypi/l/exasol-script-languages-container-tool\" alt=\"License\">\n</a>\n<a href=\"https://pypi.org/project/exasol-script-languages-container-tool/\">\n <img src=\"https://img.shields.io/pypi/dm/exasol-script-languages-container-tool\" alt=\"Downloads\">\n</a>\n<a href=\"https://pypi.org/project/exasol-script-languages-container-tool/\">\n <img src=\"https://img.shields.io/pypi/pyversions/exasol-script-languages-container-tool\" alt=\"Supported Python Versions\">\n</a>\n<a href=\"https://pypi.org/project/exasol-script-languages-container-tool/\">\n <img src=\"https://img.shields.io/pypi/v/exasol-script-languages-container-tool\" alt=\"PyPi Package\">\n</a>\n</p>\n\n\n## In a Nutshell\n\n### Prerequisites\n\n**Note**: Since version 1.0.0 the \"starter scripts\" shipped with previous version, which pulled the `exaslct` docker container runtime, were removed. If you can't use Python3, you still can use our [AI-lab](https://github.com/exasol/ai-lab) which provides VM images, AMI images and a Docker images, all capable of building script-language-container.\n\n#### For installation\n\nIn order to install this tool, your system needs to provide\nthe following prerequisites:\n\n* Software\n See [Dependencies](doc/dependencies.md)\n\n\n#### For running\n\nIn order to use this tool, your system needs to fulfill the following prerequisites:\n\n* Software\n * Linux\n * Python3 >= 3.10\n * [Docker](https://docs.docker.com/) >= 17.05\n * with support for [multi-stage builds required](https://docs.docker.com/develop/develop-images/multistage-build/)\n * host volume mounts need to be allowed\n\n* System Setup\n * We recommend at least 50 GB free disk space on the partition\n where Docker stores its images, on linux Docker typically stores\n the images at /var/lib/docker.\n * For the partition where the output directory (default: ./.build_output)\n is located we recommend additionally at least 10 GB free disk space.\n\nFurther, prerequisites might be necessary for specific tasks. These are listed under the corresponding section.\n\n### Installation\n\nIn general, it's good practice to install the package in a virtual environment, using `venv` or `Poetry`.\n\n#### Pip via PyPi\n\n```commandline\npython3 -m pip install exasol-script-languages-container-tool\n```\n\n#### Pipx via Pypi\n\nIf you plan to use `exasol-script-languages-container-tool` on the command line only via the `exaslct` script, we suggest the installation via `pipx`:\n\n```commandline\npipx install exasol-script-languages-container-tool\n```\n\n\n### Usage\n\nFor simplicity the following examples use the script version (`exaslct`), which will be installed together with the Python package. The script is just an alias for `python3 -m exasol.slc.tool.main`.\n\n#### How to build an existing flavor?\n\nCreate the language container and export it to the local file system\n\n```bash\nexaslct export --flavor-path=flavors/<flavor-name> --export-path <export-path>\n```\n\nor deploy it directly to the BucketFS (both http and https are supported)\n\n```bash\nexaslct deploy --flavor-path=flavors/<flavor-name> --bucketfs-host <hostname-or-ip> --bucketfs-port <port> \\\n --bucketfs-user w --bucketfs-password <password> --bucketfs-name <bucketfs-name> \\\n --bucket <bucket-name> --path-in-bucket <path/in/bucket> --bucketfs-use-https 1\n```\n\nOnce it is successfully deployed, it will print the ALTER SESSION statement\nthat can be used to activate the script language container in the database.\n\n#### How to activate a script language container in the database\n\nIf you uploaded a container manually, you can generate the language activation statement with\n\n```bash\nexaslct generate-language-activation --flavor-path=flavors/<flavor-name> --bucketfs-name <bucketfs-name> \\\n --bucket-name <bucket-name> --path-in-bucket <path/in/bucket> --container-name <container-name>\n```\n\nwhere \\<container-name> is the name of the uploaded archive without its file extension. To activate the language, execute the generated statement in your database session to activate the container for the current session or system wide.\n\nThis command will print a SQL statement to activate the language similar to the following one:\n\n```bash\nALTER SESSION SET SCRIPT_LANGUAGES='<LANGUAGE_ALIAS>=localzmq+protobuf:///<bucketfs-name>/<bucket-name>/<path-in-bucket>/<container-name>?lang=<language>#buckets/<bucketfs-name>/<bucket-name>/<path-in-bucket>/<container-name>/exaudf/exaudfclient[_py3]';\n```\n\n**Please, refer to the [User Guide](doc/user_guide/user_guide.md) for more detailed information, how to use exalsct.**\n\n## Features\n\n* Build a script language container as docker images\n* Export a script language container as an archive which can be used for extending Exasol UDFs\n* Upload a script language container as an archive to the Exasol DB's BucketFS\n* Generating the activation command for a script language container\n* Can use Docker registries, such as Docker Hub, as a cache to avoid rebuilding image without changes\n* Can push Docker images to Docker registries\n* Run tests for you container against an Exasol DB (docker-db or external db)\n\n## Table of Contents\n\n### Information for Users\n\n* [User Guide](doc/user_guide/user_guide.md)\n* [Changelog](doc/changes/changelog.md)\n\n## Information for Developers\n\n* [Developer Guide](doc/developer_guide/developer_guide.md)\n* [Dependencies](doc/dependencies.md)\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Script Languages Container Tool",
"version": "1.0.0",
"project_urls": {
"Documentation": "https://github.com/exasol/script-languages-container-tool",
"Homepage": "https://github.com/exasol/script-languages-container-tool",
"Issues": "https://github.com/exasol/script-languages-container-tool/issues",
"Repository": "https://github.com/exasol/script-languages-container-tool",
"Source": "https://github.com/exasol/script-languages-container-tool"
},
"split_keywords": [
"exasol",
" udf",
" script-languages"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ec3c5d1a0c04571ca98cc648b4c708e9d82f0ae759e12c969c85a1e1c454e957",
"md5": "1a5ff78913db1e1ea9125d858c144750",
"sha256": "8b87243782266f55b1bd6c153275cba1f55a8406bca99c2d4d37934b3e8bcad4"
},
"downloads": -1,
"filename": "exasol_script_languages_container_tool-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1a5ff78913db1e1ea9125d858c144750",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4,>=3.10",
"size": 92537,
"upload_time": "2024-09-04T10:00:50",
"upload_time_iso_8601": "2024-09-04T10:00:50.033778Z",
"url": "https://files.pythonhosted.org/packages/ec/3c/5d1a0c04571ca98cc648b4c708e9d82f0ae759e12c969c85a1e1c454e957/exasol_script_languages_container_tool-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "39e5d06800cab61bbfc5ed423214fb0fa4ac5efbc8306da623e8289e8790aee2",
"md5": "35ea19feb9c53d41da6a71e5bca0a768",
"sha256": "39f0da9e8a55bc0fec1477f5d6c03761ef0abbd841bfc5909253e12e1ae0bcc1"
},
"downloads": -1,
"filename": "exasol_script_languages_container_tool-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "35ea19feb9c53d41da6a71e5bca0a768",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4,>=3.10",
"size": 45714,
"upload_time": "2024-09-04T10:00:51",
"upload_time_iso_8601": "2024-09-04T10:00:51.412869Z",
"url": "https://files.pythonhosted.org/packages/39/e5/d06800cab61bbfc5ed423214fb0fa4ac5efbc8306da623e8289e8790aee2/exasol_script_languages_container_tool-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-04 10:00:51",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "exasol",
"github_project": "script-languages-container-tool",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "exasol-script-languages-container-tool"
}