Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
8 changes: 8 additions & 0 deletions .reuse/dep5
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: compas-deployment
Upstream-Contact: Sander Jansen <sander.jansen@alliander.com>
Source: https://github.com/com-pas/compas-deployment

Files: images/*
Copyright: 2022 Alliander N.V.
License: Apache-2.0
39 changes: 39 additions & 0 deletions DEPLOYMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!--
SPDX-FileCopyrightText: 2021 Alliander N.V.

SPDX-License-Identifier: Apache-2.0
-->

# Deployment View

Below is a global overview of the expected deployment of the CoMPAS Environment.

![Deployment View](images/deployment-view.png)

The engineer uses an internet browser to connect to the web application. The internet browser also sends
REST Calls to the different back-end services. All request are going to the same base URL, for instance
http://localhost/ in the Docker Compose variant.

The internet browser will first go through a reverse proxy that will first validate if the engineer is logged in.
If not an SSO Provider is used log the engineer in. This SSO Provider also delivers a JSON Web Token (JWT) to be
used by the reverse proxy.

Depending on the context root the reverse proxy send the request further to the container. The JWT is added as
authorization header to the requests to the containers. The JWT also contains the roles the engineer has.

The container validates the JWT using a verification key. This is often an URL to the SSO Provider that returns
a JSON Web Key (Set) (JWK/JWKS). Also it uses the configured Path to retrieve the Roles/Groups.

## Local Deployment

- **Docker Compose**: Container Environment
- **KeyCloak**: For the local deployment found in the GIT Repository we are using KeyCloak as an SSO Provider.
All the users and roles are configured in KeyCloak.
- **OpenResty**: As reverse proxy we are using a customized docker image of OpenResty. OpenResty verifies if the user
is logged in and injects the JWT it retrieved from KeyCloak to the request going to the back-end services.

## Amazon Cloud (AWS)

- **[Amazon EKS](https://aws.amazon.com/eks/)**: Container Environment?
- **[Amazon Cognito](https://aws.amazon.com/cognito/)**: SSO Provider?
- **[AWS Elastic Load Balancing](https://aws.amazon.com/elasticloadbalancing/)**: Reverse proxy?
42 changes: 42 additions & 0 deletions INTEGRATION_TESTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<!--
SPDX-FileCopyrightText: 2021 Alliander N.V.

SPDX-License-Identifier: Apache-2.0
-->

# Integration Testing

To improve the quality of the application more beside the testing in the separate repositories we also created some integration
tests to test all components together. The integration tests are executed against the Docker Compose version in this project.

We are using the [Robot Framework](https://robotframework.org/) to execute the integration tests. For the Robot Framework we are
using the [Browser Library](https://github.com/MarketSquare/robotframework-browser) to do the Web testing. this Library is based
on [Playwright](https://playwright.dev/). All Integration Tests and data can be found in the directory 'integration-testing'.
Output can be found in the directory 'target' is below commands and Github Actions are used.

Some useful links:
- [Robot Framework](https://robotframework.org/)
- [Robot Framework User Guid](https://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html)
- [Robot Framework BuildIn Keywords](https://robotframework.org/robotframework/latest/libraries/BuiltIn.html)
- [Browser Library](https://github.com/MarketSquare/robotframework-browser)
- [Browser Library Keywords](https://marketsquare.github.io/robotframework-browser/Browser.html)
- [Playwright](https://playwright.dev/)
- [Playwright Documentation](https://playwright.dev/docs/intro/)

Some useful commands to execute the Robot Framework locally.
Please follow the instructions of [Robot Framework](https://robotframework.org/) to install the Framework.
And also follow the instruction of [Browser Library](https://github.com/MarketSquare/robotframework-browser) to install this needed library.

```
# Prefer to remove the target directory before starting.
rm -r target

# Normal run of all the test suites (with firefox, headless).
robot -d target/firefox integration-testing/

# Run of all the test suites (with firefox in presenter mode to better follow what happens).
robot -d target/firefox -v browser:firefox -v enable_presenter_mode:true -v headless:false integration-testing/

# Run of all the test suites (with chromium, headless), looks like chromium now only works headless. It crashs otherwise.
robot -d target/chromium -v browser:chromium integration-testing/
```
41 changes: 3 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ SPDX-License-Identifier: Apache-2.0
[![Slack](https://raw.githubusercontent.com/com-pas/compas-architecture/master/public/LFEnergy-slack.svg)](http://lfenergy.slack.com/)

# CoMPAS Deployment Repository
Containing tools / configurations for deploying CoMPAS services.
Containing tools / configurations for deploying CoMPAS services. For a deployment overview see [here](DEPLOYMENT.md)

More about the integration tests being run against these Docker Compose environment can be found [here](INTEGRATION_TESTING.md)

## Docker Compose (BaseX)
There is a pre configured [Docker Compose](compas/docker-compose-basex.yml) file, which starts all the given CoMPAS services.
Expand Down Expand Up @@ -104,40 +106,3 @@ These roles are assigned to certain users (see below).
- **A SCD Reader**: A user with the role 'Read' only on the SCD Type.
- Username: scd-reader
- Password: reader

## Integration Testing

To improve the quality of the application more beside the testing in the separate repositories we also created some integration
tests to test all components together. The integration tests are executed against the Docker Compose version in this project.

We are using the [Robot Framework](https://robotframework.org/) to execute the integration tests. For the Robot Framework we are
using the [Browser Library](https://github.com/MarketSquare/robotframework-browser) to do the Web testing. this Library is based
on [Playwright](https://playwright.dev/). All Integration Tests and data can be found in the directory 'integration-testing'.
Output can be found in the directory 'target' is below commands and Github Actions are used.

Some useful links:
- [Robot Framework](https://robotframework.org/)
- [Robot Framework User Guid](https://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html)
- [Robot Framework BuildIn Keywords](https://robotframework.org/robotframework/latest/libraries/BuiltIn.html)
- [Browser Library](https://github.com/MarketSquare/robotframework-browser)
- [Browser Library Keywords](https://marketsquare.github.io/robotframework-browser/Browser.html)
- [Playwright](https://playwright.dev/)
- [Playwright Documentation](https://playwright.dev/docs/intro/)

Some useful commands to execute the Robot Framework locally.
Please follow the instructions of [Robot Framework](https://robotframework.org/) to install the Framework.
And also follow the instruction of [Browser Library](https://github.com/MarketSquare/robotframework-browser) to install this needed library.

```
# Prefer to remove the target directory before starting.
rm -r target

# Normal run of all the test suites (with firefox, headless).
robot -d target/firefox integration-testing/

# Run of all the test suites (with firefox in presenter mode to better follow what happens).
robot -d target/firefox -v browser:firefox -v enable_presenter_mode:true -v headless:false integration-testing/

# Run of all the test suites (with chromium, headless), looks like chromium now only works headless. It crashs otherwise.
robot -d target/chromium -v browser:chromium integration-testing/
```
1 change: 1 addition & 0 deletions images/deployment-view.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<mxfile host="app.diagrams.net" modified="2022-09-08T05:34:50.511Z" agent="5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36" etag="kRcnI-EVh7d9fnGrXaFf" version="20.2.8" type="device"><diagram name="Page-1" id="c37626ed-c26b-45fb-9056-f9ebc6bb27b6">3Vtfc5s4EP80eUwGxD/7MXWcXtrmktRt2j7dyCBjtTLygOzE9+lPAmGDkLFjg4lvMhOjZSXE7v52VytxYQ1mrx9jOJ/e0wCRC2AErxfWzQUApgcc/iMoq4zS7xkZIYxxIJk2hBH+F0lizrbAAUpKjIxSwvC8TPRpFCGflWgwjulLmW1CSfmpcxiiCmHkQ1Kl/sABm0qqaRibG38hHE7lo3uOvDGG/p8wpotIPi+iEcruzGA+jGRNpjCgLwWSNbywBjGlLLuavQ4QEWLNJZb1u91ydz3lGEVsrw6+B11vPOlNAgtYxuSyB7IhlpAspBxu0JzQ1UyMmM2ZrXIRvUwxQ6M59EX7hZvBhfVhymaEt0x+mcoAiUcZvLV+V9Hw6Qz7+Q0W0z9rGYuOExqxWzjDRJjOM4oDGEFJlnZi2qKNCRlQQuN0NtbEEX/rAfM7qfhlZzl18Ywlihnm2r4mOIw4jVEx+6oApUwFO3otkKRAPyI6QyxecRZ5F/SyHtLsgSNx8FIwIgNIOU8LBuRY0iqgtNxwPfZGhfxCalGv0afbeTANjdvpx+A2dJafvi/Dp8uqUgdcGhBHKObkYbTEMY0yDRviScD4vBijOEKMA/AslR6gCVwQdkq9O2W920ZV770c90W1r53BMWofWubdiJmuwciPm+Hq2+/r4OnSrOgOBdzFySaN2ZSGNIJkuKEq6tvwfKFCTqkEfyPGVlIlcMFoWf/oFbOfovuV48jmr7TZz5s3r3L0tLEqNB5RjPmro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pDZIiXveqSU3UgoAyUuZjKQG/OypV0Ln/O1qxc5e/tcgWgjr8lV1AtXt5Fv5EvBGGILPvT6OFv/vMDjfn/bxy5UYonDidg+DEKuNlgSFLuKBBWQYnmaG3uJyLKhAkmmekCo1N30VPOM3u688ya9HxNbN5fdJKgN+Mvdq7B82Jh247FVXFn7edYGoOUV4HU9yQ9j05oKICCBYQWSbY1IDC2Y5ddAc8OwGw+0njIzuuttRz/eeC9MEtrLFdG3dnyBtDlKfAyLc2x8ZOiC3SS+Z6+YplXIneXLEHTiDzO+/UrwPkAE/TzIv9245EmLIzR6CmvAo1hUs1JG6n+7Lefc3ApyNGccT1tKQh0Ur4/l9S0vCgzD01NbQvUD7QlNW0qFIHqQm/Eww4Rh+C+fxUoSo+XQN9HiYhMY5rmdVmydz2fE+zD9Jh4nt19HY6+iYCF4iX2d+d5TYaqkum0uRPeK29q6uKWaWug2sQqUruV00nNriRu0XiETHy3k1KAYTeVKmrfuJ1tmCo8lU1VT/1OsblMse41C+iUm9Jo28ILhhBHiXiFZxTjyQaen1H1QOu7XHRZbrnm6fQ1X0K1tuqqO1VdUMPDHEWjwU21Dvb+95w8tabc4kEB3tx80Z2BYvPFvDX8Dw==</diagram></mxfile>
Binary file added images/deployment-view.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.