You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+11-9Lines changed: 11 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,19 +14,21 @@ Chronos welcomes all pull requests.
14
14
6. Create a pull request to `master`.
15
15
16
16
## Getting started
17
-
-`npm run bot`: Run Node and Electron at the same time to start Chronos app
18
-
- To make changes to codebase on the Main Process
17
+
-`npm run dev:app` and `npm run dev:electron`: Run Node and Electron at the same time to start Chronos app
18
+
- To make changes to codebase on the Main Process:
19
19
- Files in the main process must be compiled prior to starting the app
20
-
- In the terminal un Chronos directory, input `tsc` to comile typescript files
21
-
- Once compiled, `npm run both`
22
-
* Note** If typescript is not installed, `npm install -g typescript`
20
+
- In the terminal in Chronos directory, input `tsc` to compile typescript files
21
+
- Once compiled, `npm run dev:app` and `npm run dev:electron`
22
+
* Note: If typescript is not installed, `npm install -g typescript`
23
23
24
24
## Issues
25
25
26
-
Please do not hesitate to file issues. Chronos is based off of community feedback and is always looking for ways to get better. The team behind Chronos is interested to hear about your experience and how we can improve it.
26
+
Please do not hesitate to file issues that detail bugs or offer ways to enhace Chronos.
27
27
28
-
Please do not hesitate to submit issues that promote bugs or offer ways to enhance to Chronos. When submitting issues, ensure your description is clear and has instructions to be able to reproduce the issue.
28
+
Chronos is based off of community feedback and is always looking for ways to get better. The team behind Chronos is interested to hear about your experience and how we can improve it.
29
29
30
-
## Get in touch
30
+
When submitting issues, ensure your description is clear and has instructions to be able to reproduce the issue.
31
31
32
-
We use GitHub as a platform of communication between users and developers to promote transparency. We thrive off of the community support and feedback
32
+
## Get In Touch
33
+
34
+
We use GitHub as a platform of communication between users and developers to promote transparency, community support and feedback.
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:
3
+
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
4
-*client*: A React application (in the *client* folder) that requests a random number from a Node/Express API
5
5
-*server*: The Node/Express API that responds with the random number. This is where the **Chronos** package is actually imported and executed.
6
6
-*launch*: YAML files describing the *deployment* and *service* configurations for the client, server, and Prometheus server
@@ -9,41 +9,48 @@ This example demonstrates how `Chronos` can be used to track health metrics of a
9
9
## Install Docker Desktop
10
10
This example has been developed and tested using the Kubernetes Engine packaged in the Docker Desktop application.
11
11
12
-
Follow instructions online to download/install Docker Desktop and to **enable the Kubernetes Engine**. The examples will not work without the Kubernetes Engine enabled.
12
+
1. Follow instructions online to download/install Docker Desktop and to **enable the Kubernetes Engine**.
13
+
14
+
<palign="center">
15
+
<imgalt="enabled kubernetes engine in docker"src="../../assets/examples_enable_kubernetes_engine.png">
16
+
</p>
17
+
18
+
13
19
## Build the Client
14
-
`cd` into the *client* folder and run the following command:
20
+
1.`cd` into the *client* folder and run the following command:
15
21
```
16
22
docker build -t frontend:1.0 .
17
23
```
18
-
**Mac Users:**Alternatively running the above command, `cd` into the scripts folder and run the `buildClient.sh` script
24
+
**Mac Users:**Alternative to running the above command, `cd` into the scripts folder and run the `buildClient.sh` script
19
25
20
-
<br>
21
26
22
27
## Build the Server
23
-
First, add a `.env` file to the *server* folder that contains the following key/value pairs:
28
+
1. Add a `.env` file to the *server* folder that contains the following key/value pairs:
24
29
25
30
```
26
31
CHRONOS_DB = MongoDB or PostgreSQL
27
-
CHRONOS_URI = The URI to the desired MongoDB or PostgreSQL database to save health metrics via **Chronos**
32
+
CHRONOS_URI = The URI to the desired MongoDB or PostgreSQL database to save health metrics via Chronos
28
33
```
34
+
2. Then look at the `package.json` file in the server folder and **note how `@chronosmicro/tracker` is included as a dependency:**
29
35
30
-
Then look at the `package.json` file in the server folder and note how `@chronosmicro/tracker` is included as a dependency:
36
+
- If the @chronosmicro/tracker dependency is listed as a **remote npm package** (i.e. `"@chronosmicro/tracker": "^8.0.3"`), no further work is needed.
31
37
32
-
- If the @chronosmicro/tracker dependency is listed as a remote npm package (i.e. `"@chronosmicro/tracker": "^8.0.1"`), no further work is needed.
38
+
- 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:
39
+
- Copy the _chronos_npm_package_ folder in manually, and **go to step 3**
40
+
-**OR**
41
+
- If you are a Mac user, you can use the `buildServer.sh` script to automate this process and **skip step 3**
42
+
- 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.
33
43
34
-
- 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 the Chronos code is in this folder. Either copy the _chronos_npm_package_ folder in manually, or see note below to automate this process **if you are a Mac user**.
44
+
3. (skip if you used the `buildServer.sh` script)
35
45
36
46
`cd` into the *server* folder and run the following command:
37
47
```
38
48
docker build -t backend:1.0 .
39
49
```
40
50
41
-
**Mac Users:** If @chronosmicro/tracker is included as a local npm package, the process of copying in the *chronos_npm_package* folder, performing the Docker build, and then removing the copied in folder is automated by `cd` into the *scripts* folder and running the `buildServer.sh` script.
42
-
43
-
<br>
44
51
45
52
## Deploy the Cluster
46
-
`cd` into the launch folder and run the following commands to start the services and deployments described in the YAML files:
53
+
1.`cd` into the launch folder and run the following commands to start the services and deployments described in the YAML files:
47
54
```
48
55
kubectl apply -f clusterRole.yml
49
56
kubectl apply -f promConfig.yml
@@ -52,18 +59,21 @@ kubectl apply -f backend.yml
52
59
kubectl apply -f frontend.yml
53
60
```
54
61
55
-
**Mac Users:** Alternatively to running the above commands, `cd` into the *scripts* folder and run the `startKuber.sh` script
56
-
62
+
**Mac Users:** Alternative to running the above commands, `cd` into the *scripts* folder and run the `startKuber.sh` script.
57
63
58
64
#
59
-
console.logs in your terminal should now indicate "kubernetesmetrics saved in *postgresql* or *mongodb* database"
60
65
61
-
Your microservice health metrics can now be viewed at the given `CHRONOS_URI` or, preferrably, in the Electron.js desktop application.
62
-
#
66
+
2. Check in Docker desktop if your containers have been created. You should see something similar to the following:
0 commit comments