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

Grab bag of dev tweaks #7055

Merged
merged 5 commits into from
Feb 3, 2020
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
2 changes: 1 addition & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion dev/cluster/client1.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion dev/cluster/client2.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion dev/cluster/client3.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
23 changes: 17 additions & 6 deletions dev/cluster/cluster.sh
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion dev/cluster/server-standalone.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion dev/cluster/server1.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion dev/cluster/server2.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion dev/cluster/server3.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions dev/hooks/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ fail () {

# only push to oss when the enterprise version is absent
# ====================
oss="[email protected]:/hashicorp/nomad"
ent="[email protected]:/hashicorp/nomad-enterprise"
oss="[email protected]:hashicorp/nomad.git"
ent="[email protected]: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
Expand Down
4 changes: 2 additions & 2 deletions e2e/consulacls/consul-client-default-token.hcl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
acl {
tokens {
agent = "CONSUL_TOKEN"
agent = "CONSUL_TOKEN"
agent_master = "CONSUL_TOKEN"
default = "CONSUL_TOKEN"
default = "CONSUL_TOKEN"
}
}
12 changes: 6 additions & 6 deletions jobspec/test-fixtures/bad-ports.hcl
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
14 changes: 7 additions & 7 deletions jobspec/test-fixtures/basic.hcl
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
12 changes: 6 additions & 6 deletions jobspec/test-fixtures/basic_wrong_key.hcl
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
12 changes: 6 additions & 6 deletions jobspec/test-fixtures/incorrect-service-def.hcl
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
12 changes: 6 additions & 6 deletions jobspec/test-fixtures/overlapping-ports.hcl
Original file line number Diff line number Diff line change
@@ -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"
Expand Down