Commit Graph

25331 Commits

Author SHA1 Message Date
James Rasell
cfbb2e8923 cli: use spaces when outputting ACL auth method token TTL param. (#19159) 2023-11-24 10:39:27 +00:00
Luiz Aoqui
bdac8d9583 cli: prevent panic on CTRL+C during a question (#19154)
Fix a panic when a question receives an interrupt signal before the
signal handler is initialized.
2023-11-23 14:51:56 -05:00
Luiz Aoqui
d2849b8a76 cli: skip allocs with replacements on job restart (#19155)
The `nomad job restart` command should skip allocations that already
have replacements. Restarting an allocation with a replacement is a
no-op because the allocation status is terminal and the command's
replacement monitor returns immediatelly.

But by not skipping them, the effective batch size is computed
incorrectly.
2023-11-23 14:51:10 -05:00
Jorge Marey
46442f441f Set correct submit time to stopped jobs (#18967) 2023-11-23 10:30:39 -05:00
James Rasell
e8e7e85b03 actions: add RPC tests and set reply index value. (#19151) 2023-11-23 08:10:56 +00:00
James Rasell
532402aa2d actions: use specific RPC request object and tighten naming. (#19149) 2023-11-23 07:42:37 +00:00
Phil Renaud
eb8553c16f Reframe nomad action as a wrapper around nomad job action (#19048)
* Reframe nomad action as a wrapper around nomad job action

* dont conditionally pass flags, just pass flags

* PR comments addressed
2023-11-22 09:23:48 -05:00
James Rasell
0f0b9a1a3c action: add job action name validation (#19145) 2023-11-22 08:02:49 +00:00
Phil Renaud
e03e674135 [ui] UI actions implementation on task index (#19036)
* Sidequest: always show actions column on client view

* Task sidebar and task index actions menus

* Fixing test-fixture selector to no longer use old title class

* Remove actions dropdown from fly-out

* PR feedback addressed
2023-11-22 01:18:11 -05:00
dependabot[bot]
36b74496a5 chore(deps): bump github.com/go-jose/go-jose/v3 from 3.0.0 to 3.0.1 (#19146)
Bumps [github.com/go-jose/go-jose/v3](https://github.com/go-jose/go-jose) from 3.0.0 to 3.0.1.
- [Release notes](https://github.com/go-jose/go-jose/releases)
- [Changelog](https://github.com/go-jose/go-jose/blob/v3/CHANGELOG.md)
- [Commits](https://github.com/go-jose/go-jose/compare/v3.0.0...v3.0.1)

---
updated-dependencies:
- dependency-name: github.com/go-jose/go-jose/v3
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-21 20:20:45 -05:00
James Rasell
e3979dd5a1 actions: add test coverage to structs and fix equal func. (#19141) 2023-11-21 15:37:04 +00:00
Piotr Kazmierczak
711da2e653 client: change Consul client interface (#19140)
DeriveSITokenWithJWT is a misleading method name, because it's used to derive
Consul ACL tokens for other purposes too.
2023-11-21 16:01:26 +01:00
Phil Renaud
2e254112f5 addToPath to prevent multiple param string starting chars (#19139) 2023-11-21 09:23:51 -05:00
Piotr Kazmierczak
e9019d5fc8 client: make sure consul_hook does not perform double requests for tasks (#19137) 2023-11-21 10:24:45 +01:00
Tim Gross
ff928a8045 E2E: remove assertion from ACL role test (#19121)
The ACL role test asserts that the role has various permissions by listing jobs
in namespaces. It never creates jobs, because we can make all the assertions we
need by checking the error. But the test included an assertion that the
namespace was empty. Usually this will be the case, but if the previous test
case has not completed its GC (which is sync), then it's possible a stopped job
will be in the namespace. Because this assertion is irrelevant for this test,
remove it.
2023-11-17 14:35:20 -05:00
Tim Gross
a3f8a52fd4 E2E: fix assertion in dynamic node metadata test (#19120)
In #18664 we change how null values worked with dynamic node metadata so that
they were no longer returned if there wasn't also a static value for that
key. The test assertion in E2E was not updated to match the new behavior.

Fixes: #19112
2023-11-17 14:35:07 -05:00
Tim Gross
c144af2823 E2E: fix expected error message from token expiration test (#19119)
In Nomad 1.5 we started masking the specific error returned from the
authentication method and returned the "permission denied" error instead. Update
the E2E test that covers token expiration to ensure we're asserting the correct
error here.

Fixes: https://github.com/hashicorp/nomad/issues/16803
2023-11-17 14:00:47 -05:00
Charlie Voiselle
659c0945fc [core] Honor job's namespace when checking distinct_hosts feasibility (#19004)
* Update distinct_host feasibility checking to honor the job's namespace. Fixes #9792
* Added test to verify original condition and that fix resolved it.
* Added documentation
2023-11-17 11:25:10 -05:00
codenoid
557b4942d0 api: fix panic in Allocation.Stub() when Job is nil (#19115) 2023-11-17 08:55:46 -05:00
Daniel Bennett
4ec9343447 e2e: use tf variable defaults (#19108) 2023-11-16 14:50:11 -06:00
Tim Gross
da61d278d0 e2e: fix and modernize rescheduling test (#19105)
The E2E test suite for rescheduling had a few bugs:
* Using the command line to stop a job with a failing deployment returns a non-zero exit
  code, which would cause an otherwise passing test to fail.
* Two of the input jobs were actually invalid but were only correctly detected
  as such because of #17342

This changeset also updates the whole test suite to move it off the v1
"framework". A few test assertions are also de-flaked.

Fixes: #19076
2023-11-16 15:39:18 -05:00
Tim Gross
18e22e6de5 bump Consul constraint to 1.8.0 (#19104)
The JWT authentication feature was added to Consul in 1.8.0. Bump the version
constraint in the job endpoint hooks to match. This version is long out of
support so it shouldn't have any impact on existing jobs.
2023-11-16 12:05:59 -05:00
Judith Malnick
d9fa19f542 docs: fix networking and licensing links (#19096) 2023-11-16 09:03:23 -05:00
Adrian Todorov
8cde5f799c dist: move systemd unit file rate limits from [Service] to [Unit] block (#19098) 2023-11-16 08:25:04 -05:00
Michael Schurter
f95697abaf Merge pull request #19097 from hashicorp/release/1.7.0-beta.2
Release/1.7.0 beta.2
2023-11-15 18:49:33 -08:00
hc-github-team-nomad-core
847bc49625 Prepare for next release 2023-11-15 22:47:47 +00:00
hc-github-team-nomad-core
ea3f6cc879 Generate files for 1.7.0-beta.2 release 2023-11-15 22:47:41 +00:00
Michael Schurter
2def3bb2b9 Prepare release 1.7.0-beta.2 2023-11-15 14:42:22 -08:00
Adriano Caloiaro
f66eb83fc0 Add go-netaddrs support to retry_join (#18745) 2023-11-15 10:07:18 -05:00
Phil Renaud
bb6c86d2a4 Shows the client/node name alongside alloc short ID if the job is sys/sysbatch (#19051) 2023-11-15 10:05:12 -05:00
Luiz Aoqui
26746a4093 cli: add zero nodes message to node status (#19082)
Display a message to indicate that there are no nodes registered when
`node status` returns zero values.
2023-11-14 23:00:12 -05:00
Tim Gross
98e9fb4698 docs: clarify when "all" is not permitted for cap_add (#19091)
Linux capabilities configurable by the task must be a subset of those configured
in the plugin configuration. Clarify this implies that `"all"` is not permitted
if the plugin is not also configured to allow all capabilities.

Fixes: https://github.com/hashicorp/nomad/issues/19059
2023-11-14 16:33:55 -05:00
Tim Gross
0236bd0907 qemu: fix panic from missing resources block (#19089)
The `qemu` driver uses our universal executor to run the qemu command line
tool. Because qemu owns the resource isolation, we don't pass in the resource
block that the universal executor uses to configure cgroups and core
pinning. This resulted in a panic.

Fix the panic by returning early in the cgroup configuration in the universal
executor. This fixes `qemu` but also any third-party drivers that might exist
and are using our executor code without passing in the resource block.

In future work, we should ensure that the `resources` block is being translated
into qemu equivalents, so that we have support for things like NUMA-aware
scheduling for that driver.

Fixes: https://github.com/hashicorp/nomad/issues/19078
2023-11-14 16:26:44 -05:00
dependabot[bot]
9bc4a8df59 chore(deps): bump debug from 4.1.1 to 4.3.4 in /scripts/screenshots/src (#18636)
Bumps [debug](https://github.com/debug-js/debug) from 4.1.1 to 4.3.4.
- [Release notes](https://github.com/debug-js/debug/releases)
- [Commits](https://github.com/debug-js/debug/compare/4.1.1...4.3.4)

---
updated-dependencies:
- dependency-name: debug
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-14 14:36:02 -05:00
Phil Renaud
12e43aa07f Re-add wildcard for test-ui path restrictions (#19085) 2023-11-14 11:28:53 -05:00
Tim Gross
42f0540f9a docs: fix link to dynamic node metadata API (#19086) 2023-11-14 11:16:12 -05:00
Tim Gross
8fac70c92c E2E: refactor vaultcompat to allow for ENT tests (#19081)
We want to run the Vault compatibility E2E test with Vault Enterprise binaries
and use Vault namespaces. Refactor the `vaultcompat` test so as to parameterize
most of the test setup logic with the namespace, and add the appropriate build
tag for the CE version of the test.
2023-11-14 09:54:47 -05:00
Tim Gross
b5af87ebf3 set Vault namespace from task in vault_hook JWT login (#19080)
The JWT login codepath for the `vault_hook` was missing the Vault namespace, so
the login request for non-default namespaces would fail.
2023-11-14 09:54:36 -05:00
Juana De La Cuesta
bae82b14b4 docs: Add section for disable restart (#19083)
* docs: add section for disable restart that mirrors what is on disable reschedule

* Update restart.mdx
2023-11-14 14:53:43 +01:00
Tim Gross
1c9c75cc83 E2E: refactor consulcompat to allow for ENT tests (#19068)
We want to run the Consul compatibility E2E test with Consul Enterprise binaries
and use Consul namespaces. Refactor the `consulcompat` test so as to
parameterize most of the test setup logic with the namespace, and add the
appropriate build tag for the CE version of the test.

Ref: https://github.com/hashicorp/nomad-enterprise/pull/1305
2023-11-10 15:05:51 -05:00
Seth Hoenig
5987ba434f e2ev3: wait for logs to become ready (#19067)
Just because an alloc is running does not mean nomad is ready to serve
task logs. In a test case where you immediatly read logs after starting
a task, it could be that nomad responds with "no logs found" when you
try to read logs, in which case you just need to wait longer. Do so in
the v3 TaskLogs helper function.
2023-11-10 12:43:16 -06:00
Luiz Aoqui
f0acf72ae7 client: fix Consul token retrievel for templates (#19058)
The template hook must use the Consul token for the cluster defined in
the task-level `consul` block or, if `nil, in the group-level `consul`
block.

The Consul tokens are generated by the allocrunner consul hook, but
during the transition period we must fallback to the Nomad agent token
if workload identities are not being used.

So an empty token returned from `GetConsulTokens()` is not enough to
determine if we should use the legacy flow (either this is an old task
or the cluster is not configured for Consul WI), or if there is a
misconfiguration (task or group is `consul` block is using a cluster
that doesn't have an `identity` set).

In order to distinguish between the two scenarios we must iterate over
the task identities looking for one suitable for the Consul cluster
being used.
2023-11-10 13:42:30 -05:00
Phil Renaud
62007e3b18 [ui] Small fix to let UI actions passing use job.name instead of job.id, since namespace is passed as an explicit param afterward (#19061) 2023-11-10 10:55:00 -05:00
Seth Hoenig
c17333d74a e2e refactor oversubscription (#19060)
* e2e: remove old oversubscription test

* e2e: fixup and cleanup oversubscription test suite

Fix and cleanup this old oversubscription test.

* use t.Cleanup instead of defer in tests
2023-11-10 09:25:32 -06:00
Tim Gross
5d0008a9b4 tools: bump version of hc-install (#19063)
The version we have of `hc-install` doesn't allow installing Enterprise
binaries. Upgrade so that this is available to the development team and to our
E2E tests in the Enterprise repo.
2023-11-10 09:57:29 -05:00
Tim Gross
4e38b41d9d E2E: add template block to consulcompat test (#19055)
The Consul compatibility test focuses on Connect, but it'd be a good idea to
ensure we can successfully get template data out of Consul as well.

Also tightens up the test's Consul ACL policy for the Nomad agent.
2023-11-10 09:25:37 -05:00
Seth Hoenig
1f957947b4 e2e: refactor nomadexec test suite (#19054) 2023-11-10 07:09:24 -06:00
Seth Hoenig
2f8d94ae3e e2e: more cpu and memory for java tasks and some scripts (#19057) 2023-11-10 07:08:14 -06:00
Tim Gross
5ad715b281 fix taskrunner test after broken signature (#19056)
PRs #19034 and #19040 accidentally conflicted with each other without a merge
conflict when #19034 changes the method signature of `SetConsulTokens`. Because
CI doesn't rebase, both PRs tested fine and only were broken once they landed on
`main`. Fix that.
2023-11-09 15:53:25 -05:00
Seth Hoenig
f211a0ab7c e2e: update terrform lock file for 1.6.3 (#19049)
Using the latest version of terraform, the lock file is not the same
as when it was generated. Seems like the http module is not needed?
versioned? present? anymore.
2023-11-09 10:49:49 -06:00