Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added wireguard option to tfrobot #1139

Merged
merged 4 commits into from
Aug 11, 2024
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
3 changes: 2 additions & 1 deletion tfrobot/example/conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
"env_vars": {
"user": "user1",
"pwd": "1234"
}
},
"wireguard": false
}
],
"ssh_keys": {
Expand Down
1 change: 1 addition & 0 deletions tfrobot/example/conf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ vms:
env_vars: # env vars are passed to the newly created vms
user: user1
pwd: 1234
wireguard: false

ssh_keys: # map of ssh keys with key=name and value=the actual ssh key
example1: ssh_key1
Expand Down
15 changes: 15 additions & 0 deletions tfrobot/example/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ node_groups:
free_cpu: 2
free_mru: 8

- name: group_d
nodes_count: 2
free_cpu: 1
free_mru: 4

vms:
- name: example_a #test deployment of vms with public ip
vms_count: 3
Expand Down Expand Up @@ -49,5 +54,15 @@ vms:
entry_point: /sbin/zinit init
ssh_key: key1

- name: example_d #test deployment with wireguard access
vms_count: 2
node_group: group_d
cpu: 1
mem: 1
wireguard: true
flist: https://hub.grid.tf/tf-official-apps/base:latest.flist
entry_point: /sbin/zinit init
ssh_key: key1

ssh_keys:
key1: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCsnouceyLPDj1OFjMO0amzznxbSurxLbZ21WEY5o6uaBuhAlDa2zMIvN8gmeZZeJcKHZfOZI0+atVo0FCjFc2VWZX7LwasW4Lbb2MV3xk4RTlkIRlKov/Iyj8lcAXEnFIV81fpLZtTmk6ERp5gYIBYP2n5CISK0lCiWeu/QFerYa9lb1cYpo/+epSREts4ka80XifA12kWMKfDNJKcWqv4EZZyRyPTVTTxKSJzHahu+J+Kpg+fs65toRaDAuXDzwBLJ/d2qCeR3dfbJl681jiFUlS46ap4njSrnGLssSSwpbhxPEWF3lJ+mQFn14aPLQikq4lOhGUhq7BCYQH9RNkZ
3 changes: 1 addition & 2 deletions tfrobot/pkg/deployer/deployer.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,6 @@ func buildNetworkDeployment(vm Vms, nodeID uint32, name, solutionType string) wo

myceliumKeys[nodeID] = key
}

return workloads.ZNet{
Name: fmt.Sprintf("%s_network", name),
Description: "network for mass deployment",
Expand All @@ -326,7 +325,7 @@ func buildNetworkDeployment(vm Vms, nodeID uint32, name, solutionType string) wo
IP: net.IPv4(10, 20, 0, 0),
Mask: net.CIDRMask(16, 32),
}),
AddWGAccess: false,
AddWGAccess: vm.WireGuard,
MyceliumKeys: myceliumKeys,
SolutionType: solutionType,
}
Expand Down
1 change: 1 addition & 0 deletions tfrobot/pkg/deployer/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ type Vms struct {
Entrypoint string `yaml:"entry_point" validate:"required" json:"entry_point"`
SSHKey string `yaml:"ssh_key" validate:"required" json:"ssh_key"`
EnvVars map[string]string `yaml:"env_vars" json:"env_vars"`
WireGuard bool `yaml:"wireguard" json:"wireguard"`
}

type Disk struct {
Expand Down
Loading