From 15735c81b1935d00bf238f56a4fdae87d5dbe364 Mon Sep 17 00:00:00 2001 From: xzchaoo Date: Thu, 27 Apr 2023 14:55:52 +0800 Subject: [PATCH] docs: update test-scenes.md --- docs/src/en/dev-guide/test/test-scenes.md | 42 +++++++++++++++++++---- 1 file changed, 35 insertions(+), 7 deletions(-) diff --git a/docs/src/en/dev-guide/test/test-scenes.md b/docs/src/en/dev-guide/test/test-scenes.md index 7ab5498..85133cd 100644 --- a/docs/src/en/dev-guide/test/test-scenes.md +++ b/docs/src/en/dev-guide/test/test-scenes.md @@ -1,10 +1,13 @@ # Notice + These test scenes are mainly used in the development and testing phase and are not suitable for production. # Common scene shell scripts + There are many commonly used scripts under directory of each scene. ### up.sh + `up.sh` deploys current scene using docker-compose. ```bash @@ -13,14 +16,24 @@ build=1 debug=1 up.sh up.sh shell options: -| Option | Description | -|---|---| +| Option | Description | +|---------|-----------------------------------------------------------------------------------------------------------------------------------------| | build=1 | Build image(named `holoinsight/server:latest`) from source code.
This image exists in local docker, and is not pushed to Docker Hub. | -| debug=1 | Enable debug mode:
- Enable JVM remote debugger
- Start MySQL/MongoDB/Kibana Web UI | +| debug=1 | Enable debug mode:
- Enable JVM remote debugger
- Start MySQL/MongoDB/Kibana Web UI | > You can generate Markdown tables using [Tables Generator](https://www.tablesgenerator.com/markdown_tables). +### after.sh + +If this file exists and is executable, `up.sh` will call it after `docker-compose up`. +We use this script to do the following things: + +- Install `HoloInsight agent` into `HoloInsight server`, `demo-client` and `demo-server` +- Run Python scripts in `HoloInsight server` in background to generate demo logs +- Run ttyd `HoloInsight server` in background for easy access to server + ### status.sh + `status.sh prints status of current deployed scene. ```text @@ -45,24 +58,30 @@ scene-default_server_1 /entrypoint.sh Up (healthy) ``` ### down.sh + `down.sh` stops and removes current deployed scene. ### server-exec.sh + `server-exec.sh` is aliased to `docker exec -w /home/admin/logs/holoinsight-server -it ${server_container_id} bash` ### mysql-exec.sh + `server-exec.sh` is aliased to `docker exec -it ${mysql_container_id} mysql -uholoinsight -pholoinsight -Dholoinsight` ### server-update.sh + `server-update.sh` rebuilds HoloInsight server fat jar, copies the fat jar into server container, and then restarts server process. # Test scenes ### scene-default + ![scene-default deployment](/resources/images/dev-guide/test/scene-default.jpg) > Running this scene consumes about 5GB of memory. The `scene-default` scene contains the following components: + - HoloInsight server - [CeresDB](https://github.com/ceresdb/ceresdb) - MySQL @@ -72,17 +91,21 @@ The `scene-default` scene contains the following components: - [HoloInsight OTEL Collector](https://github.com/traas-stack/holoinsight-collector) This scene also deploys several test applications for better integration testing and better demonstration effects. + - demo-client - demo-server - demo-redis `demo-client` and `demo-server` have `skywalking-java-agent` enabled. They will report trace datum to `HoloInsight OTEL Collector`. -After the container is started, the deployment script will copy HoloInsight-agent into it and execute agent in background using sidecar mode. +After all containers are started, the deployment script will copy HoloInsight-agent into it and execute agent in background using sidecar +mode. +Some Python scripts are mounted into `/home/admin/test` directory of `HoloInsight server`. In after.sh Currently, running this test scene consumes about 5GB of memory. Example: + ```text build=1 debug=1 ./test/scenes/scene-default/up.sh @@ -147,11 +170,16 @@ scene-default_server_1 /entrypoint.sh Up (healthy) ``` # Misc + ## Update database -There is a service named `mysql-data-init` in `docker-compose.yaml`. It is used to initialize database tables and pre-populate some data for its test scene. + +There is a service named `mysql-data-init` in `docker-compose.yaml`. It is used to initialize database tables and pre-populate some data for +its test scene. This service does three things: -1. mounts `server/extension/extension-common-flyway/src/main/resources/db/migration` to `/sql/0migration` in container + +1. mounts `server/extension/extension-common-flyway/src/main/resources/db/migration` to `/sql/0migration` in container 2. mounts `${test_scene_dir}/data.sql` to `/sql/1data/V999999__data.sql` in container 3. executes all sql scripts lexicographically under `/sql` in container -Most scenes will choose to reuse the `data.sql` of scene-default, and the docker-compose of these scenes will refer to the `data.sql` of scene-default instead of copying a copy to their own directory. +Most scenes will choose to reuse the `data.sql` of scene-default, and the docker-compose of these scenes will refer to the `data.sql` of +scene-default instead of copying a copy to their own directory.