Merge pull request #7055 from hashicorp/r-dev-tweaks-20200203

Grab bag of dev tweaks
This commit is contained in:
Mahmood Ali
2020-02-03 14:25:06 -05:00
committed by GitHub
17 changed files with 61 additions and 50 deletions

View File

@@ -177,7 +177,7 @@ check: ## Lint the source code
@if (git status | grep -q .pb.go); then echo the following proto files are out of sync; git status |grep .pb.go; exit 1; fi
@echo "==> Check API package is isolated from rest"
@! go list --test -f '{{ join .Deps "\n" }}' ./api | grep github.com/hashicorp/nomad/ | grep -v -e /vendor/ -e /nomad/api/ -e nomad/api.test
@if go list --test -f '{{ join .Deps "\n" }}' ./api | grep github.com/hashicorp/nomad/ | grep -v -e /vendor/ -e /nomad/api/ -e nomad/api.test; then echo " /api package depends the ^^ above internal nomad packages. Remove such dependency"; exit 1; fi
.PHONY: checkscripts
checkscripts: ## Lint shell scripts

2
Vagrantfile vendored
View File

@@ -183,7 +183,7 @@ def configureProviders(vmCfg, cpus: "2", memory: "2048")
end
vmCfg.vm.provider "virtualbox" do |v|
v.customize ["modifyvm", :id, "--cableconnected1", "on"]
v.customize ["modifyvm", :id, "--cableconnected1", "on", "--audio", "none"]
v.memory = memory
v.cpus = cpus
end

View File

@@ -2,7 +2,7 @@
log_level = "DEBUG"
# Setup data dir
data_dir = "/tmp/client1"
data_dir = "/tmp/nomad-dev-cluster/client1"
# Give the agent a unique name. Defaults to hostname
name = "client1"

View File

@@ -2,7 +2,7 @@
log_level = "DEBUG"
# Setup data dir
data_dir = "/tmp/client2"
data_dir = "/tmp/nomad-dev-cluster/client2"
# Give the agent a unique name. Defaults to hostname
name = "client2"

View File

@@ -2,7 +2,7 @@
log_level = "DEBUG"
# Setup data dir
data_dir = "/tmp/client3"
data_dir = "/tmp/nomad-dev-cluster/client3"
# Give the agent a unique name. Defaults to hostname
name = "client3"

View File

@@ -1,17 +1,28 @@
#!/usr/bin/env bash
set -e
mkdir -p /tmp/server{1,2,3} /tmp/client{1,2}
mkdir -p /tmp/nomad-dev-cluster/server{1,2,3} /tmp/nomad-dev-cluster/client{1,2}
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
# launch server
( nomad agent -config=server1.hcl 2>&1 | tee "/tmp/server1/log" ; echo "Exit code: $?" >> "/tmp/server1/log" ) &
( nomad agent -config=${DIR}/server1.hcl 2>&1 | tee "/tmp/nomad-dev-cluster/server1/log" ; echo "Exit code: $?" >> "/tmp/nomad-dev-cluster/server1/log" ) &
( nomad agent -config=server2.hcl 2>&1 | tee "/tmp/server2/log" ; echo "Exit code: $?" >> "/tmp/server2/log" ) &
( nomad agent -config=${DIR}/server2.hcl 2>&1 | tee "/tmp/nomad-dev-cluster/server2/log" ; echo "Exit code: $?" >> "/tmp/nomad-dev-cluster/server2/log" ) &
( nomad agent -config=server3.hcl 2>&1 | tee "/tmp/server3/log" ; echo "Exit code: $?" >> "/tmp/server3/log" ) &
( nomad agent -config=${DIR}/server3.hcl 2>&1 | tee "/tmp/nomad-dev-cluster/server3/log" ; echo "Exit code: $?" >> "/tmp/nomad-dev-cluster/server3/log" ) &
# launch client 1
( nomad agent -config=client1.hcl 2>&1 | tee "/tmp/client1/log" ; echo "Exit code: $?" >> "/tmp/client1/log" ) &
( nomad agent -config=${DIR}/client1.hcl 2>&1 | tee "/tmp/nomad-dev-cluster/client1/log" ; echo "Exit code: $?" >> "/tmp/nomad-dev-cluster/client1/log" ) &
# launch client 2
( nomad agent -config=client2.hcl 2>&1 | tee "/tmp/client2/log" ; echo "Exit code: $?" >> "/tmp/client2/log" ) &
( nomad agent -config=${DIR}/client2.hcl 2>&1 | tee "/tmp/nomad-dev-cluster/client2/log" ; echo "Exit code: $?" >> "/tmp/nomad-dev-cluster/client2/log" ) &
trap 'kill -SIGTERM $(jobs -pr)' SIGINT SIGTERM
wait
# wait again to ensure process die
wait

View File

@@ -2,7 +2,7 @@
log_level = "DEBUG"
# Setup data dir
data_dir = "/tmp/serverstandalone"
data_dir = "/tmp/nomad-dev-cluster/serverstandalone"
# Give the agent a unique name. Defaults to hostname
name = "serverstandalone"

View File

@@ -2,7 +2,7 @@
log_level = "DEBUG"
# Setup data dir
data_dir = "/tmp/server1"
data_dir = "/tmp/nomad-dev-cluster/server1"
# Give the agent a unique name. Defaults to hostname
name = "server1"

View File

@@ -2,7 +2,7 @@
log_level = "DEBUG"
# Setup data dir
data_dir = "/tmp/server2"
data_dir = "/tmp/nomad-dev-cluster/server2"
# Give the agent a unique name. Defaults to hostname
name = "server2"

View File

@@ -2,7 +2,7 @@
log_level = "DEBUG"
# Setup data dir
data_dir = "/tmp/server3"
data_dir = "/tmp/nomad-dev-cluster/server3"
# Give the agent a unique name. Defaults to hostname
name = "server3"

View File

@@ -7,8 +7,8 @@ fail () {
# only push to oss when the enterprise version is absent
# ====================
oss="git@github.com:/hashicorp/nomad"
ent="git@github.com:/hashicorp/nomad-enterprise"
oss="git@github.com:hashicorp/nomad.git"
ent="git@github.com:hashicorp/nomad-enterprise.git"
if [ "$2" != "$ent" -a -f version/version_ent.go ]; then
fail "found enterprise version file version/version_ent.go while pushing to oss remote"
fi

View File

@@ -1,7 +1,7 @@
acl {
tokens {
agent = "CONSUL_TOKEN"
agent = "CONSUL_TOKEN"
agent_master = "CONSUL_TOKEN"
default = "CONSUL_TOKEN"
default = "CONSUL_TOKEN"
}
}

View File

@@ -1,11 +1,11 @@
job "binstore-storagelocker" {
region = "global"
type = "service"
priority = 50
all_at_once = true
datacenters = ["us2", "eu1"]
region = "global"
type = "service"
priority = 50
all_at_once = true
datacenters = ["us2", "eu1"]
consul_token = "abc"
vault_token = "foo"
vault_token = "foo"
meta {
foo = "bar"

View File

@@ -1,12 +1,12 @@
job "binstore-storagelocker" {
region = "fooregion"
namespace = "foonamespace"
type = "batch"
priority = 52
all_at_once = true
datacenters = ["us2", "eu1"]
region = "fooregion"
namespace = "foonamespace"
type = "batch"
priority = 52
all_at_once = true
datacenters = ["us2", "eu1"]
consul_token = "abc"
vault_token = "foo"
vault_token = "foo"
meta {
foo = "bar"

View File

@@ -1,11 +1,11 @@
job "binstore-storagelocker" {
region = "global"
type = "service"
priority = 50
all_at_once = true
datacenters = ["us2", "eu1"]
region = "global"
type = "service"
priority = 50
all_at_once = true
datacenters = ["us2", "eu1"]
consul_token = "abc"
vault_token = "foo"
vault_token = "foo"
meta {
foo = "bar"

View File

@@ -1,11 +1,11 @@
job "binstore-storagelocker" {
region = "global"
type = "service"
priority = 50
all_at_once = true
datacenters = ["us2", "eu1"]
region = "global"
type = "service"
priority = 50
all_at_once = true
datacenters = ["us2", "eu1"]
consul_token = "abc"
vault_token = "foo"
vault_token = "foo"
meta {
foo = "bar"

View File

@@ -1,11 +1,11 @@
job "binstore-storagelocker" {
region = "global"
type = "service"
priority = 50
all_at_once = true
datacenters = ["us2", "eu1"]
region = "global"
type = "service"
priority = 50
all_at_once = true
datacenters = ["us2", "eu1"]
consul_token = "abc"
vault_token = "foo"
vault_token = "foo"
meta {
foo = "bar"