Skip to content

Commit 16f35e1

Browse files
authored
pktvisor release 4.2.0
pktvisor release 4.2.0
2 parents efbce2e + 370cb0e commit 16f35e1

File tree

319 files changed

+65531
-4322
lines changed

Some content is hidden

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

319 files changed

+65531
-4322
lines changed

.github/actions/build-cpp/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ LABEL author="Everton Haise Taques <[email protected]>"
44
LABEL maintainer="NS1 Labs"
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"
7+
ENV BUILD_DEPS "g++ cmake make git pkgconf jq python3-pip python3-setuptools ca-certificates libasan6 zip curl python"
88

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

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

+11-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@ inputs:
1212
description: "symbol url"
1313
required: true
1414
default: ""
15+
16+
build_type:
17+
description: "build type"
18+
required: true
19+
default: "Debug"
20+
21+
asan:
22+
description: "asan"
23+
required: true
24+
default: "ON"
1525

1626
file:
1727
description: "Dockerfile used to build the image"
@@ -21,4 +31,4 @@ inputs:
2131
runs:
2232
using: 'docker'
2333
image: 'Dockerfile'
24-
34+

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

+9-4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ function build() {
1111
cp -rf /github/workspace/src/ /pktvisor-src/src/
1212
cp -rf /github/workspace/cmd/ /pktvisor-src/cmd/
1313
cp -rf /github/workspace/3rd/ /pktvisor-src/3rd/
14+
cp -rf /github/workspace/libs/ /pktvisor-src/libs/
1415
cp -rf /github/workspace/docker/ /pktvisor-src/docker/
1516
cp -rf /github/workspace/golang/ /pktvisor-src/golang/
1617
cp -rf /github/workspace/integration_tests/ /pktvisor-src/integration_tests/
@@ -19,10 +20,10 @@ function build() {
1920
cp -rf /github/workspace/conanfile.txt /pktvisor-src/
2021
mkdir /tmp/build
2122
cd /tmp/build
22-
conan profile new --detect default && \
23-
conan profile update settings.compiler.libcxx=libstdc++11 default && \
23+
conan profile new --detect default
24+
conan profile update settings.compiler.libcxx=libstdc++11 default
2425
conan config set general.revisions_enabled=1
25-
PKG_CONFIG_PATH=/local/lib/pkgconfig cmake -DCMAKE_BUILD_TYPE=Debug -DASAN=ON /pktvisor-src && \
26+
PKG_CONFIG_PATH=/local/lib/pkgconfig cmake -DCMAKE_BUILD_TYPE=$INPUT_BUILD_TYPE -DASAN=$INPUT_ASAN /pktvisor-src
2627
make all -j 4
2728
}
2829

@@ -31,10 +32,14 @@ function compact() {
3132
cd /tmp/build
3233
zip pktvisord.zip /tmp/build/bin/pktvisord
3334
cp -rf /tmp/build/bin/pktvisord /github/workspace/
35+
strip -s /tmp/build/bin/crashpad_handler
3436
cp -rf /tmp/build/bin/crashpad_handler /github/workspace/
3537
cp -rf /tmp/build/bin/pktvisor-reader /github/workspace/
38+
cp -rf /tmp/build/VERSION /github/workspace/
3639
#version for pktvisor-cli
3740
cp -rf /pktvisor-src/golang/pkg/client/version.go /github/workspace/version.go
41+
#copy pktvisor custom iana port service names file
42+
cp -rf /pktvisor-src/src/tests/fixtures/pktvisor-port-service-names.csv /github/workspace/custom-iana.csv
3843
}
3944

4045
function publish() {
@@ -46,4 +51,4 @@ function publish() {
4651
validateParams
4752
build
4853
compact
49-
publish
54+
publish

.github/hosted-runner/amd64/main.tf

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
resource "aws_instance" "orb-devops" {
2+
ami = lookup(var.amis, var.aws_region)
3+
instance_type = var.instance_type
4+
security_groups = [aws_security_group.sg_SelfRunner_amd64.id]
5+
key_name = var.key_name
6+
user_data = file("user_data.sh")
7+
associate_public_ip_address = true
8+
subnet_id = "subnet-086909352c7cc4e61"
9+
10+
ebs_block_device {
11+
device_name = "/dev/sda1"
12+
volume_size = 20
13+
}
14+
15+
tags = {
16+
Name = "orb-pktvisor-self-runner-${var.environment}"
17+
Provider = "terraform"
18+
Role = "test"
19+
}
20+
}

.github/hosted-runner/amd64/output.tf

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
output "ip" {
2+
value = aws_instance.orb-devops.public_ip
3+
}
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
provider "aws" {
2+
access_key = var.aws_access_key
3+
secret_key = var.aws_secret_key
4+
region = var.aws_region
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
resource "aws_security_group" "sg_SelfRunner_amd64" {
2+
name = "sg_pktvisor_SelfRunner_amd64_${var.environment}"
3+
description = "Allow all outbound traffic and inbound 22/80"
4+
vpc_id = "vpc-0cd4a525c008d8d71"
5+
6+
ingress {
7+
from_port = 22
8+
to_port = 22
9+
protocol = "tcp"
10+
cidr_blocks = ["0.0.0.0/0"]
11+
}
12+
13+
ingress {
14+
from_port = 80
15+
to_port = 80
16+
protocol = "tcp"
17+
cidr_blocks = ["0.0.0.0/0"]
18+
}
19+
20+
egress {
21+
from_port = 0
22+
to_port = 0
23+
protocol = "-1"
24+
cidr_blocks = ["0.0.0.0/0"]
25+
}
26+
27+
tags = {
28+
Name = "SelfRunner_amd64_${var.environment}"
29+
Provisioner = "terraform"
30+
31+
}
32+
}
+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/sh
2+
3+
#installing packages
4+
apt-get update -y
5+
apt-get install apt-transport-https qemu qemu-user-static ca-certificates gnupg2 curl tar software-properties-common build-essential zlib1g-dev \
6+
libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev libreadline-dev libffi-dev libbz2-dev python3 python3-pip python3-dev python xvfb \
7+
libfontconfig1 libfreetype6 xfonts-scalable fonts-liberation fonts-noto-cjk g++-10-arm-linux-gnueabihf g++-10-multilib-arm-linux-gnueabihf \
8+
gcc-10-arm-linux-gnueabihf gcc-10-arm-linux-gnueabihf-base gcc-10-multilib-arm-linux-gnueabihf python3-venv tcpreplay docker.io containerd cmake zip -y
9+
10+
#set permission to use docker
11+
usermod -aG docker ubuntu
12+
13+
#creating directory git actions runner
14+
mkdir actions-runner && cd actions-runner
15+
16+
chown ubuntu.ubuntu /actions-runner -R
17+
18+
#get git actions self-runner
19+
/bin/su -c "cd /actions-runner && curl -o actions-runner-linux-x64-2.296.2.tar.gz -L https://github.com/actions/runner/releases/download/v2.296.2/actions-runner-linux-x64-2.296.2.tar.gz" - ubuntu >> /home/ubuntu/user-data.log
20+
21+
#extract git actions runner installer
22+
/bin/su -c "cd /actions-runner && tar xzf ./actions-runner-linux-x64-2.296.2.tar.gz" - ubuntu >> /home/ubuntu/user-data.log
23+
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
25+
26+
/bin/su -c "cd /actions-runner && ./run.sh" - ubuntu >> /home/ubuntu/user-data.log

.github/hosted-runner/amd64/vars.tf

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
variable "aws_access_key" {
2+
default = "AWSID"
3+
}
4+
variable "aws_secret_key" {
5+
default = "AWSSECRET"
6+
}
7+
8+
variable "environment" {
9+
default = "ENVIRONMENT"
10+
}
11+
12+
variable "aws_region" {
13+
default = "us-east-1"
14+
}
15+
16+
variable "amis" {
17+
type = map
18+
default = {
19+
us-east-1 = "ami-0c4f7023847b90238" //ubuntu 20.04 amd64 us-east-1
20+
}
21+
}
22+
23+
variable "key_name" {
24+
default = "devops-key"
25+
}
26+
27+
variable "instance_type" {
28+
default = "t3.xlarge"
29+
}

.github/hosted-runner/arm32/main.tf

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
resource "aws_instance" "orb-devops" {
2+
ami = lookup(var.amis, var.aws_region)
3+
instance_type = var.instance_type
4+
security_groups = [aws_security_group.sg_SelfRunner_arm32.id]
5+
key_name = var.key_name
6+
user_data = file("user_data.sh")
7+
associate_public_ip_address = true
8+
subnet_id = "subnet-0e4137bca8a8a81da"
9+
10+
ebs_block_device {
11+
device_name = "/dev/sda1"
12+
volume_size = 20
13+
}
14+
15+
tags = {
16+
Name = "orb-pktvisor-self-runner-${var.environment}"
17+
Provider = "terraform"
18+
Role = "test"
19+
}
20+
}

.github/hosted-runner/arm32/output.tf

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
output "ip" {
2+
value = aws_instance.orb-devops.public_ip
3+
}
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
provider "aws" {
2+
access_key = var.aws_access_key
3+
secret_key = var.aws_secret_key
4+
region = var.aws_region
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
resource "aws_security_group" "sg_SelfRunner_arm32" {
2+
name = "sg_pktvisor_SelfRunner_arm32_${var.environment}"
3+
description = "Allow all outbound traffic and inbound 22/80"
4+
vpc_id = "vpc-0cd4a525c008d8d71"
5+
6+
ingress {
7+
from_port = 22
8+
to_port = 22
9+
protocol = "tcp"
10+
cidr_blocks = ["0.0.0.0/0"]
11+
}
12+
13+
ingress {
14+
from_port = 80
15+
to_port = 80
16+
protocol = "tcp"
17+
cidr_blocks = ["0.0.0.0/0"]
18+
}
19+
20+
egress {
21+
from_port = 0
22+
to_port = 0
23+
protocol = "-1"
24+
cidr_blocks = ["0.0.0.0/0"]
25+
}
26+
27+
tags = {
28+
Name = "SelfRunner_arm32_${var.environment}"
29+
Provisioner = "terraform"
30+
31+
}
32+
}
+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/sh
2+
3+
#installing packages
4+
apt-get update -y
5+
apt-get install apt-transport-https qemu qemu-user-static ca-certificates gnupg2 curl tar software-properties-common build-essential zlib1g-dev \
6+
libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev libreadline-dev libffi-dev libbz2-dev python3 python3-pip python3-dev python xvfb \
7+
libfontconfig1 libfreetype6 xfonts-scalable fonts-liberation fonts-noto-cjk g++-10-arm-linux-gnueabihf g++-10-multilib-arm-linux-gnueabihf \
8+
gcc-10-arm-linux-gnueabihf gcc-10-arm-linux-gnueabihf-base gcc-10-multilib-arm-linux-gnueabihf python3-venv tcpreplay docker.io containerd cmake zip -y
9+
10+
#set permission to use docker
11+
usermod -aG docker ubuntu
12+
13+
#creating directory git actions runner
14+
mkdir actions-runner && cd actions-runner
15+
16+
chown ubuntu.ubuntu /actions-runner -R
17+
18+
#get git actions self-runner
19+
/bin/su -c "cd /actions-runner && curl -o actions-runner-linux-x64-2.296.2.tar.gz -L https://github.com/actions/runner/releases/download/v2.296.2/actions-runner-linux-x64-2.296.2.tar.gz" - ubuntu >> /home/ubuntu/user-data.log
20+
21+
#extract git actions runner installer
22+
/bin/su -c "cd /actions-runner && tar xzf ./actions-runner-linux-x64-2.296.2.tar.gz" - ubuntu >> /home/ubuntu/user-data.log
23+
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
25+
26+
/bin/su -c "cd /actions-runner && ./run.sh" - ubuntu >> /home/ubuntu/user-data.log

.github/hosted-runner/arm32/vars.tf

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
variable "aws_access_key" {
2+
default = "AWSID"
3+
}
4+
variable "aws_secret_key" {
5+
default = "AWSSECRET"
6+
}
7+
8+
variable "environment" {
9+
default = "ENVIRONMENT"
10+
}
11+
12+
variable "aws_region" {
13+
default = "us-east-1"
14+
}
15+
16+
variable "amis" {
17+
type = map
18+
default = {
19+
us-east-1 = "ami-070650c005cce4203" //ubuntu 20.04 arm64 on us-east-1
20+
}
21+
}
22+
23+
variable "key_name" {
24+
default = "devops-key"
25+
}
26+
27+
variable "instance_type" {
28+
default = "t3.xlarge"
29+
}

.github/hosted-runner/arm64/main.tf

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
resource "aws_instance" "orb-devops" {
2+
ami = lookup(var.amis, var.aws_region)
3+
instance_type = var.instance_type
4+
security_groups = [aws_security_group.sg_SelfRunner_arm64.id]
5+
key_name = var.key_name
6+
user_data = file("user_data.sh")
7+
associate_public_ip_address = true
8+
subnet_id = "subnet-0e4137bca8a8a81da"
9+
10+
ebs_block_device {
11+
device_name = "/dev/sda1"
12+
volume_size = 20
13+
}
14+
15+
tags = {
16+
Name = "orb-pktvisor-self-runner-${var.environment}"
17+
Provider = "terraform"
18+
Role = "test"
19+
}
20+
}

.github/hosted-runner/arm64/output.tf

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
output "ip" {
2+
value = aws_instance.orb-devops.public_ip
3+
}
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
provider "aws" {
2+
access_key = var.aws_access_key
3+
secret_key = var.aws_secret_key
4+
region = var.aws_region
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
resource "aws_security_group" "sg_SelfRunner_arm64" {
2+
name = "sg_pktvisor_SelfRunner_arm64_${var.environment}"
3+
description = "Allow all outbound traffic and inbound 22/80"
4+
vpc_id = "vpc-0cd4a525c008d8d71"
5+
6+
ingress {
7+
from_port = 22
8+
to_port = 22
9+
protocol = "tcp"
10+
cidr_blocks = ["0.0.0.0/0"]
11+
}
12+
13+
ingress {
14+
from_port = 80
15+
to_port = 80
16+
protocol = "tcp"
17+
cidr_blocks = ["0.0.0.0/0"]
18+
}
19+
20+
egress {
21+
from_port = 0
22+
to_port = 0
23+
protocol = "-1"
24+
cidr_blocks = ["0.0.0.0/0"]
25+
}
26+
27+
tags = {
28+
Name = "SelfRunner_arm64_${var.environment}"
29+
Provisioner = "terraform"
30+
31+
}
32+
}

0 commit comments

Comments
 (0)