Skip to content

Commit 3fc9673

Browse files
authored
Pktvisor release 4.3.0
Pktvisor release 4.3.0
2 parents 1309121 + 087e1da commit 3fc9673

File tree

148 files changed

+6827
-1423
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

148 files changed

+6827
-1423
lines changed

.github/actions/build-cpp/Dockerfile

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
FROM debian:bullseye-slim
22

33
LABEL author="Everton Haise Taques <[email protected]>"
4-
LABEL maintainer="NS1 Labs"
4+
LABEL maintainer="Orb Community"
55
LABEL version="1.0.0"
66

7-
ENV BUILD_DEPS "g++ cmake make git pkgconf jq python3-pip python3-setuptools ca-certificates libasan6 zip curl python"
7+
ENV BUILD_DEPS "g++ cmake make git pkgconf jq python3-pip python3-setuptools ca-certificates libasan6 zip curl python wget"
88

99
COPY ./entrypoint.sh /entrypoint.sh
1010

@@ -15,8 +15,8 @@ WORKDIR /pktvisor-src
1515
RUN apt-get update && \
1616
apt-get upgrade --yes --force-yes && \
1717
apt-get install --yes --force-yes --no-install-recommends ${BUILD_DEPS} && \
18-
pip3 install conan
19-
18+
pip3 install 'conan==1.59.0' --force-reinstall
19+
2020
RUN chmod +x /entrypoint.sh
2121

2222
ENTRYPOINT [ "/entrypoint.sh" ]

.github/actions/build-cpp/action.yml

+14-4
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,33 @@
11
name: 'docker'
22
author: 'Everton Haise Taques <[email protected]>'
3-
description: 'NS1 Labs'
3+
description: 'Orb Community'
44

55
inputs:
66
context:
77
description: "Docker build context"
88
required: true
99
default: "./"
10-
11-
symbol_url:
12-
description: "symbol url"
10+
11+
bugsplat_key:
12+
description: "bugsplat key"
1313
required: true
1414
default: ""
1515

16+
bugsplat_symbol_url:
17+
description: "bugsplat symbol url"
18+
required: true
19+
default: ""
20+
1621
build_type:
1722
description: "build type"
1823
required: true
1924
default: "Debug"
2025

26+
bugsplat:
27+
description: "bugsplat active"
28+
required: true
29+
default: "true"
30+
2131
asan:
2232
description: "asan"
2333
required: true

.github/actions/build-cpp/entrypoint.sh

+21-10
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
function validateParams() {
44
echo "========================= Checking parameters ========================="
5-
[[ -z $INPUT_SYMBOL_URL ]] && echo "Backtrace symbol url is required" && exit 1 || echo "Backtrace symbol url present"
5+
[[ -z $INPUT_BUGSPLAT_SYMBOL_URL ]] && echo "Bugsplat symbol url is required" && exit 1 || echo "Bugsplat symbol url pŕesent"
66
}
77

88
function build() {
@@ -14,41 +14,52 @@ function build() {
1414
cp -rf /github/workspace/libs/ /pktvisor-src/libs/
1515
cp -rf /github/workspace/docker/ /pktvisor-src/docker/
1616
cp -rf /github/workspace/golang/ /pktvisor-src/golang/
17+
cp -rf /github/workspace/build/ /pktvisor-src/build/
1718
cp -rf /github/workspace/integration_tests/ /pktvisor-src/integration_tests/
1819
cp -rf /github/workspace/cmake/ /pktvisor-src/cmake/
1920
cp -rf /github/workspace/CMakeLists.txt /pktvisor-src/
2021
cp -rf /github/workspace/conanfile.txt /pktvisor-src/
2122
mkdir /tmp/build
2223
cd /tmp/build
24+
cp -rf /pktvisor-src/build/conan_home/ .
25+
chmod -R 777 /tmp/build/conan_home/
2326
conan profile new --detect default
2427
conan profile update settings.compiler.libcxx=libstdc++11 default
2528
conan config set general.revisions_enabled=1
2629
PKG_CONFIG_PATH=/local/lib/pkgconfig cmake -DCMAKE_BUILD_TYPE=$INPUT_BUILD_TYPE -DASAN=$INPUT_ASAN /pktvisor-src
2730
make all -j 4
2831
}
2932

30-
function compact() {
33+
function move() {
3134
echo "========================= Compacting binary and copying ========================="
3235
cd /tmp/build
33-
zip pktvisord.zip /tmp/build/bin/pktvisord
3436
cp -rf /tmp/build/bin/pktvisord /github/workspace/
3537
strip -s /tmp/build/bin/crashpad_handler
3638
cp -rf /tmp/build/bin/crashpad_handler /github/workspace/
3739
cp -rf /tmp/build/bin/pktvisor-reader /github/workspace/
3840
cp -rf /tmp/build/VERSION /github/workspace/
39-
#version for pktvisor-cli
41+
chmod -R 777 /tmp/build/conan_home/
42+
cp -rf /tmp/build/conan_home/ /github/workspace/build/
4043
cp -rf /pktvisor-src/golang/pkg/client/version.go /github/workspace/version.go
41-
#copy pktvisor custom iana port service names file
4244
cp -rf /pktvisor-src/src/tests/fixtures/pktvisor-port-service-names.csv /github/workspace/custom-iana.csv
4345
}
4446

45-
function publish() {
46-
echo "========================= Publishing symbol to backtrace ========================="
47+
function publishToBugsplat() {
48+
echo "========================= Publishing symbol to bugsplat ========================="
4749
cd /tmp/build
48-
curl --data-binary @pktvisord.zip -H "Expect: gzip" "${INPUT_SYMBOL_URL}"
50+
if [ "$INPUT_BUGSPLAT" == "true" ]; then
51+
wget https://github.com/orb-community/CrashpadTools/raw/main/linux/dump_syms
52+
chmod a+x ./dump_syms
53+
wget https://github.com/orb-community/CrashpadTools/raw/main/linux/symupload
54+
chmod a+x ./symupload
55+
./dump_syms /github/workspace/pktvisord > pktvisor.sym
56+
PKTVISOR_VERSION=$(cat VERSION)
57+
ls -lha
58+
./symupload -k $INPUT_BUGSPLAT_KEY pktvisor.sym $INPUT_BUGSPLAT_SYMBOL_URL$PKTVISOR_VERSION 2>/dev/null
59+
fi
4960
}
5061

5162
validateParams
5263
build
53-
compact
54-
publish
64+
move
65+
publishToBugsplat

.github/actions/build-go/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM golang:latest
22

33
LABEL author="Everton Haise Taques <[email protected]>"
4-
LABEL maintainer="NS1 Labs"
4+
LABEL maintainer="netboxlabs"
55
LABEL version="1.0.0"
66

77
COPY ./entrypoint.sh /entrypoint.sh

.github/actions/build-go/action.yml

+11-1
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,18 @@ inputs:
1212
description: "Dockerfile used to build the image"
1313
required: true
1414
default: "./Dockerfile"
15+
16+
goos:
17+
description: "OS for cross-build"
18+
required: false
19+
default: "linux"
20+
21+
goarch:
22+
description: "ARCH for cross-build"
23+
required: false
24+
default: "amd64"
1525

1626
runs:
1727
using: 'docker'
1828
image: 'Dockerfile'
19-
29+

.github/actions/build-go/entrypoint.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function build() {
66
# Copying this from previous build (cpp)
77
cp -rf ./version.go /src/pkg/client/version.go
88
cd /src
9-
go build -o pktvisor-cli cmd/pktvisor-cli/main.go
9+
GOOS=$INPUT_GOOS GOARCH=$INPUT_GOARCH go build -o pktvisor-cli cmd/pktvisor-cli/main.go
1010
}
1111

1212
function copy() {
@@ -15,4 +15,4 @@ function copy() {
1515
}
1616

1717
build
18-
copy
18+
copy

.github/hosted-runner/amd64/user_data.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ chown ubuntu.ubuntu /actions-runner -R
2121
#extract git actions runner installer
2222
/bin/su -c "cd /actions-runner && tar xzf ./actions-runner-linux-x64-2.296.2.tar.gz" - ubuntu >> /home/ubuntu/user-data.log
2323

24-
/bin/su -c "cd /actions-runner && ./config.sh --unattended --url https://github.com/ns1labs/pktvisor --token RUNNER_TOKEN --name AMD64_RUNNER --labels RUNNER_LABEL --work _work --runasservice" - ubuntu >> /home/ubuntu/user-data.log
24+
/bin/su -c "cd /actions-runner && ./config.sh --unattended --url https://github.com/orb-community/pktvisor --token RUNNER_TOKEN --name AMD64_RUNNER --labels RUNNER_LABEL --work _work --runasservice" - ubuntu >> /home/ubuntu/user-data.log
2525

2626
/bin/su -c "cd /actions-runner && ./run.sh" - ubuntu >> /home/ubuntu/user-data.log

.github/hosted-runner/arm32/user_data.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ chown ubuntu.ubuntu /actions-runner -R
2121
#extract git actions runner installer
2222
/bin/su -c "cd /actions-runner && tar xzf ./actions-runner-linux-x64-2.296.2.tar.gz" - ubuntu >> /home/ubuntu/user-data.log
2323

24-
/bin/su -c "cd /actions-runner && ./config.sh --unattended --url https://github.com/ns1labs/pktvisor --token RUNNER_TOKEN --name AMD64_RUNNER --labels RUNNER_LABEL --work _work --runasservice" - ubuntu >> /home/ubuntu/user-data.log
24+
/bin/su -c "cd /actions-runner && ./config.sh --unattended --url https://github.com/orb-community/pktvisor --token RUNNER_TOKEN --name AMD64_RUNNER --labels RUNNER_LABEL --work _work --runasservice" - ubuntu >> /home/ubuntu/user-data.log
2525

2626
/bin/su -c "cd /actions-runner && ./run.sh" - ubuntu >> /home/ubuntu/user-data.log

.github/hosted-runner/arm64/user_data.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ chown ubuntu.ubuntu /actions-runner -R
2121
#extract git actions runner installer
2222
/bin/su -c "cd /actions-runner && tar xzf ./actions-runner-linux-arm64-2.294.0.tar.gz" - ubuntu >> /home/ubuntu/user-data.log
2323

24-
/bin/su -c "cd /actions-runner && ./config.sh --unattended --url https://github.com/ns1labs/pktvisor --token RUNNER_TOKEN --name ARM64_RUNNER --labels RUNNER_LABEL --work _work --runasservice" - ubuntu >> /home/ubuntu/user-data.log
24+
/bin/su -c "cd /actions-runner && ./config.sh --unattended --url https://github.com/orb-community/pktvisor --token RUNNER_TOKEN --name ARM64_RUNNER --labels RUNNER_LABEL --work _work --runasservice" - ubuntu >> /home/ubuntu/user-data.log
2525

2626
/bin/su -c "cd /actions-runner && ./run.sh" - ubuntu >> /home/ubuntu/user-data.log

0 commit comments

Comments
 (0)