Skip to content

Commit

Permalink
Merge pull request #258 from miyurud/docker-compose-fix
Browse files Browse the repository at this point in the history
Add docker compose scripts
  • Loading branch information
miyurud authored Nov 7, 2024
2 parents 18dfd3e + 499a66a commit 1d884c1
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 0 deletions.
14 changes: 14 additions & 0 deletions conf/prometheus.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
global:
scrape_interval: 15s
external_labels:
monitor: "codelab-monitor"
scrape_configs:
- job_name: "prometheus"
scrape_interval: 5s
static_configs:
- targets: ["localhost:9090"]

- job_name: "pushgateway"
scrape_interval: 2s
static_configs:
- targets: ["172.28.5.3"]
45 changes: 45 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
services:
jasminegraph:
image: jasminegraph:latest
ports:
- '7777:7777'
- '7778:7778'
volumes:
- '/var/run/docker.sock:/var/run/docker.sock:rw'
- './env/databases/metadb:/home/ubuntu/software/jasminegraph/metadb'
- './env/databases/performancedb:/home/ubuntu/software/jasminegraph/performancedb'
- './env/data:/var/tmp/data'
- '/tmp/jasminegraph:/tmp/jasminegraph'
networks:
- jasminenet
command: --MODE 1 --MASTERIP 172.28.5.1 --WORKERS 2 --WORKERIP 172.28.5.1 --ENABLE_NMON false
depends_on:
- prometheus
prometheus:
image: prom/prometheus:latest
ports:
- 9090:9090
volumes:
- './conf/prometheus.yaml:/etc/prometheus/prometheus.yml'
networks:
jasminenet:
ipv4_address: 172.28.5.2
depends_on:
- pushgateway
pushgateway:
image: prom/pushgateway
ports:
- 9091:9091
networks:
jasminenet:
ipv4_address: 172.28.5.3
networks:
jasminenet:
external: false
name: jasminenet
driver: bridge
ipam:
config:
- subnet: 172.28.5.0/24
ip_range: 172.28.5.0/24
gateway: 172.28.5.1
2 changes: 2 additions & 0 deletions start-docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
docker compose up -d jasminegraph prometheus &
18 changes: 18 additions & 0 deletions stop-docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

# Variables
HOST="localhost"
PORT="7777"

# Establish telnet connection and send command
(
sleep 5
echo "shdn"
sleep 5
echo "exit"
sleep 5
) | telnet "$HOST" "$PORT"



docker compose stop prometheus pushgateway &
3 changes: 3 additions & 0 deletions test-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,7 @@ fi

stop_and_remove_containers
force_remove "${TEST_ROOT}/env" "${WORKER_LOG_DIR}"
if [ "$exit_code" = '0' ]; then
docker tag jasminegraph:test jasminegraph:latest
fi
exit "$exit_code"

0 comments on commit 1d884c1

Please sign in to comment.