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

manual backport 889c5aa0f7 #17208

Closed
wants to merge 17 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
9045542
Backport of scale: fixed a bug where evals could be created with wron…
hc-github-team-nomad-core May 5, 2023
3ff9f66
Merge branch 'release/1.5.5' into release/1.5.x
tgross May 5, 2023
d6056a8
Correct the status description and modify time of canceled evals. (#1…
stswidwinski May 8, 2023
174a76f
docs: add note to upgrade guide about yanked version (#17115)
tgross May 8, 2023
230ca60
backport of commit ae7016d84a17ece13975e64f1c2501969bae5657 (#17121)
hc-github-team-nomad-core May 8, 2023
35fc785
test: fix TestJobEndpoint_Scale_BatchJob (#17125)
lgfa29 May 9, 2023
d98cc3c
backport of commit ccaedec0c8d6430a4af008457110219759cf6bc6 (#17136)
hc-github-team-nomad-core May 10, 2023
b949742
backport of commit a2b126363f46657a118af96810749c93c7b43fec (#17144)
hc-github-team-nomad-core May 10, 2023
7bdd9eb
backport of commit c2126a14512848a9f33a7e3d1b12a4a689d3b385 (#17153)
hc-github-team-nomad-core May 11, 2023
6ee7c98
Backport of docs: add node meta command docs into release/1.5.x (#17160)
hc-github-team-nomad-core May 11, 2023
8be5097
backport of commit 46b5f9446f22d103eb061598a9433d9299f9e6d4 (#17164)
hc-github-team-nomad-core May 11, 2023
d725cc1
allocrunner: provide factory function so we can build mock ARs (#1716…
hc-github-team-nomad-core May 12, 2023
e2abd39
backport of commit 7578d3d530647acdc1ba037aec7164807cd34a2c (#17188)
hc-github-team-nomad-core May 15, 2023
5bf31b9
backport of commit e3c7aae453cfea30ce30fdc7293c2dc2c44ce9fc (#17202)
hc-github-team-nomad-core May 16, 2023
872baa4
changelog: add changelog update for vendor label for linux packaging …
tgross May 16, 2023
c09e319
Backport of Prevent kill_timeout greater than progress_deadline into…
hc-github-team-nomad-core May 16, 2023
af857ca
services: un-mark group services as deregistered if restart hook runs…
shoenig Apr 24, 2023
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: 3 additions & 0 deletions .changelog/16071.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
build: Linux packages now have vendor label and set the default label to HashiCorp. This fix is implemented for any future releases, but will not be updated for historical releases
```
3 changes: 3 additions & 0 deletions .changelog/16761.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
core: Prevent `task.kill_timeout` being greater than `update.progress_deadline`
```
3 changes: 3 additions & 0 deletions .changelog/16905.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
services: Fixed a bug preventing group service deregistrations after alloc restarts
```
3 changes: 3 additions & 0 deletions .changelog/17071.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
bug: Corrected status description and modification time for canceled evaluations
```
3 changes: 3 additions & 0 deletions .changelog/17092.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
scale: Fixed a bug where evals could be created with the wrong type
```
3 changes: 3 additions & 0 deletions .changelog/17104.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
client: clean up resources upon failure to restore task during client restart
```
2 changes: 1 addition & 1 deletion .release/ci.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ event "prepare" {
}

notification {
on = "fail"
on = "always"
}
}

Expand Down
2 changes: 1 addition & 1 deletion api/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/hashicorp/nomad/api

go 1.19
go 1.20

require (
github.com/docker/go-units v0.5.0
Expand Down
21 changes: 7 additions & 14 deletions client/allocrunner/alloc_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import (

log "github.com/hashicorp/go-hclog"
multierror "github.com/hashicorp/go-multierror"

"github.com/hashicorp/nomad/client/allocdir"
"github.com/hashicorp/nomad/client/allocrunner/interfaces"
"github.com/hashicorp/nomad/client/allocrunner/state"
"github.com/hashicorp/nomad/client/allocrunner/tasklifecycle"
"github.com/hashicorp/nomad/client/allocrunner/taskrunner"
"github.com/hashicorp/nomad/client/allocwatcher"
"github.com/hashicorp/nomad/client/config"
"github.com/hashicorp/nomad/client/consul"
"github.com/hashicorp/nomad/client/devicemanager"
Expand Down Expand Up @@ -143,10 +143,10 @@ type allocRunner struct {

// prevAllocWatcher allows waiting for any previous or preempted allocations
// to exit
prevAllocWatcher allocwatcher.PrevAllocWatcher
prevAllocWatcher config.PrevAllocWatcher

// prevAllocMigrator allows the migration of a previous allocations alloc dir.
prevAllocMigrator allocwatcher.PrevAllocMigrator
prevAllocMigrator config.PrevAllocMigrator

// dynamicRegistry contains all locally registered dynamic plugins (e.g csi
// plugins).
Expand Down Expand Up @@ -181,7 +181,7 @@ type allocRunner struct {

// rpcClient is the RPC Client that should be used by the allocrunner and its
// hooks to communicate with Nomad Servers.
rpcClient RPCer
rpcClient config.RPCer

// serviceRegWrapper is the handler wrapper that is used by service hooks
// to perform service and check registration and deregistration.
Expand All @@ -194,13 +194,8 @@ type allocRunner struct {
getter cinterfaces.ArtifactGetter
}

// RPCer is the interface needed by hooks to make RPC calls.
type RPCer interface {
RPC(method string, args interface{}, reply interface{}) error
}

// NewAllocRunner returns a new allocation runner.
func NewAllocRunner(config *Config) (*allocRunner, error) {
func NewAllocRunner(config *config.AllocRunnerConfig) (interfaces.AllocRunner, error) {
alloc := config.Alloc
tg := alloc.Job.LookupTaskGroup(alloc.TaskGroup)
if tg == nil {
Expand Down Expand Up @@ -344,17 +339,15 @@ func (ar *allocRunner) Run() {
ar.logger.Error("prerun failed", "error", err)

for _, tr := range ar.tasks {
tr.MarkFailedDead(fmt.Sprintf("failed to setup alloc: %v", err))
// emit event and mark task to be cleaned up during runTasks()
tr.MarkFailedKill(fmt.Sprintf("failed to setup alloc: %v", err))
}

goto POST
}
}

// Run the runners (blocks until they exit)
ar.runTasks()

POST:
if ar.isShuttingDown() {
return
}
Expand Down
4 changes: 4 additions & 0 deletions client/allocrunner/alloc_runner_hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"time"

multierror "github.com/hashicorp/go-multierror"

"github.com/hashicorp/nomad/client/allocrunner/interfaces"
clientconfig "github.com/hashicorp/nomad/client/config"
"github.com/hashicorp/nomad/client/taskenv"
Expand Down Expand Up @@ -135,6 +136,9 @@ func (ar *allocRunner) initRunnerHooks(config *clientconfig.Config) error {
newCSIHook(alloc, hookLogger, ar.csiManager, ar.rpcClient, ar, ar.hookResources, ar.clientConfig.Node.SecretID),
newChecksHook(hookLogger, alloc, ar.checkStore, ar),
}
if config.ExtraAllocHooks != nil {
ar.runnerHooks = append(ar.runnerHooks, config.ExtraAllocHooks...)
}

return nil
}
Expand Down
Loading