Skip to content

Commit

Permalink
fixed host name for promtail config (#2055)
Browse files Browse the repository at this point in the history
* fixed host name for promtail config

* fixed syntax errror in manual-deploy-testnet-l2

* fixed syntax issue

* fixed syntax issue

* fixed syntax issue

* fixed l2 workflow

* fixed docker network

* removed basic auth in promtail config

* added basic auth in promtail config

* replaced datadog agentd in testnet-l1  and validator workflows

* fixed host name in L1 and validators

---------

Co-authored-by: krishnath.poologanathan <krish@krishnaths-MacBook-Pro.local>
  • Loading branch information
pkrishnath and krishnath.poologanathan authored Sep 17, 2024
1 parent ca6843e commit 0bb1220
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 48 deletions.
58 changes: 44 additions & 14 deletions .github/workflows/manual-deploy-testnet-l1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ${{ 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=${{ 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 \
-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 }} \
Expand Down
40 changes: 20 additions & 20 deletions .github/workflows/manual-deploy-testnet-l2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ 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:
Expand Down Expand Up @@ -247,31 +247,31 @@ 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: ${HOSTNAME}
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 \
-e HOSTNAME=${HOSTNAME} \
--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' \
-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 }} \
Expand Down
58 changes: 44 additions & 14 deletions .github/workflows/manual-deploy-testnet-validator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ${{ 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=${{ 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 \
-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 \
Expand Down

0 comments on commit 0bb1220

Please sign in to comment.