Skip to content

Commit 6bda0be

Browse files
authored
Merge pull request #9 from HEET-Group/devDocker-addingGrafana
Dev docker adding grafana
2 parents 1561013 + 7d7e15e commit 6bda0be

File tree

6 files changed

+1792
-9
lines changed

6 files changed

+1792
-9
lines changed

examples/docker/README.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
# Chronos Dockerized Microservices Example
22

33
This sample microservices architecture allows developers to explore the functionality of Chronos but with one docker compose command. This consists of four microservices, which are contained within the directories:
4+
45
- books
56
- customers
67
- frontend
78
- orders
89

910
Each microservice has its own server, which receives requests from both the client and from other microservices.
11+
1012
- _books_, _customers_, and _orders_ also have their own databases, which they can query to respond to those requests.
1113

1214
The frontend has a reverse proxy set up for proxying requests to the appropriate service (individual application) in the microservice network.
@@ -22,12 +24,14 @@ Docker also ensures that the versions that worked well on dev are bundled up and
2224
For additional details on how Chronos works this example, please review the Docker section in the [Chronos NPM Package README](../../chronos_npm_package/README.md).
2325

2426
## Steps to Run Example
27+
2528
Peform the following steps in each of the _books_, _customers_, _frontend_, and _orders_ directories
2629

27-
1. Add a `.env` file to *each* folder with the following key/value pairs:
30+
1. Add a `.env` file to _each_ folder with the following key/value pairs:
31+
2832
- **NOTE**: Ensure that there are no quotes surrounding any of the keys and values.
2933

30-
>>>New collaboration group - testing all 5 url added to each .env// --> testing now...<<<
34+
> > > New collaboration group - testing all 5 url added to each .env// --> testing now...<<<
3135
3236
```
3337
CHRONOS_DB = MongoDB or PostgreSQL
@@ -36,21 +40,24 @@ BOOK_URI = A MongoDB URI for the bookserver microservice to use
3640
CUSTOMER_URI = A MongoDB URI for the customerserver microservice to use
3741
ORDER_URI = A MongoDB URI for the orderserver microservice to use
3842
```
43+
3944
2. Verify that `@chronosmicro/tracker` is a dependency in each of the _books_, _customers_, _frontend_, and _orders_ folders (see the `package.json` in each folder).
4045

4146
- If the @chronosmicro/tracker dependency is listed as a **remote** npm package (i.e. `"@chronosmicro/tracker": "^11.0.1"`) and you've ran `npm install`, no further work is needed continue to step 3.
4247

4348
- If you have the dependency as
44-
`"@chronosmicro/tracker": "file:./chronos_npm_package"`, which is a **local** file, make sure to change the version from `"file:./chronos_npm_package"` to `"^11.0.1"` and run npm install.
49+
`"@chronosmicro/tracker": "file:./chronos_npm_package"`, which is a **local** file, make sure to change the version from `"file:./chronos_npm_package"` to `"^11.0.1"` and run npm install.
50+
51+
3. With the terminal navigated to the the _examples/docker_ folder, run the command:
4552

46-
3. With the terminal navigated to the the _examples/docker_ folder, run the command:
53+
> > > No working, installing VSC docker ext<<< --must have docker installed for this command to run
4754
48-
>>>No working, installing VSC docker ext<<< --must have docker installed for this command to run
4955
```
5056
docker-compose -f docker-compose.yml up
5157
```
5258

53-
#
59+
4. If you run into any issues regarding 'linux/amd64,linux/arm/v7,linux/arm64/v8' for cadvisor, navigate to the docker-compose.yml and find the cadvisor dictionary. Change "platform" to linux/arm64/v8 for M1 Chips and linux/amd64 for Intel Chips.
60+
###
5461

5562
You should now see the containers running in your terminal, each reporting `"Docker data recorded in..."`.
5663

@@ -85,6 +92,7 @@ Use `docker compose down` to remove.
8592
Chronos hopes to inspire an active community of both users and developers. For questions, comments, or contributions, please submit a pull request.
8693

8794
Read our [contributing README](../../CONTRIBUTING.md) to further learn how you can take part in improving Chronos.
95+
8896
## License
8997

90-
[MIT](https://github.com/oslabs-beta/Chronos/blob/master/LICENSE.md)
98+
[MIT](https://github.com/oslabs-beta/Chronos/blob/master/LICENSE.md)

examples/docker/docker-compose.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,10 @@ services:
8282
- orders
8383

8484
cadvisor:
85-
image: gcr.io/cadvisor/cadvisor:latest
85+
image: gcr.io/cadvisor/cadvisor:v0.47.0
8686
container_name: cadvisor
8787
privileged: true
88+
platform: linux/arm64/v8
8889
ports:
8990
- 8080:8080
9091
volumes:
@@ -108,6 +109,7 @@ services:
108109
- --config.file=/etc/prometheus/prometheus.yml
109110
volumes:
110111
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
112+
111113
depends_on:
112114
- cadvisor
113115

@@ -118,7 +120,8 @@ services:
118120
- 2999:3000
119121
volumes:
120122
# Share the named volume with the grafana container
121-
- grafana-dir:/etc/grafana
123+
- ./grafana/provisioning/datasources:/etc/grafana/provisioning/datasources
124+
- ./grafana/provisioning/dashboards:/etc/grafana/provisioning/dashboards
122125
environment:
123126
GF_PATHS_CONFIG: /etc/grafana/grafana.ini
124127
GF_SECURITY_ALLOW_EMBEDDING: 'true'

0 commit comments

Comments
 (0)