Commit Graph

26444 Commits

Author SHA1 Message Date
Tim Gross
24fa7439df cni: use tmpfs location for ipam plugin (#24650)
When a Nomad host reboots, the network namespace files in the tmpfs in
`/var/run` are wiped out. So when we restore allocations after a host reboot, we
need to be able to restore both the network namespace and the network
configuration. But because the netns is newly created and we need to run the CNI
plugins again, this create potential conflicts with the IPAM plugin which has
written state to persistent disk at `/var/lib/cni`. These IPs aren't the ones
advertised to Consul, so there's no particular reason to keep them around after
a host reboot because all virtual interfaces need to be recreated too.

Reconfigure the CNI bridge configuration to use `/var/run/cni` as its state
directory. We already expect this location to be created by CNI because the
netns files are hard-coded to be created there too in `libcni`.

Note this does not fix the problem described for Docker in #24292 because that
appears to be related to the netns itself being restored unexpectedly from
Docker's state.

Ref: https://github.com/hashicorp/nomad/issues/24292#issuecomment-2537078584
Ref: https://www.cni.dev/plugins/current/ipam/host-local/#files
2024-12-16 09:36:35 -05:00
Judith Malnick
21c684affa Let education approve PRs to the documentation side nav (#24636) 2024-12-16 09:22:10 +01:00
Juana De La Cuesta
526c6375ad Make paths in e2e/terraform/ directory relative to the module (#24664)
* func: make paths relative

* func: make paths relative to the module inside the e2e terraform folder

* fix: add license files to gitignore

* func: move /etc and update all paths

* Uncomment forgotten code

* fix: update the path to the tls certificates to be local to the instance
2024-12-13 17:33:59 +01:00
Juana De La Cuesta
a9a0f71213 Remove sockaddr and use native tools (#24665)
* func: remove sockaddr and use native tools

* Update setup.sh
2024-12-13 17:24:53 +01:00
dependabot[bot]
614cb5c17f chore(deps): bump slackapi/slack-github-action from 1.27.0 to 2.0.0 (#24472) 2024-12-13 14:00:37 +00:00
Phil Renaud
f452948556 Character restrictions in action names were unduly oppressive (#24642)
* Character restrictions in action names were unduly oppressive

* OK but what about SOME oppression

* Test updates for our new action name rules
2024-12-12 16:58:26 -05:00
dependabot[bot]
dcb0259fe3 chore(deps): bump nanoid from 3.3.7 to 3.3.8 in /ui (#24640)
Bumps [nanoid](https://github.com/ai/nanoid) from 3.3.7 to 3.3.8.
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ai/nanoid/compare/3.3.7...3.3.8)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-12 10:35:33 -05:00
James Rasell
7d48aa2667 client: emit optional telemetry from prerun and prestart hooks. (#24556)
The Nomad client can now optionally emit telemetry data from the
prerun and prestart hooks. This allows operators to monitor and
alert on failures and time taken to complete.

The new datapoints are:
  - nomad.client.alloc_hook.prerun.success (counter)
  - nomad.client.alloc_hook.prerun.failed (counter)
  - nomad.client.alloc_hook.prerun.elapsed (sample)

  - nomad.client.task_hook.prestart.success (counter)
  - nomad.client.task_hook.prestart.failed (counter)
  - nomad.client.task_hook.prestart.elapsed (sample)

The hook execution time is useful to Nomad engineering and will
help optimize code where possible and understand job specification
impacts on hook performance.

Currently only the PreRun and PreStart hooks have telemetry
enabled, so we limit the number of new metrics being produced.
2024-12-12 14:43:14 +00:00
James Rasell
86bc7ed224 cli: Ensure JSON flag is respected in autopilot health command. (#24655) 2024-12-12 13:43:32 +00:00
dependabot[bot]
63e2c6aaec chore(deps): bump golang.org/x/crypto from 0.27.0 to 0.31.0 (#24652)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.27.0 to 0.31.0.
- [Commits](https://github.com/golang/crypto/compare/v0.27.0...v0.31.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-12 11:05:03 +01:00
Phil Renaud
3bc2c07821 Remove the Ember Test Audit workflow (#24637) 2024-12-10 11:25:53 -06:00
dependabot[bot]
6a41dc7b2f chore(deps): bump nanasess/setup-chromedriver from 2.2.2 to 2.3.0 (#24623)
Bumps [nanasess/setup-chromedriver](https://github.com/nanasess/setup-chromedriver) from 2.2.2 to 2.3.0.
- [Release notes](https://github.com/nanasess/setup-chromedriver/releases)
- [Commits](42cc299832...e93e57b843)

---
updated-dependencies:
- dependency-name: nanasess/setup-chromedriver
  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-12-09 14:26:24 -06:00
dependabot[bot]
f46097ee54 chore(deps): bump github.com/rs/cors from 1.8.3 to 1.11.1 (#24627)
Bumps [github.com/rs/cors](https://github.com/rs/cors) from 1.8.3 to 1.11.1.
- [Commits](https://github.com/rs/cors/compare/v1.8.3...v1.11.1)

---
updated-dependencies:
- dependency-name: github.com/rs/cors
  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-12-09 09:56:54 -05:00
dependabot[bot]
fe217518a4 chore(deps): bump github.com/shoenig/test from 1.11.0 to 1.12.0 (#24625)
Bumps [github.com/shoenig/test](https://github.com/shoenig/test) from 1.11.0 to 1.12.0.
- [Release notes](https://github.com/shoenig/test/releases)
- [Commits](https://github.com/shoenig/test/compare/v1.11.0...v1.12.0)

---
updated-dependencies:
- dependency-name: github.com/shoenig/test
  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-12-09 09:56:47 -05:00
dependabot[bot]
5a0205083c chore(deps): bump github.com/miekg/dns from 1.1.56 to 1.1.62 (#24624)
Bumps [github.com/miekg/dns](https://github.com/miekg/dns) from 1.1.56 to 1.1.62.
- [Changelog](https://github.com/miekg/dns/blob/master/Makefile.release)
- [Commits](https://github.com/miekg/dns/compare/v1.1.56...v1.1.62)

---
updated-dependencies:
- dependency-name: github.com/miekg/dns
  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-12-09 09:55:30 -05:00
dependabot[bot]
09f6043937 chore(deps): bump github.com/hashicorp/go-kms-wrapping/wrappers/awskms/v2 (#24626)
Bumps [github.com/hashicorp/go-kms-wrapping/wrappers/awskms/v2](https://github.com/hashicorp/go-kms-wrapping) from 2.0.9 to 2.0.10.
- [Commits](https://github.com/hashicorp/go-kms-wrapping/compare/v2.0.9...v2.0.10)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/go-kms-wrapping/wrappers/awskms/v2
  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-12-09 09:30:21 -05:00
Judith Malnick
76fcc6f2e3 codeowners: let nomad education and web presence merge PRs to website files (#24621)
* add nomad education and web presence ability to merge PRs to relavent website files
* add github-nomad-core
* change edu approvers to nomad-docs
2024-12-09 08:44:30 -05:00
Jonathan Weinberg
d1cec4285f Spelling error (#24619) 2024-12-06 14:31:39 -05:00
dependabot[bot]
9a1d951f45 chore(deps-dev): bump prettier from 3.2.4 to 3.4.1 in /website (#24573)
Bumps [prettier](https://github.com/prettier/prettier) from 3.2.4 to 3.4.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.2.4...3.4.1)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  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-12-06 09:40:05 -05:00
Aimee Ukasick
af5e2a742e Docs Feature: Add clone and edit feature (#24593)
* Docs: Add clone and edit feature

CE-741

* Change clone and edit heading level

* A few work tweaks
2024-12-05 09:21:27 -06:00
Michael Smithhisler
a43f46e247 ci: only cache from github hosted runners to avoid file perm issues (#24607) 2024-12-04 12:27:26 -05:00
Tim Gross
4f3de69537 test: fix panic from concurrent writes in periodic dispatch test (#24602)
Test setup for the `TestPeriodicDispatch_Add_TriggersUpdate` test can panic if
the goroutine for the runner is running concurrently with adding the job the
second time.

Update the test as follows:
* Make a copy when mutating the job before adding it.
* Add a lock around checking if the dispatcher has a waiting eval.
* Update to use `shoenig/test` in lieu of `testify`.
2024-12-04 09:57:38 -05:00
Tim Gross
da786f64c7 helper: sanitize method on ACL token object (#24600)
There are several places where we want to redact the secret ID of an ACL token,
some of which are in the Enterprise code base for Sentinel. Add a new method
`Sanitize` that mirrors the one we have on `Node`.

Ref: https://github.com/hashicorp/nomad-enterprise/pull/2087
2024-12-03 14:02:30 -05:00
CJ
4563165196 Update sentinel.mdx (#24598) 2024-12-03 11:24:06 -05:00
Phil Renaud
4b91c17dfa [ui, ci] retain artifacts from test runs including test timing (#24555)
* retain artifacts from test runs including test timing

* Pinning commit hashes for action helpers

* trigger for ui-test run

* Trying to isolate down to a simple upload

* Once more with mkdir

* What if we just wrote our own test reporter tho

* Let the partitioned runs handle placement

* Filter out common token logs, add a summary at the end, and note failures in logtime

* Custom reporter cannot also have an output file, he finds out two days late

* Aggregate summary, duration, and removing failure case

* Conditional test report generation

* Timeouts are errors

* Trying with un-partitioned input json file

* Remove the commented-out lines for main-only runs

* combine-ui-test-results as its own script
2024-12-03 09:56:06 -05:00
Anthony
97d14c91dc Merge pull request #24588 from hashicorp/security-model-doc-fix-title
Fix doc title in security.mdx
2024-12-02 13:05:39 -05:00
CJ
b603b97d26 Update security.mdx 2024-12-02 11:43:24 -06:00
Michael Smithhisler
11ae64acb0 drivers: defer executor cleanup func to fix executor leak (#24495) 2024-12-02 12:25:32 -05:00
Daniel Bennett
e963d55ea0 release: always use service user for git ops (#24546) 2024-12-02 10:58:43 -06:00
dependabot[bot]
e5da96ee09 chore(deps): bump github.com/zclconf/go-cty-yaml from 1.0.3 to 1.1.0 (#24570)
Bumps [github.com/zclconf/go-cty-yaml](https://github.com/zclconf/go-cty-yaml) from 1.0.3 to 1.1.0.
- [Changelog](https://github.com/zclconf/go-cty-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/zclconf/go-cty-yaml/compare/v1.0.3...v1.1.0)

---
updated-dependencies:
- dependency-name: github.com/zclconf/go-cty-yaml
  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-12-02 10:37:36 -06:00
dependabot[bot]
b7f24793ac chore(deps): bump github.com/docker/docker (#24471)
Bumps [github.com/docker/docker](https://github.com/docker/docker) from 27.1.1+incompatible to 27.3.1+incompatible.
- [Release notes](https://github.com/docker/docker/releases)
- [Commits](https://github.com/docker/docker/compare/v27.1.1...v27.3.1)

---
updated-dependencies:
- dependency-name: github.com/docker/docker
  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-12-02 09:02:03 -06:00
dependabot[bot]
33f8a7a35e chore(deps): bump github.com/hashicorp/go-sockaddr from 1.0.6 to 1.0.7 (#24571)
Bumps [github.com/hashicorp/go-sockaddr](https://github.com/hashicorp/go-sockaddr) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/hashicorp/go-sockaddr/releases)
- [Commits](https://github.com/hashicorp/go-sockaddr/compare/v1.0.6...v1.0.7)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/go-sockaddr
  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-12-02 08:59:04 -06:00
Michael Smithhisler
4e2d9675e7 executor: fail early on reattach if listener is not executor (#24538) 2024-12-02 09:56:00 -05:00
dependabot[bot]
b293e6a82a chore(deps): bump github.com/hashicorp/vault/api from 1.10.0 to 1.15.0 (#24572)
Bumps [github.com/hashicorp/vault/api](https://github.com/hashicorp/vault) from 1.10.0 to 1.15.0.
- [Release notes](https://github.com/hashicorp/vault/releases)
- [Changelog](https://github.com/hashicorp/vault/blob/main/CHANGELOG-v1.10-v1.15.md)
- [Commits](https://github.com/hashicorp/vault/compare/v1.10.0...v1.15.0)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/vault/api
  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-12-02 08:49:38 -06:00
Phil Renaud
76e39b1c1e [ui] Volumes and plugins navigation fixes, generally (#24542)
* Volumes and plugins navigation fixes, generally

* Mirage no longer has to take the csi/ string into account

* Volume adapter test fix
2024-11-29 16:14:17 -05:00
Phil Renaud
de96c3498b [ui] "Clone and Edit" functionality for versions (#24168)
* Edit from Version functionality

* Reworked as Clone and Revert

* Change name warning for cloning as new job, version 0 checking, and erroring on sourceless clone

* If you try to plan a new version of a job with a different name of the one you're editing, suggest they might want to run a new one instead

* A few code comments and log cleanup

* Scaffolding new acceptance tests

* A whack of fun new tests

* Unit test for version number url passing on fetchRawDef

* Bit of cleanup

* fetchRawDefinition gets version support at adapter layer

* Handle spec-not-available-but-definition-is for clone-as-new-job
2024-11-29 16:12:56 -05:00
James Rasell
261359fba7 agent: Fix a bug where retry_join was not retrying. (#24561)
The retry_join logic was not allowing for retries to happen and
was exiting after the first failed discovery attempt. This change
fixes that behaviour and adds a test to ensure no further
regressions.
2024-11-29 08:29:15 +00:00
Piotr Kazmierczak
3a18f22c18 goflags: go:build linux for tests that won't compile on other platforms (#24559)
I'm a heavy LSP user and I frequently goto:next_error. This confuses my
editor on macOS.
2024-11-28 15:05:00 +01:00
dependabot[bot]
1f29a95c24 chore(deps): bump golang.org/x/sync from 0.8.0 to 0.9.0 (#24550) 2024-11-25 12:37:54 +00:00
dependabot[bot]
629e869a75 chore(deps): bump github.com/fatih/color from 1.17.0 to 1.18.0 (#24549) 2024-11-25 09:18:07 +00:00
dependabot[bot]
1f502c1d13 chore(deps): bump github.com/stretchr/testify from 1.9.0 to 1.10.0 (#24548) 2024-11-25 08:28:31 +00:00
dependabot[bot]
b290e753c3 chore(deps): bump actions/setup-node from 4.0.4 to 4.1.0 (#24300)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 4.0.4 to 4.1.0.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](0a44ba7841...39370e3970)

---
updated-dependencies:
- dependency-name: actions/setup-node
  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-11-24 09:28:17 -05:00
Piotr Kazmierczak
f7a4ded2c0 security: add CT executeTemplate to default function_denylist (#24541)
This PR adds Consul Template's executeTemplate function to the denylist by
default, in order to prevent accidental or malicious infinitely recursive
execution.

---------

Co-authored-by: Tim Gross <tgross@hashicorp.com>
2024-11-22 19:33:56 +01:00
Piotr Kazmierczak
368241dbf2 security: a more comprehensive env.denylist (#24540)
A more comprehensive env.denylist that now includes more token, token file and
license variables. 

---------

Co-authored-by: Daniel Bennett <dbennett@hashicorp.com>
2024-11-22 18:54:18 +01:00
Yucong Sun
642e33ae41 CSI: fix topology matching logic (#24522)
Some plugins emit multiple topology segment entries for the same segment (ex. newer versions of AWS EBS) to accommodate convention changes in k8s. Check that segments are a superset instead of exactly equal to the plugin's topology segments.
2024-11-22 09:22:36 -05:00
Juana De La Cuesta
c21dfdb17a [gh-476] Sanitise HCL variables before storing on job submission (#24423)
* func: User url rules to scape non alphanumeric values in hcl variables

* docs: add changelog

* func: unscape flags before returning

* use JSON.stringify instead of bespoke value quoting to handle in-value-multi-line cases

---------

Co-authored-by: Phil Renaud <phil@riotindustries.com>
2024-11-22 11:45:02 +01:00
Martijn Vegter
997da25cdb scheduler: take all assigned cpu cores into account instead of only those part of the largest lifecycle (#24304)
Fixes a bug in the AllocatedResources.Comparable method, where the scheduler
would only take into account the cpusets of the tasks in the largest lifecycle.
This could result in overlapping cgroup cpusets. Now we make the distinction
between reserved and fungible resources throughout the lifespan of the alloc.
In addition, added logging in case of future regressions thus not requiring
manual inspection of cgroup files.
2024-11-21 13:21:48 -05:00
Juana De La Cuesta
a9e7166b6b [gh-24339] Move from streaming stats to polling for docker (#24525)
* fix: dont stream the docker stats, read them one by one

* func: add a NewSafeTicker to the herlper functions

* style: remove commented code
2024-11-21 17:36:53 +01:00
Martijn Vegter
bfb714144e client: fixed a bug where AMD CPUs were not correctly fingerprinting base speed (#24415)
Relates to: #19468
2024-11-21 09:08:47 -06:00
Piotr Kazmierczak
6ccfcc37a3 scheduler: fix a bug where force GC wasn't respected (#24456)
This PR fixes a bug where System.GarbageCollect endpoint didn't work on objects
that weren't older than their respective GC thresholds. System.GarbageCollect
is used to force garbage collection (also used by the system gc command) and
should ignore any GC threshold settings.
2024-11-21 09:07:23 +01:00