From 5cc391bd97af665878520ded3de699160c24ec7c Mon Sep 17 00:00:00 2001 From: "krishnath.poologanathan" Date: Fri, 13 Sep 2024 11:14:39 +0100 Subject: [PATCH 01/11] fixed host name for promtail config --- .github/workflows/manual-deploy-testnet-l2.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/manual-deploy-testnet-l2.yml b/.github/workflows/manual-deploy-testnet-l2.yml index e4c9d33197..9306aea63a 100644 --- a/.github/workflows/manual-deploy-testnet-l2.yml +++ b/.github/workflows/manual-deploy-testnet-l2.yml @@ -260,12 +260,12 @@ jobs: target_label: 'logstream' - source_labels: ['__meta_docker_container_label_logging_jobname'] target_label: 'job' - - replacement: ${HOSTNAME} + - replacement: ${{ matrix.host_id }}-${{ github.event.inputs.testnet_type }}-${{ GITHUB.RUN_NUMBER }} target_label: node_name " > /home/obscuro/promtail/promtail-config.yaml \ && docker run -d --name promtail \ --network ten_node \ - -e HOSTNAME=${HOSTNAME} \ + -e HOSTNAME=${{ matrix.host_id }}-${{ github.event.inputs.testnet_type }}-${{ GITHUB.RUN_NUMBER }} \ -v /var/log:/var/log \ -v /home/obscuro/promtail:/etc/promtail \ -v /var/lib/docker/containers:/var/lib/docker/containers:ro \ From 5bc282ce76f4099e17d2b9dce29aa6dee8b9fc55 Mon Sep 17 00:00:00 2001 From: "krishnath.poologanathan" Date: Fri, 13 Sep 2024 11:52:16 +0100 Subject: [PATCH 02/11] fixed syntax errror in manual-deploy-testnet-l2 --- .github/workflows/manual-deploy-testnet-l2.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/manual-deploy-testnet-l2.yml b/.github/workflows/manual-deploy-testnet-l2.yml index 9306aea63a..2f028f9c64 100644 --- a/.github/workflows/manual-deploy-testnet-l2.yml +++ b/.github/workflows/manual-deploy-testnet-l2.yml @@ -254,7 +254,7 @@ jobs: refresh_interval: 5s relabel_configs: - source_labels: ['__meta_docker_container_name'] - regex: '/(.*)' + regex: '/\(.*\)' target_label: 'container' - source_labels: ['__meta_docker_container_log_stream'] target_label: 'logstream' From 813c65de6da81e3b36b6366d7aa81be6d85d3d04 Mon Sep 17 00:00:00 2001 From: "krishnath.poologanathan" Date: Fri, 13 Sep 2024 14:34:40 +0100 Subject: [PATCH 03/11] fixed syntax issue --- .../workflows/manual-deploy-testnet-l2.yml | 81 ++++++++++--------- 1 file changed, 41 insertions(+), 40 deletions(-) diff --git a/.github/workflows/manual-deploy-testnet-l2.yml b/.github/workflows/manual-deploy-testnet-l2.yml index 2f028f9c64..cbaef0d0e8 100644 --- a/.github/workflows/manual-deploy-testnet-l2.yml +++ b/.github/workflows/manual-deploy-testnet-l2.yml @@ -247,55 +247,56 @@ jobs: username: ${{ secrets.LOKI_USER }} password: ${{ secrets.LOKI_PASSWORD }} - scrape_configs: - - job_name: flog_scrape - docker_sd_configs: - - host: unix:///var/run/docker.sock - refresh_interval: 5s - relabel_configs: - - source_labels: ['__meta_docker_container_name'] - regex: '/\(.*\)' - target_label: 'container' - - source_labels: ['__meta_docker_container_log_stream'] - target_label: 'logstream' - - source_labels: ['__meta_docker_container_label_logging_jobname'] - target_label: 'job' - - replacement: ${{ matrix.host_id }}-${{ github.event.inputs.testnet_type }}-${{ GITHUB.RUN_NUMBER }} - target_label: node_name - " > /home/obscuro/promtail/promtail-config.yaml \ + scrape_configs: + - job_name: flog_scrape + docker_sd_configs: + - host: unix:///var/run/docker.sock + refresh_interval: 5s + relabel_configs: + - source_labels: ['__meta_docker_container_name'] + regex: '/(.*)' + target_label: 'container' + - source_labels: ['__meta_docker_container_log_stream'] + target_label: 'logstream' + - source_labels: ['__meta_docker_container_label_logging_jobname'] + target_label: 'job' + - replacement: ${{ matrix.host_id }}-${{ github.event.inputs.testnet_type }}-${{ GITHUB.RUN_NUMBER }} + target_label: node_name + " > /home/obscuro/promtail/promtail-config.yaml \ && docker run -d --name promtail \ - --network ten_node \ + --network ten_node \ -e HOSTNAME=${{ matrix.host_id }}-${{ github.event.inputs.testnet_type }}-${{ GITHUB.RUN_NUMBER }} \ -v /var/log:/var/log \ -v /home/obscuro/promtail:/etc/promtail \ -v /var/lib/docker/containers:/var/lib/docker/containers:ro \ -v /var/run/docker.sock:/var/run/docker.sock \ grafana/promtail:latest \ - -config.file=/etc/promtail/promtail-config.yaml -config.expand-env=true' \ + -config.file=/etc/promtail/promtail-config.yaml -config.expand-env=true \ && cd /home/obscuro/go-obscuro/ \ && sudo go run /home/obscuro/go-obscuro/go/node/cmd \ - -is_genesis=${{ matrix.is_genesis }} \ - -node_type=${{ matrix.node_type }} \ - -is_sgx_enabled=true \ - -host_id=${{ vars[matrix.node_addr_lookup] }} \ - -l1_ws_url=${{ secrets[matrix.node_l1_ws_lookup] }} \ - -management_contract_addr=${{needs.build.outputs.MGMT_CONTRACT_ADDR}} \ - -message_bus_contract_addr=${{needs.build.outputs.MSG_BUS_CONTRACT_ADDR}} \ - -l1_start=${{needs.build.outputs.L1_START_HASH}} \ - -private_key=${{ secrets[matrix.node_pk_lookup] }} \ - -sequencer_addr=obscuronode-0-${{ github.event.inputs.testnet_type }}-${{ GITHUB.RUN_NUMBER }}.uksouth.cloudapp.azure.com:10000 \ - -host_public_p2p_addr=obscuronode-${{ matrix.host_id }}-${{ github.event.inputs.testnet_type }}-${{ GITHUB.RUN_NUMBER }}.uksouth.cloudapp.azure.com:10000 \ - -host_p2p_port=10000 \ - -enclave_docker_image=${{ vars.L2_ENCLAVE_DOCKER_BUILD_TAG }} \ - -host_docker_image=${{ vars.L2_HOST_DOCKER_BUILD_TAG }} \ - -is_debug_namespace_enabled=true \ - -log_level=${{ github.event.inputs.log_level }} \ - -batch_interval=${{ vars.L2_BATCH_INTERVAL }} \ - -max_batch_interval=${{ vars.L2_MAX_BATCH_INTERVAL }} \ - -rollup_interval=${{ vars.L2_ROLLUP_INTERVAL }} \ - -l1_chain_id=${{ vars.L1_CHAIN_ID }} \ - -postgres_db_host=postgres://tenuser:${{ secrets.TEN_POSTGRES_USER_PWD }}@postgres-ten-${{ github.event.inputs.testnet_type }}.postgres.database.azure.com:5432/ \ - start' + -is_genesis=${{ matrix.is_genesis }} \ + -node_type=${{ matrix.node_type }} \ + -is_sgx_enabled=true \ + -host_id=${{ vars[matrix.node_addr_lookup] }} \ + -l1_ws_url=${{ secrets[matrix.node_l1_ws_lookup] }} \ + -management_contract_addr=${{needs.build.outputs.MGMT_CONTRACT_ADDR}} \ + -message_bus_contract_addr=${{needs.build.outputs.MSG_BUS_CONTRACT_ADDR}} \ + -l1_start=${{needs.build.outputs.L1_START_HASH}} \ + -private_key=${{ secrets[matrix.node_pk_lookup] }} \ + -sequencer_addr=obscuronode-0-${{ github.event.inputs.testnet_type }}-${{ GITHUB.RUN_NUMBER }}.uksouth.cloudapp.azure.com:10000 \ + -host_public_p2p_addr=obscuronode-${{ matrix.host_id }}-${{ github.event.inputs.testnet_type }}-${{ GITHUB.RUN_NUMBER }}.uksouth.cloudapp.azure.com:10000 \ + -host_p2p_port=10000 \ + -enclave_docker_image=${{ vars.L2_ENCLAVE_DOCKER_BUILD_TAG }} \ + -host_docker_image=${{ vars.L2_HOST_DOCKER_BUILD_TAG }} \ + -is_debug_namespace_enabled=true \ + -log_level=${{ github.event.inputs.log_level }} \ + -batch_interval=${{ vars.L2_BATCH_INTERVAL }} \ + -max_batch_interval=${{ vars.L2_MAX_BATCH_INTERVAL }} \ + -rollup_interval=${{ vars.L2_ROLLUP_INTERVAL }} \ + -l1_chain_id=${{ vars.L1_CHAIN_ID }} \ + -postgres_db_host=postgres://tenuser:${{ secrets.TEN_POSTGRES_USER_PWD }}@postgres-ten-${{ github.event.inputs.testnet_type }}.postgres.database.azure.com:5432/ \ + start' + check-obscuro-is-healthy: needs: From 66a6da50a702415f76911ab78cdce889ae889618 Mon Sep 17 00:00:00 2001 From: "krishnath.poologanathan" Date: Fri, 13 Sep 2024 18:29:57 +0100 Subject: [PATCH 04/11] fixed syntax issue --- .../workflows/manual-deploy-testnet-l2.yml | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/manual-deploy-testnet-l2.yml b/.github/workflows/manual-deploy-testnet-l2.yml index cbaef0d0e8..18951865bd 100644 --- a/.github/workflows/manual-deploy-testnet-l2.yml +++ b/.github/workflows/manual-deploy-testnet-l2.yml @@ -220,7 +220,7 @@ jobs: uses: azure/CLI@v1 with: inlineScript: | - az vm run-command invoke -g Testnet -n "${{ vars.AZURE_RESOURCE_PREFIX }}-${{ matrix.host_id }}-${{ GITHUB.RUN_NUMBER }}" \ + az vm run-command invoke -g Testnet -n "${{ vars.AZURE_RESOURCE_PREFIX }}-${{ matrix.host_id }}-${{ GITHUB.RUN_NUMBER }}" \ --command-id RunShellScript \ --scripts 'mkdir -p /home/obscuro \ && git clone --depth 1 -b ${{ env.BRANCH_NAME }} https://github.com/ten-protocol/go-ten.git /home/obscuro/go-obscuro \ @@ -253,18 +253,18 @@ jobs: - host: unix:///var/run/docker.sock refresh_interval: 5s relabel_configs: - - source_labels: ['__meta_docker_container_name'] + - source_labels: ["__meta_docker_container_name"] regex: '/(.*)' - target_label: 'container' - - source_labels: ['__meta_docker_container_log_stream'] - target_label: 'logstream' - - source_labels: ['__meta_docker_container_label_logging_jobname'] - target_label: 'job' + target_label: "container" + - source_labels: ["__meta_docker_container_log_stream"] + target_label: "logstream" + - source_labels: ["__meta_docker_container_label_logging_jobname"] + target_label: "job" - replacement: ${{ matrix.host_id }}-${{ github.event.inputs.testnet_type }}-${{ GITHUB.RUN_NUMBER }} - target_label: node_name + target_label: "node_name" " > /home/obscuro/promtail/promtail-config.yaml \ && docker run -d --name promtail \ - --network ten_node \ + --network ten_node \ -e HOSTNAME=${{ matrix.host_id }}-${{ github.event.inputs.testnet_type }}-${{ GITHUB.RUN_NUMBER }} \ -v /var/log:/var/log \ -v /home/obscuro/promtail:/etc/promtail \ @@ -273,7 +273,7 @@ jobs: grafana/promtail:latest \ -config.file=/etc/promtail/promtail-config.yaml -config.expand-env=true \ && cd /home/obscuro/go-obscuro/ \ - && sudo go run /home/obscuro/go-obscuro/go/node/cmd \ + && sudo go run /home/obscuro/go-obscuro/go/node/cmd \ -is_genesis=${{ matrix.is_genesis }} \ -node_type=${{ matrix.node_type }} \ -is_sgx_enabled=true \ @@ -294,10 +294,11 @@ jobs: -max_batch_interval=${{ vars.L2_MAX_BATCH_INTERVAL }} \ -rollup_interval=${{ vars.L2_ROLLUP_INTERVAL }} \ -l1_chain_id=${{ vars.L1_CHAIN_ID }} \ - -postgres_db_host=postgres://tenuser:${{ secrets.TEN_POSTGRES_USER_PWD }}@postgres-ten-${{ github.event.inputs.testnet_type }}.postgres.database.azure.com:5432/ \ + -postgres_db_host=postgres://tenuser:${{ secrets.TEN_POSTGRES_USER_PWD }}@postgres-ten-${{ github.event.inputs.testnet_type }}.postgres.database.azure.com:5432/ \ start' + check-obscuro-is-healthy: needs: - build From a04a28714460556e9a39a315d0a338af0cdc6a61 Mon Sep 17 00:00:00 2001 From: "krishnath.poologanathan" Date: Fri, 13 Sep 2024 18:55:25 +0100 Subject: [PATCH 05/11] fixed syntax issue --- .../workflows/manual-deploy-testnet-l2.yml | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/manual-deploy-testnet-l2.yml b/.github/workflows/manual-deploy-testnet-l2.yml index 18951865bd..66eefc64fe 100644 --- a/.github/workflows/manual-deploy-testnet-l2.yml +++ b/.github/workflows/manual-deploy-testnet-l2.yml @@ -248,20 +248,20 @@ jobs: password: ${{ secrets.LOKI_PASSWORD }} scrape_configs: - - job_name: flog_scrape - docker_sd_configs: - - host: unix:///var/run/docker.sock - refresh_interval: 5s - relabel_configs: - - source_labels: ["__meta_docker_container_name"] - regex: '/(.*)' - target_label: "container" - - source_labels: ["__meta_docker_container_log_stream"] - target_label: "logstream" - - source_labels: ["__meta_docker_container_label_logging_jobname"] - target_label: "job" - - replacement: ${{ matrix.host_id }}-${{ github.event.inputs.testnet_type }}-${{ GITHUB.RUN_NUMBER }} - target_label: "node_name" + - job_name: flog_scrape + docker_sd_configs: + - host: unix:///var/run/docker.sock + refresh_interval: 5s + relabel_configs: + - source_labels: [\"__meta_docker_container_name\"] + regex: \"/(.*)\" + target_label: \"container\" + - source_labels: [\"__meta_docker_container_log_stream\"] + target_label: \"logstream\" + - source_labels: [\"__meta_docker_container_label_logging_jobname\"] + target_label: \"job\" + - replacement: ${{ matrix.host_id }}-${{ github.event.inputs.testnet_type }}-${{ GITHUB.RUN_NUMBER }} + target_label: "node_name" " > /home/obscuro/promtail/promtail-config.yaml \ && docker run -d --name promtail \ --network ten_node \ From fd37489aa6bc0556c793afa94e9924bf9adeba10 Mon Sep 17 00:00:00 2001 From: "krishnath.poologanathan" Date: Sat, 14 Sep 2024 18:46:09 +0100 Subject: [PATCH 06/11] fixed l2 workflow --- .../workflows/manual-deploy-testnet-l2.yml | 52 +++++++++---------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/.github/workflows/manual-deploy-testnet-l2.yml b/.github/workflows/manual-deploy-testnet-l2.yml index 66eefc64fe..2bb0f65c90 100644 --- a/.github/workflows/manual-deploy-testnet-l2.yml +++ b/.github/workflows/manual-deploy-testnet-l2.yml @@ -215,12 +215,12 @@ jobs: - name: 'Allow time for VM initialization' shell: bash run: sleep 60 - + - name: 'Start Obscuro node-${{ matrix.host_id }} on Azure' uses: azure/CLI@v1 with: inlineScript: | - az vm run-command invoke -g Testnet -n "${{ vars.AZURE_RESOURCE_PREFIX }}-${{ matrix.host_id }}-${{ GITHUB.RUN_NUMBER }}" \ + az vm run-command invoke -g Testnet -n "${{ vars.AZURE_RESOURCE_PREFIX }}-${{ matrix.host_id }}-${{ GITHUB.RUN_NUMBER }}" \ --command-id RunShellScript \ --scripts 'mkdir -p /home/obscuro \ && git clone --depth 1 -b ${{ env.BRANCH_NAME }} https://github.com/ten-protocol/go-ten.git /home/obscuro/go-obscuro \ @@ -273,31 +273,29 @@ jobs: grafana/promtail:latest \ -config.file=/etc/promtail/promtail-config.yaml -config.expand-env=true \ && cd /home/obscuro/go-obscuro/ \ - && sudo go run /home/obscuro/go-obscuro/go/node/cmd \ - -is_genesis=${{ matrix.is_genesis }} \ - -node_type=${{ matrix.node_type }} \ - -is_sgx_enabled=true \ - -host_id=${{ vars[matrix.node_addr_lookup] }} \ - -l1_ws_url=${{ secrets[matrix.node_l1_ws_lookup] }} \ - -management_contract_addr=${{needs.build.outputs.MGMT_CONTRACT_ADDR}} \ - -message_bus_contract_addr=${{needs.build.outputs.MSG_BUS_CONTRACT_ADDR}} \ - -l1_start=${{needs.build.outputs.L1_START_HASH}} \ - -private_key=${{ secrets[matrix.node_pk_lookup] }} \ - -sequencer_addr=obscuronode-0-${{ github.event.inputs.testnet_type }}-${{ GITHUB.RUN_NUMBER }}.uksouth.cloudapp.azure.com:10000 \ - -host_public_p2p_addr=obscuronode-${{ matrix.host_id }}-${{ github.event.inputs.testnet_type }}-${{ GITHUB.RUN_NUMBER }}.uksouth.cloudapp.azure.com:10000 \ - -host_p2p_port=10000 \ - -enclave_docker_image=${{ vars.L2_ENCLAVE_DOCKER_BUILD_TAG }} \ - -host_docker_image=${{ vars.L2_HOST_DOCKER_BUILD_TAG }} \ - -is_debug_namespace_enabled=true \ - -log_level=${{ github.event.inputs.log_level }} \ - -batch_interval=${{ vars.L2_BATCH_INTERVAL }} \ - -max_batch_interval=${{ vars.L2_MAX_BATCH_INTERVAL }} \ - -rollup_interval=${{ vars.L2_ROLLUP_INTERVAL }} \ - -l1_chain_id=${{ vars.L1_CHAIN_ID }} \ - -postgres_db_host=postgres://tenuser:${{ secrets.TEN_POSTGRES_USER_PWD }}@postgres-ten-${{ github.event.inputs.testnet_type }}.postgres.database.azure.com:5432/ \ - start' - - + && sudo go run /home/obscuro/go-obscuro/go/node/cmd \ + -is_genesis=${{ matrix.is_genesis }} \ + -node_type=${{ matrix.node_type }} \ + -is_sgx_enabled=true \ + -host_id=${{ vars[matrix.node_addr_lookup] }} \ + -l1_ws_url=${{ secrets[matrix.node_l1_ws_lookup] }} \ + -management_contract_addr=${{needs.build.outputs.MGMT_CONTRACT_ADDR}} \ + -message_bus_contract_addr=${{needs.build.outputs.MSG_BUS_CONTRACT_ADDR}} \ + -l1_start=${{needs.build.outputs.L1_START_HASH}} \ + -private_key=${{ secrets[matrix.node_pk_lookup] }} \ + -sequencer_addr=obscuronode-0-${{ github.event.inputs.testnet_type }}-${{ GITHUB.RUN_NUMBER }}.uksouth.cloudapp.azure.com:10000 \ + -host_public_p2p_addr=obscuronode-${{ matrix.host_id }}-${{ github.event.inputs.testnet_type }}-${{ GITHUB.RUN_NUMBER }}.uksouth.cloudapp.azure.com:10000 \ + -host_p2p_port=10000 \ + -enclave_docker_image=${{ vars.L2_ENCLAVE_DOCKER_BUILD_TAG }} \ + -host_docker_image=${{ vars.L2_HOST_DOCKER_BUILD_TAG }} \ + -is_debug_namespace_enabled=true \ + -log_level=${{ github.event.inputs.log_level }} \ + -batch_interval=${{ vars.L2_BATCH_INTERVAL }} \ + -max_batch_interval=${{ vars.L2_MAX_BATCH_INTERVAL }} \ + -rollup_interval=${{ vars.L2_ROLLUP_INTERVAL }} \ + -l1_chain_id=${{ vars.L1_CHAIN_ID }} \ + -postgres_db_host=postgres://tenuser:${{ secrets.TEN_POSTGRES_USER_PWD }}@postgres-ten-${{ github.event.inputs.testnet_type }}.postgres.database.azure.com:5432/ \ + start' check-obscuro-is-healthy: needs: From fc223805d0d4e7db49565b582117f2d7dc493935 Mon Sep 17 00:00:00 2001 From: "krishnath.poologanathan" Date: Sat, 14 Sep 2024 23:06:34 +0100 Subject: [PATCH 07/11] fixed docker network --- .github/workflows/manual-deploy-testnet-l2.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/manual-deploy-testnet-l2.yml b/.github/workflows/manual-deploy-testnet-l2.yml index 2bb0f65c90..f325087108 100644 --- a/.github/workflows/manual-deploy-testnet-l2.yml +++ b/.github/workflows/manual-deploy-testnet-l2.yml @@ -264,7 +264,7 @@ jobs: target_label: "node_name" " > /home/obscuro/promtail/promtail-config.yaml \ && docker run -d --name promtail \ - --network ten_node \ + --network node_network \ -e HOSTNAME=${{ matrix.host_id }}-${{ github.event.inputs.testnet_type }}-${{ GITHUB.RUN_NUMBER }} \ -v /var/log:/var/log \ -v /home/obscuro/promtail:/etc/promtail \ From 12f21574661fea8dcfd488ff2f37ea76b2bcc4a4 Mon Sep 17 00:00:00 2001 From: "krishnath.poologanathan" Date: Mon, 16 Sep 2024 09:18:47 +0100 Subject: [PATCH 08/11] removed basic auth in promtail config --- .github/workflows/manual-deploy-testnet-l2.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/manual-deploy-testnet-l2.yml b/.github/workflows/manual-deploy-testnet-l2.yml index f325087108..48859a73be 100644 --- a/.github/workflows/manual-deploy-testnet-l2.yml +++ b/.github/workflows/manual-deploy-testnet-l2.yml @@ -243,9 +243,6 @@ jobs: batchsize: 1048576 tls_config: insecure_skip_verify: true - basic_auth: - username: ${{ secrets.LOKI_USER }} - password: ${{ secrets.LOKI_PASSWORD }} scrape_configs: - job_name: flog_scrape From 16c59efca3d2168d0d17d93a38ec1dfc853dd973 Mon Sep 17 00:00:00 2001 From: "krishnath.poologanathan" Date: Mon, 16 Sep 2024 11:22:13 +0100 Subject: [PATCH 09/11] added basic auth in promtail config --- .github/workflows/manual-deploy-testnet-l2.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/manual-deploy-testnet-l2.yml b/.github/workflows/manual-deploy-testnet-l2.yml index 48859a73be..f325087108 100644 --- a/.github/workflows/manual-deploy-testnet-l2.yml +++ b/.github/workflows/manual-deploy-testnet-l2.yml @@ -243,6 +243,9 @@ jobs: batchsize: 1048576 tls_config: insecure_skip_verify: true + basic_auth: + username: ${{ secrets.LOKI_USER }} + password: ${{ secrets.LOKI_PASSWORD }} scrape_configs: - job_name: flog_scrape From ffb22324aabd6a471d98c36b656902eec47854bc Mon Sep 17 00:00:00 2001 From: "krishnath.poologanathan" Date: Mon, 16 Sep 2024 12:13:29 +0100 Subject: [PATCH 10/11] replaced datadog agentd in testnet-l1 and validator workflows --- .../workflows/manual-deploy-testnet-l1.yml | 58 ++++++++++++++----- .../manual-deploy-testnet-validator.yml | 58 ++++++++++++++----- 2 files changed, 88 insertions(+), 28 deletions(-) diff --git a/.github/workflows/manual-deploy-testnet-l1.yml b/.github/workflows/manual-deploy-testnet-l1.yml index 2ccace0ff1..01cc0dc887 100644 --- a/.github/workflows/manual-deploy-testnet-l1.yml +++ b/.github/workflows/manual-deploy-testnet-l1.yml @@ -113,20 +113,50 @@ jobs: && sudo snap refresh \ && curl -fsSL https://get.docker.com -o get-docker.sh && sh ./get-docker.sh \ && docker network create --driver bridge l1_network || true \ - && docker run -d --name datadog-agent \ - --network l1_network \ - -e DD_API_KEY=${{ secrets.DD_API_KEY }} \ - -e DD_LOGS_ENABLED=true \ - -e DD_LOGS_CONFIG_CONTAINER_COLLECT_ALL=true \ - -e DD_LOGS_CONFIG_AUTO_MULTI_LINE_DETECTION=true \ - -e DD_CONTAINER_EXCLUDE_LOGS="name:datadog-agent" \ - -e DD_SITE="datadoghq.eu" \ - -v /var/run/docker.sock:/var/run/docker.sock:ro \ - -v /proc/:/host/proc/:ro \ - -v /opt/datadog-agent/run:/opt/datadog-agent/run:rw \ - -v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro \ - --log-opt max-file=3 --log-opt max-size=10m \ - datadog/agent:latest \ + && mkdir -p /home/obscuro/promtail \ + && echo " + server: + http_listen_port: 9080 + grpc_listen_port: 0 + + positions: + filename: /tmp/positions.yaml + + clients: + - url: ${{ vars.METRICS_URI }} + batchwait: 3s + batchsize: 1048576 + tls_config: + insecure_skip_verify: true + basic_auth: + username: ${{ secrets.LOKI_USER }} + password: ${{ secrets.LOKI_PASSWORD }} + + scrape_configs: + - job_name: flog_scrape + docker_sd_configs: + - host: unix:///var/run/docker.sock + refresh_interval: 5s + relabel_configs: + - source_labels: [\"__meta_docker_container_name\"] + regex: \"/(.*)\" + target_label: \"container\" + - source_labels: [\"__meta_docker_container_log_stream\"] + target_label: \"logstream\" + - source_labels: [\"__meta_docker_container_label_logging_jobname\"] + target_label: \"job\" + - replacement: ${{ matrix.host_id }}-${{ github.event.inputs.testnet_type }}-${{ GITHUB.RUN_NUMBER }} + target_label: "node_name" + " > /home/obscuro/promtail/promtail-config.yaml \ + && docker run -d --name promtail \ + --network l1_network \ + -e HOSTNAME=${{ matrix.host_id }}-${{ github.event.inputs.testnet_type }}-${{ GITHUB.RUN_NUMBER }} \ + -v /var/log:/var/log \ + -v /home/obscuro/promtail:/etc/promtail \ + -v /var/lib/docker/containers:/var/lib/docker/containers:ro \ + -v /var/run/docker.sock:/var/run/docker.sock \ + grafana/promtail:latest \ + -config.file=/etc/promtail/promtail-config.yaml -config.expand-env=true \ && docker run -d \ -p 8025:8025 -p 8026:8026 -p 9000:9000 -p 9001:9001 \ --entrypoint /home/obscuro/go-obscuro/integration/eth2network/main/main ${{ vars.DOCKER_BUILD_TAG_ETH2NETWORK }} \ diff --git a/.github/workflows/manual-deploy-testnet-validator.yml b/.github/workflows/manual-deploy-testnet-validator.yml index 11d8f5d847..986b5d0e19 100644 --- a/.github/workflows/manual-deploy-testnet-validator.yml +++ b/.github/workflows/manual-deploy-testnet-validator.yml @@ -148,20 +148,50 @@ jobs: --scripts 'mkdir -p /home/obscuro \ && git clone --depth 1 -b ${{ env.BRANCH_NAME }} https://github.com/ten-protocol/go-ten.git /home/obscuro/go-obscuro \ && docker network create --driver bridge node_network || true \ - && docker run -d --name datadog-agent \ - --network node_network \ - -e DD_API_KEY=${{ secrets.DD_API_KEY }} \ - -e DD_LOGS_ENABLED=true \ - -e DD_LOGS_CONFIG_CONTAINER_COLLECT_ALL=true \ - -e DD_LOGS_CONFIG_AUTO_MULTI_LINE_DETECTION=true \ - -e DD_CONTAINER_EXCLUDE_LOGS="name:datadog-agent" \ - -e DD_SITE="datadoghq.eu" \ - -v /var/run/docker.sock:/var/run/docker.sock:ro \ - -v /proc/:/host/proc/:ro \ - -v /opt/datadog-agent/run:/opt/datadog-agent/run:rw \ - -v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro \ - --log-opt max-file=3 --log-opt max-size=10m \ - datadog/agent:latest \ + && mkdir -p /home/obscuro/promtail \ + && echo " + server: + http_listen_port: 9080 + grpc_listen_port: 0 + + positions: + filename: /tmp/positions.yaml + + clients: + - url: ${{ vars.METRICS_URI }} + batchwait: 3s + batchsize: 1048576 + tls_config: + insecure_skip_verify: true + basic_auth: + username: ${{ secrets.LOKI_USER }} + password: ${{ secrets.LOKI_PASSWORD }} + + scrape_configs: + - job_name: flog_scrape + docker_sd_configs: + - host: unix:///var/run/docker.sock + refresh_interval: 5s + relabel_configs: + - source_labels: [\"__meta_docker_container_name\"] + regex: \"/(.*)\" + target_label: \"container\" + - source_labels: [\"__meta_docker_container_log_stream\"] + target_label: \"logstream\" + - source_labels: [\"__meta_docker_container_label_logging_jobname\"] + target_label: \"job\" + - replacement: ${{ matrix.host_id }}-${{ github.event.inputs.testnet_type }}-${{ GITHUB.RUN_NUMBER }} + target_label: "node_name" + " > /home/obscuro/promtail/promtail-config.yaml \ + && docker run -d --name promtail \ + --network node_network \ + -e HOSTNAME=${{ matrix.host_id }}-${{ github.event.inputs.testnet_type }}-${{ GITHUB.RUN_NUMBER }} \ + -v /var/log:/var/log \ + -v /home/obscuro/promtail:/etc/promtail \ + -v /var/lib/docker/containers:/var/lib/docker/containers:ro \ + -v /var/run/docker.sock:/var/run/docker.sock \ + grafana/promtail:latest \ + -config.file=/etc/promtail/promtail-config.yaml -config.expand-env=true \ && cd /home/obscuro/go-obscuro/ \ && sudo go run /home/obscuro/go-obscuro/go/node/cmd \ -is_genesis=false \ From cf412a3997e330f12f5287c5a4d1ca5bd066a46c Mon Sep 17 00:00:00 2001 From: "krishnath.poologanathan" Date: Mon, 16 Sep 2024 13:34:27 +0100 Subject: [PATCH 11/11] fixed host name in L1 and validators --- .github/workflows/manual-deploy-testnet-l1.yml | 4 ++-- .github/workflows/manual-deploy-testnet-validator.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/manual-deploy-testnet-l1.yml b/.github/workflows/manual-deploy-testnet-l1.yml index 01cc0dc887..7f23f0689c 100644 --- a/.github/workflows/manual-deploy-testnet-l1.yml +++ b/.github/workflows/manual-deploy-testnet-l1.yml @@ -145,12 +145,12 @@ jobs: target_label: \"logstream\" - source_labels: [\"__meta_docker_container_label_logging_jobname\"] target_label: \"job\" - - replacement: ${{ matrix.host_id }}-${{ github.event.inputs.testnet_type }}-${{ GITHUB.RUN_NUMBER }} + - replacement: ${{ github.event.inputs.testnet_type }}-eth2network-${{ GITHUB.RUN_NUMBER }} target_label: "node_name" " > /home/obscuro/promtail/promtail-config.yaml \ && docker run -d --name promtail \ --network l1_network \ - -e HOSTNAME=${{ matrix.host_id }}-${{ github.event.inputs.testnet_type }}-${{ GITHUB.RUN_NUMBER }} \ + -e HOSTNAME=${{ github.event.inputs.testnet_type }}-eth2network-${{ GITHUB.RUN_NUMBER }} \ -v /var/log:/var/log \ -v /home/obscuro/promtail:/etc/promtail \ -v /var/lib/docker/containers:/var/lib/docker/containers:ro \ diff --git a/.github/workflows/manual-deploy-testnet-validator.yml b/.github/workflows/manual-deploy-testnet-validator.yml index 986b5d0e19..ece09cb703 100644 --- a/.github/workflows/manual-deploy-testnet-validator.yml +++ b/.github/workflows/manual-deploy-testnet-validator.yml @@ -180,12 +180,12 @@ jobs: target_label: \"logstream\" - source_labels: [\"__meta_docker_container_label_logging_jobname\"] target_label: \"job\" - - replacement: ${{ matrix.host_id }}-${{ github.event.inputs.testnet_type }}-${{ GITHUB.RUN_NUMBER }} + - replacement: ${{ vars.AZURE_RESOURCE_PREFIX }}-${{ github.event.inputs.node_id }}-${{ GITHUB.RUN_NUMBER }} target_label: "node_name" " > /home/obscuro/promtail/promtail-config.yaml \ && docker run -d --name promtail \ --network node_network \ - -e HOSTNAME=${{ matrix.host_id }}-${{ github.event.inputs.testnet_type }}-${{ GITHUB.RUN_NUMBER }} \ + -e HOSTNAME=${{ vars.AZURE_RESOURCE_PREFIX }}-${{ github.event.inputs.node_id }}-${{ GITHUB.RUN_NUMBER }} \ -v /var/log:/var/log \ -v /home/obscuro/promtail:/etc/promtail \ -v /var/lib/docker/containers:/var/lib/docker/containers:ro \