Skip to main content

DTaaS CLI

Project description

DTaaS Command Line Interface

This is a command line tool for the INTO-CPS-Association Digital Twins as a Service.

Prerequisite

Please visit and download the DTaaS Software.

The DTaaS service with base users and essential containers should be up and running before using the CLI.

Installation

Simply install using:

We recommend installing this in a virutal environment.

Steps to install:

  • Change the working folder:
cd <DTaaS-directory>/cli
  • We recommend installing this in a virtual environment. Create and activate a virtual environment.

  • To install, simply:

pip install dtaas-cli

Usage

Setup

The base DTaaS system should be up and running before adding/deleting users with the CLI.

Additionally, Setup the dtaas.toml file in the cli directory:

  • Set common.server-dns to domain name of your server. If you want to bring up the server locally, please set this to "localhost".

  • Set the path to the full system path of the DTaaS directory.

[common]
# absolute path to the DTaaS application directory
server-dns = "localhost"
path = "/home/Desktop/DTaaS"

Add users

To add new users using the CLI, fill in the users.add list in dtaas.toml with the Gitlab instance usernames of the users to be added

[users]
# matching user info must present in this config file
add = ["username1","username2", "username3"] 

Then simply:

dtaas admin user add

Caveat

This brings up the containers, without the AuthMS authentication.

  • Currently the email fields for each user in dtaas.toml are not in use, and are not necessary to fill in. These emails must be configured manually for each user in the docker/conf.local or docker/conf.server files and the traefik-forward-auth container must be restarted. This is done as follows:

  • Go to the docker directory

cd <DTaaS>/docker
  • Add two lines to the conf.local file
rule.onlyu4.action=allow
rule.onlyu4.rule=PathPrefix(`/user4`)
  • Add three lines to the conf.server file
rule.onlyu3.action=auth
rule.onlyu3.rule=PathPrefix(`/user3`)
rule.onlyu3.whitelist = user3@emailservice.com

Run the appropritate command for a server/local installation:

docker compose -f compose.server.yml --env-file .env up -d --force-recreate traefik-forward-auth
docker compose -f compose.local.yml --env-file .env up -d --force-recreate traefik-forward-auth

The new users are now added to the DTaaS instance, with authorization enabled.

Delete users

TO delete existing users, fill in the users.delete list in dtaas.toml_ with the Gitlab instance usernames of the users to be deleted.

Make sure you are in the cli directory.

Then simply:

dtaas admin user delete

Additional Points to Remember

  • The user add CLI will add and start a container for a new user. It can also start a container for an existing user if that container was somehow stopped. It shows a Running status for existing user containers that are already up and running, it doesn't restart them.

  • user add and user delete CLIs return an error if the add and delete lists in dtaas.toml are empty, respectively.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dtaas11-0.1.0.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

dtaas11-0.1.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file dtaas11-0.1.0.tar.gz.

File metadata

  • Download URL: dtaas11-0.1.0.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.10.12 Linux/5.15.0-60-generic

File hashes

Hashes for dtaas11-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2d817f144ed3cc93b1fcb5e92f4b8de5a71cb0d17b26300be7dd56186ff2626f
MD5 e5ea967cea981858cba680cf8806bcda
BLAKE2b-256 5d1e448aebb88631ad7e02f49b1fa5a2902c200506f1a292bc52a6cc03c8853a

See more details on using hashes here.

File details

Details for the file dtaas11-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: dtaas11-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.10.12 Linux/5.15.0-60-generic

File hashes

Hashes for dtaas11-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0268afd616152f5b4c4dc0a8d303675f91233cb3c52ebc36e9977c038b0a7f03
MD5 baf8e24e5c99ffffc64bead1429e6e09
BLAKE2b-256 693c36d01d3287045c7cbd680ebee7284c9550b973a72710cb22118e89196472

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page