Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds new documentation #803

Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 3 additions & 14 deletions cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ 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_
for each user in the
deploy/docker/conf.server files and the _traefik-forward-auth_
container must be restarted. This is done as follows:

- Go to the _docker_ directory
Expand All @@ -94,13 +94,6 @@ This brings up the containers, without the AuthMS authentication.
cd <DTaaS>/docker
```

- Add two lines to the `conf.local` file

```txt
rule.onlyu4.action=allow
rule.onlyu4.rule=PathPrefix(`/user4`)
```

- Add three lines to the `conf.server` file

```txt
Expand All @@ -109,16 +102,12 @@ rule.onlyu3.rule=PathPrefix(`/user3`)
rule.onlyu3.whitelist = [email protected]
```

Run the appropritate command for a server/local installation:
Run the command for these changes to take effect:

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

```bash
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.

Expand Down
19 changes: 0 additions & 19 deletions deploy/config/client/env.trial.js

This file was deleted.

1 change: 0 additions & 1 deletion deploy/config/gateway/auth

This file was deleted.

35 changes: 0 additions & 35 deletions deploy/config/gateway/fileConfig.local.yml

This file was deleted.

48 changes: 0 additions & 48 deletions deploy/config/gateway/fileConfig.trial.yml

This file was deleted.

61 changes: 0 additions & 61 deletions deploy/config/gateway/fileConfig.yml

This file was deleted.

20 changes: 0 additions & 20 deletions deploy/config/gateway/traefik.yml

This file was deleted.

17 changes: 3 additions & 14 deletions docs/admin/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ 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_
for each user in the
deploy/docker/conf.server files and the _traefik-forward-auth_
container must be restarted. This is done as follows:

- Go to the _docker_ directory
Expand All @@ -91,13 +91,6 @@ This brings up the containers, without the AuthMS authentication.
cd <DTaaS>/deploy/docker
```

- Add two lines to the `conf.local` file

```txt
rule.onlyu4.action=allow
rule.onlyu4.rule=PathPrefix(`/user4`)
```

- Add three lines to the `conf.server` file

```txt
Expand All @@ -106,16 +99,12 @@ rule.onlyu3.rule=PathPrefix(`/user3`)
rule.onlyu3.whitelist = [email protected]
```

Run the appropritate command for a server/local installation:
Run the appropritate command for a server installation:

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

```bash
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.

Expand Down
95 changes: 26 additions & 69 deletions docs/admin/guides/add_user.md
Original file line number Diff line number Diff line change
@@ -1,81 +1,38 @@
# Add a new user
# Add User

This page will guide you on, how to add more users to the DTaas. Please do the following:
This page provides steps to adding a user from a DTaaS installation.
The username **alice** is used here to illustrate the steps involved in
removing a user account.

<!-- prettier-ignore -->
!!! important
Make sure to replace **<username\>** and **<port\>**
Select a port that is not already being used by the system.
Please do the following:

**1. Add user:**
1. **Add user to Gitlab instance:**
Add a new account for the new user on the Gitlab instance.
Note the username and email of the new account.

Add the new user on the Gitlab instance.
1. Use the [DTaaS CLI](../cli.md) to bring up the workspaces for new users.
This brings up the containers, without the backend authorization.

**2. Setup a new workspace:**
1. Add backend authorization for the user

The above code creates a new workspace for the new user based on _user2_.
1. Go to the _docker_ directory

```bash
cd DTaaS/files
cp -R user2 <username>
cd ..
docker run -d \
-p <port>:8080 \
--name "ml-workspace-<username>" \
-v "${TOP_DIR}/files/<username>:/workspace" \
-v "${TOP_DIR}/files/<username>:/workspace/common" \
--env AUTHENTICATE_VIA_JUPYTER="" \
--env WORKSPACE_BASE_URL="<username>" \
--shm-size 512m \
--restart always \
mltooling/ml-workspace-minimal:0.13.2
```
```bash
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code block style

cd <DTaaS>/docker
```

**3. Add username and password:**
1. Add three lines to the `conf.server` file

The following code adds basic authorization for the new user.
```txt
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code block style

rule.onlyu3.action=auth
rule.onlyu3.rule=PathPrefix(`/alice`)
rule.onlyu3.whitelist = [email protected]
```

```bash
cd DTaaS/servers/config/gateway
htpasswd auth <username>
```
1. Restart the docker container responsible for backend authorization.

**4. Add 'route' for new user:**
```bash
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code block style

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

We need to add a new route to the servers ingress.

Open the following file with your preffered editor (e.g. VIM/nano).

```bash
vi DTaaS/servers/config/gateway/dynamic/fileConfig.yml
```

Now add the new route and service for the user.

<!-- prettier-ignore -->
!!! important
foo.com should be replaced with your own domain.

```yml
http:
routers:
....
<username>:
entryPoints:
- http
rule: 'Host(`foo.com`) && PathPrefix(`/<username>`)'
middlewares:
- basic-auth
service: <username>

services:
...
<username>:
loadBalancer:
servers:
- url: 'http://localhost:<port>'
```

**5. Access the new user:**

Log into the DTaaS application as new user.
1. The new users are now added to the DTaaS instance, with authorization enabled.
Loading