Skip to content

Commit

Permalink
Port #1256 for logs on the L1 containers
Browse files Browse the repository at this point in the history
  • Loading branch information
moraygrieve committed Jun 7, 2023
1 parent 108168a commit 53fc9a4
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/manual-deploy-testnet-l1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ jobs:
name: ${{env.L1_CONTAINER_NAME}}
location: 'uksouth'
restart-policy: 'Never'
command-line: /home/obscuro/go-obscuro/integration/eth2network/main/main --blockTimeSecs=15 --numNodes=1 --gethHTTPStartPort=8025 --gethWSStartPort=9000 --prefundedAddrs='${{ secrets.GETHNETWORK_PREFUNDED_ADDR_WORKER }},${{ secrets.GETHNETWORK_PREFUNDED_ADDR_0 }},${{ secrets.GETHNETWORK_PREFUNDED_ADDR_1 }}'
secure-environment-variables: DD_API_KEY=${{ secrets.DD_API_KEY }}
environment-variables: DD_HOSTNAME=${{ github.event.inputs.testnet_type }}-eth2network
command-line: /home/obscuro/go-obscuro/.github/workflows/runner-scripts/run-datadog.sh /home/obscuro/go-obscuro/integration/eth2network/main/main --blockTimeSecs=15 --numNodes=1 --gethHTTPStartPort=8025 --gethWSStartPort=9000 --prefundedAddrs='${{ secrets.GETHNETWORK_PREFUNDED_ADDR_WORKER }},${{ secrets.GETHNETWORK_PREFUNDED_ADDR_0 }},${{ secrets.GETHNETWORK_PREFUNDED_ADDR_1 }}'
# Ports start at 9000 for Websockets and 8000 for Start port and 80025 for Http Port
# Each node has Port + id
ports: '8025 8026 9000 9001'
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/runner-scripts/conf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
logs:
- type: file
path: "/home/obscuro/go-obscuro/integration/.build/eth2/*/geth*.log"
service: "geth"
source: "eth2network"
- type: file
path: "/home/obscuro/go-obscuro/integration/.build/eth2/*/prysm*.log"
service: "prysm"
source: "eth2network"
27 changes: 27 additions & 0 deletions .github/workflows/runner-scripts/run-datadog.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash

#
# This script installs and runs datadog before running the actual command
# It requires that DD_API_KEY and DD_HOSTNAME is set, will fail otherwise
#

# 1. Check if the DD_API_KEY env var is set, exit with error otherwise
if [ -z "$DD_API_KEY" ] || [ -z "$DD_HOSTNAME" ]
then
echo "Either DD_API_KEY and/or DD_HOSTNAME is not set. Exiting."
exit 1
fi

# Install datadog agent
DD_API_KEY=none DD_HOSTNAME=none DD_INSTALL_ONLY=true DD_SITE="datadoghq.eu" bash -c "$(curl -L https://s3.amazonaws.com/dd-agent/scripts/install_script_agent7.sh)"
sed -i 's/# logs_enabled: false/logs_enabled: true/' /etc/datadog-agent/datadog.yaml
mkdir -p /etc/datadog-agent/conf.d/eth2network.d/
cp -p /home/obscuro/go-obscuro/.github/workflows/runner-scripts/conf.yml /etc/datadog-agent/conf.d/eth2network.d/conf.yml

sed -i "s/api_key: none/api_key: ${DD_API_KEY}/" /etc/datadog-agent/datadog.yaml
sed -i "s/hostname: none/hostname: ${DD_HOSTNAME}/" /etc/datadog-agent/datadog.yaml

service datadog-agent start

# 3. Execute whatever is in the arguments as a command
"$@"
1 change: 0 additions & 1 deletion testnet/eth2network.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# Build stage for downloading dependencies based on the core defined system
FROM golang:1.18-buster as get-dependencies

# create the base directory
# setup container data structure
RUN mkdir -p /home/obscuro/go-obscuro

Expand Down

0 comments on commit 53fc9a4

Please sign in to comment.