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

Ops/#166 ops restructure and enhance readme #167

Merged
merged 6 commits into from
Apr 8, 2024
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
74 changes: 0 additions & 74 deletions .env

This file was deleted.

4 changes: 4 additions & 0 deletions .env.dist
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Used to set a default docker compose profile when no profile is specified

COMPOSE_PROFILE=dev

#############
# Lake core #
#############
Expand Down
2 changes: 1 addition & 1 deletion .github/SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ At OpenDORA, we take security seriously. If you believe you have found a securit

1. **Do not disclose the issue publicly.** Please do not post the issue on GitHub, forums, or any other public platform until we have had a chance to address it.

2. **Submit a report.** Send a detailed email to [jeroen.van.der.meulen@devoteam.com](mailto:jeroen.van.der.meulen@devoteam.com) with the following information:
2. **Submit a report.** Send a detailed email to [opendora@devoteam.com](mailto:opendora@devoteam.com) with the following information:
- Your name and affiliation (if any).
- A detailed description of the vulnerability, including steps to reproduce it.
- Attach any necessary PoC (Proof of Concept) files or code snippets.
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -189,5 +189,4 @@
**/cover.*

# Dev environment
dev-environment/backstage/app/*
dev-environment/.env
.env
84 changes: 40 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,6 @@ This is a basic Spring application used to provide a mock for the DORA API metri

[More details](dora-api-mock/README.md)

### dev-environment

Contains an initial docker compose with the services needed to test the metrics in the dev's local environment.

[More details](dev-environment/README.md)

## Setup

Goto [Plugin setup documentation](backstage-plugin/plugins/open-dora/README.md) and follow the steps to install and setup the plugin in your Backstage environment.
Expand All @@ -75,69 +69,71 @@ We also accept pull requests for the code and documentation. Kindly use the disc

## Configuring the Environment

### Apache DevLake
### Running the Dev Environment

Before running the Dev Environment, some minor configurations needs to be performed. This development environment
already provides default values for the majority of them but at least an encryption key (`DEVLAKE_ENCRYPTION_SECRET`) needs to be provided.
OpenDORA contains an initial Docker Compose with the services needed to test the metrics in the dev's local environment.

To generate one, run the below:
- Make sure you have copied the .env.dist to .env. The .env is in .gitignore because it contains secrets and custom configuration

```shell
openssl rand -base64 2000 | tr -dc 'A-Z' | fold -w 128 | head -n 1
cp .env.dist .env
```

It can be configured globally, and it will be picked up by the docker compose, or it can be added to the `.env` file.
- Run the Docker environment with Docker Compose v2.*

Some environment variables can be customised. The list below has all of them as well as their default values:
```shell
docker compose --profile dev up -d
```

| Variable Name | Default Value |
|--------------------------------|------------------------------------------------------------------------|
| `DEVLAKE_ENCRYPTION_SECRET` | |
| `DEVLAKE_MYSQL_USER` | `merico` |
| `DEVLAKE_MYSQL_PASSWORD` | `merico` |
| `DEVLAKE_MYSQL_CONNECTION_URL` | `mysql://merico:merico@mysql:3306/lake?charset=utf8mb4&parseTime=True` |
| `DEVLAKE_ADMIN_USER` | `devlake` |
| `DEVLAKE_ADMIN_PASSWORD` | `merico` |
It may take some time for all the containers to be available. Healthchecks to monitor this are not available right now.

For more information on how to configure Apache DevLake with docker compose, check their official reference: [Launch DevLake with Docker Compose](https://devlake.apache.org/docs/v0.18/GettingStarted/DockerComposeSetup).
- When using the development profile. There won't be a Devlake available to manage. Instead, It will use a mock-api to create responses. If you want to test Opendora with a Devlake instance, use the `test` profile.

Also, make sure to check [DevLake's Configuration documentation](https://devlake.apache.org/docs/v0.18/Configuration) to correctly configure
the connection, data scope, etc. For the DORA metrics, the most important part is the [transformations](https://devlake.apache.org/docs/v0.18/Configuration/Tutorial#step-3---add-transformations-optional),
so make sure to configure it accordingly (job names) for the metrics to be properly calculated.
```shell
docker compose --profile test up -d
```

## Running the Dev Environment
- A Grafana container is also available in case you want to access the default dashboards delivered with Apache DevLake.

- Docker Compose v1.*
To start it, run the below:

```shell
docker-compose up -d
docker compose --profile dashboard up -d
```

- Docker Compose v2.*
After that, the services will be accessible on the below:

```shell
docker compose up -d
```
- DevLake Configuration UI: http://localhost:4000
- Grafana Dashboards (if started with profile `dashboard`): http://localhost:3002 (initial credential: `admin`/`admin`)

A Grafana container is also available in case you want to access the default dashboards delivered with Apache DevLake.
For more information about Docker Compose, check their official documentation: [Docker Compose](https://docs.docker.com/compose/)

To start it, run the below:
### Apache DevLake

- Docker Compose v1.*
Before running the Dev Environment, some minor configurations needs to be performed. This development environment
already provides default values for the majority of them but at least an encryption key (`DEVLAKE_ENCRYPTION_SECRET`) needs to be provided.

To generate one, run the below:

```shell
docker-compose --profile dashboard up -d
openssl rand -base64 2000 | tr -dc 'A-Z' | fold -w 128 | head -n 1
```

- Docker Compose v2.*
It can be configured globally, and it will be picked up by the docker compose, or it can be added to the `.env` file.

```shell
docker compose --profile dashboard up -d
```
Some environment variables can be customised. The list below has all of them as well as their default values:

After that, the services will be accessible on the below:
| Variable Name | Default Value |
|--------------------------------|------------------------------------------------------------------------|
| `DEVLAKE_ENCRYPTION_SECRET` | |
| `DEVLAKE_MYSQL_USER` | `merico` |
| `DEVLAKE_MYSQL_PASSWORD` | `merico` |
| `DEVLAKE_MYSQL_CONNECTION_URL` | `mysql://merico:merico@mysql:3306/lake?charset=utf8mb4&parseTime=True` |
| `DEVLAKE_ADMIN_USER` | `devlake` |
| `DEVLAKE_ADMIN_PASSWORD` | `merico` |

- DevLake Configuration UI: http://localhost:4000
- Grafana Dashboards (if started with profile `dashboard`): http://localhost:3000 (initial credential: `admin`/`admin`)
For more information on how to configure Apache DevLake with docker compose, check their official reference: [Launch DevLake with Docker Compose](https://devlake.apache.org/docs/v0.18/GettingStarted/DockerComposeSetup).

For more information about Docker Compose, check their official documentation: [Docker Compose](https://docs.docker.com/compose/)
Also, make sure to check [DevLake's Configuration documentation](https://devlake.apache.org/docs/v0.18/Configuration) to correctly configure
the connection, data scope, etc. For the DORA metrics, the most important part is the [transformations](https://devlake.apache.org/docs/v0.18/Configuration/Tutorial#step-3---add-transformations-optional),
so make sure to configure it accordingly (job names) for the metrics to be properly calculated.
4 changes: 3 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "3"
services:

opendora:
Expand Down Expand Up @@ -73,6 +72,7 @@ services:
image: mysql:8
profiles:
- test
- dashboard
volumes:
- mysql-storage:/var/lib/mysql
restart: unless-stopped
Expand Down Expand Up @@ -109,6 +109,7 @@ services:
devlake:
profiles:
- test
- dashboard
image: devlake.docker.scarf.sh/apache/devlake:v0.18.0
ports:
- "8080:8080"
Expand All @@ -125,6 +126,7 @@ services:
config-ui:
profiles:
- test
- dashboard
image: devlake.docker.scarf.sh/apache/devlake-config-ui:v0.18.0
ports:
- "4000:4000"
Expand Down