Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
FROM debian:bullseye-slim AS cppbuild

ENV BUILD_DEPS "g++ cmake make git pkgconf jq python3-pip python3-setuptools"
ENV BUILD_DEPS "g++ cmake make git pkgconf jq python3-pip python3-setuptools ca-certificates"

RUN \
apt-get update && \
apt-get upgrade && \
apt-get install --yes --no-install-recommends ${BUILD_DEPS} && \
pip3 install conan

Expand All @@ -15,7 +16,7 @@ RUN \
conan profile update settings.compiler.libcxx=libstdc++11 default

RUN \
PKG_CONFIG_PATH=/local/lib/pkgconfig cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo /pktvisor-src && \
PKG_CONFIG_PATH=/local/lib/pkgconfig cmake -DCMAKE_BUILD_TYPE=Release /pktvisor-src && \
make all test -j 4

FROM golang:latest AS gobuild
Expand All @@ -25,10 +26,11 @@ RUN go build -o pktvisor-cli cmd/pktvisor-cli/main.go

FROM debian:bullseye-slim AS runtime

ENV RUNTIME_DEPS "curl"
ENV RUNTIME_DEPS "curl ca-certificates"

RUN \
apt-get update && \
apt-get upgrade && \
apt-get install --yes --no-install-recommends ${RUNTIME_DEPS} && \
rm -rf /var/lib/apt

Expand Down
19 changes: 10 additions & 9 deletions docs/POLICIES.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Line Examples below.
```yaml
version: "1.0"

policy:
visor:
# each tap has input module specific configuration options
taps:
# a pcap tap which uses eth0 and is referenced by the identifier "anycast"
Expand Down Expand Up @@ -57,7 +57,7 @@ are not stored in a file, but rather in the control plane database).
```yaml
version: "1.0"

policy:
visor:
collection:
# policy name and description
anycast_dns:
Expand Down Expand Up @@ -143,7 +143,7 @@ information such as region, pop, and node type.
```yaml
version: "1.0"

policy:
orb:
vitals:
region: EU
pop: ams02
Expand Down Expand Up @@ -171,12 +171,13 @@ Or instead combine them into a single file:
```yaml
version: "1.0"

policy:
pktvisor:
taps:
anycast:
type: pcap
config:
iface: eth0
orb:
vitals:
region: EU
pop: ams02
Expand All @@ -197,7 +198,7 @@ the control plane, not on the command line or in files.
```yaml
version: "1.0"

policy:
orb:
selectors:
all_dns:
node_type: dns
Expand All @@ -215,7 +216,7 @@ on the command line or in files.
```yaml
version: "1.0"

policy:
orb:
sinks:
default_prometheus:
type: prometheus_exporter
Expand All @@ -241,11 +242,11 @@ success or failure. Upon success, the sink will be created.
```yaml
version: "1.0"

policy:
orb:
orb:
policy:
selectors:
- eu_dns
collection_policy: anycast_dns
collection: anycast_dns
sinks:
- default_prometheus
```
Expand Down
4 changes: 2 additions & 2 deletions golang/cmd/pktvisor-cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Options:
flag.Parse()

if *wantVersion {
fmt.Println(client.VizerVersionNum)
fmt.Println(client.VisorVersionNum)
return
}
if *wantHelp {
Expand Down Expand Up @@ -381,7 +381,7 @@ func layout(g *gocui.Gui) error {
if err != gocui.ErrUnknownView {
return err
}
v.Title = fmt.Sprintf("pktvisor-cli (client: %s | server: %s)", client.VizerVersionNum, serverVersion)
v.Title = fmt.Sprintf("pktvisor-cli (client: %s | server: %s)", client.VisorVersionNum, serverVersion)
}

//if currentView == "main" {
Expand Down
4 changes: 2 additions & 2 deletions golang/pkg/client/version.go.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
package client

var (
VizerVersionNum = "${VIZER_VERSION_NUM}"
VizerVersion = "${VIZER_VERSION}"
VisorVersionNum = "${VISOR_VERSION_NUM}"
VisorVersion = "${VISOR_VERSION}"
)

30 changes: 0 additions & 30 deletions reporting/prometheus/config/prometheus.yml

This file was deleted.

11 changes: 0 additions & 11 deletions reporting/prometheus/docker-compose.yaml

This file was deleted.

19 changes: 19 additions & 0 deletions reporting/prometheus/docker-grafana-agent/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM grafana/agent:latest as agent

FROM ns1labs/pktvisor:develop

COPY --from=agent /bin/agent /usr/local/bin/agent

RUN apt-get update \
&& apt-get install -y runit-init \
&& rm -rf /var/lib/apt \
&& mkdir -p /etc/runit/ \
&& mkdir -p /etc/agent/ \
&& mkdir -p /etc/agent/data \
&& rm -rf /etc/service/*

COPY files/run-grafana-agent.sh /etc/service/agent/run
COPY files/run-pktvisord.sh /etc/service/pktvisord/run
COPY files/entrypoint /usr/local/bin/entrypoint

ENTRYPOINT /usr/local/bin/entrypoint
28 changes: 28 additions & 0 deletions reporting/prometheus/docker-grafana-agent/files/entrypoint
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env bash

(
cat <<END
prometheus:
global:
scrape_interval: 1m
remote_write:
- url: $REMOTE_URL
basic_auth:
username: $USERNAME
password: $PASSWORD
configs:
- name: agent
scrape_configs:
- job_name: pktvisor
honor_timestamps: true
scrape_interval: 1m
scrape_timeout: 5s
metrics_path: /metrics
scheme: http
static_configs:
- targets:
- localhost:10853
END
) >/etc/agent/agent.yaml

exec runsvdir /etc/service/
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

exec agent --config.file=/etc/agent/agent.yaml --prometheus.wal-directory=/etc/agent/data
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

[[ "$PKTVISORD_ARGS" == "" ]] && PKTVISORD_ARGS="eth0"

exec pktvisord --prometheus $PKTVISORD_ARGS
Loading