Skip to content

Commit

Permalink
Remove gitlab mode from libms and updates docs (INTO-CPS-Association#435
Browse files Browse the repository at this point in the history
)

 - The gitlab mode of library microservice has become
   non functional. Hence the code for gitlab mode
   has been removed.
 - Improves code and tests of lib microservices.
 - Upgrades the dependencies of library microservice
 - Fixes github action of library microservice
 - Updates the documentation for library microservice
   to reflect the removal of gitlab mode.
 - Updates documentation to include correct C4 diagrams.
 - Updates diagrams in the docs to reflect the latest
   codebase.
  • Loading branch information
prasadtalasila authored Jan 16, 2024
1 parent abc90a6 commit 105044c
Show file tree
Hide file tree
Showing 67 changed files with 1,984 additions and 2,925 deletions.
28 changes: 5 additions & 23 deletions .github/workflows/lib-ms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,43 +39,25 @@ jobs:
yarn install
yarn build
- name: Run unit tests
- name: Run all tests
run: |
cd servers/lib
yarn install
yarn test:unit
yarn test:all
env:
PORT: 4001
LOCAL_PATH: ${{ github.workspace }}/files
GITLAB_GROUP: dtaas
GITLAB_URL: https://gitlab.com/api/graphql
TOKEN: token
MODE: gitlab
MODE: local
LOG_LEVEL: debug
APOLLO_PATH: /lib

- name: Run integration tests
if: ${{ always() }}
run: |
cd servers/lib
yarn install
yarn test:int
env:
PORT: 4001
LOCAL_PATH: ${{ github.workspace }}/files
GITLAB_GROUP: dtaas
GITLAB_URL: https://gitlab.com/api/graphql
TOKEN: token
MODE: gitlab
LOG_LEVEL: debug
APOLLO_PATH: /lib

- name: Upload unit and integration test coverage to Codecov
- name: Upload test coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: servers/lib/coverage/clover.xml
flags: lib-microservice-tests


publish-package:

if: |
Expand Down
11 changes: 2 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,5 @@ This software is owned by
[The INTO-CPS Association](https://into-cps.org/)
and is available under [the INTO-CPS License](./LICENSE.md).

The DTaaS software platform uses
[Træfik](https://github.com/traefik/traefik),
[ML Workspace](https://github.com/ml-tooling/ml-workspace),
[Grafana](https://github.com/grafana/grafana),
[InfluxDB](https://github.com/influxdata/influxdb),
[MQTT](https://github.com/eclipse/mosquitto) and
[RabbitMQ](https://github.com/rabbitmq/rabbitmq-server)
open-source components.
These software components have their own licenses.
Please see [third-party](docs/third-party.md) for details of
the third-party software included in the DTaaS.
5 changes: 1 addition & 4 deletions deploy/config/lib
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
PORT='4001'
MODE='local' or 'gitlab'
MODE='local'
LOCAL_PATH ='filepath'
GITLAB_GROUP ='dtaas'
GITLAB_URL='https://gitlab.foo.com/api/graphql'
TOKEN='123-sample-token'
LOG_LEVEL='debug'
APOLLO_PATH='/lib' or ''
GRAPHQL_PLAYGROUND='false' or 'true'
3 changes: 0 additions & 3 deletions deploy/single-script-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,6 @@ sudo npm install -g @into-cps-association/libms
printf "PORT='4001'\n "
printf "MODE='local'\n "
printf "LOCAL_PATH ='%s/files'\n " "$TOP_DIR"
printf "GITLAB_GROUP ='dtaas'\n "
printf "GITLAB_URL='https://gitlab.com/api/graphql'\n "
printf "TOKEN='123-sample-token'\n "
printf "LOG_LEVEL='debug'\n "
printf "APOLLO_PATH='lib'\n "
printf "GRAPHQL_PLAYGROUND='true'\n "
Expand Down
11 changes: 8 additions & 3 deletions docs/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,12 @@
The licensed software are not available on the software platform.
But users have private workspaces which are based
on Linux-based xfce Desktop environment.
Users can install software in their workspaces. The licensed software
installed by one user is not available to another user.
Users can install software in their workspaces.
Please see a
[screencast](FAQ/matlab-simulink.mp4) of using Matlab Simulink
within the DTaaS software.
The licensed software installed by one user is not available
to another user.

## Digital Twin Models

Expand Down Expand Up @@ -159,7 +163,8 @@

??? Question "Does DTaaS support data collection from different sources like hardware, software and network? Is there any user interface or any tracking instruments used for data collection?"

The DTaaS provids InfluxDB, RabbitMQ, MQTT services. Both the physical twin
The DTaaS provids InfluxDB, RabbitMQ, MQTT and MongoDB services.
Both the physical twin
and digital twin can utilize these protocols for communication.
The IoT (time-series) data can be collected using InfluxDB and MQTT
broker services. There is a user interface for InfluxDB which can be
Expand Down
Binary file added docs/FAQ/matlab-simulink.mp4
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/admin/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ Follow the installation that fits your usecase.
| [Production installation on single host](./host.md) | Install DTaaS on server for multiple users. |
| [One vagrant machine](vagrant/single-machine.md) | Install DTaaS on a virtual machine; can be used for single or multiple users. |
| [Two vagrant machines](vagrant/two-machines.md) | Install DTaaS on two virtual machines; can be used for single or multiple users. |
| | The core DTaaS application is installed on the first virtual machine and all the services (RabbitMQ, MQTT, InfluxDB and Grafana) are installed on second virtual machine. |
| | The core DTaaS application is installed on the first virtual machine and all the services (RabbitMQ, MQTT, InfluxDB, Grafana and MongoDB) are installed on second virtual machine. |
| Seperater Packages: [client website](client/CLIENT.md) and [lib microservice](servers/lib/LIB-MS.md) | Can be used independently; do not need full installation of DTaaS. |
46 changes: 8 additions & 38 deletions docs/admin/servers/lib/LIB-MS.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,34 +24,22 @@ There is a skeleton file structure in
[DTaaS codebase](https://github.com/INTO-CPS-Association/DTaaS/tree/feature/distributed-demo/files).
You can copy and create file system for your users.

## Gitlab setup (optional)

For this microserivce to be functional,
a certain directory or gitlab project structure is expected.
The microservice expects that the gitlab consisting of one group,
DTaaS, and within that group, all of the projects be located,
**user1**, **user2**, ... , as well as a **commons** project.
Each project corresponds to files of one user.
A sample file structure can be seen in [gitlab dtaas group](https://gitlab.com/dtaas).
You can visit the gitlab documentation on [groups](https://docs.gitlab.com/ee/user/group/)
for help on the management of gitlab groups.

You can clone the git repositories from the `dtaas` group
to get a sample file system structure for the lib microservice.

## :arrow_down: Install

The package is available in Github
[packages registry](https://github.com/orgs/INTO-CPS-Association/packages).
[packages registry](https://github.com/orgs/INTO-CPS-Association/packages)
and on
[npmjs](https://www.npmjs.com/package/@into-cps-association/libms).

Set the registry and install the package with the following commands
Set the registry and install the package with the one of
the two following commands

```bash
sudo npm install -g @into-cps-association/libms # requires no login
sudo npm config set @into-cps-association:registry https://npm.pkg.github.com
sudo npm install -g @into-cps-association/libms
```

The _npm install_ command asks for username and password. The username is
The _github package registry_ asks for username and password. The username is
your Github username and the password is your Github
[personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens).
In order for the npm to download the package, your personal access token
Expand All @@ -64,11 +52,8 @@ The template configuration file is:

```ini
PORT='4001'
MODE='local' or 'gitlab'
MODE='local'
LOCAL_PATH='/Users/<Username>/DTaaS/files'
GITLAB_GROUP='dtaas'
GITLAB_URL='https://gitlab.com/api/graphql'
TOKEN='123-sample-token'
LOG_LEVEL='debug'
APOLLO_PATH='/lib' or ''
GRAPHQL_PLAYGROUND='false' or 'true'
Expand All @@ -78,23 +63,8 @@ The `LOCAL_PATH` variable is the absolute filepath to the
location of the local directory which will be served to users
by the Library microservice.

The `GITLAB_URL`, `GITLAB_GROUP` and `TOKEN` are only relevant for `gitlab` mode.
The `TOKEN` should be set to your GitLab Group access API token.
For more information on how to create and use your access token,
[gitlab page](https://docs.gitlab.com/ee/user/group/settings/group_access_tokens.html).

Once you've generated a token, copy it and replace
the value of `TOKEN` with your token for the gitlab group, can be found.

Replace the default values the appropriate values for your setup.

**NOTE**:

1. When \__MODE=local_, only _LOCAL_PATH_ is used.
Other environment variables are unused.
1. When _MODE=gitlab_, _GITLAB_URL, TOKEN_,
and _GITLAB_GROUP_ are used; _LOCAL_PATH_ is unused.

## :rocket: Use

Display help.
Expand Down
Binary file modified docs/admin/servers/lib/file-system-layout.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/admin/vagrant/basebox.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/admin/vagrant/single-machine.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/admin/vagrant/two-machine-use-legend.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/admin/vagrant/two-machine.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/dtaas-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 105044c

Please sign in to comment.