-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pktvisor release 4.2.0
- Loading branch information
Showing
319 changed files
with
65,531 additions
and
4,322 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
resource "aws_instance" "orb-devops" { | ||
ami = lookup(var.amis, var.aws_region) | ||
instance_type = var.instance_type | ||
security_groups = [aws_security_group.sg_SelfRunner_amd64.id] | ||
key_name = var.key_name | ||
user_data = file("user_data.sh") | ||
associate_public_ip_address = true | ||
subnet_id = "subnet-086909352c7cc4e61" | ||
|
||
ebs_block_device { | ||
device_name = "/dev/sda1" | ||
volume_size = 20 | ||
} | ||
|
||
tags = { | ||
Name = "orb-pktvisor-self-runner-${var.environment}" | ||
Provider = "terraform" | ||
Role = "test" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
output "ip" { | ||
value = aws_instance.orb-devops.public_ip | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
provider "aws" { | ||
access_key = var.aws_access_key | ||
secret_key = var.aws_secret_key | ||
region = var.aws_region | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
resource "aws_security_group" "sg_SelfRunner_amd64" { | ||
name = "sg_pktvisor_SelfRunner_amd64_${var.environment}" | ||
description = "Allow all outbound traffic and inbound 22/80" | ||
vpc_id = "vpc-0cd4a525c008d8d71" | ||
|
||
ingress { | ||
from_port = 22 | ||
to_port = 22 | ||
protocol = "tcp" | ||
cidr_blocks = ["0.0.0.0/0"] | ||
} | ||
|
||
ingress { | ||
from_port = 80 | ||
to_port = 80 | ||
protocol = "tcp" | ||
cidr_blocks = ["0.0.0.0/0"] | ||
} | ||
|
||
egress { | ||
from_port = 0 | ||
to_port = 0 | ||
protocol = "-1" | ||
cidr_blocks = ["0.0.0.0/0"] | ||
} | ||
|
||
tags = { | ||
Name = "SelfRunner_amd64_${var.environment}" | ||
Provisioner = "terraform" | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/sh | ||
|
||
#installing packages | ||
apt-get update -y | ||
apt-get install apt-transport-https qemu qemu-user-static ca-certificates gnupg2 curl tar software-properties-common build-essential zlib1g-dev \ | ||
libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev libreadline-dev libffi-dev libbz2-dev python3 python3-pip python3-dev python xvfb \ | ||
libfontconfig1 libfreetype6 xfonts-scalable fonts-liberation fonts-noto-cjk g++-10-arm-linux-gnueabihf g++-10-multilib-arm-linux-gnueabihf \ | ||
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 | ||
|
||
#set permission to use docker | ||
usermod -aG docker ubuntu | ||
|
||
#creating directory git actions runner | ||
mkdir actions-runner && cd actions-runner | ||
|
||
chown ubuntu.ubuntu /actions-runner -R | ||
|
||
#get git actions self-runner | ||
/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 | ||
|
||
#extract git actions runner installer | ||
/bin/su -c "cd /actions-runner && tar xzf ./actions-runner-linux-x64-2.296.2.tar.gz" - ubuntu >> /home/ubuntu/user-data.log | ||
|
||
/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 | ||
|
||
/bin/su -c "cd /actions-runner && ./run.sh" - ubuntu >> /home/ubuntu/user-data.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
variable "aws_access_key" { | ||
default = "AWSID" | ||
} | ||
variable "aws_secret_key" { | ||
default = "AWSSECRET" | ||
} | ||
|
||
variable "environment" { | ||
default = "ENVIRONMENT" | ||
} | ||
|
||
variable "aws_region" { | ||
default = "us-east-1" | ||
} | ||
|
||
variable "amis" { | ||
type = map | ||
default = { | ||
us-east-1 = "ami-0c4f7023847b90238" //ubuntu 20.04 amd64 us-east-1 | ||
} | ||
} | ||
|
||
variable "key_name" { | ||
default = "devops-key" | ||
} | ||
|
||
variable "instance_type" { | ||
default = "t3.xlarge" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
resource "aws_instance" "orb-devops" { | ||
ami = lookup(var.amis, var.aws_region) | ||
instance_type = var.instance_type | ||
security_groups = [aws_security_group.sg_SelfRunner_arm32.id] | ||
key_name = var.key_name | ||
user_data = file("user_data.sh") | ||
associate_public_ip_address = true | ||
subnet_id = "subnet-0e4137bca8a8a81da" | ||
|
||
ebs_block_device { | ||
device_name = "/dev/sda1" | ||
volume_size = 20 | ||
} | ||
|
||
tags = { | ||
Name = "orb-pktvisor-self-runner-${var.environment}" | ||
Provider = "terraform" | ||
Role = "test" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
output "ip" { | ||
value = aws_instance.orb-devops.public_ip | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
provider "aws" { | ||
access_key = var.aws_access_key | ||
secret_key = var.aws_secret_key | ||
region = var.aws_region | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
resource "aws_security_group" "sg_SelfRunner_arm32" { | ||
name = "sg_pktvisor_SelfRunner_arm32_${var.environment}" | ||
description = "Allow all outbound traffic and inbound 22/80" | ||
vpc_id = "vpc-0cd4a525c008d8d71" | ||
|
||
ingress { | ||
from_port = 22 | ||
to_port = 22 | ||
protocol = "tcp" | ||
cidr_blocks = ["0.0.0.0/0"] | ||
} | ||
|
||
ingress { | ||
from_port = 80 | ||
to_port = 80 | ||
protocol = "tcp" | ||
cidr_blocks = ["0.0.0.0/0"] | ||
} | ||
|
||
egress { | ||
from_port = 0 | ||
to_port = 0 | ||
protocol = "-1" | ||
cidr_blocks = ["0.0.0.0/0"] | ||
} | ||
|
||
tags = { | ||
Name = "SelfRunner_arm32_${var.environment}" | ||
Provisioner = "terraform" | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/sh | ||
|
||
#installing packages | ||
apt-get update -y | ||
apt-get install apt-transport-https qemu qemu-user-static ca-certificates gnupg2 curl tar software-properties-common build-essential zlib1g-dev \ | ||
libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev libreadline-dev libffi-dev libbz2-dev python3 python3-pip python3-dev python xvfb \ | ||
libfontconfig1 libfreetype6 xfonts-scalable fonts-liberation fonts-noto-cjk g++-10-arm-linux-gnueabihf g++-10-multilib-arm-linux-gnueabihf \ | ||
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 | ||
|
||
#set permission to use docker | ||
usermod -aG docker ubuntu | ||
|
||
#creating directory git actions runner | ||
mkdir actions-runner && cd actions-runner | ||
|
||
chown ubuntu.ubuntu /actions-runner -R | ||
|
||
#get git actions self-runner | ||
/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 | ||
|
||
#extract git actions runner installer | ||
/bin/su -c "cd /actions-runner && tar xzf ./actions-runner-linux-x64-2.296.2.tar.gz" - ubuntu >> /home/ubuntu/user-data.log | ||
|
||
/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 | ||
|
||
/bin/su -c "cd /actions-runner && ./run.sh" - ubuntu >> /home/ubuntu/user-data.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
variable "aws_access_key" { | ||
default = "AWSID" | ||
} | ||
variable "aws_secret_key" { | ||
default = "AWSSECRET" | ||
} | ||
|
||
variable "environment" { | ||
default = "ENVIRONMENT" | ||
} | ||
|
||
variable "aws_region" { | ||
default = "us-east-1" | ||
} | ||
|
||
variable "amis" { | ||
type = map | ||
default = { | ||
us-east-1 = "ami-070650c005cce4203" //ubuntu 20.04 arm64 on us-east-1 | ||
} | ||
} | ||
|
||
variable "key_name" { | ||
default = "devops-key" | ||
} | ||
|
||
variable "instance_type" { | ||
default = "t3.xlarge" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
resource "aws_instance" "orb-devops" { | ||
ami = lookup(var.amis, var.aws_region) | ||
instance_type = var.instance_type | ||
security_groups = [aws_security_group.sg_SelfRunner_arm64.id] | ||
key_name = var.key_name | ||
user_data = file("user_data.sh") | ||
associate_public_ip_address = true | ||
subnet_id = "subnet-0e4137bca8a8a81da" | ||
|
||
ebs_block_device { | ||
device_name = "/dev/sda1" | ||
volume_size = 20 | ||
} | ||
|
||
tags = { | ||
Name = "orb-pktvisor-self-runner-${var.environment}" | ||
Provider = "terraform" | ||
Role = "test" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
output "ip" { | ||
value = aws_instance.orb-devops.public_ip | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
provider "aws" { | ||
access_key = var.aws_access_key | ||
secret_key = var.aws_secret_key | ||
region = var.aws_region | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
resource "aws_security_group" "sg_SelfRunner_arm64" { | ||
name = "sg_pktvisor_SelfRunner_arm64_${var.environment}" | ||
description = "Allow all outbound traffic and inbound 22/80" | ||
vpc_id = "vpc-0cd4a525c008d8d71" | ||
|
||
ingress { | ||
from_port = 22 | ||
to_port = 22 | ||
protocol = "tcp" | ||
cidr_blocks = ["0.0.0.0/0"] | ||
} | ||
|
||
ingress { | ||
from_port = 80 | ||
to_port = 80 | ||
protocol = "tcp" | ||
cidr_blocks = ["0.0.0.0/0"] | ||
} | ||
|
||
egress { | ||
from_port = 0 | ||
to_port = 0 | ||
protocol = "-1" | ||
cidr_blocks = ["0.0.0.0/0"] | ||
} | ||
|
||
tags = { | ||
Name = "SelfRunner_arm64_${var.environment}" | ||
Provisioner = "terraform" | ||
|
||
} | ||
} |
Oops, something went wrong.