Skip to content

Commit f60c9aa

Browse files
committed
fixed package-lock json version 8.03
1 parent 3ca8d27 commit f60c9aa

File tree

13 files changed

+10675
-10659
lines changed

13 files changed

+10675
-10659
lines changed

examples/AWS/AWS-EC2/package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/AWS/AWS-ECS/app/package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/AWS/AWS-ECS/app/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"author": "Nana Janashia",
1111
"license": "ISC",
1212
"dependencies": {
13-
"@chronosmicro/tracker": "^8.0.3",
13+
"@chronosmicro/tracker": "^12.0.1",
1414
"body-parser": "^1.19.0",
1515
"dotenv": "^16.0.3",
1616
"express": "^4.17.1",

examples/gRPC/books/package-lock.json

+2,329-2,329
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/gRPC/orders/package-lock.json

+2,329-2,329
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/gRPC/reverse_proxy/package-lock.json

+2,882-2,882
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
+20-20
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
{
2-
"name": "reverse_proxy",
3-
"version": "1.0.0",
4-
"description": "",
5-
"main": "index.js",
6-
"scripts": {
7-
"test": "echo \"Error: no test specified\" && exit 1",
8-
"start": "nodemon reverseProxyServer.js"
9-
},
10-
"keywords": [],
11-
"author": "",
12-
"license": "ISC",
13-
"dependencies": {
14-
"@chronosmicro/tracker": "^8.0.3",
15-
"@grpc/grpc-js": "^1.2.5",
16-
"@grpc/proto-loader": "^0.5.5",
17-
"dotenv": "^8.2.0",
18-
"express": "^4.17.1",
19-
"nodemon": "^2.0.22",
20-
"uuid": "^8.3.2"
21-
}
2+
"name": "reverse_proxy",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1",
8+
"start": "nodemon reverseProxyServer.js"
9+
},
10+
"keywords": [],
11+
"author": "",
12+
"license": "ISC",
13+
"dependencies": {
14+
"@chronosmicro/tracker": "^12.0.1",
15+
"@grpc/grpc-js": "^1.2.5",
16+
"@grpc/proto-loader": "^0.5.5",
17+
"dotenv": "^8.2.0",
18+
"express": "^4.17.1",
19+
"nodemon": "^2.0.22",
20+
"uuid": "^8.3.2"
21+
}
2222
}

examples/kubernetes/README.md

+33-17
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
# Chronos Kubernetes Example
22

33
This example demonstrates how **Chronos** can be used to track health metrics of a Kubernetes cluster when deployed with a Prometheus monitoring server. The folders in this example include the following:
4-
- *client*: A React application (in the *client* folder) that requests a random number from a Node/Express API
5-
- *server*: The Node/Express API that responds with the random number. This is where the **Chronos** package is actually imported and executed.
6-
- *launch*: YAML files describing the *deployment* and *service* configurations for the client, server, and Prometheus server
7-
- *scripts*: Scripts to automate some of the steps involved in running the example
4+
5+
- _client_: A React application (in the _client_ folder) that requests a random number from a Node/Express API
6+
- _server_: The Node/Express API that responds with the random number. This is where the **Chronos** package is actually imported and executed.
7+
- _launch_: YAML files describing the _deployment_ and _service_ configurations for the client, server, and Prometheus server
8+
- _scripts_: Scripts to automate some of the steps involved in running the example
89

910
## Additional Documentation
1011

1112
For additional information on how Chronos works this example, please review the Kubernetes section in the [Chronos NPM Package README](../../chronos_npm_package/README.md).
1213

1314
## Install Docker Desktop
14-
This example has been developed and tested using the Kubernetes Engine packaged in the Docker Desktop application.
15+
16+
This example has been developed and tested using the Kubernetes Engine packaged in the Docker Desktop application.
1517

1618
1. Follow instructions online to download/install Docker Desktop and to **enable the Kubernetes Engine**.
1719

@@ -20,67 +22,76 @@ This example has been developed and tested using the Kubernetes Engine packaged
2022
</p>
2123

2224
## Setup Prometheus and Grafana
23-
1. `cd` into the *scripts* folder and run the setup script with `./setup.sh` - the process of configuring Prometheus and Grafana.
25+
26+
1. `cd` into the _scripts_ folder and run the setup script with `./setup.sh` - the process of configuring Prometheus and Grafana.
2427

2528
**Note**: If you run into `Permission denied` error, try run this command: `chmod +x [the_file_name]` in the terminal and re-run `./setup.sh`.
2629

2730
2. In your browser, go to `localhost:32000`, which will be the login page of grafana. Use `admin` as both username and password to login. You can change the password after login.
2831

2932
3. Navigate to `Home -> Administration -> Service accounts`, then click `Add service account` to create an service account. Be sure to choose `Admin` as the role. Then click `Add service account token`, hit `generate`, you are done! Remember this token, you will be using this token to access Grafana HTTP API programmatically.
3033

31-
4. Add a `.env` file to the *server* folder that contains the following key/value pairs:
34+
4. Add a `.env` file to the _server_ folder that contains the following key/value pairs:
3235

3336
```
3437
CHRONOS_GRAFANA_API_KEY = Bearer [the access token you created in step 3]
3538
```
3639

3740
## Build the Client
38-
1. `cd` into the *client* folder and run the following command:
41+
42+
1. `cd` into the _client_ folder and run the following command:
43+
3944
```
4045
docker build -t frontend:1.0 .
4146
```
42-
**Mac Users:** Alternative to running the above command, `cd` into the scripts folder and run the `buildClient.sh` script by running `./buildClient.sh` in the terminal.
4347

48+
**Mac Users:** Alternative to running the above command, `cd` into the scripts folder and run the `buildClient.sh` script by running `./buildClient.sh` in the terminal.
4449

4550
## Build the Server
51+
4652
1. In the `.env` file you just created, add the following key/value pairs as well:
4753

4854
```
4955
CHRONOS_DB = MongoDB or PostgreSQL
5056
CHRONOS_URI = The URI to the desired MongoDB or PostgreSQL database to save health metrics via Chronos
5157
```
58+
5259
2. Then look at the `package.json` file in the server folder and **note how `@chronosmicro/tracker` is included as a dependency:**
5360

54-
- If the @chronosmicro/tracker dependency is listed as a **remote npm package** (i.e. `"@chronosmicro/tracker": "^8.0.3"`), no further work is needed.
61+
- If the @chronosmicro/tracker dependency is listed as a **remote npm package** (i.e. `"@chronosmicro/tracker": "^12.0.1"`), no further work is needed.
5562

5663
- If the @chronosmicro/tracker dependency is listed as a **local npm package** (i.e. `"@chronosmicro/tracker": "file:./chronos_npm_package"`), the Docker build will require that the Chronos code is in this folder. Either:
57-
- Copy the _chronos_npm_package_ folder in manually, and **go to step 3**
58-
- **OR**
59-
- If you are a Mac user, you can use the `buildServer.sh` script to automate this process and **skip step 3**
60-
- Do this by `cd`ing into the *scripts* folder and run the buildServer script with `./buildServer.sh` - the process of copying in the *chronos_npm_package* folder, performing the Docker build, and then removing the copied in folder is automated.
64+
- Copy the _chronos_npm_package_ folder in manually, and **go to step 3**
65+
- **OR**
66+
- If you are a Mac user, you can use the `buildServer.sh` script to automate this process and **skip step 3**
67+
- Do this by `cd`ing into the _scripts_ folder and run the buildServer script with `./buildServer.sh` - the process of copying in the _chronos_npm_package_ folder, performing the Docker build, and then removing the copied in folder is automated.
6168

6269
3. (skip if you used the `buildServer.sh` script)
6370

64-
`cd` into the *server* folder and run the following command:
71+
`cd` into the _server_ folder and run the following command:
72+
6573
```
6674
docker build -t backend:1.0 .
6775
```
6876

6977
## Start the npm Server
78+
7079
1. `cd` into the `server` folder inside `chronos_npm_package`, then run `npm install` to install all dependencies.
7180

7281
2. run `npm start` to start npm server.
7382

7483
3. You should see `🤖 Example app listening on port 1111! chronos_npm_package Server Loaded 🎉` in the terminal.
7584

7685
## Deploy the Cluster
86+
7787
1. `cd` into the launch folder and run the following commands to start the services and deployments described in the YAML files:
88+
7889
```
7990
kubectl apply -f backend.yml
8091
kubectl apply -f frontend.yml
8192
```
8293

83-
**Mac Users:** Alternative to running the above commands, `cd` into the *scripts* folder and run the `startKuber.sh` script.
94+
**Mac Users:** Alternative to running the above commands, `cd` into the _scripts_ folder and run the `startKuber.sh` script.
8495

8596
2. Check in Docker desktop if your containers have been created. You should see something similar to the following:
8697

@@ -98,6 +109,7 @@ Your microservice health metrics can now be viewed at the given `CHRONOS_URI` or
98109
## Teardown the Cluster
99110

100111
1. `cd` into the launch folder and run the following commands to stop the running services and deployments:
112+
101113
```
102114
kubectl delete -f clusterRole.yml
103115
kubectl delete -f promConfig.yml
@@ -106,19 +118,22 @@ kubectl delete -f backend.yml
106118
kubectl delete -f frontend.yml
107119
```
108120

109-
**Mac Users:** Alternative to running the above commands, `cd` into the *scripts* folder and run the `stopKuber.sh` script
121+
**Mac Users:** Alternative to running the above commands, `cd` into the _scripts_ folder and run the `stopKuber.sh` script
110122

111123
**Note**: The above part only teardown Prometheus and Kubernetes, it leaves Grafana running. This is because if you teardown Grafana, the next time you redeploy you will be login with a new account, the access token and dashboard you created within this account will be lost.
112124

113125
To teardown grafana, run the following commands:
126+
114127
```
115128
kubectl delete -f launch/grafana-datasource-config.yml
116129
kubectl delete -f launch/grafanaService.yml
117130
kubectl delete -f launch/grafana.yml
118131
```
119132

120133
## Insight for how to migrate this example to your own app
134+
121135
To configure Prometheus and Grafana, you can simply copy the below yaml files to your own app.
136+
122137
```
123138
clusterRole.yml
124139
promConfig.yml
@@ -127,6 +142,7 @@ grafana-datasource-config.yml
127142
grafanaService.yml
128143
grafana.yml
129144
```
145+
130146
Then configure Prometheus and Grafana with your own application's deployments using images.
131147

132148
## Contributing

examples/kubernetes/server/package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/microservices/books/package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)