Skip to content

Commit

Permalink
Merge branch 'master' into f_gh_4381
Browse files Browse the repository at this point in the history
  • Loading branch information
jrasell authored Jun 19, 2018
2 parents 40a6675 + 4ccbf32 commit 46037d7
Show file tree
Hide file tree
Showing 133 changed files with 1,474 additions and 1,299 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 0.8.4 (Unreleased)
## 0.8.4 (June 11, 2018)

IMPROVEMENTS:
* core: Updated serf library to improve how leave intents are handled [[GH-4278](https://github.com/hashicorp/nomad/issues/4278)]
Expand Down Expand Up @@ -36,12 +36,14 @@ IMPROVEMENTS:
an empty string rather than the field key. [[GH-3720](https://github.com/hashicorp/nomad/issues/3720)]
* ui: Show node drain, node eligibility, and node drain strategy information in the Client list and Client detail pages [[GH-4353](https://github.com/hashicorp/nomad/issues/4353)]
* ui: Show reschedule-event information for allocations that were server-side rescheduled [[GH-4254](https://github.com/hashicorp/nomad/issues/4254)]
* ui: Show the running deployment Progress Deadlines on the Job Detail Page [[GH-4388](https://github.com/hashicorp/nomad/issues/4388)]
* ui: Show driver health status and node events on the Client Detail Page [[GH-4294](https://github.com/hashicorp/nomad/issues/4294)]
* ui: Fuzzy and tokenized search on the Jobs List Page [[GH-4201](https://github.com/hashicorp/nomad/issues/4201)]
* ui: The stop job button looks more dangerous [[GH-4339](https://github.com/hashicorp/nomad/issues/4339)]

BUG FIXES:
* core: Clean up leaked deployments on restoration [[GH-4329](https://github.com/hashicorp/nomad/issues/4329)]
* core: Fix regression to allow for dynamic Vault configuration reload [[GH-4395](https://github.com/hashicorp/nomad/issues/4395)]
* core: Fix bug where older failed allocations of jobs that have been updated to a newer version were
not being garbage collected [[GH-4313](https://github.com/hashicorp/nomad/issues/4313)]
* core: Fix bug when upgrading an existing server to Raft protocol 3 that
Expand All @@ -57,9 +59,10 @@ BUG FIXES:
* driver/exec: Disable exec on non-linux platforms [[GH-4366](https://github.com/hashicorp/nomad/issues/4366)]
* rpc: Fix RPC tunneling when running both client/server on one machine [[GH-4317](https://github.com/hashicorp/nomad/issues/4317)]
* ui: Track the method in XHR tracking to prevent errant ACL error dialogs when stopping a job [[GH-4319](https://github.com/hashicorp/nomad/issues/4319)]
* ui: Make the tasks list on the Allocation Detail Page look and behave like other lists [[GH-4387](https://github.com/hashicorp/nomad/issues/4387)] [[GH-4393](https://github.com/hashicorp/nomad/issues/4393)]
* ui: Use the Network IP, not the Node IP, for task addresses [[GH-4369](https://github.com/hashicorp/nomad/issues/4369)]
* ui: Use Polling instead of Streaming for logs in Safari [[GH-4335](https://github.com/hashicorp/nomad/issues/4335)]
* ui: Track PlaceCanaries in deployment metrics [[GH-4325](https://github.com/hashicorp/nomad/issues/4325)]
* ui: Use the Network IP, not the Node IP, for task addresses [[GH-4369](https://github.com/hashicorp/nomad/issues/4369)]

## 0.8.3 (April 27, 2018)

Expand Down
1 change: 0 additions & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,6 @@ test-ui: ## Run Nomad UI test suite
@cd ui && npm rebuild node-sass
@cd ui && yarn install
@echo "--> Running ember tests"
@cd ui && phantomjs --version
@cd ui && npm test

.PHONY: ember-dist
Expand Down
16 changes: 16 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,22 @@ Vagrant.configure(2) do |config|

vmCfg = configureLinuxProvisioners(vmCfg)

vmCfg.vm.synced_folder '.',
'/opt/gopath/src/github.com/hashicorp/nomad'

vmCfg.vm.provision "shell",
privileged: false,
path: './scripts/vagrant-linux-unpriv-bootstrap.sh'
end

config.vm.define "linux-ui", autostart: false, primary: false do |vmCfg|
vmCfg.vm.box = LINUX_BASE_BOX
vmCfg.vm.hostname = "linux"
vmCfg = configureProviders vmCfg,
cpus: suggestedCPUCores()

vmCfg = configureLinuxProvisioners(vmCfg)

vmCfg.vm.synced_folder '.',
'/opt/gopath/src/github.com/hashicorp/nomad'

Expand Down
3 changes: 2 additions & 1 deletion api/jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,7 @@ type Job struct {
Update *UpdateStrategy
Periodic *PeriodicConfig
ParameterizedJob *ParameterizedJobConfig
Dispatched bool
Payload []byte
Reschedule *ReschedulePolicy
Migrate *MigrateStrategy
Expand All @@ -636,7 +637,7 @@ func (j *Job) IsPeriodic() bool {

// IsParameterized returns whether a job is parameterized job.
func (j *Job) IsParameterized() bool {
return j.ParameterizedJob != nil
return j.ParameterizedJob != nil && !j.Dispatched
}

func (j *Job) Canonicalize() {
Expand Down
32 changes: 13 additions & 19 deletions client/allocdir/alloc_dir_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ import (

cstructs "github.com/hashicorp/nomad/client/structs"
"github.com/hashicorp/nomad/client/testutil"
"github.com/hashicorp/nomad/helper/testlog"
"github.com/hashicorp/nomad/nomad/structs"
"github.com/kr/pretty"
"github.com/stretchr/testify/require"
)

var (
Expand Down Expand Up @@ -45,13 +46,6 @@ var (
}
)

func testLogger() *log.Logger {
if testing.Verbose() {
return log.New(os.Stderr, "", log.LstdFlags)
}
return log.New(ioutil.Discard, "", log.LstdFlags)
}

// Test that AllocDir.Build builds just the alloc directory.
func TestAllocDir_BuildAlloc(t *testing.T) {
tmp, err := ioutil.TempDir("", "AllocDir")
Expand All @@ -60,7 +54,7 @@ func TestAllocDir_BuildAlloc(t *testing.T) {
}
defer os.RemoveAll(tmp)

d := NewAllocDir(testLogger(), tmp)
d := NewAllocDir(testlog.Logger(t), tmp)
defer d.Destroy()
d.NewTaskDir(t1.Name)
d.NewTaskDir(t2.Name)
Expand Down Expand Up @@ -97,7 +91,7 @@ func TestAllocDir_MountSharedAlloc(t *testing.T) {
}
defer os.RemoveAll(tmp)

d := NewAllocDir(testLogger(), tmp)
d := NewAllocDir(testlog.Logger(t), tmp)
defer d.Destroy()
if err := d.Build(); err != nil {
t.Fatalf("Build() failed: %v", err)
Expand Down Expand Up @@ -142,7 +136,7 @@ func TestAllocDir_Snapshot(t *testing.T) {
}
defer os.RemoveAll(tmp)

d := NewAllocDir(testLogger(), tmp)
d := NewAllocDir(testlog.Logger(t), tmp)
defer d.Destroy()
if err := d.Build(); err != nil {
t.Fatalf("Build() failed: %v", err)
Expand Down Expand Up @@ -229,13 +223,13 @@ func TestAllocDir_Move(t *testing.T) {
defer os.RemoveAll(tmp2)

// Create two alloc dirs
d1 := NewAllocDir(testLogger(), tmp1)
d1 := NewAllocDir(testlog.Logger(t), tmp1)
if err := d1.Build(); err != nil {
t.Fatalf("Build() failed: %v", err)
}
defer d1.Destroy()

d2 := NewAllocDir(testLogger(), tmp2)
d2 := NewAllocDir(testlog.Logger(t), tmp2)
if err := d2.Build(); err != nil {
t.Fatalf("Build() failed: %v", err)
}
Expand Down Expand Up @@ -290,7 +284,7 @@ func TestAllocDir_EscapeChecking(t *testing.T) {
}
defer os.RemoveAll(tmp)

d := NewAllocDir(testLogger(), tmp)
d := NewAllocDir(testlog.Logger(t), tmp)
if err := d.Build(); err != nil {
t.Fatalf("Build() failed: %v", err)
}
Expand Down Expand Up @@ -331,7 +325,7 @@ func TestAllocDir_ReadAt_SecretDir(t *testing.T) {
}
defer os.RemoveAll(tmp)

d := NewAllocDir(testLogger(), tmp)
d := NewAllocDir(testlog.Logger(t), tmp)
if err := d.Build(); err != nil {
t.Fatalf("Build() failed: %v", err)
}
Expand Down Expand Up @@ -416,14 +410,14 @@ func TestAllocDir_CreateDir(t *testing.T) {
// TestAllocDir_Copy asserts that AllocDir.Copy does a deep copy of itself and
// all TaskDirs.
func TestAllocDir_Copy(t *testing.T) {
a := NewAllocDir(testLogger(), "foo")
a := NewAllocDir(testlog.Logger(t), "foo")
a.NewTaskDir("bar")
a.NewTaskDir("baz")

b := a.Copy()
if diff := pretty.Diff(a, b); len(diff) > 0 {
t.Errorf("differences between copies: %# v", pretty.Formatter(diff))
}

// Clear the logger
require.Equal(t, a, b)

// Make sure TaskDirs map is copied
a.NewTaskDir("new")
Expand Down
3 changes: 2 additions & 1 deletion client/allocdir/task_dir_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"path/filepath"
"testing"

"github.com/hashicorp/nomad/helper/testlog"
"golang.org/x/sys/unix"
)

Expand All @@ -21,7 +22,7 @@ func TestLinuxSpecialDirs(t *testing.T) {
}
defer os.RemoveAll(allocDir)

td := newTaskDir(testLogger(), allocDir, "test")
td := newTaskDir(testlog.Logger(t), allocDir, "test")

// Despite the task dir not existing, unmountSpecialDirs should *not*
// return an error
Expand Down
9 changes: 5 additions & 4 deletions client/allocdir/task_dir_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"testing"

cstructs "github.com/hashicorp/nomad/client/structs"
"github.com/hashicorp/nomad/helper/testlog"
)

// Test that building a chroot will skip nonexistent directories.
Expand All @@ -17,7 +18,7 @@ func TestTaskDir_EmbedNonexistent(t *testing.T) {
}
defer os.RemoveAll(tmp)

d := NewAllocDir(testLogger(), tmp)
d := NewAllocDir(testlog.Logger(t), tmp)
defer d.Destroy()
td := d.NewTaskDir(t1.Name)
if err := d.Build(); err != nil {
Expand All @@ -39,7 +40,7 @@ func TestTaskDir_EmbedDirs(t *testing.T) {
}
defer os.RemoveAll(tmp)

d := NewAllocDir(testLogger(), tmp)
d := NewAllocDir(testlog.Logger(t), tmp)
defer d.Destroy()
td := d.NewTaskDir(t1.Name)
if err := d.Build(); err != nil {
Expand Down Expand Up @@ -96,7 +97,7 @@ func TestTaskDir_NonRoot_Image(t *testing.T) {
}
defer os.RemoveAll(tmp)

d := NewAllocDir(testLogger(), tmp)
d := NewAllocDir(testlog.Logger(t), tmp)
defer d.Destroy()
td := d.NewTaskDir(t1.Name)
if err := d.Build(); err != nil {
Expand All @@ -119,7 +120,7 @@ func TestTaskDir_NonRoot(t *testing.T) {
}
defer os.RemoveAll(tmp)

d := NewAllocDir(testLogger(), tmp)
d := NewAllocDir(testlog.Logger(t), tmp)
defer d.Destroy()
td := d.NewTaskDir(t1.Name)
if err := d.Build(); err != nil {
Expand Down
Loading

0 comments on commit 46037d7

Please sign in to comment.