Add whois and upgrade to 2.1.0

This commit is contained in:
Tim Evens 2022-02-22 14:30:05 -08:00
parent a1d00198dd
commit 492c000ce9
6 changed files with 97 additions and 22 deletions

View File

@ -1,7 +1,7 @@
# syntax=docker/dockerfile:1.3
# Collector: openbmp/collector
#
# Copyright (c) 2021-2022 Cisco Systems, Inc. and Tim Evens. All rights reserved.
# Copyright (c) 2021-2022 Cisco Systems, Inc. and others. All rights reserved.
#
# Author: Tim Evens <tim@openbmp.org>
#
@ -19,8 +19,8 @@
# Example docker build:
# tar -c -C ../../ ./obmp-collector ./obmp-docker/collector \
# | docker buildx build --progress=plain \
# --build-arg VERSION=dev-2.1.0 \
# -f obmp-docker/collector/Dockerfile -t openbmp/collector:dev-2.1.0 -
# --build-arg VERSION=2.1.0 \
# -f obmp-docker/collector/Dockerfile -t openbmp/collector:2.1.0 -
#
# -----------------------------------------------

View File

@ -1,7 +1,6 @@
# Development build container: openbmp/dev-image
#
# Copyright (c) 2021-2022 Cisco Systems, Inc. and others. All rights reserved.
# Copyright (c) 2021-2022 Tim Evens. All rights reserved.
#
# Container used to build the OpenBMP components
#

View File

@ -25,7 +25,7 @@ services:
depends_on:
- zookeeper
ports:
- 9092:9092
- "9092:9092"
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: obmp-zookeeper:2181
@ -50,7 +50,7 @@ services:
container_name: obmp-grafana
image: grafana/grafana:8.3.4
ports:
- 3000:3000
- "3000:3000"
volumes:
- ${OBMP_DATA_ROOT}/grafana:/var/lib/grafana
- ${OBMP_DATA_ROOT}/grafana/provisioning:/etc/grafana/provisioning/
@ -58,14 +58,15 @@ services:
- GF_SECURITY_ADMIN_PASSWORD=openbmp
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_SERVER_ROOT_URL=/ # Change this if you have grafana behind URL/paths, such as /grafana/
- GF_INSTALL_PLUGINS=agenty-flowcharting-panel,briangann-datatable-panel,digrich-bubblechart-panel,grafana-piechart-panel,grafana-worldmap-panel,vonage-status-panel
- GF_INSTALL_PLUGINS=agenty-flowcharting-panel,grafana-piechart-panel,grafana-worldmap-panel,grafana-simple-json-datasource,vonage-status-panel
psql:
restart: unless-stopped
container_name: obmp-psql
image: openbmp/postgres:2.0.3
image: openbmp/postgres:2.1.0
shm_size: 1024m
ports:
- 5432:5432
- "5432:5432"
volumes:
- ${OBMP_DATA_ROOT}/postgres/data:/var/lib/postgresql/data # change this to 80GB SSD slice/partition
- ${OBMP_DATA_ROOT}/postgres/ts:/var/lib/postgresql/ts # Chnage this to 500GB SSD slice/partition
@ -78,13 +79,13 @@ services:
collector:
restart: unless-stopped
container_name: obmp-collector
image: openbmp/collector:2.0.3
image: openbmp/collector:2.1.0
sysctls:
- net.ipv4.tcp_keepalive_intvl=30
- net.ipv4.tcp_keepalive_probes=5
- net.ipv4.tcp_keepalive_time=180
ports:
- 5000:5000
- "5000:5000"
volumes:
- ${OBMP_DATA_ROOT}/config:/config
environment:
@ -93,13 +94,13 @@ services:
psql-app:
restart: unless-stopped
container_name: obmp-psql-app
image: openbmp/psql-app:2.0.3
image: openbmp/psql-app:2.1.0
sysctls:
- net.ipv4.tcp_keepalive_intvl=30
- net.ipv4.tcp_keepalive_probes=5
- net.ipv4.tcp_keepalive_time=180
ports:
- 9005:9005
- "9005:9005"
volumes:
- ${OBMP_DATA_ROOT}/config:/config
@ -132,3 +133,22 @@ services:
- POSTGRES_DROP_stats_ip_origins='4 weeks'
- POSTGRES_DROP_stats_peer_rib='4 weeks'
- POSTGRES_DROP_stats_peer_update_counts='4 weeks'
whois:
restart: unless-stopped
container_name: obmp-whois
image: openbmp/whois:2.1.0
sysctls:
- net.ipv4.tcp_keepalive_intvl=30
- net.ipv4.tcp_keepalive_probes=5
- net.ipv4.tcp_keepalive_time=180
ports:
- "4300:43"
# volumes:
# - ${OBMP_DATA_ROOT}/config:/config
environment:
- POSTGRES_PASSWORD=openbmp
- POSTGRES_USER=openbmp
- POSTGRES_DB=openbmp
- POSTGRES_HOST=obmp-psql
- POSTGRES_PORT=5432

View File

@ -1,16 +1,16 @@
# Postgres Container
#
# Copyright (c) 2021-2022 Cisco Systems, Inc. and Tim Evens. All rights reserved.
# Copyright (c) 2021-2022 Cisco Systems, Inc. and others. All rights reserved.
#
# Build:
# docker build --platform linux/amd64 -t openbmp/postgres:2.0.3 .
# docker build --platform linux/amd64 -t openbmp/postgres:2.1.0 .
#
# Run:
# docker run --rm -it -p 5432:5432 \
# -e POSTGRES_PASSWORD=openbmp \
# -e POSTGRES_USER=openbmp \
# -e POSTGRES_DB=openbmp \
# openbmp/postgres:2.0.2
# openbmp/postgres:2.1.0
FROM timescale/timescaledb:2.5.1-pg14
@ -36,9 +36,7 @@ RUN apk update \
&& sed -i -e "s/^\#*listen_addresses.*=.*/listen_addresses = '*'/" /usr/local/share/postgresql/postgresql.conf.sample \
&& sed -i -e "s/^\#*ssl[ ]*=.*/ssl = on/" /usr/local/share/postgresql/postgresql.conf.sample \
&& sed -i -e "s/^\#*ssl_cert_file.*=.*/ssl_cert_file = \'\/psql_server.crt\'/" /usr/local/share/postgresql/postgresql.conf.sample \
&& sed -i -e "s/^\#*ssl_key_file.*=.*/ssl_key_file = \'\/psql_server.key\'/" /usr/local/share/postgresql/postgresql.conf.sample \
&& sed -i -e "s/^\#*shared_buffers.*=.*/shared_buffers = ${MEM:-1}GB/" /usr/local/share/postgresql/postgresql.conf.sample \
&& sed -i -e "s/^\#*work_mem.*=.*/work_mem = $(( (${MEM:-1} * 1024) * 5 / 100))MB/" /usr/local/share/postgresql/postgresql.conf.sample
&& sed -i -e "s/^\#*ssl_key_file.*=.*/ssl_key_file = \'\/psql_server.key\'/" /usr/local/share/postgresql/postgresql.conf.sample
# Init timesries location
RUN echo 'mkdir -p /var/lib/postgresql/ts/data' > /docker-entrypoint-initdb.d/0_obmp_init.sh \

View File

@ -1,7 +1,7 @@
# syntax=docker/dockerfile:1.3
# Postgres Backend: openbmp/psql-app
#
# Copyright (c) 2021-2022 Cisco Systems, Inc. and Tim Evens. All rights reserved.
# Copyright (c) 2021-2022 Cisco Systems, Inc. and others. All rights reserved.
#
# Author: Tim Evens <tim@openbmp.org>
#
@ -17,8 +17,8 @@
# Example docker build:
# tar -c -C ../../ ./obmp-psql ./obmp-docker/psql-app ./obmp-java-api-message \
# | docker buildx build --platform linux/amd64 --progress=plain \
# --build-arg VERSION=dev-2.1.0 \
# -f obmp-docker/psql-app/Dockerfile -t openbmp/psql-app:dev-2.1.0 -
# --build-arg VERSION=2.1.0 \
# -f obmp-docker/psql-app/Dockerfile -t openbmp/psql-app:2.1.0 -
# -----------------------------------------------
# stage: Build

58
whois/Dockerfile Normal file
View File

@ -0,0 +1,58 @@
# syntax=docker/dockerfile:1.3
# Postgres Backend: openbmp/whois
#
# Copyright (c) 2022 Cisco Systems, Inc. and others. All rights reserved.
#
# BUILD:
# tar -c -C ../../ ./obmp-whois ./obmp-docker/whois \
# | docker buildx build --platform linux/amd64 --progress=plain \
# -f obmp-docker/whois/Dockerfile -t openbmp/whois:2.1.0 -
# -----------------------------------------------
# stage: Build
# -----------------------------------------------
FROM golang:alpine AS build
WORKDIR /ws
COPY obmp-whois/ /ws
ENV GO111MODULE=on
ENV GCGO_ENABLED=0
ENV GOARCH=amd64
ENV GOOS=linux
RUN apk add --no-cache bash git
RUN cd /ws && go mod tidy
# Build the app
RUN cd /ws && go build -o obmp-whoisd .
# -----------------------------------------------
# stage: Final container
# -----------------------------------------------
FROM alpine
COPY --from=build /ws/obmp-whoisd /usr/local/bin/
WORKDIR /tmp
# Environment varialbes that should be set when running container
# Defaults are given below
ENV DB_MAX_THREADS=10
ENV WHOIS_PORT=43
ENV PGHOST=obmp-psql
ENV PGDATABASE=openbmp
ENV PGUSER=openbmp
ENV PGPASSWORD=openbmp
ENV PGPORT=5432
EXPOSE 43
# -- general depends
RUN apk add --no-cache bash
# -- set entry point to bash and act as login (load profile)
ENTRYPOINT /usr/local/bin/obmp-whoisd --logfile /dev/stdout -p $WHOIS_PORT -t $DB_MAX_THREADS