diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 00000000000..db4801ba355 --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,36 @@ +# Please adjust to your needs (see https://www.gitpod.io/docs/config-gitpod-file) +# and commit this file to your remote git repository to share the goodness with others. + + +tasks: + - name: Run Script to Comment ut required lines + init: | + cd ./.scripts + sh commentLinesForSetup.sh + + - name: Run Docker Images + init: | + cd ./deploy + sudo docker-compose --env-file ./docker/clickhouse-setup/env/x86_64.env -f docker/clickhouse-setup/docker-compose.yaml up -d + # command: + + - name: Run Frontend + init: | + cd ./frontend + yarn install + command: + yarn dev + +ports: + - port: 3000 + onOpen: open-browser + - port: 8080 + onOpen: ignore + - port: 9000 + onOpen: ignore + - port: 8123 + onOpen: ignore + - port: 8089 + onOpen: ignore + - port: 9093 + onOpen: ignore diff --git a/.scripts/commentLinesForSetup.sh b/.scripts/commentLinesForSetup.sh new file mode 100644 index 00000000000..7ea6b468ad4 --- /dev/null +++ b/.scripts/commentLinesForSetup.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +# It Comments out the Line Query-Service & Frontend Section of deploy/docker/clickhouse-setup/docker-compose.yaml +# Update the Line Numbers when deploy/docker/clickhouse-setup/docker-compose.yaml chnages. +# Docs Ref.: https://github.com/SigNoz/signoz/blob/main/CONTRIBUTING.md#contribute-to-frontend-with-docker-installation-of-signoz + +sed -i 38,70's/.*/# &/' .././deploy/docker/clickhouse-setup/docker-compose.yaml diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4c0e474b3ab..412afd5eaba 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -18,7 +18,7 @@ Need to update [https://github.com/SigNoz/signoz/tree/main/frontend](https://git ### Contribute to Frontend with Docker installation of SigNoz - `git clone https://github.com/SigNoz/signoz.git && cd signoz` -- comment out frontend service section at `deploy/docker/clickhouse-setup/docker-compose.yaml#L38` +- comment out frontend service section at `deploy/docker/clickhouse-setup/docker-compose.yaml#L59` - run `cd deploy` to move to deploy directory - Install signoz locally without the frontend - If you are using x86_64 processors (All Intel/AMD processors) run `sudo docker-compose -f docker/clickhouse-setup/docker-compose.yaml up -d` @@ -27,6 +27,8 @@ Need to update [https://github.com/SigNoz/signoz/tree/main/frontend](https://git - `yarn install` - `yarn dev` +> Notes for Maintainers/Contributors who will change Line Numbers of Frontend & Query-Section. Please Update Line Numbers in `./scripts/commentLinesForSetup.sh` + ### Contribute to Frontend without installing SigNoz backend If you don't want to install SigNoz backend just for doing frontend development, we can provide you with test environments which you can use as the backend. Please ping us in #contributing channel in our [slack community](https://signoz.io/slack) and we will DM you with `` @@ -46,16 +48,27 @@ Need to update [https://github.com/SigNoz/signoz/tree/main/pkg/query-service](ht - 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` +- comment out frontend service section at `docker/clickhouse-setup/docker-compose.yaml#L59` +- comment out query-service section at `docker/clickhouse-setup/docker-compose.yaml#L38` - Install signoz locally without the frontend and query-service - 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` +> Notes for Maintainers/Contributors who will change Line Numbers of Frontend & Query-Section. Please Update Line Numbers in `./scripts/commentLinesForSetup.sh` + **_Query Service should now be available at `http://localhost:8080`_** > If you want to see how, frontend plays with query service, you can run frontend also in you local env with the baseURL changed to `http://localhost:8080` in file `src/constants/env.ts` as the query-service is now running at port `8080` +--- +Instead of configuring a local setup, you can also use [Gitpod](https://www.gitpod.io/), a VSCode-based Web IDE. + +Click the button below. A workspace with all required environments will be created. + +[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/SigNoz/signoz) + +> To use it on your forked repo, edit the 'Open in Gitpod' button url to `https://gitpod.io/#https://github.com//signoz` + # Contribute to SigNoz Helm Chart Need to update [https://github.com/SigNoz/charts](https://github.com/SigNoz/charts). @@ -90,6 +103,7 @@ kubectl -n sample-application run strzal --image=djbingham/curl \ --restart='OnFailure' -i --tty --rm --command -- curl \ http://locust-master:8089/stop ``` +--- ## General Instructions diff --git a/deploy/docker/clickhouse-setup/docker-compose.yaml b/deploy/docker/clickhouse-setup/docker-compose.yaml index e7c8b40ee38..71b678459f0 100644 --- a/deploy/docker/clickhouse-setup/docker-compose.yaml +++ b/deploy/docker/clickhouse-setup/docker-compose.yaml @@ -22,6 +22,9 @@ services: - '--config.file=/prometheus/alertmanager.yml' - '--storage.path=/data' +# Notes for Maintainers/Contributors who will change Line Numbers of Frontend & Query-Section. Please Update Line Numbers in `./scripts/commentLinesForSetup.sh` & `./CONTRIBUTING.md` + + query-service: image: signoz/query-service:0.5.4 container_name: query-service diff --git a/frontend/src/constants/env.ts b/frontend/src/constants/env.ts index 9ec41e25c2b..6e12260df16 100644 --- a/frontend/src/constants/env.ts +++ b/frontend/src/constants/env.ts @@ -1,3 +1,3 @@ export const ENVIRONMENT = { - baseURL: process?.env?.FRONTEND_API_ENDPOINT || '', + baseURL: process?.env?.FRONTEND_API_ENDPOINT || process.env.GITPOD_WORKSPACE_URL.replace('://','://8080-') ||'http://localhost:8080'|| '', }; diff --git a/frontend/webpack.config.js b/frontend/webpack.config.js index 1eb43d9ecf0..5b94f0f9035 100644 --- a/frontend/webpack.config.js +++ b/frontend/webpack.config.js @@ -41,6 +41,7 @@ const config = { publicPath: '/', watch: true, }, + allowedHosts: 'all', }, target: 'web', output: {