From 9c07ac376db8f0125b1fb8cadb129867af376e8e Mon Sep 17 00:00:00 2001 From: Kartik Verma Date: Tue, 25 Jan 2022 16:31:19 +0530 Subject: [PATCH] fix: update Contributing and Makefile for dev-setup (#599) --- .gitignore | 1 + CONTRIBUTING.md | 12 ++++++------ Makefile | 14 ++++++++++++++ pkg/query-service/go.mod | 2 +- 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 4e720c6728..1556564080 100644 --- a/.gitignore +++ b/.gitignore @@ -42,3 +42,4 @@ frontend/cypress.env.json frontend/*.env pkg/query-service/signoz.db +/deploy/docker/clickhouse-setup/data/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c58a713482..99764e34fd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -44,13 +44,13 @@ Need to update [https://github.com/SigNoz/signoz/tree/main/pkg/query-service](ht ### To run ClickHouse setup (recommended for local development) -- `git clone https://github.com/SigNoz/signoz.git && cd signoz/deploy` -- comment out frontend service section at `docker/clickhouse-setup/docker-compose.yaml#L38` -- comment out query-service section at `docker/clickhouse-setup/docker-compose.yaml#L22` +- git clone https://github.com/SigNoz/signoz.git +- run `sudo make dev-setup` to configure local setup to run query-service +- comment out frontend service section at `deploy/docker/clickhouse-setup/docker-compose.yaml#L38` +- comment out query-service section at `deploy/docker/clickhouse-setup/docker-compose.yaml#L22` - Install signoz locally without the frontend and query-service - - If you are using x86_64 processors (All Intel/AMD processors) run `sudo docker-compose --env-file ./docker/clickhouse-setup/env/x86_64.env -f docker/clickhouse-setup/docker-compose.yaml up -d` - - If you are on arm64 processors (Apple M1 Macbooks) run `sudo docker-compose --env-file ./docker/clickhouse-setup/env/arm64.env -f docker/clickhouse-setup/docker-compose.yaml up -d` -- `STORAGE=clickhouse ClickHouseUrl=tcp://localhost:9001 go run main.go` + - If you are using x86_64 processors (All Intel/AMD processors) run `sudo make run-x86` + - If you are on arm64 processors (Apple M1 Macbooks) run `sudo make run-arm` **_Query Service should now be available at `http://localhost:8080`_** diff --git a/Makefile b/Makefile index 83ba66976b..67dbd9a522 100644 --- a/Makefile +++ b/Makefile @@ -81,3 +81,17 @@ build-push-flattener: @echo "------------------" @cd $(FLATTENER_DIRECTORY) && \ docker buildx build --file Dockerfile --progress plane --no-cache --push --platform linux/arm64,linux/amd64 --tag $(REPONAME)/$(FLATTERNER_DOCKER_IMAGE):$(DOCKER_TAG) . + +dev-setup: + mkdir -p /var/lib/signoz + sqlite3 /var/lib/signoz/signoz.db "VACUUM"; + mkdir -p pkg/query-service/config/dashboards + @echo "------------------" + @echo "--> Local Setup completed" + @echo "------------------" + +run-x86: + @sudo docker-compose --env-file ./deploy/docker/clickhouse-setup/env/x86_64.env -f ./deploy/docker/clickhouse-setup/docker-compose.yaml up -d + +run-arm: + @sudo docker-compose --env-file ./deploy/docker/clickhouse-setup/env/arm64.env -f ./deploy/docker/clickhouse-setup/docker-compose.yaml up -d \ No newline at end of file diff --git a/pkg/query-service/go.mod b/pkg/query-service/go.mod index 023f231dbe..d64a824ab2 100644 --- a/pkg/query-service/go.mod +++ b/pkg/query-service/go.mod @@ -11,7 +11,7 @@ require ( github.com/aws/aws-sdk-go v1.27.0 // indirect github.com/containerd/containerd v1.4.12 // indirect github.com/dhui/dktest v0.3.4 // indirect - github.com/docker/docker v20.10.12+incompatible + github.com/docker/docker v20.10.12+incompatible // indirect github.com/frankban/quicktest v1.13.0 // indirect github.com/go-kit/log v0.1.0 github.com/golang-migrate/migrate/v4 v4.14.1