From f0019e5f2f357fd872d0d636edd6a76f82084cb0 Mon Sep 17 00:00:00 2001 From: Jennifer Echenim Date: Tue, 1 Oct 2024 17:59:25 +0400 Subject: [PATCH 1/2] add pnpm installation to Dockerfiles --- tools/bridge-frontend/Dockerfile | 5 ++++- tools/tenscan/frontend/Dockerfile | 2 ++ tools/walletextension/frontend/Dockerfile | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/bridge-frontend/Dockerfile b/tools/bridge-frontend/Dockerfile index ff95310842..ebbfff4024 100644 --- a/tools/bridge-frontend/Dockerfile +++ b/tools/bridge-frontend/Dockerfile @@ -1,6 +1,9 @@ # Use an official Node.js 22 as a parent image FROM node:22-alpine +# Install pnpm +RUN npm install -g pnpm + # setup container data structure RUN mkdir -p /home/obscuro/go-obscuro/tools COPY ./tools/bridge-frontend /home/obscuro/go-obscuro/tools/bridge-frontend @@ -19,4 +22,4 @@ ENV NEXT_PUBLIC_BRIDGE_GOOGLE_ANALYTICS_ID=${GOOGLE_ANALYTICS_ID} RUN pnpm install -EXPOSE 80 \ No newline at end of file +EXPOSE 80 diff --git a/tools/tenscan/frontend/Dockerfile b/tools/tenscan/frontend/Dockerfile index 77bf0e873e..691489c28a 100644 --- a/tools/tenscan/frontend/Dockerfile +++ b/tools/tenscan/frontend/Dockerfile @@ -1,4 +1,6 @@ FROM node:18-buster as runner +# Install pnpm +RUN npm install -g pnpm # setup container data structure RUN mkdir -p /home/obscuro/go-obscuro/tools/tenscan/ COPY ./tools/tenscan/frontend /home/obscuro/go-obscuro/tools/tenscan/frontend diff --git a/tools/walletextension/frontend/Dockerfile b/tools/walletextension/frontend/Dockerfile index e8f81feb92..341bf8efdf 100644 --- a/tools/walletextension/frontend/Dockerfile +++ b/tools/walletextension/frontend/Dockerfile @@ -1,5 +1,7 @@ # Use an official Node.js LTS version as a base image FROM node:20-alpine AS base +# Install pnpm +RUN npm install -g pnpm ARG NEXT_PUBLIC_NETWORK_NAME From 156c55cb3d7c657c97b4322fb587feb7f410b485 Mon Sep 17 00:00:00 2001 From: krishnath poologanathan Date: Wed, 2 Oct 2024 12:05:37 +0100 Subject: [PATCH 2/2] fix: added promtail for gateway and gateway DB (#2074) Co-authored-by: krishnath.poologanathan --- ...manual-deploy-obscuro-gateway-database.yml | 44 ++++++++++++++++++ .../manual-deploy-obscuro-gateway.yml | 45 +++++++++++++++++++ 2 files changed, 89 insertions(+) diff --git a/.github/workflows/manual-deploy-obscuro-gateway-database.yml b/.github/workflows/manual-deploy-obscuro-gateway-database.yml index 14b671681f..552a4a01c9 100644 --- a/.github/workflows/manual-deploy-obscuro-gateway-database.yml +++ b/.github/workflows/manual-deploy-obscuro-gateway-database.yml @@ -90,6 +90,50 @@ jobs: && curl -fsSL https://get.docker.com -o get-docker.sh && sh ./get-docker.sh \ && 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 \ + && 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 }}-OG-MariaDB-${{ GITHUB.RUN_NUMBER }} + target_label: "node_name" + " > /home/obscuro/promtail/promtail-config.yaml \ + && docker run -d --name promtail \ + --network node_network \ + -e HOSTNAME=${{ github.event.inputs.testnet_type }}-OG-MariaDB-${{ 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/ \ && docker run -d --name ${{ github.event.inputs.testnet_type }}-OG-MariaDB-${{ GITHUB.RUN_NUMBER }} \ -p 3306:3306 \ diff --git a/.github/workflows/manual-deploy-obscuro-gateway.yml b/.github/workflows/manual-deploy-obscuro-gateway.yml index bff2ba871d..9460a16a07 100644 --- a/.github/workflows/manual-deploy-obscuro-gateway.yml +++ b/.github/workflows/manual-deploy-obscuro-gateway.yml @@ -217,7 +217,52 @@ jobs: && curl -fsSL https://get.docker.com -o get-docker.sh && sh ./get-docker.sh \ && 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 \ + && 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: ${{ env.VM_NAME }} + target_label: "node_name" + " > /home/obscuro/promtail/promtail-config.yaml \ + && docker run -d --name promtail \ + --network node_network \ + -e HOSTNAME=${{ env.VM_NAME }} \ + -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/ \ + && mkdir -p /home/obscuro/promtail \ && docker run -d -p 80:80 -p 81:81 --name "${{ env.VM_NAME }}" \ -e OBSCURO_GATEWAY_VERSION="${{ GITHUB.RUN_NUMBER }}-${{ GITHUB.SHA }}" \ --log-opt max-file=3 --log-opt max-size=10m \