Commit Graph

21595 Commits

Author SHA1 Message Date
Luiz Aoqui
10d750161f changelog: add entry for #10675 (#10919) 2021-07-21 10:05:48 -04:00
Luiz Aoqui
af0ee7bd7a docs: fix ACL enabled parameter description (#10918) 2021-07-21 10:05:18 -04:00
Nicholas Cioli
801a7324a3 ui: add parameterized dispatch interface (#10675)
* ui: add parameterized dispatch interface

This commit adds a new interface for dispatching parameteried jobs, if
the user has the right permissions. The UI can be accessed by viewing a
parameterized job and clicking on the "Dispatch Job" button located in
the "Job Launches" section.

* fix failing lint test

* clean up dispatch and remove meta

This commit cleans up a few things that had typos and
inconsistent naming. In line with this, the custom
`meta` view was removed in favor of using the
included `AttributesTable`.

* ui: encode dispatch job payload and start adding tests

* ui: remove unused test imports

* ui: redesign job dispatch form

* ui: initial acceptance tests for dispatch job

* ui: generate parameterized job children with correct id format

* ui: fix job dispatch breadcrumb link

* ui: refactor job dispatch component into glimmer component and add form validation

* ui: remove unused CSS class

* ui: align job dispatch button

* ui: handle namespace-specific requests on job dispatch

* ui: rename payloadMissing to payloadHasError

* ui: don't re-fetch job spec on dispatch job

* ui: keep overview tab selected on job dispatch page

* ui: fix task and task-group linting

* ui: URL encode job id on dispatch job tests

* ui: fix error when job meta is null

* ui: handle job dispatch from adapter

* ui: add more tests for dispatch job page

* ui: add "job dispatch" capability check

* ui: update job dispatch from code review

Co-authored-by: Luiz Aoqui <luiz@hashicorp.com>
2021-07-20 18:27:41 -04:00
Mahmood Ali
3165ae8112 client: avoid acting on stale data after launch (#10907)
When the client launches, use a consistent read to fetch its own allocs,
but allow stale read afterwards as long as reads don't revert into older
state.

This change addresses an edge case affecting restarting client. When a
client restarts, it may fetch a stale data concerning its allocs: allocs
that have completed prior to the client shutdown may still have "run/running"
desired/client status, and have the client attempt to re-run again.

An alternative approach is to track the indices such that the client
set MinQueryIndex on the maximum index the client ever saw, or compare
received allocs against locally restored client state. Garbage
collection complicates this approach (local knowledge is not complete),
and the approach still risks starting "dead" allocations (e.g. the
allocation may have been placed when client just restarted and have
already been reschuled by the time the client started. This approach
here is effective against all kinds of stalness problems with small
overhead.
2021-07-20 15:13:28 -04:00
Michael Schurter
179e88c52b Merge pull request #10849 from benbuzbee/benbuz/fix-destroy
Don't treat a failed recover + successful destroy as a successful recover
2021-07-19 10:49:31 -07:00
Michael Schurter
f2fddc9a75 docs: add changelog entry for #10849 2021-07-16 15:58:58 -07:00
Kent 'picat' Gruber
dfe003dfc2 Merge pull request #10886 from hashicorp/cli-handle-successful-deployment
Handle successful/canceled/blocked deployments in CLI output
2021-07-16 12:27:22 -04:00
Mahmood Ali
202d189d35 Merge pull request #10905 from tgxworld/patch-1
Fix typo.
2021-07-16 11:00:31 -04:00
Kent 'picat' Gruber
fc3ff8ee13 Update deployment status doc example output 2021-07-16 09:58:58 -04:00
Alan Guo Xiang Tan
a6d8995f9b Fix typo. 2021-07-16 13:49:15 +08:00
Kent 'picat' Gruber
4bcc72da1a Handle DeploymentStatusFailed unless hasAutoRevert 2021-07-15 17:06:13 -04:00
Mahmood Ali
428174ab55 Merge pull request #10875 from hashicorp/b-namespace-flag-override
cli: `-namespace` should override job namespace
2021-07-14 17:28:36 -04:00
Mahmood Ali
6c6a364bbf Merge pull request #10864 from hashicorp/b-10746-plan-datacenter
scheduler: datacenter updates should be destructive
2021-07-14 17:25:13 -04:00
Mahmood Ali
86bbb9abe5 ci: prepare unprivileged user for checkout (#10900)
Job `test-e2e` uses an unprivileged user to compile and run tests.
Ensure that the user has ssh and git properly configured to checkout
dependencies.
2021-07-14 16:12:04 -04:00
Seth Hoenig
7c962b54ad Merge pull request #10898 from hashicorp/f-rm-vendor
build: no longer use vendor directory
2021-07-14 13:00:41 -05:00
Seth Hoenig
8d0e31989d Merge pull request #10896 from hashicorp/b-rm-constraint-memoization
core: do not internalize constraint strings
2021-07-14 11:22:49 -05:00
Seth Hoenig
ec6eaac4c7 docs: update changelog 2021-07-14 11:21:00 -05:00
Seth Hoenig
8869c4ddd1 build: no longer use vendor directory
This PR removes the vendor directory from the Nomad repository.
Contributers will no longer need to deal with our `make sync`
step when working on Nomad, which was suprising when making changes
to the api. It also causes huge diffs in PRs that nobody looks at.
2021-07-14 11:13:30 -05:00
Seth Hoenig
2f2eef00a1 docs: add changelog entry 2021-07-14 10:46:40 -05:00
Seth Hoenig
564be22f79 core: add spec changed test with constriants 2021-07-14 10:44:09 -05:00
Seth Hoenig
755c5fa388 core: fix constraint tests 2021-07-14 10:39:38 -05:00
Seth Hoenig
07c57ffeab core: do not memoize constraint strings
This PR causes Nomad to no longer memoize the String value of
a Constraint. The private memoized variable may or may not be
initialized at any given time, which means a reflect.DeepEqual
comparison between two jobs (e.g. during Plan) may return incorrect
results.

Fixes #10836
2021-07-14 10:04:35 -05:00
James Rasell
7538eed733 Merge pull request #10892 from hashicorp/b-gh-10890
deps: update consul-template to v0.25.2.
2021-07-14 09:26:16 +02:00
Luiz Aoqui
34e0291eb7 changelog: add entry for GH-10563 (#10894) 2021-07-13 16:12:41 -04:00
James Rasell
2a54036891 changelog: add entry for #10892 2021-07-13 10:29:44 +02:00
James Rasell
0e197d540e deps: update consul-template to v0.25.2. 2021-07-13 09:46:32 +02:00
Georges-Etienne Legendre
86fca8f513 Capture ACL Token from self API call for Reverse Proxy use-case (#10563)
* Proposed fix for #10561

Signed-off-by: Georges-Etienne Legendre <legege@legege.com>

* Add acceptance tests for reverse proxy use-case

Signed-off-by: Georges-Etienne Legendre <legege@legege.com>

* Use reads instead of computed/get

Signed-off-by: Georges-Etienne Legendre <legege@legege.com>

* Move back the line closer to the task

Signed-off-by: Georges-Etienne Legendre <legege@legege.com>

* skip a11y-audit-called lint rule on reverse proxy tests

Co-authored-by: Luiz Aoqui <luiz@hashicorp.com>
2021-07-12 20:42:08 -04:00
Noel Quiles
e7dbd5af0e Bump hashi-stack-menu (#10889) 2021-07-12 15:44:42 -04:00
Seth Hoenig
f453e483d8 Merge pull request #10883 from hashicorp/b-multi-ingress
consul/connect: fix bug causing high cpu with multiple connect sidecars in group
2021-07-12 10:13:41 -05:00
Seth Hoenig
a18d901bb0 consul/connect: add missing import statements 2021-07-12 09:28:16 -05:00
Seth Hoenig
3ac8d4e7a6 consul/connect: use join host port
Co-authored-by: Michael Schurter <mschurter@hashicorp.com>
2021-07-12 09:04:54 -05:00
Jai
0ef51f1383 Merge pull request #10755 from hashicorp/f-ui/nomad-agent-version
Closes Nomad UI showing 'vUnknown' #10672
2021-07-11 16:58:11 -04:00
Jai Bhagat
bcb3e64237 add name property back to agent schema in ember mirage
The name property had to be added back to the agent schema
in the Agent Factory because the /agent/monitor endpoint in
the config finds agents by their names and since member is not
a proper entity in our Mirage Config we can't just findBy name
of the member. So although we're following the correct schema
we're set-up to rely on this.
2021-07-11 16:09:43 -04:00
Kent 'picat' Gruber
440d556fdb Handle successful/canceled/blocked deployments in CLI output
Otherwise the spinner would just end, which felt a bit awkward.

I wanted to see a  "✓" to know that everything was ok, and a "!" (maybe something else?) if something went wrong.
2021-07-09 19:27:55 -04:00
Seth Hoenig
ee7d32fb98 consul/connect: fix bug causing high cpu with multiple connect sidecars in group
This PR fixes a bug where the underlying Envoy process of a Connect gateway
would consume a full core of CPU if there is more than one sidecar or gateway
in a group. The utilization was being caused by Consul injecting an envoy_ready_listener
on 127.0.0.1:8443, of which only one of the Envoys would be able to bind to.
The others would spin in a hot loop trying to bind the listener.

As a workaround, we now specify -address during the Envoy bootstrap config
step, which is how Consul maps this ready listener. Because there is already
the envoy_admin_listener, and we need to continue supporting running gateways
in host networking mode, and in those case we want to use the same port
value coming from the service.port field, we now bind the admin listener to
the 127.0.0.2 loop-back interface, and the ready listener takes 127.0.0.1.

This shouldn't make a difference in the 99.999% use case where envoy is
being run in its official docker container. Advanced users can reference
${NOMAD_ENVOY_ADMIN_ADDR_<service>} (as they 'ought to) if needed,
as well as the new variable ${NOMAD_ENVOY_READY_ADDR_<service>} for the
envoy_ready_listener.
2021-07-09 14:34:44 -05:00
Zachary Shilton
c4e0355775 docs: remove unnecessary redirect (#10802) 2021-07-09 09:44:34 -04:00
Mike Nomitch
9235c790f0 [docs] Adds federation caveat to upgrade guide (#10847) 2021-07-09 09:42:17 -04:00
Mahmood Ali
8d1a6ea1d5 e2e: use -detach mode when registering jobs with cli (#10877)
Pick up 15d39f0dee but for RegisterFromJobspec:

>  This PR changes the e2e helper thingy to set -detach option
>  when registering a job with the CLI instead of the API. This is
>  necessary for jobs which never become healthy, as the deployment
>  never finishes for failing jobs and the command never returns,
>  causing the test to timeout after 10 minutes.

This case occurs in TestVaultSecrets
2021-07-09 09:25:44 -04:00
Shishir
24f88398c3 Containerd task driver options. (#10878)
- Auth support via driver config
- pid_mode
- shm_size

Signed-off-by: Shishir Mahajan <smahajan@roblox.com>
2021-07-09 08:17:42 -04:00
Tim Gross
d0fb5c8c2a client: interpolate meta blocks with task environment (#10876)
Adds missing interpolation step to the `meta` blocks when building the task
environment. Also fixes incorrect parameter order in the test assertion and
adds diagnostics to the test.
2021-07-08 16:03:15 -04:00
Seth Hoenig
0e49f0d20a Merge pull request #10873 from hashicorp/b-cc-rm-sidecar-first
consul/connect: remove sidecar proxy before removing parent service
2021-07-08 14:29:06 -05:00
Seth Hoenig
8ad8e1095a consul/connect: remove sidecar proxy before removing parent service
This PR will have Nomad de-register a sidecar proxy service before
attempting to de-register the parent service. Otherwise, Consul will
emit a warning and an error.

Fixes #10845
2021-07-08 13:30:19 -05:00
Seth Hoenig
72f431f4c4 Merge pull request #10872 from hashicorp/b-cc-regex-checkids
consul/connect: Avoid assumption of parent service when filtering connect proxies
2021-07-08 13:29:40 -05:00
Seth Hoenig
82f424585a consul/connect: improve regex from CR suggestions 2021-07-08 13:05:05 -05:00
Seth Hoenig
10f8b4e3e1 Merge pull request #10874 from hashicorp/b-fix-logline
client: fix logline in group shutdown hook
2021-07-08 12:59:00 -05:00
Tim Gross
38af39e1b2 cli: -namespace should override job namespace
When a jobspec doesn't include a namespace, we provide it with the default
namespace, but this ends up overriding the explicit `-namespace` flag. This
changeset uses the same logic as region parsing to create an order of
precedence: the query string parameter (the `-namespace` flag) overrides the
API request body which overrides the jobspec.
2021-07-08 13:17:27 -04:00
Seth Hoenig
d783dc940a client: fix logline in group shutdown hook
Fixes #10844
2021-07-08 11:14:37 -05:00
Seth Hoenig
86283ad2dc consul/connect: Avoid assumption of parent service when filtering connect proxies
This PR uses regex-based matching for sidecar proxy services and checks when syncing
with Consul. Previously we would check if the parent of the sidecar was still being
tracked in Nomad. This is a false invariant - one which we must not depend when we
make #10845 work.

Fixes #10843
2021-07-08 09:43:41 -05:00
Mahmood Ali
0f0bcdb6ed Merge pull request #10806 from hashicorp/munda/idempotent-job-dispatch
Enforce idempotency of dispatched jobs using token on dispatch request
2021-07-08 10:23:31 -04:00
Tim Gross
b397edff4e cni: respect default cni_config_dir and cni_path (#10870)
The default agent configuration values were not set, which meant they were not
being set in the client configuration and this results in fingerprints failing
unless the values were set explicitly.
2021-07-08 09:56:57 -04:00