Commit Graph

25850 Commits

Author SHA1 Message Date
Phil Renaud
784ec507b8 Omit the current-time-displaying components during our visual diff tests (#22435) 2024-05-31 13:41:26 -04:00
Phil Renaud
ddfadca618 Checking for the type of event param before executing a lazy click (#22429) 2024-05-31 13:24:22 -04:00
Phil Renaud
014f5145dc Lockfile and bindata_assetfs recompiled on latest main (#22434) 2024-05-31 13:23:59 -04:00
Phil Renaud
36c2439503 [ui] Tests for Sentinel Policies (#22398)
* Tests for Sentinel Policies UI

* Further sentinel tests

* job allocations test reinstated
2024-05-31 10:38:54 -04:00
Seth Hoenig
2054e87158 e2e: add tests for exec2 task driver (#22406)
* e2e: add tests for exec2 task driver

* e2e: use envoy 1.29.4 because consul

* e2e: add a bridge networking http test for exec driver

* e2e: split up http test so curl always starts after the server
2024-05-31 09:22:39 -05:00
Phil Renaud
86ee56b8c5 [ui] Jobs index page badge for when a job has a paused task (#22392)
* Adds a badge on the jobs index page if any task within any allocation of a running job is currently paused

* Snapshot and acceptance tests for paused states

* Cleared yarn cache

* Remove MirageScenario from the test dependency chain

* Logging before toString

* Cardinal sin of time-based test execution

* Maybe weve been lucky for years and the clientStatus has always been running for this test by happenstance

* Back away from the time-based and toward the settled() approach
2024-05-30 21:18:35 -04:00
Piotr Kazmierczak
307fd590d7 docker: new container_exists_attempts configuration field (#22419)
This allows users to set a custom value of attempts that will be made to purge
an existing (not running) container if one is found during task creation.

---------

Co-authored-by: Tim Gross <tgross@hashicorp.com>
2024-05-30 19:22:14 +02:00
Piotr Kazmierczak
bf11e39ac8 docker: add a unit test for "container already exists" error when creating containers (#22238) 2024-05-30 11:24:28 +02:00
James Rasell
6cb9bed236 docs: add operations benchmarking page with nomad-bench link. (#22393) 2024-05-30 07:34:10 +01:00
Phil Renaud
1412e65bbd [ui] Dropdowns on the jobs index page get a max-height and filtering (#20626)
* Adds a max-height to dropdowns lest they get any funny ideas

* Filter filtering
2024-05-29 21:01:57 -04:00
David Yu
5f0dea189e Merge pull request #22411 from hashicorp/docs-tbte
docs: add docs for time based task execution
2024-05-29 16:23:57 -07:00
Michael Schurter
7048d3a482 link release notes to schedule block 2024-05-29 15:53:15 -07:00
Michael Schurter
a2fe43030c rap 2024-05-29 15:50:33 -07:00
Michael Schurter
5a0c74d1f9 Apply suggestions from code review
Co-authored-by: David Yu <dyu@hashicorp.com>
2024-05-29 15:50:33 -07:00
Michael Schurter
fe0bda9c34 speling 2024-05-29 15:50:33 -07:00
Michael Schurter
690abefc4a docs: add docs for time based task execution 2024-05-29 15:50:33 -07:00
Phil Renaud
e09b29113c [ui] Helios and Power Select upgrades (#22328)
* Helios and Power Select upgrades

* Renamed namespaced contextual components
2024-05-29 17:00:56 -04:00
Phil Renaud
8a9d58ae8f Storybook scripts and references removed (#22232) 2024-05-29 16:34:26 -04:00
Tim Gross
140747240f consul: include admin partition in JWT login requests (#22226)
When logging into a JWT auth method, we need to explicitly supply the Consul
admin partition if the local Consul agent is in a partition. We can't derive
this from agent configuration because the Consul agent's configuration is
canonical, so instead we get the partition from the fingerprint (if
available). This changeset updates the Consul client constructor so that we
close over the partition from the fingerprint.

Ref: https://hashicorp.atlassian.net/browse/NET-9451
2024-05-29 16:31:09 -04:00
Tim Gross
de38ff4189 consul: set partition for gateway config entries (#22228)
When we write Connect gateway configuation entries from the server, we're not
passing in the intended partition. This means we're using the server's own
partition to submit the configuration entries and this may not match. Note this
requires the Nomad server's token has permission to that partition.

Also, move the config entry write after we check Sentinel policies. This allows
us to return early if we hit a Sentinel error without making Consul RPCs first.
2024-05-29 16:31:02 -04:00
Daniel Bennett
c5dae2bf35 Merge pull request #22402 from hashicorp/post-1.8.0-release
Post 1.8.0 release
2024-05-29 13:46:07 -05:00
Daniel Bennett
05be289b24 Merge release 1.8.0 files 2024-05-29 13:57:57 -04:00
David Yu
42d72ff8a6 Merge pull request #22403 from hashicorp/david-yu-patch-1
docs: release note typo
2024-05-29 10:19:06 -07:00
David Yu
f083a27979 Update v1_8_x.mdx 2024-05-29 09:24:35 -07:00
hc-github-team-nomad-core
82e4ecd809 Prepare for next release 2024-05-29 11:48:56 -04:00
hc-github-team-nomad-core
32d820644a Generate files for 1.8.0 release 2024-05-29 11:48:55 -04:00
Seth Hoenig
9fb2b10ab6 e2e: no lnoger need consul terraform module (#22396) 2024-05-28 08:04:03 -05:00
David Yu
6493bc6c86 docs: Nomad 1.8 release notes (#22104) 2024-05-28 08:48:08 -04:00
David Yu
5f93bbb3cd docs: update CNI plugin version (#22341) 2024-05-28 08:47:43 -04:00
Tim Gross
91d422ec21 E2E: document how the AMIs are tagged and how those tags are used (#22237)
The process by which we tag AMIs with the commit SHA of the Packer directory
isn't documented in this repository, which makes it easy to accidentally build
an AMI that will break nightly E2E.
2024-05-24 11:11:00 -05:00
David Yu
ace3ccfcc2 Merge pull request #22234 from hashicorp/david-yu-patch-1
docs: small typo
2024-05-24 09:08:01 -07:00
James Rasell
81d87f1e9f config: fix panic in job using Vault cluster not in agent config. (#22227) 2024-05-24 15:13:20 +01:00
David Yu
1e90369c87 Update exec2.mdx
Small change, removal of extraneous open parentheses
2024-05-23 15:15:02 -07:00
Daniel Bennett
ac8fc25dd8 Merge pull request #22233 from hashicorp/post-1.8.0-rc.1-release
Post 1.8.0 rc.1 release
2024-05-23 16:17:02 -05:00
hc-github-team-nomad-core
5e1be121ad Prepare for next release 2024-05-23 16:55:05 -04:00
hc-github-team-nomad-core
c374bd375b Generate files for 1.8.0-rc.1 release 2024-05-23 16:55:05 -04:00
Daniel Bennett
032cddd7e8 Prepare release 1.8.0-rc.1 2024-05-23 16:55:05 -04:00
Piotr Kazmierczak
f0851bc989 job endpoint: fix implicit constraint mutation for task-level services (#22229)
Fixes a regression in Nomad 1.7 which caused task-level services no longer
having created implicit Consul constraints.
2024-05-23 19:27:47 +02:00
Phil Renaud
811b7e85f9 [ui] Better UX with filter expressions in the jobs index search box (#22100)
* Maintains rawSearchText separate from searchText

* Filter expression suggestions

* Now super-stops duelling queries on else-type error

* Filter suggestions and corrections

* Errorlink is now template standard and testfixes

* Mirage simulates healthy errors

* Test for bad filter expressions and snapshots
2024-05-22 23:39:37 -04:00
Phil Renaud
86c858cdc3 [ui] Sentinel Policies CRUD UI (#20483)
* Gallery allows picking stuff

* Small fixes

* added sentinel templates

* Can set enforcement level on policies

* Working on the interactive sentinel dev mode

* Very rough development flow on FE

* Changed position in gutter menu

* More sentinel stuff

* PR cleanup: removed testmode, removed unneeded mixins and deps

* Heliosification

* Index-level sentinel policy deletion and page title fixes

* Makes the Canaries sentinel policy real and then comments out the unfinished ones

* rename Access Control to Administration in prep for moving Sentinel Policies and Node Pool admin there

* Sentinel policies moved within the Administration section

* Mirage fixture for sentinel policy endpoints

* Description length check and 500 prevention

* Sync review PR feedback addressed, implied butons on radio cards

* Cull un-used sentinel policies

---------

Co-authored-by: Mike Nomitch <mail@mikenomitch.com>
2024-05-22 16:41:50 -04:00
Daniel Bennett
4415fabe7d jobspec: time based task execution (#22201)
this is the CE side of an Enterprise-only feature.
a job trying to use this in CE will fail to validate.

to enable daily-scheduled execution entirely client-side,
a job may now contain:

task "name" {
  schedule {
    cron {
      start    = "0 12 * * * *" # may not include "," or "/"
      end      = "0 16"         # partial cron, with only {minute} {hour}
      timezone = "EST"          # anything in your tzdb
    }
  }
...

and everything about the allocation will be placed as usual,
but if outside the specified schedule, the taskrunner will block
on the client, waiting on the schedule start, before proceeding
with the task driver execution, etc.

this includes a taksrunner hook, which watches for the end of
the schedule, at which point it will kill the task.

then, restarts-allowing, a new task will start and again block
waiting for start, and so on.

this also includes all the plumbing required to pipe API calls
through from command->api->agent->server->client, so that
tasks can be force-run, force-paused, or resume the schedule
on demand.
2024-05-22 15:40:25 -05:00
David Yu
6a25c2fb12 docs: add installation section to exec2 driver (#22091)
* Update exec2.mdx

Add installation section

* Update exec2.mdx
2024-05-22 15:14:00 -05:00
Phil Renaud
e8b77fcfa0 [ui] Jobspec UI block: Descriptions and Links (#18292)
* Hacky but shows links and desc

* markdown

* Small pre-test cleanup

* Test for UI description and link rendering

* JSON jobspec docs and variable example job get UI block

* Jobspec documentation for UI block

* Description and links moved into the Title component and made into Helios components

* Marked version upgrade

* Allow links without a description and max description to 1000 chars

* Node 18 for setup-js

* markdown sanitization

* Ui to UI and docs change

* Canonicalize, copy and diff for job.ui

* UI block added to testJob for structs testing

* diff test

* Remove redundant reset

* For readability, changing the receiving pointer of copied job variables

* TestUI endpiont conversion tests

* -require +must

* Nil check on Links

* JobUIConfig.Links as pointer

---------

Co-authored-by: Tim Gross <tgross@hashicorp.com>
2024-05-22 15:00:45 -04:00
Seth Hoenig
09bd11383c client: alloc_mounts directory must be sibling of data directory (#22199)
This PR adjusts the default location of -alloc-mounts-dir path to be a
sibling of the -data-dir path rather than a child. This is because on a
production-hardened systems the data dir is supposed to be chmod 0700
owned by root - preventing the exec2 task driver (and others using
unveil file system isolation features) from working properly.

For reference the directory structure from -data-dir now looks like this
after running an example job. Under the alloc_mounts directory, task
specific directories are mode 0710 and owned by the task user (which
may be a dynamic user UID/GID).

➜ sudo tree -p -d -u /tmp/mynomad
[drwxrwxr-x shoenig ]  /tmp/mynomad
├── [drwx--x--x root    ]  alloc_mounts
│   └── [drwx--x--- 80552   ]  c753b71d-c6a1-3370-1f59-47ab838fd8a6-mytask
│       ├── [drwxrwxrwx nobody  ]  alloc
│       │   ├── [drwxrwxrwx nobody  ]  data
│       │   ├── [drwxrwxrwx nobody  ]  logs
│       │   └── [drwxrwxrwx nobody  ]  tmp
│       ├── [drwxrwxrwx nobody  ]  local
│       ├── [drwxr-xr-x root    ]  private
│       ├── [drwx--x--- 80552   ]  secrets
│       └── [drwxrwxrwt nobody  ]  tmp
└── [drwx------ root    ]  data
    ├── [drwx--x--x root    ]  alloc
    │   └── [drwxr-xr-x root    ]  c753b71d-c6a1-3370-1f59-47ab838fd8a6
    │       ├── [drwxrwxrwx nobody  ]  alloc
    │       │   ├── [drwxrwxrwx nobody  ]  data
    │       │   ├── [drwxrwxrwx nobody  ]  logs
    │       │   └── [drwxrwxrwx nobody  ]  tmp
    │       └── [drwx--x--- 80552   ]  mytask
    │           ├── [drwxrwxrwx nobody  ]  alloc
    │           │   ├── [drwxrwxrwx nobody  ]  data
    │           │   ├── [drwxrwxrwx nobody  ]  logs
    │           │   └── [drwxrwxrwx nobody  ]  tmp
    │           ├── [drwxrwxrwx nobody  ]  local
    │           ├── [drwxrwxrwx nobody  ]  private
    │           ├── [drwx--x--- 80552   ]  secrets
    │           └── [drwxrwxrwt nobody  ]  tmp
    ├── [drwx------ root    ]  client
    └── [drwxr-xr-x root    ]  server
        ├── [drwx------ root    ]  keystore
        ├── [drwxr-xr-x root    ]  raft
        │   └── [drwxr-xr-x root    ]  snapshots
        └── [drwxr-xr-x root    ]  serf

32 directories
2024-05-22 13:14:34 -05:00
Tim Gross
5bfb500932 refactor scheduler tests for node down/disconnected (#22198)
While working on #20462 #12319 I found that some of our scheduler tests around
down nodes or disconnected clients were enforcing invariants that were
unclear. This changeset pulls out some minor refactorings so that the bug fix PR
is easier to review. This includes:

* Migrating a few tests from `testify` to `shoenig/test` that I'm going to touch
  in #12319 anyways.
* Adding test names to the node down test
* Update the disconnected client test so that we always re-process the
  pending/blocked eval it creates; this eliminates 2 redundant sub-tests.
* Update the disconnected client test assertions so that they're explicit in the
  test setup rather than implied by whether we re-process the pending/blocked
  eval.

Ref: https://github.com/hashicorp/nomad/issues/20462
Ref: https://github.com/hashicorp/nomad/pull/12319
2024-05-22 10:23:08 -04:00
KeisukeYamashita
1b872c422c build: fix broken link to nomad in docker (#22191)
Signed-off-by: KeisukeYamashita <19yamashita15@gmail.com>
2024-05-22 12:02:25 +02:00
Nick Wales
1174019676 docs: typo fix (#22090) 2024-05-21 14:29:31 -04:00
Michael Schurter
a3b1810bdb doc: specify ca cert needs to be shared (#20620)
Specify that the Vault JWT auth method must be configured to trust Nomad's CA certificate when mTLS is enabled.
2024-05-17 14:49:48 -07:00
Tim Gross
5a6262d1c4 tproxy: add implicit constraint on client version (#20623)
The new transparent proxy feature already has an implicity constraint on the
presence of the CNI plugin. But if the CNI plugin is installed on an older
version of Nomad, this isn't sufficient to protect against placing tproxy
workloads on clients that can't support it. Add a Nomad version constraint as
well.

Fixes: https://github.com/hashicorp/nomad/issues/20614
2024-05-17 11:57:06 -04:00
Piotr Kazmierczak
b5bca27c07 docs: add a note to binding rules docs about multiple rules application (#20624) 2024-05-17 17:40:12 +02:00