From 2c9e164763502c5d627052c11b8b1eefebd9065d Mon Sep 17 00:00:00 2001 From: jbahire Date: Wed, 10 Feb 2021 15:47:36 +0530 Subject: [PATCH 1/4] docs: updated readme with arch and other details --- README.md | 60 +++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 49 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index d69752bd..1b0a1cb3 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,20 @@ # Hypertrace GraphQL Hypertrace GraphQL service serves the GraphQL API which will be used by Hypertrace UI. -## Testing +## Description -`./gradlew test` +| ![space-1.jpg](https://hypertrace-docs.s3.amazonaws.com/arch/ht-query.png) | +|:--:| +| *Hypertrace Query Architecture* | -## Running +[Hypertrace-UI](https://github.com/hypertrace/hypertrace-ui) talks to hypertrace-GraphQL service which serves the GraphQL API which queries data from downstream services. GraphQL services talks to different grpc services to form the response including [attribute-service](https://github.com/hypertrace/attribute-service), [entity-service](https://github.com/hypertrace/entity-service), [gateway-service](https://github.com/hypertrace/gateway-service) and [config-service](https://github.com/hypertrace/config-service). -`./gradlew run` -## Queries +### Queries Here are some of the important GraphQL queries: -### 1. Verify trace exists +#### 1. Verify trace exists ```graphql curl -s localhost:2020/graphql -H 'Content-Type: application/graphql' -d \ @@ -39,7 +40,7 @@ curl -s localhost:2020/graphql -H 'Content-Type: application/graphql' -d \ ``` -### 2. Get all service names +#### 2. Get all service names ```graphql curl -s localhost:2020/graphql -H 'Content-Type: application/graphql' -d \ @@ -59,7 +60,7 @@ curl -s localhost:2020/graphql -H 'Content-Type: application/graphql' -d \ }' ``` -### 3. Get all backend names +#### 3. Get all backend names ```graphql curl -s localhost:2020/graphql -H 'Content-Type: application/graphql' -d \ @@ -79,7 +80,7 @@ curl -s localhost:2020/graphql -H 'Content-Type: application/graphql' -d \ }' ``` -### 4. Get all API names +#### 4. Get all API names ```graphql curl -s localhost:2020/graphql -H 'Content-Type: application/graphql' -d \ @@ -99,7 +100,7 @@ curl -s localhost:2020/graphql -H 'Content-Type: application/graphql' -d \ }' ``` -### 5. Get service and backend dependency graph +#### 5. Get service and backend dependency graph ```graphql curl -s localhost:2020/graphql -H 'Content-Type: application/graphql' -d \ @@ -138,4 +139,41 @@ curl -s localhost:2020/graphql -H 'Content-Type: application/graphql' -d \ } } }' -``` \ No newline at end of file +``` + +## Testing + +### Running unit tests +Run `./gradlew test` to execute unit tests. + +### Testing image + +To test your image using the docker-compose setup follow the steps: + +- Commit you changes to a branch say `graphql-service-test`. +- Go to [hypertrace-service](https://github.com/hypertrace/hypertrace-service) and checkout the above branch in the submodule. +``` +cd hypertrace-graphql && git checkout graphql-service-test && cd .. +``` +- Change tag for `hypertrace-service` from `:main` to `:test` in [docker-compose file](https://github.com/hypertrace/hypertrace/blob/main/docker/docker-compose.yml) like this. + +```yaml + hypertrace-service: + image: hypertrace/hypertrace-service:test + container_name: hypertrace-service + ... +``` +- and then run `docker-compose up` to test the setup. + +### Helm setup +Add image repository and tag in values.yaml file [here](https://github.com/hypertrace/hypertrace/blob/main/kubernetes/platform-services/values.yaml) like below and then run `./hypertrace.sh install` again and you can test your image! + +```yaml +hypertrace-graphql-service: + image: + repository: "hypertrace/hypertrace-graphql-service" + tagOverride: "test" + ``` + +## Docker Image Source: +- [DockerHub > Hypertrace GraphQL](https://hub.docker.com/r/hypertrace/hypertrace-graphql-service/) From c7efa80e083dcbb4681457c22d9f87beead102be Mon Sep 17 00:00:00 2001 From: Jayesh Bapu Ahire Date: Wed, 10 Feb 2021 18:36:15 +0530 Subject: [PATCH 2/4] docs: adds build docker image instructions in README --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 1b0a1cb3..727c2418 100644 --- a/README.md +++ b/README.md @@ -141,6 +141,14 @@ curl -s localhost:2020/graphql -H 'Content-Type: application/graphql' -d \ }' ``` + +## Building locally +The Hypertrace GraphQl service uses gradlew to compile/install/distribute. Gradle wrapper is already part of the source code. To build Hypertrace GraphQL image, run: + +``` +./gradlew dockerBuildImages +``` + ## Testing ### Running unit tests From ae12a8f93d4350f6d7eabc848302e498df91096d Mon Sep 17 00:00:00 2001 From: Jayesh Bapu Ahire Date: Wed, 10 Feb 2021 21:22:38 +0530 Subject: [PATCH 3/4] Update README.md Co-authored-by: Aaron Steinfeld <45047841+aaron-steinfeld@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 727c2418..562541af 100644 --- a/README.md +++ b/README.md @@ -143,7 +143,7 @@ curl -s localhost:2020/graphql -H 'Content-Type: application/graphql' -d \ ## Building locally -The Hypertrace GraphQl service uses gradlew to compile/install/distribute. Gradle wrapper is already part of the source code. To build Hypertrace GraphQL image, run: +The Hypertrace GraphQl service uses gradle to compile/install/distribute. Gradle wrapper is already part of the source code. To build Hypertrace GraphQL image, run: ``` ./gradlew dockerBuildImages From 215c31b7512a05e3f3f892f3b1698bbf441f789c Mon Sep 17 00:00:00 2001 From: Jayesh Bapu Ahire Date: Wed, 10 Feb 2021 21:24:38 +0530 Subject: [PATCH 4/4] docs: updates sections for testing as per suggestions --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 562541af..03c01177 100644 --- a/README.md +++ b/README.md @@ -156,6 +156,8 @@ Run `./gradlew test` to execute unit tests. ### Testing image +#### With docker-compose + To test your image using the docker-compose setup follow the steps: - Commit you changes to a branch say `graphql-service-test`. @@ -173,7 +175,7 @@ cd hypertrace-graphql && git checkout graphql-service-test && cd .. ``` - and then run `docker-compose up` to test the setup. -### Helm setup +#### With Helm setup Add image repository and tag in values.yaml file [here](https://github.com/hypertrace/hypertrace/blob/main/kubernetes/platform-services/values.yaml) like below and then run `./hypertrace.sh install` again and you can test your image! ```yaml