Metadata-Version: 2.2
Name: delta-core
Version: 1.2.0
Summary: Delta core
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)
Requires-Python: ~=3.11
Description-Content-Type: text/markdown
Requires-Dist: drb>=2.2.1
Requires-Dist: drb-driver-odata~=1.3.3
Requires-Dist: drb-driver-swift~=1.3.0
Requires-Dist: GitPython>=3.1.36
Requires-Dist: requests>=2.27.0
Requires-Dist: jsonschema>=4.17.0
Requires-Dist: drb-driver-http~=1.3.5
Requires-Dist: s3fs==2023.12.2
Requires-Dist: pydantic==2.5.3
Requires-Dist: pydantic-settings==2.2.1
Requires-Dist: fastapi==0.109.2
Requires-Dist: uvicorn==0.25.0
Requires-Dist: sqlalchemy==2.0.25
Requires-Dist: alembic==1.13.1
Requires-Dist: ansible==9.1.0
Requires-Dist: ansible-runner==2.3.4
Requires-Dist: kubernetes==28.1.0
Requires-Dist: boto3==1.34.51
Requires-Dist: apscheduler==3.10.4
Requires-Dist: pytz==2024.1
Requires-Dist: docker>=7.0.0
Requires-Dist: psycopg[binary,pool]==3.1.18
Requires-Dist: python-jose==3.3.0
Requires-Dist: redis==5.0.6
Requires-Dist: python-socketio==5.11.2
Requires-Dist: rsa==4.9
Requires-Dist: aiohttp==3.9.5

# Delta Core

## prerequisites
### Initialize or update submodule dependency
```
git submodule update --init
```
### Install Ansible requirements
this action requires credentials to GitLab at https://git2.gael.fr 
```shell
cd ansibleworkplan
ansible-galaxy install --force
```

## Run the DeltaTwin-Run microservice
### command
```shell
python -m delta.run.api.api
```
### Environment variables
| name                        | default                                         | description                              |
|:----------------------------|:------------------------------------------------|:-----------------------------------------|
| DELTA_GSS_API_URL           |                                                 | DeltaTwin GSS API                        |
| DELTA_RUN_LIMIT             | 10                                              | Maximal active parallel runs per owner   |
| DELTA_EVICTION_ACTIVE       | false                                           | Active run eviction                      |
| DELTA_EVICTION_KEEP_PERIOD  | 48                                              | Run retention time in hour               |
| DELTA_DATABASE_URL          | sqlite:///.delta-run.db?check_same_thread=false | DeltaTwin Run database URL               |
| DELTA_DATABASE_SHOW_SQL     | false                                           | Log database SQL requests                |
| DELTA_PAGE_LIMIT            | 100                                             | Max element returned from a request      |
| DELTA_SOCKETIO_ADAPTER_URL  |                                                 | Redis server URL (redis://hostname:port) |
| DELTA_KEYCLOAK_JWKS_URL     |                                                 | OpenID certs endpoint                    |
| DELTA_IMAGE_REPO_HOSTNAME   |                                                 | image registry hostname for model images |
| DELTA_IMAGE_REPO_USERNAME   |                                                 | image registry username                  |
| DELTA_IMAGE_REPO_PASSWORD   |                                                 | image registry password                  |
| DELTA_S3_ENDPOINT           |                                                 | S3 object storage endpoint               |
| DELTA_S3_REGION             |                                                 | S3 object storage region                 |
| DELTA_S3_ACCESS_KEY         |                                                 | S3 object storage access key             |
| DELTA_S3_SECRET_ACCESS_KEY  |                                                 | S3 object storage secret access key      |
| DELTA_S3_BUCKET             |                                                 | S3 object storage bucket name            |
| DELTA_K8S_CONTEXT           |                                                 | K8s config context name                  |
| DELTA_K8S_NAMESPACE         |                                                 | K8s config namespace                     |
| DELTA_K8S_CLUSTER_NAME      |                                                 | K8s config cluster name                  |
| DELTA_K8S_CLUSTER_CERT_AUTH |                                                 | K8s config cluster cert                  |
| DELTA_K8S_CLUSTER_SERVER    |                                                 | K8s config cluster server                |
| DELTA_K8S_USER_NAME         |                                                 | K8s config user name                     |
| DELTA_K8S_USER_CLI_CERT     |                                                 | K8s config user client cert              |
| DELTA_K8S_USER_CLI_KEY      |                                                 | K8s config user client key               |

## Docker
### Build image
All prerequisites are managed in the Docker image.
```
docker build --build-arg "GIT_USERNAME=<git2.gael.fr username>" --build-arg "GIT_PASSWORD=<git2.gael.fr password>" -t registry.gael.fr/gael10/delta/software/delta-core/delta-run .
```
### Compose
#### Environment variables
| name                         | default                    | description                              |
|:-----------------------------|:---------------------------|:-----------------------------------------|
| DB_USERNAME                  |                            | database username                        |
| DB_PASSWORD                  |                            | database password                        |
| DB_DATABASE                  |                            | database name                            |
| DB_DRIVER                    |                            | database driver (psycopg)                |
| DELTA_GSS_API_URL            |                            | DeltaTwin GSS API URL                    |
| DELTA_RUN_LIMIT              |                            | Maximal active parallel runs per owner   |
| DELTA_EVICTION_ACTIVE        |                            | Active run eviction                      |
| DELTA_EVICTION_KEEP_PERIOD   |                            | Run retention time in hour               |
| DELTA_SOCKETIO_ADAPTER_URL   | redis://redis-adapter:6379 | Redis server URL                         |
| DELTA_KEYCLOAK_JWKS_URL      |                            | OpenID certs endpoint                    |
| DELTA_DATABASE_SHOW_SQL      |                            | Log database SQL requests                |
| DELTA_IMAGE_REPO_HOSTNAME    |                            | image registry hostname for model images |
| DELTA_IMAGE_REPO_USERNAME    |                            | image registry username                  |
| DELTA_IMAGE_REPO_PASSWORD    |                            | image registry password                  |
| DELTA_S3_ENDPOINT            |                            | S3 object storage endpoint               |
| DELTA_S3_REGION              |                            | S3 object storage region                 |
| DELTA_S3_ACCESS_KEY          |                            | S3 object storage access key             |
| DELTA_S3_SECRET_ACCESS_KEY   |                            | S3 object storage secret access key      |
| DELTA_S3_BUCKET              |                            | S3 object storage bucket name            |
| DELTA_K8S_CONTEXT            |                            | K8s config context name                  |
| DELTA_K8S_NAMESPACE          |                            | K8s config namespace                     |
| DELTA_K8S_CLUSTER_NAME       |                            | K8s config cluster name                  |
| DELTA_K8S_CLUSTER_CERT_AUTH  |                            | K8s config cluster cert                  |
| DELTA_K8S_CLUSTER_SERVER     |                            | K8s config cluster server                |
| DELTA_K8S_USER_NAME          |                            | K8s config user name                     |
| DELTA_K8S_USER_CLI_CERT      |                            | K8s config user client cert              |
| DELTA_K8S_USER_CLI_KEY       |                            | K8s config user client key               |
