Commit Graph

26148 Commits

Author SHA1 Message Date
Seth Hoenig
8bb94ec32d WIP: try less hard to cache go modules (#24016) 2024-09-20 09:37:13 -05:00
Tim Gross
b7d5acc47b test: wait for keyring for plan apply tests (#24021)
In #23977 we merged a change to how the keyring was stored. Because keyring
initialization takes slightly longer now, this uncovered existing timing bugs in
some of our tests where tests that require the keyring (ex. plan applier tests)
were waiting for the leader but not the keyring initialization. Fix some of the
examples we've seen cause test flakes.
2024-09-20 10:33:40 -04:00
Seth Hoenig
68ecf67c99 ci: (ent) specify instance types when using self hosted runners (#24015) 2024-09-20 07:53:34 -05:00
dependabot[bot]
16c4b7ca19 chore(deps): bump actions/download-artifact from 4.1.7 to 4.1.8 (#23990)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-20 08:44:45 +01:00
Seth Hoenig
d1fca7bde2 update changelog 1.8.4 (#23987)
* update changelog for 1.8.4 release

* changelog: add 1.8.4 backport changelog notes

I botched the changelog bits of the checklist, adding the backport notes
to the CE changelog now.
2024-09-19 14:57:31 -05:00
Tim Gross
44f4970372 keyring in raft (#23977)
In Nomad 1.4, we implemented a root keyring to support encrypting Variables and
signing Workload Identities. The keyring was originally stored with the
AEAD-wrapped DEKs and the KEK together in a JSON keystore file on disk. We
recently added support for using an external KMS for the KEK to improve the
security model for the keyring. But we've encountered multiple instances of the
keystore files not getting backed up separately from the Raft snapshot,
resulting in failure to restore clusters from backup.

Move Nomad's root keyring into Raft (encrypted with a KMS/Vault where available)
in order to eliminate operational problems with the separate on-disk keystore.

Fixes: https://github.com/hashicorp/nomad/issues/23665
Ref: https://hashicorp.atlassian.net/browse/NET-10523
2024-09-19 13:56:42 -04:00
Tim Gross
85e8774ed4 version: bump base to 1.9.0 (#24012)
We're releasing the beta for Nomad 1.9.0 shortly. Bumping the base version now
will make it easier to test out new features that require a version
check. Builds from `main` will show as `1.9.0-dev`.
2024-09-19 11:07:07 -04:00
James Rasell
370c1c06ac contributing: add note about first issue label. (#24002) 2024-09-19 15:28:29 +01:00
dependabot[bot]
b71124864b chore(deps): bump slackapi/slack-github-action from 1.26.0 to 1.27.0 (#23991)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-19 13:04:44 +01:00
dependabot[bot]
59b07eed4d chore(deps): bump github.com/creack/pty from 1.1.18 to 1.1.23 (#23995)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-19 11:24:24 +01:00
dependabot[bot]
29a5edb4c9 chore(deps): bump actions/upload-artifact from 4.3.3 to 4.4.0 (#23994)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.3.3 to 4.4.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](65462800fd...50769540e7)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-19 09:20:24 +02:00
dependabot[bot]
287a4c0789 chore(deps): bump actions/setup-node from 4.0.2 to 4.0.3 (#23992)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 4.0.2 to 4.0.3.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](60edb5dd54...1e60f620b9)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-19 09:19:52 +02:00
dependabot[bot]
c057490c3b chore(deps): bump github.com/opencontainers/runc from 1.1.13 to 1.1.14 (#23903) 2024-09-19 08:17:19 +01:00
dependabot[bot]
518f9c6505 chore(deps): bump actions/setup-go from 5.0.1 to 5.0.2 (#23989) 2024-09-19 07:56:05 +01:00
Michael Smithhisler
25b2bd8467 test: add missing checks for vault binary in unit tests (#23986) 2024-09-18 17:12:29 -04:00
Deniz Onur Duzgun
52f0b40f4c security: fine tune security-scanner to reduce false-positives (#20465)
Resolve scan job runner

Resolve linting alerts

adding EOF on files

adding EOF on gitignore too

add hclfmt and bump action versions

update scan.hcl comments

Co-authored-by: Tim Gross <tgross@hashicorp.com>

fix typo

move scan.hcl file and paths-ignore for scans

change action runner

use org secret to checkout

typo

change runner

use hashicorp/setup-golang@v3

Co-authored-by: Tim Gross <tgross@hashicorp.com>

pin the github action sha
2024-09-18 16:55:39 -04:00
Daniel Bennett
ec81e7c57c networking: add ignore_collision for static port{} (#23956)
so more than one copy of a program can run
at a time on the same port with SO_REUSEPORT.

requires host network mode.

some task drivers (like docker) may also need
config {
  network_mode = "host"
}
but this is not validated prior to placement.
2024-09-17 16:01:48 -05:00
Daniel Bennett
603a747f5b Port and AllocatedPortMapping msgpack omitempty (#23980)
to optimize log entries with empty fields, which TestPlanNormalize checks
2024-09-17 14:21:54 -05:00
Tim Gross
b7f1800657 fingerprint: update landlock test to accept v4+ APIs (#23979)
The landlock fingerprint test assumes there's no version of the landlock API
>3. Update the test assertion to allow for the current v4 and any future
versions.
2024-09-17 15:07:44 -04:00
Tim Gross
a2b19851a2 keyring: reduce locking and replication overhead (#23975)
While working on #23655 I found there were a few places in the encrypter/keyring
where we could make modest improvements to performance and reliability of the
existing code.

This changeset allows keyring replication to skip trying to replicate from
itself, switches some of the read-only keyring accesses to use the read lock
instead of a r/w lock, fixes the logging configuration to drop spurious "extra
value" warnings in the logs, drops an unused type, and makes a minor refactoring
to eliminate shadowing of the `keyset` type. Pulling this out to its own PR lets
us backport these changes to the LTS and reduces the size of the PR that
implements #23665.

Ref https://github.com/hashicorp/nomad/issues/23665
2024-09-17 11:23:57 -04:00
dependabot[bot]
4d6856a306 chore(deps): bump golang.org/x/crypto from 0.24.0 to 0.27.0 (#23932) 2024-09-17 07:55:00 +01:00
Seth Hoenig
51215bf102 deps: update to go-set/v3 and refactor to use custom iterators (#23971)
* deps: update to go-set/v3

* deps: use custom set iterators for looping
2024-09-16 13:40:10 -05:00
Seth Hoenig
212a72b203 deps update go1.23.1 (#23972)
* deps: update to go1.23.1

* deps: update to golangci-lint 1.61.0
2024-09-16 11:03:23 -05:00
Phil Renaud
483506873e Revert "Pin body-parser to resolve an outdated dep problem (#23954)" (#23970)
This reverts commit 51caca1a85.
2024-09-16 11:44:03 -04:00
Daniel Bennett
5e1fae2856 networking: set alloc NetworkStatus.AddressIPv6 (#23959)
when a CNI result includes an IPv6 address,
set it on the alloc's NetworkStatus for reference.

e.g.:

$ nomad alloc status -json 3dca | jq '.NetworkStatus'
{
  "Address": "172.26.64.14",
  "AddressIPv6": "fd00:a110:c8::b",
  "DNS": null,
  "InterfaceName": "eth0"
}
2024-09-16 10:21:52 -05:00
dependabot[bot]
210044b465 chore(deps): bump github.com/shoenig/test from 1.7.1 to 1.11.0 (#23962) 2024-09-16 10:46:19 +01:00
Phil Renaud
51caca1a85 Pin body-parser to resolve an outdated dep problem (#23954) 2024-09-13 13:59:21 -04:00
Phil Renaud
c2bb18e167 Pin path-to-regexp with yarn1 syntax (#23955) 2024-09-13 13:51:29 -04:00
dependabot[bot]
9ed0e1aed8 chore(deps): bump ws from 7.4.6 to 7.5.10 in /scripts/screenshots/src (#23367)
Bumps [ws](https://github.com/websockets/ws) from 7.4.6 to 7.5.10.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/7.4.6...7.5.10)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-13 10:06:11 -04:00
dependabot[bot]
f579b4add1 chore(deps): bump ws from 7.5.9 to 7.5.10 in /ui (#23368)
Bumps [ws](https://github.com/websockets/ws) from 7.5.9 to 7.5.10.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/7.5.9...7.5.10)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-13 10:05:28 -04:00
Benjamin Boudreau
cdaf45d990 Stop referring non existent vault.file attribute (#23946)
The documentation is referring to a `file` attribute that does not exist on the `vault` block.

This PR changes those references to mention the `disable_file` attribute instead.
2024-09-12 09:10:41 -07:00
Piotr Kazmierczak
47f3313ffd cli: quota status extension for devices (#23899)
quota status CLI now displays device limits (if present in the quota spec)
2024-09-12 16:51:53 +02:00
Tim Gross
650e783b06 refactor keyring state store methods (#23943)
For #23665 I'm about to make add a lot more code to the state store for the
keyring, so I'd like to pull these out to their own file. Also updates the test
to use `shoenig/test` and changes the name of one method to be a little more
accurate.
2024-09-12 09:47:48 -04:00
Tim Gross
07aca67108 template: lock task handle before trying script check (#23917)
In #23663 we fixed the template hook so that `change_mode="script"` didn't lose
track of the task handle during restores. But this revealed a second bug which
is that access to the handle is not locked while in use, which can allow it to
be removed concurrently.

Fixes: https://github.com/hashicorp/nomad/issues/23875
2024-09-12 08:41:06 -04:00
Piotr Kazmierczak
4ade277cab quotas: correct addComputedAllocAttrs (#23942)
Quota usage calculation depends on allocation.Resources field (which will be
deprecated in the future), while device resources are being kept in
allocation.AllocatedResources and parsed into a structure (vendor/type/name)
in order for the ranking in the scheduler to find nodes that can satisfy device
requirements. To make device quotas work properly, this has to be temporarily
translated into allocation.Resources.Devices.

---------

Co-authored-by: Tim Gross <tgross@hashicorp.com>
2024-09-12 08:46:10 +02:00
Piotr Kazmierczak
0babf01ad0 docs: update quota API examples to demonstrate device quotas (#23941) 2024-09-11 18:23:16 +02:00
Tim Gross
8739d7738c E2E: remove invalid HCLv1 field on submissions test (#23936)
HCLv1 support was removed entirely in #23912, but I missed this one test and
documentation reference.
2024-09-09 09:57:25 -04:00
Piotr Kazmierczak
2e6ccf825a quotas: corrections to Resources.Add and quota apply parsing logic (#23894) 2024-09-09 15:27:17 +02:00
Juana De La Cuesta
cbc27e2db6 style: differenciate the error message for different rpc calls (#23907) 2024-09-09 10:36:24 +02:00
Phil Renaud
faf95ef7b9 Update the pinned playwright version (#23929) 2024-09-06 15:57:19 -04:00
Tim Gross
192d70cee7 docker: update infra_image to new registry (#23927)
The gcr.io container registry is shutting down in March. Update the default
`image_image` for Docker's "pause" containers to point to the new location
hosted by the k8s project.

Fixes: https://github.com/hashicorp/nomad/issues/23911
Ref: https://hashicorp.atlassian.net/browse/NET-10942
2024-09-06 14:34:03 -04:00
Juana De La Cuesta
bd8569e16e Merge pull request #23922 from hashicorp/b-NET-10880
[NET-10880] Keep a register of the usable cores to avoid using more than that
2024-09-06 13:18:56 +02:00
Juana De La Cuesta
9c5f962940 Update client/lib/cgroupslib/partition_linux.go
Co-authored-by: Tim Gross <tgross@hashicorp.com>
2024-09-06 10:56:47 +02:00
Juana De La Cuesta
426c225dc2 Update client/lib/cgroupslib/partition_linux.go
Co-authored-by: Tim Gross <tgross@hashicorp.com>
2024-09-06 10:56:41 +02:00
Juana De La Cuesta
8e6d85b66f Update client/lib/cgroupslib/partition_linux.go
Co-authored-by: Tim Gross <tgross@hashicorp.com>
2024-09-06 10:56:36 +02:00
Tim Gross
06f5fbc5d6 auth: enforce use of node secret and remove legacy auth (#23838)
As of Nomad 1.6.0, Nomad client agents send their secret with all the
RPCs (other than registration). But for backwards compatibility we had to keep
a legacy auth method that didn't require the node secret. We've previously
announced that this legacy auth method would be removed and that nodes older
than 1.6.0 would not be supported with Nomad 1.9.0.

This changeset removes the legacy auth method.

Ref: https://developer.hashicorp.com/nomad/docs/release-notes/nomad/upcoming#nomad-1-9-0
2024-09-05 14:24:28 -04:00
Tim Gross
04ad7165e7 services: reject node secret for Read/List RPC (#23910)
As of Nomad 1.6.0, Nomad clients never make RPC requests to the
ServiceRegistrationList/Read RPC without using a specific Workload Identity
rather than the node secret. Tighten the ACL permissions on these RPCs so that
node secrets are no longer valid tokens.

Ref: https://hashicorp.atlassian.net/browse/NET-10009
Ref: https://developer.hashicorp.com/nomad/docs/release-notes/nomad/upcoming#nomad-1-9-0
2024-09-05 13:52:32 -04:00
Juanadelacuesta
a65d05ff51 fix: keep a register of the usable cores to avoid using more than that 2024-09-05 17:02:54 +02:00
Tim Gross
a9beef7edd jobspec: remove HCL1 support (#23912)
This changeset removes support for parsing jobspecs via the long-deprecated
HCLv1.

Fixes: https://github.com/hashicorp/nomad/issues/20195
Ref: https://hashicorp.atlassian.net/browse/NET-10220
2024-09-05 09:02:45 -04:00
Juana De La Cuesta
4972b7382d Merge pull request #23909 from hashicorp/docs-gh-23878
Remove wrong `VariableFlags` parameter from parse job endpoint
2024-09-04 20:15:21 +02:00