Skip to content

Commit d60245f

Browse files
committed
Docker-compose and README for Release 0.1.2
1 parent 2f60b2d commit d60245f

File tree

3 files changed

+109
-15
lines changed

3 files changed

+109
-15
lines changed

.env.example

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ CONTROL_PANEL_PORT=3000
1616
# -----------------
1717
DELAY_MINUTES=10
1818
DATASET_LOAD_TYPE=csv # github or csv
19-
GITHUB_ORG=percona
20-
GITHUB_TOKEN= # The parameter is required for DATASET_LOAD_TYPE=github
2119
DATASET_DEMO_CSV_PULLS=data/csv/pulls.csv # https://github.com/dbazhenov/github-stat/raw/refs/heads/main/data/csv/pulls.csv.zip
2220
DATASET_DEMO_CSV_REPOS=data/csv/repositories.csv # https://github.com/dbazhenov/github-stat/raw/refs/heads/main/data/csv/repositories.csv.zip
21+
GITHUB_ORG=percona
22+
GITHUB_TOKEN= # The parameter is required for DATASET_LOAD_TYPE=github . Your personalized GitHub Token. You can get a Token in your GitHub profile settings, it's free, instructions at https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens
2323
DEBUG=false
2424

2525
# -----------------

README.md

+38-10
Original file line numberDiff line numberDiff line change
@@ -35,29 +35,55 @@ How it works technically:
3535

3636
1. Clone the project repository
3737

38-
`git clone [email protected]:dbazhenov/github-stat.git`
38+
```
39+
git clone [email protected]:dbazhenov/github-stat.git
40+
```
3941

40-
2. Run the environment, this will run the three databases locally. Check docker-compose.yaml and add the correct versions or configurations if necessary.
42+
2. Copy or rename `.env.example` to `.env`. Set the parameters in the .env file.
4143

42-
`docker compose up -d`
44+
3. Run the environment.
45+
46+
```
47+
docker compose up -d
48+
```
49+
50+
docker-compose launches three databases (MySQL, Postgres, MongoDB) and the Demo application.
51+
52+
4. Launch the application at `localhost:3000` in your browser.
53+
54+
5. Open the Settings tab and create connections to the databases you want to load. Connection options are available in docker-compose.yaml
55+
56+
- MySQL: `root:password@tcp(mysql:3306)/dataset`
4357

44-
3. Copy or rename `.env.example` to `.env`. Set the parameters in the .env file
58+
- Postgres: `user=postgres password='password' dbname=dataset host=postgres port=5432 sslmode=disable`
4559

46-
- `GITHUB_ORG` - GitHub organization whose repositories will be investigated. For example, percona contains 193 repositories.
60+
- MongoDB: `mongodb://databaseAdmin:password@mongodb:27017/`
4761

48-
- `GITHUB_TOKEN` - Your personalized GitHub Token. If left empty, the limit is 60 API requests per hour, which is enough for a test run. If you add token then 5000 requests per hour. You can get a Token in your GitHub profile settings, it's free, instructions at [the link](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens)
62+
6. On the Settings tab, for each database, load the test dataset by clicking the “Create schema” and “Import Dataset” buttons. By default a small dataset from a CSV file (26 repos and 4600 PRs) will be imported, to import the full dataset you need to add a GitHub Token to the .env file and change the import type to github.
4963

50-
4. Run the Control Panel script
64+
7. Turn on the Enable Load setting and open the Load Generator Control Panel tab.
65+
66+
8. Change load adjustments and check the results in PMM at `localhost:8081`
67+
68+
## Development environment
69+
70+
0. Run the environment.
71+
72+
```
73+
docker compose -f docker-compose-dev.yaml up -d
74+
```
75+
76+
1. Run the Control Panel script
5177

5278
`go run cmd/web/main.go`
5379

5480
Launch the control panel in your browser (localhost:3000).
5581

56-
5. Run the Dataset loader script
82+
2. Run the Dataset loader script
5783

5884
`go run cmd/dataset/main.go`
5985

60-
6. Run the Load Generator script
86+
3. Run the Load Generator script
6187

6288
`go run cmd/load/main.go`
6389

@@ -85,7 +111,9 @@ Create databases if you don't have any.
85111

86112
3. Install the PMM, e.g. with HELM
87113

88-
`helm repo add percona https://percona.github.io/percona-helm-charts/`
114+
```
115+
helm repo add percona https://percona.github.io/percona-helm-charts/
116+
```
89117

90118
```
91119
helm install pmm -n demo \

docker-compose.yaml

+69-3
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ services:
1515
retries: 5
1616

1717
demo_app_dataset:
18-
image: dbazhenov/demo_app_dataset:0.1.1
18+
image: dbazhenov/demo_app_dataset:0.1.2
1919
depends_on:
2020
valkey:
2121
condition: service_healthy
2222
env_file:
2323
- .env
2424

2525
demo_app_web:
26-
image: dbazhenov/demo_app_web:0.1.1
26+
image: dbazhenov/demo_app_web:0.1.2
2727
depends_on:
2828
valkey:
2929
condition: service_healthy
@@ -33,7 +33,7 @@ services:
3333
- "${CONTROL_PANEL_PORT}:${CONTROL_PANEL_PORT}"
3434

3535
demo_app_load:
36-
image: dbazhenov/demo_app_load:0.1.1
36+
image: dbazhenov/demo_app_load:0.1.2
3737
depends_on:
3838
valkey:
3939
condition: service_healthy
@@ -84,6 +84,72 @@ services:
8484
--performance-schema --innodb_monitor_enable=all
8585
--slow_query_log --slow_query_log_file=/mysql/slowlogs/slow.log --long_query_time=0
8686
87+
pmm-server:
88+
image: percona/pmm-server:2
89+
platform: "linux/amd64"
90+
container_name: pmm-server
91+
restart: always
92+
ports:
93+
- 8081:80
94+
- 443:443
95+
volumes:
96+
- pmm-data:/srv
97+
environment:
98+
- DISABLE_TELEMETRY=0
99+
100+
pmm-client-postgres:
101+
image: percona/pmm-client:2
102+
platform: "linux/amd64"
103+
container_name: pmm-client-postgres
104+
depends_on:
105+
pmm-server:
106+
condition: service_healthy
107+
environment:
108+
PMM_AGENT_SERVER_ADDRESS: pmm-server
109+
PMM_AGENT_SERVER_USERNAME: admin
110+
PMM_AGENT_SERVER_PASSWORD: admin
111+
PMM_AGENT_SERVER_INSECURE_TLS: 1
112+
PMM_AGENT_CONFIG_FILE: config/pmm-agent.yaml
113+
PMM_AGENT_SETUP: 1
114+
PMM_AGENT_SETUP_FORCE: 1
115+
PMM_AGENT_PRERUN_SCRIPT: "pmm-admin status --wait=10s; pmm-admin add postgresql --username=postgres --password=password --host=postgres --port=5432 --query-source=pgstatmonitor"
116+
117+
pmm-client-mysql:
118+
image: percona/pmm-client:2
119+
platform: "linux/amd64"
120+
container_name: pmm-client-mysql
121+
depends_on:
122+
mysql:
123+
condition: service_healthy
124+
pmm-server:
125+
condition: service_healthy
126+
environment:
127+
PMM_AGENT_SERVER_ADDRESS: pmm-server
128+
PMM_AGENT_SERVER_USERNAME: admin
129+
PMM_AGENT_SERVER_PASSWORD: admin
130+
PMM_AGENT_SERVER_INSECURE_TLS: 1
131+
PMM_AGENT_CONFIG_FILE: config/pmm-agent.yaml
132+
PMM_AGENT_SETUP: 1
133+
PMM_AGENT_SETUP_FORCE: 1
134+
PMM_AGENT_PRERUN_SCRIPT: "pmm-admin status --wait=10s; pmm-admin add mysql --query-source=perfschema --username=root --password=password --host=mysql --port=3306"
135+
136+
pmm-client-mongodb:
137+
image: percona/pmm-client:2
138+
platform: "linux/amd64"
139+
container_name: pmm-client-mongodb
140+
depends_on:
141+
pmm-server:
142+
condition: service_healthy
143+
environment:
144+
PMM_AGENT_SERVER_ADDRESS: pmm-server
145+
PMM_AGENT_SERVER_USERNAME: admin
146+
PMM_AGENT_SERVER_PASSWORD: admin
147+
PMM_AGENT_SERVER_INSECURE_TLS: 1
148+
PMM_AGENT_CONFIG_FILE: config/pmm-agent.yaml
149+
PMM_AGENT_SETUP: 1
150+
PMM_AGENT_SETUP_FORCE: 1
151+
PMM_AGENT_PRERUN_SCRIPT: "pmm-admin status --wait=10s; pmm-admin add mongodb --username=databaseAdmin --password=password --host=mongodb --port=27017 --query-source=profiler"
152+
87153
volumes:
88154
mongodata:
89155
pgdata:

0 commit comments

Comments
 (0)