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: README.md
+55-1Lines changed: 55 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,60 @@ You can always run the GSW service by doing a `./gsw_service` after building. Fo
12
12
### Compatibility
13
13
Some machines do not have a /dev/shm directory. The directory used for shared memory can be changed with the flag `-shm (DIRECTORY_NAME)`. For example, `go run cmd/mem_view/mem_view.go -shm /someDirectory/RAMDrive`.
14
14
15
+
## Docker
16
+
It may be easier to run the GSW in a docker container. This might be better for compatibility and easier for people on Windows hosts (as docker desktop will natively use a WLS 2 backend).
17
+
18
+
A dockerfile for GSW is provided in `./cmd/Containerfile` and can be built and run with:
For simplicity, a `docker-compose` file is provided for building and running GSW, Grafana, and InfluxDB:
37
+
```shell
38
+
$ docker compose up --build
39
+
```
40
+
41
+
#### Accessing Grafana
42
+
43
+
Grafana should be exposed at <http://localhost:3000>.
44
+
The default compose file has anonymous access enabled where the default user only has viewer permissions.
45
+
If you need to change dashboards or datasources, set `GF_AUTH_ANONYMOUS_ORG_ROLE=Admin` in `compose.yaml` before starting the container.
46
+
47
+
#### Accessing InfluxDB
48
+
49
+
You can access the InfluxDB CLI using `docker compose exec -it influxdb influx`.
50
+
For example, to export all receiver telemetry as a CSV, run:
51
+
```shell
52
+
$ docker compose exec influxdb influx \
53
+
-database "gsw" \
54
+
-format csv \
55
+
-execute "SELECT * FROM receiver"
56
+
```
57
+
58
+
### Attaching to the container
59
+
60
+
If you need to run any of the apps in `cmd/`, you can get a shell into the container using:
61
+
```shell
62
+
$ docker exec -it gsw-service sh
63
+
```
64
+
65
+
(if you're using docker compose this will be `docker compose exec -it gsw sh`)
66
+
67
+
All binaries are in PATH as the names of their folders in `cmd/`.
68
+
15
69
## Unit Tests
16
70
There are several unit tests that can be run. You can do a `go test ./...` from the root project directory to execute all tests. It is also recommended to run with the -cover
17
71
flag to get coverage statements.
@@ -46,7 +100,7 @@ Once set up, the grafana_live application can be run from the root directory (wi
46
100
Make sure the GSW service is running before starting the application.
47
101
48
102
In case the setup utility does not work, live data streaming can be set up manually as follows:
49
-
1. Import a new dashboard into Grafana using the JSON file located at `data/grafana/Backplane-Live.json`. The dashboard can have any name and UID.
103
+
1. Import a new dashboard into Grafana using the JSON file located at `data/grafana/dashboards/Backplane-Live.json`. The dashboard can have any name and UID.
50
104
2. Create a service account at the following URL: [http://localhost:3000/org/serviceaccounts/create](http://localhost:3000/org/serviceaccounts/create) (replace `http://localhost:3000` if you are using a different host).
51
105
The service account can have any display name but must be given the Admin role ([More information about creating service accounts](https://grafana.com/docs/grafana/latest/administration/service-accounts/)).
52
106
3. Click "Add service account token" and then "Generate token". The token can have any display name. Don't set an expiration date unless you want the token to become invalid after that date.
0 commit comments