Skip to content
Merged
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
50 changes: 37 additions & 13 deletions nodesim.nomad
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@

variable "num_nodes" {
type = string
default = 10
}

variable "server" {
type = string
variable "servers" {
type = list(string)
default = ["localhost:4647"]
}

job "nodesim" {
datacenters = ["dc1"]

group "nodesim" {
count = 20

update {
max_parallel = 3
Expand All @@ -22,20 +23,43 @@ job "nodesim" {
task "nodesim" {
driver = "docker"

kill_signal = "SIGINT"

config {
image = "schmichael/nomad-nodesim:0.2"

command = "/build/nomad-nodesim"
args = [
"-dir", "/local",
"-num", var.num_nodes,
"-server", var.server,
"-id", "${NOMAD_SHORT_ALLOC_ID}",
image = "hashicorppreview/nomad-nodesim:6cebba3"

command = "/bin/nomad-nodesim"
args = ["-config", "/local/config.hcl"]

# For use on a linux host
volumes = [
"/sys/fs/cgroup:/sys/fs/cgroup",
]
}

template {
data = <<EOH
work_dir = "/tmp/nomad-nodesim/"
node_name_prefix = "nodesim"
server_addr = ${jsonencode(var.servers)}
node_num = ${var.num_nodes}

log {
level = "info"
json = true
include_location = true
}

node {
datacenter = "dc1"
node_pool = "default"
options = {
"fingerprint.denylist" = "env_aws,env_gce,env_azure,env_digitalocean"
}
}
EOH
destination = "/local/config.hcl"
once = true
}

resources {
cpu = 500
memory = 500
Expand Down
Loading