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

Improves Docker Installation Files (on top of #988) #1019

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
9333d02
Rename `lib.docker` to `lib.env`
aryanpingle Oct 15, 2024
a074708
Add `OAUTH_` prefix to auth variables
aryanpingle Oct 15, 2024
08b1fd6
Update auth microservice diagram
aryanpingle Oct 15, 2024
bd2fae0
Update auth microservice diagram
aryanpingle Oct 17, 2024
39a1e79
Enable debugging for traefik + forward auth for devs
aryanpingle Oct 17, 2024
19a4fa5
Removes version tag from docker-compose files
aryanpingle Oct 18, 2024
506ff64
Remove version tag from test expectation
aryanpingle Oct 21, 2024
c2d1f4e
Revert "Remove version tag from test expectation"
aryanpingle Oct 22, 2024
827a059
Removes `CLIENT_CONFIG` variable
aryanpingle Oct 23, 2024
31380d1
Remove `CLIENT_CONFIG` variable from docs
aryanpingle Oct 23, 2024
9755fc7
Remove lib.env mapping from libms container
aryanpingle Oct 24, 2024
7e50b9d
Remove some mkdocs callouts for 'tip'
aryanpingle Oct 24, 2024
1030568
Preserve mkdocs tip callout for docs/admin
aryanpingle Oct 24, 2024
ce71406
Remove lib.env mapping from SERVER.md
aryanpingle Oct 24, 2024
a3fc61a
Add OAUTH prefix for docker/.env
aryanpingle Oct 24, 2024
8e3f96c
Adds a `LIB_CONFIG` variable for the libms env file
aryanpingle Oct 24, 2024
5c17bf0
Format markdowns
aryanpingle Oct 25, 2024
5480703
Enable debugging for traefik + forward auth
aryanpingle Oct 28, 2024
3c1b821
Fix incorrect docker commands in `LOCALHOST.SECURE.md`
aryanpingle Oct 28, 2024
5b33632
Fixes installation documentation
prasadtalasila Oct 30, 2024
941e9c1
Fixes installation documentation
prasadtalasila Oct 30, 2024
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
1 change: 0 additions & 1 deletion cli/tests/compose.users.test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3'
services:
astitvasehgal05:
image: mltooling/ml-workspace-minimal:0.13.2
Expand Down
1 change: 0 additions & 1 deletion client/compose.client.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3'
services:
client:
image: intocps/dtaas-web:latest
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion deploy/docker/.env.local
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
DTAAS_DIR='/Users/<Username>/DTaaS'
CLIENT_CONFIG='/Users/<Username>/DTaaS/deploy/config/client/env.local.js'
username1='user1'
5 changes: 2 additions & 3 deletions deploy/docker/.env.server
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
DTAAS_DIR='/Users/<Username>/DTaaS'
SERVER_DNS='foo.com'
OAUTH_URL='https://gitlab.foo.com'
CLIENT_ID='xx'
CLIENT_SECRET='xx'
OAUTH_CLIENT_ID='xx'
OAUTH_CLIENT_SECRET='xx'
OAUTH_SECRET='random-secret-string'
CLIENT_CONFIG='/Users/<Username>/DTaaS/deploy/config/client/env.js'
username1='user1'
username2='user2'
10 changes: 5 additions & 5 deletions deploy/docker/DOCKER-ENV.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ Edit all the fields according to your specific case.
| DTAAS_DIR | '/Users/username/DTaaS' | Full path to the DTaaS directory. This is an absolute path with no trailing slash. |
| SERVER_DNS | <http>_foo.com_</http> | The server DNS, if you are deploying with a dedicated server. Remember not use <http:>http(s)</http:> at the beginning of the DNS string |
| OAUTH_URL | <http>_gitlab.foo.com_<http/> | The URL of your Gitlab instance. It can be <http>_gitlab.com_<http/> if you are planning to use it for authorization. |
| CLIENT_ID | 'xx' | The ID of your server OAuth application |
| CLIENT_SECRET | 'xx' | The Secret of your server OAuth application |
| OAUTH_CLIENT_ID | 'xx' | The ID of your server OAuth application |
| OAUTH_CLIENT_SECRET | 'xx' | The Secret of your server OAuth application |
| OAUTH_SECRET | 'random-secret-string' | Any private random string. This is a password you choose for local installation. |
| username1 | 'user1' | The gitlab instance username of a user of DTaaS |
| username2 | 'user2' | The gitlab instance username of a user of DTaaS |
| CLIENT_CONFIG | '/Users/username/DTaaS/deploy/config/client/env.js' | Full path to env.js file for client |

:clipboard: Important points to note:

1. The path examples given here are for Linux OS.
These paths can be Windows OS compatible paths as well.
1. The Server DNS can also be an IP address.
However, for proper working it is neccessary to use the
same convention (IP/DNS) in the `CLIENT_CONFIG` file as well.
However, for proper working it is neccessary to use the same
convention (IP/DNS) in the client configuration file
(`deploy/config/client/env.js`) as well.
17 changes: 11 additions & 6 deletions deploy/docker/LOCALHOST.SECURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,15 @@ Edit all the fields according to your specific case.
|:------------|:---------------|:---------------|
| DTAAS_DIR | '/home/Desktop/DTaaS' | Full path to the DTaaS directory. This is an absolute path with no trailing slash. |
| username1 | 'user1' | Your gitlab username |
| CLIENT_CONFIG | '/home/Desktop/DTaaS/deploy/config/client/env.local.js' | Full path to env.js file for client |

:clipboard: The path examples given here are for Linux OS.
These paths can be Windows OS compatible paths as well.
:clipboard: Important points to note:

1. The path examples given here are for Linux OS.
These paths can be Windows OS compatible paths as well.
1. The client configuration file is located at
`deploy/config/client/env.local.js`.
Edit the URLs in this file by replacing `http` with `https`.
Beyond this, it is not necessary to modify this file.

### Start DTaaS to Integrate Gitlab

Expand Down Expand Up @@ -184,14 +189,14 @@ included in the localhost installation scenario.
The commands to start and stop the appliation are:

```bash
docker compose -f compose.local.secure.yml --env-file .env.server up -d
docker compose -f compose.local.secure.yml --env-file .env.server down
docker compose -f compose.local.secure.yml --env-file .env.local up -d
docker compose -f compose.local.secure.yml --env-file .env.local down
```

To restart only a specific container, for example `client`

```bash
docker compose -f compose.server.secure.yml --env-file .env.server up -d --force-recreate client
docker compose -f compose.local.secure.yml --env-file .env.local up -d --force-recreate client
```

## References
Expand Down
9 changes: 6 additions & 3 deletions deploy/docker/LOCALHOST.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,13 @@ Edit all the fields according to your specific case.
|:------------|:---------------|:---------------|
| DTAAS_DIR | '/home/Desktop/DTaaS' | Full path to the DTaaS directory. This is an absolute path with no trailing slash. |
| username1 | 'user1' | Your gitlab username |
| CLIENT_CONFIG | '/home/Desktop/DTaaS/deploy/config/client/env.local.js' | Full path to env.js file for client |

:clipboard: The path examples given here are for Linux OS.
These paths can be Windows OS compatible paths as well.
:clipboard: Important points to note:

1. The path examples given here are for Linux OS.
These paths can be Windows OS compatible paths as well.
1. The client configuration file is located at `deploy/config/client/env.local.js`.
It is not necessary to modify this file.

### Create User Workspace

Expand Down
10 changes: 4 additions & 6 deletions deploy/docker/SERVER.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,7 @@ Description of file configuration can be found here. [.env file description](./D
### Website Client

The frontend React website requires configuration which is specified
via a filename provided in `CLIENT_CONFIG` variable of
`deploy/docker/.env.server` file.

The `CLIENT_CONFIG` file is in relative directory of
`deploy/config/client/env.js`.
in the client configuration file (`deploy/config/client/env.js`).

Further explanation on the client configuration is available in
[client config](../../docs/admin/client/config.md).
Expand Down Expand Up @@ -188,7 +184,6 @@ please change,
image: intocps/libms:latest
restart: unless-stopped
volumes:
- ${DTAAS_DIR}/deploy/config/lib.docker:/dtaas/libms/.env
- ${DTAAS_DIR}/files/common:/dtaas/libms/files
```

Expand Down Expand Up @@ -300,7 +295,10 @@ To add a new user to your DTaaS instance, follow these steps:
Run the appropritate command for a server/local installation:

```bash
# if the server is installed with http option, execute
docker compose -f compose.server.yml --env-file .env.server up -d --force-recreate traefik-forward-auth
# if the server is installed with https option, execute
docker compose -f compose.server.secure.yml --env-file .env.server up -d --force-recreate traefik-forward-auth
```

The new users are now added to the DTaaS instance, with authorization enabled.
Expand Down
2 changes: 1 addition & 1 deletion deploy/docker/compose.local.secure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ services:
image: intocps/dtaas-web:latest
restart: unless-stopped
volumes:
- "${CLIENT_CONFIG}:/dtaas/client/build/env.js"
- "${DTAAS_DIR}/deploy/config/client/env.local.js:/dtaas/client/build/env.js"
labels:
- "traefik.enable=true"
- "traefik.http.routers.client.rule=PathPrefix(`/`)"
Expand Down
3 changes: 2 additions & 1 deletion deploy/docker/compose.local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ services:
image: traefik:v2.10
restart: unless-stopped
command:
- "--log.level=DEBUG"
- "--api.insecure=true"
- "--providers.docker=true"
- "--entryPoints.web.address=:80"
Expand All @@ -20,7 +21,7 @@ services:
image: intocps/dtaas-web:latest
restart: unless-stopped
volumes:
- ${CLIENT_CONFIG}:/dtaas/client/build/env.js
- ${DTAAS_DIR}/deploy/config/client/env.local.js:/dtaas/client/build/env.js
labels:
- "traefik.enable=true"
- "traefik.http.routers.client.entryPoints=web"
Expand Down
7 changes: 3 additions & 4 deletions deploy/docker/compose.server.secure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ services:
image: intocps/dtaas-web:latest
restart: unless-stopped
volumes:
- "${CLIENT_CONFIG}:/dtaas/client/build/env.js"
- "${DTAAS_DIR}/deploy/config/client/env.js:/dtaas/client/build/env.js"
labels:
- "traefik.enable=true"
- "traefik.http.routers.client.rule=Host(`${SERVER_DNS}`)&&PathPrefix(`/`)"
Expand All @@ -42,7 +42,6 @@ services:
image: intocps/libms:latest
restart: unless-stopped
volumes:
- ${DTAAS_DIR}/deploy/config/lib.docker:/dtaas/libms/.env
- ${DTAAS_DIR}/files:/dtaas/libms/files
labels:
- "traefik.enable=true"
Expand Down Expand Up @@ -102,8 +101,8 @@ services:
- PROVIDERS_GENERIC_OAUTH_AUTH_URL=${OAUTH_URL}/oauth/authorize
- PROVIDERS_GENERIC_OAUTH_TOKEN_URL=${OAUTH_URL}/oauth/token
- PROVIDERS_GENERIC_OAUTH_USER_URL=${OAUTH_URL}/api/v4/user
- PROVIDERS_GENERIC_OAUTH_CLIENT_ID=${CLIENT_ID}
- PROVIDERS_GENERIC_OAUTH_CLIENT_SECRET=${CLIENT_SECRET}
- PROVIDERS_GENERIC_OAUTH_CLIENT_ID=${OAUTH_CLIENT_ID}
- PROVIDERS_GENERIC_OAUTH_CLIENT_SECRET=${OAUTH_CLIENT_SECRET}
- PROVIDERS_GENERIC_OAUTH_SCOPE=read_user
- SECRET= "${OAUTH_SECRET}"
- CONFIG=/conf
Expand Down
11 changes: 6 additions & 5 deletions deploy/docker/compose.server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ services:
traefik:
image: traefik:v2.10
restart: unless-stopped
command:
command:
- "--log.level=DEBUG"
- "--api.insecure=true"
- "--providers.docker=true"
- "--entryPoints.web.address=:80"
Expand All @@ -20,7 +21,6 @@ services:
image: intocps/libms:latest
restart: unless-stopped
volumes:
- ${DTAAS_DIR}/deploy/config/lib.docker:/dtaas/libms/.env
- ${DTAAS_DIR}/files:/dtaas/libms/files
labels:
- "traefik.enable=true"
Expand All @@ -35,7 +35,7 @@ services:
image: intocps/dtaas-web:latest
restart: unless-stopped
volumes:
- ${CLIENT_CONFIG}:/dtaas/client/build/env.js
- ${DTAAS_DIR}/deploy/config/client/env.js:/dtaas/client/build/env.js
labels:
- "traefik.enable=true"
- "traefik.http.routers.client.entryPoints=web"
Expand Down Expand Up @@ -87,12 +87,13 @@ services:
volumes:
- ${DTAAS_DIR}/deploy/docker/conf.server:/conf
environment:
- LOG_LEVEL=trace
- DEFAULT_PROVIDER=generic-oauth
- PROVIDERS_GENERIC_OAUTH_AUTH_URL=${OAUTH_URL}/oauth/authorize
- PROVIDERS_GENERIC_OAUTH_TOKEN_URL=${OAUTH_URL}/oauth/token
- PROVIDERS_GENERIC_OAUTH_USER_URL=${OAUTH_URL}/api/v4/user
- PROVIDERS_GENERIC_OAUTH_CLIENT_ID=${CLIENT_ID}
- PROVIDERS_GENERIC_OAUTH_CLIENT_SECRET=${CLIENT_SECRET}
- PROVIDERS_GENERIC_OAUTH_CLIENT_ID=${OAUTH_CLIENT_ID}
- PROVIDERS_GENERIC_OAUTH_CLIENT_SECRET=${OAUTH_CLIENT_SECRET}
- PROVIDERS_GENERIC_OAUTH_SCOPE=read_user
- SECRET= ${OAUTH_SECRET}
# INSECURE_COOKIE is required if not using a https entrypoint
Expand Down
15 changes: 14 additions & 1 deletion deploy/services/gitlab/INTEGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,20 +80,33 @@ the **client website** service.

```sh
cd deploy/docker
docker compose -f compose.server.yml --env-file .env.server up -d --force-recreate client
docker compose -f compose.local.yml --env-file .env.local up -d --force-recreate client
```

### Production Server Installation

The updated OAuth application configuration needs to be loaded into
the **client website** and the **forward-auth** services.

The production server can be installed with either **http**
or **https** option.
If it is installed with **http** option, run the following commands.

```sh
cd deploy/docker
docker compose -f compose.server.yml --env-file .env.server up -d --force-recreate client
docker compose -f compose.server.yml --env-file .env.server up -d --force-recreate traefik-forward-auth
```

If the production server is installed with **https** option,
run the following commands.

```sh
cd deploy/docker
docker compose -f compose.server.secure.yml --env-file .env.server up -d --force-recreate client
docker compose -f compose.server.secure.yml --env-file .env.server up -d --force-recreate traefik-forward-auth
```

## Post Setup Usage

If you have set up everything correctly:
Expand Down
9 changes: 8 additions & 1 deletion deploy/services/gitlab/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ config file (`.env.server`).

If the DTaaS application and gitlab are to be hosted at <https://localhost>, then
the client config file (`deploy/config/client/env.local.js`)
eeds to use the <https://localhost/gitlab> as `REACT_APP_AUTH_AUTHORITY`.
needs to use the <https://localhost/gitlab> as `REACT_APP_AUTH_AUTHORITY`.
If the application and the integrated gitlab are to be hosted at
`https://localhost/gitlab`, then `.env.server` need not be modified.

Expand Down Expand Up @@ -104,6 +104,13 @@ After running the container, your local GitLab instance will be available at
`external_url` specified in _gitlab.rb_, i.e., either at
<https://foo.com/gitlab> or at <https://localhost/gitlab>.

### Create Users

The newly installed gitlab only contains `root` user. More users need
to be created for use with DTaaS. Please see the
[Gitlab docs](https://docs.gitlab.com/ee/user/profile/account/create_accounts.html)
for further help.

## Pending Tasks

This README helps with installation of Gitlab along side DTaaS application.
Expand Down
5 changes: 3 additions & 2 deletions docker/.env
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
DTAAS_DIR='/Users/<Username>/DTaaS'
SERVER_DNS='localhost'
OAUTH_URL='https://gitlab.com'
CLIENT_ID='xx'
CLIENT_SECRET='xx'
OAUTH_CLIENT_ID='xx'
OAUTH_CLIENT_SECRET='xx'
OAUTH_SECRET='random-secret-string'
OAUTH_CONF_FILEPATH='/Users/<Username>/DTaaS/docker/conf.dev'
username1='user1'
username2='user2'
LIB_CONFIG='/Users/<Username>/DTaaS/servers/lib/config/.env.default'
8 changes: 5 additions & 3 deletions docker/compose.dev.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3'
services:
traefik:
image: traefik:v2.10
Expand All @@ -9,6 +8,7 @@ services:
- "--entryPoints.web.address=:80"
- "--entrypoints.web.forwardedHeaders.insecure=true"
- "--entrypoints.web.proxyProtocol.insecure=true"
- "--log.level=DEBUG"
ports:
- "80:80"
volumes:
Expand Down Expand Up @@ -40,6 +40,7 @@ services:
restart: unless-stopped
volumes:
- ${DTAAS_DIR}/files:/dtaas/libms/files
- ${LIB_CONFIG}:/dtaas/libms/config/.env.default
labels:
- "traefik.enable=true"
- "traefik.http.routers.libms.entryPoints=web"
Expand Down Expand Up @@ -95,13 +96,14 @@ services:
- PROVIDERS_GENERIC_OAUTH_AUTH_URL=${OAUTH_URL}/oauth/authorize
- PROVIDERS_GENERIC_OAUTH_TOKEN_URL=${OAUTH_URL}/oauth/token
- PROVIDERS_GENERIC_OAUTH_USER_URL=${OAUTH_URL}/api/v4/user
- PROVIDERS_GENERIC_OAUTH_CLIENT_ID=${CLIENT_ID}
- PROVIDERS_GENERIC_OAUTH_CLIENT_SECRET=${CLIENT_SECRET}
- PROVIDERS_GENERIC_OAUTH_CLIENT_ID=${OAUTH_CLIENT_ID}
- PROVIDERS_GENERIC_OAUTH_CLIENT_SECRET=${OAUTH_CLIENT_SECRET}
- PROVIDERS_GENERIC_OAUTH_SCOPE=read_user
- SECRET= ${OAUTH_SECRET}
# INSECURE_COOKIE is required if not using a https entrypoint
- INSECURE_COOKIE=true
- CONFIG=/conf
- LOG_LEVEL=debug
labels:
- "traefik.enable=true"

Expand Down
2 changes: 1 addition & 1 deletion docker/libms.npm.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ WORKDIR /dtaas/libms
ARG VERSION="latest"
RUN npm i -g @into-cps-association/libms@${VERSION}

COPY ./deploy/config/lib.docker .env
COPY ./deploy/config/lib.env .env
COPY ./servers/lib/config/http.json .

# Define the command to run your app
Expand Down
Loading
Loading