Commit Graph

20418 Commits

Author SHA1 Message Date
James Rasell 005e15afbc
Merge pull request #9744 from hashicorp/f-add-namespace-e2e-oss
e2e: move namespace tests into OSS.
2021-01-07 17:36:09 +01:00
Nick Ethier 6705f845f2
Merge pull request #9739 from hashicorp/b-alloc-netmode-ports
Use port's to value when building service address under 'alloc' addr_mode
2021-01-07 09:16:27 -05:00
Kdu Bonalume 425ad5892d Fix missing link for Consul integration
Add a link back to configuration/consul in the `service` parameter section of the `group` stanza.
2021-01-07 09:02:43 -05:00
Nick Ethier 7a6aab10bb
Apply suggestions from code review
Co-authored-by: Tim Gross <tgross@hashicorp.com>
2021-01-07 08:53:54 -05:00
James Rasell 02b9d9da87
e2e: move namespace tests into OSS. 2021-01-07 09:15:43 +01:00
Jeff Escalante f791725736
Merge pull request #9743 from hashicorp/je.fix-edit-page-links
hotfix: fix 'edit this page' links
2021-01-06 19:09:46 -05:00
Jeff Escalante 8c04e22ce4
fix 'edit this page' links 2021-01-06 19:01:32 -05:00
Mahmood Ali 050ad6b6f4
tests: deflake test-api job (#9742)
Deflake test-api job, currently failing at around 7.6% (44 out of 578
workflows), by ensuring that test nomad agent use a small dedicated port
range that doesn't conflict with the kernel ephemeral range.

The failures are disproportionatly related to port allocation, where a
nomad agent fails to start when the http port is already bound to
another process. The failures are intermitent and aren't specific to any
test in particular. The following is a representative failure:
https://app.circleci.com/pipelines/github/hashicorp/nomad/13995/workflows/6cf6eb38-f93c-46f8-8aa0-f61e62fe7694/jobs/128169
.

Upon investigation, the issue seems to be that the api freeport library
picks a port block within 10,000-14,500, but that overlaps with the
kernel ephemeral range 32,769-60,999! So, freeport may allocate a free
port to the nomad agent, just to be used by another process before the
nomad agent starts!

This happened for example in
https://app.circleci.com/pipelines/github/hashicorp/nomad/14111/workflows/e1fcd7ff-f0e0-4796-8719-f57f510b1ffa/jobs/129684
.  `freeport` allocated port 41662 to serf, but `google_accounts`
raced to use it to connect to the CirleCI vm metadata service.

We avoid such races by using a dedicated port range that's disjoint from
the kernel ephemeral port range.
2021-01-06 16:18:28 -05:00
Mahmood Ali 00be4fc63c
tests: deflake TestTaskRunner_StatsHook_Periodic (#9734)
This PR deflakes TestTaskRunner_StatsHook_Periodic tests and adds backoff when the driver closes the channel.

TestTaskRunner_StatsHook_Periodic is currently the most flaky test - failing ~4% of the time (20 out of 486 workflows). A sample failure: https://app.circleci.com/pipelines/github/hashicorp/nomad/14028/workflows/957b674f-cbcc-4228-96d9-1094fdee5b9c/jobs/128563 .

This change has two components:

First, it updates the StatsHook so that it backs off when stats channel is closed. In the context of the test where the mock driver emits a single stats update and closes the channel, the test may make tens of thousands update during the period. In real context, if a driver doesn't implement the stats handler properly or when a task finishes, we may generate way too many Stats queries in a tight loop. Here, the backoff reduces these queries. I've added a failing test that shows 154,458 stats updates within 500ms in https://app.circleci.com/pipelines/github/hashicorp/nomad/14092/workflows/50672445-392d-4661-b19e-e3561ed32746/jobs/129423 .

Second, the test ignores the first stats update after a task exit. Due to the asynchronicity of updates and channel/context use, it's possible that an update is enqueued while the test marks the task as exited, resulting into a spurious update.
2021-01-06 16:03:00 -05:00
Nick Ethier bb060bd46b command/agent/consul: remove duplicated tests 2021-01-06 14:11:31 -05:00
Kris Hicks 868ba0cea5
consul: Refactor parts of UpdateWorkload (#9737)
This removes modification of ops in methods that UpdateWorkload calls, keeping
them local to UpdateWorkload. It also includes some rewrites of checkRegs for
clarity.
2021-01-06 11:11:28 -08:00
Nick Ethier ab01e19df3 command/agent/consul: use port's to value when building service address under 'alloc' addr_mode 2021-01-06 13:52:48 -05:00
Jeff Escalante 220a24f973
Merge pull request #9638 from hashicorp/je.mdx-remote
implement mdx remote
2021-01-06 11:55:05 -05:00
Jeff Escalante af3759fc84
fix intro navigation 2021-01-05 19:40:19 -05:00
Jeff Escalante 48bfdbc565
fix style references 2021-01-05 19:07:55 -05:00
Jeff Escalante 2c9b689c8e
touch up dependencies 2021-01-05 19:03:18 -05:00
Jeff Escalante eaaafd9dd4
implement mdx remote 2021-01-05 19:02:39 -05:00
Michael Lange e2c063fa0f
Merge pull request #9697 from hashicorp/docs-wtdd-cleanup-images
docs: Remove unused images + intro pages
2021-01-05 14:22:52 -08:00
Michael Schurter 8345bd273c
Merge pull request #9732 from hashicorp/docs-cleanup
Docs cleanup
2021-01-05 13:10:36 -08:00
Michael Lange 5a37cfded0
Merge pull request #9692 from hashicorp/docs-wtdd-jobs-field-reference
docs: Enumerate job statuses and types in docs
2021-01-05 11:46:22 -08:00
Michael Schurter d5b858680b docs: mention client can be non-root
I want to strike a balance here:

- On the one hand there are use cases (raw_exec or Docker only) where
  running Nomad clients as an unprivileged user is *preferable.*
- On the other hand running Nomad clients as root is our main and best
  tested environment. So I want to leave that a strong recommendation.
2021-01-05 11:08:23 -08:00
Michael Schurter 70bf5456d3 docs: remove old client.options migration note
There's no reason to give the `client.options` to `plugins` migration
top billing on the client configuration page. Remove and and clarify the
more appropriately placed note down below.
2021-01-05 10:56:14 -08:00
Michael Schurter 5d7713bb4e docs: remove duplicate PreserveCounts entry 2021-01-05 10:41:38 -08:00
Michael Schurter b91b941b79
Merge pull request #9731 from hashicorp/docs-upgrade-102
docs: note that 1.0.2 is unreleased
2021-01-05 10:12:25 -08:00
Michael Schurter 1cede6cff8 docs: note that 1.0.2 is unreleased 2021-01-05 10:06:39 -08:00
Kris Hicks be6580bd28
Refactor alloc exec command (#9718)
This re-arranges the alloc exec Run implementation to have validation
hoisted as high as possible.
2021-01-05 09:33:04 -08:00
Luiz Aoqui af5fd4bb89
Merge pull request #9429 from hashicorp/docs-update-autoscale-policy
docs: update file scaling policy docs
2021-01-05 11:10:11 -05:00
Seth Hoenig b88996b2dd
Merge pull request #9727 from hashicorp/b-empty-ingress-proxy
consul/connect: avoid NPE from unset connect gateway proxy
2021-01-05 10:09:46 -06:00
Seth Hoenig 3636ff8f80
Merge pull request #9726 from hashicorp/f-add-tf-lockfile
e2e: add terraform lockfile
2021-01-05 10:03:38 -06:00
Seth Hoenig c46a503fdb docs: update changelog 2021-01-05 09:31:22 -06:00
Seth Hoenig 6c9366986b consul/connect: avoid NPE from unset connect gateway proxy
Submitting a job with an ingress gateway in host networking mode
with an absent gateway.proxy block would cause the Nomad client
to panic on NPE.

The consul registration bits would assume the proxy stanza was
not nil, but it could be if the user does not supply any manually
configured envoy proxy settings.

Check the proxy field is not nil before using it.

Fixes #9669
2021-01-05 09:27:01 -06:00
Seth Hoenig 7da808b43a e2e: add terraform lockfile
Terraform v0.14 is producing a lockfile after running `terraform init`.
The docs suggest we should include this file in the git repository:

> You should include this file in your version control repository so
> that you can discuss potential changes to your external dependencies
> via code review, just as you would discuss potential changes to your
> configuration itself.

Sounds similar to go.sum

https://www.terraform.io/docs/configuration/dependency-lock.html#lock-file-location
2021-01-05 08:55:37 -06:00
Seth Hoenig 0ed44a82b0
Merge pull request #9720 from hashicorp/b-consul-sreg-update
consul: always include task services hook
2021-01-05 08:48:44 -06:00
Seth Hoenig 59f230714f e2e: add e2e test for service registration 2021-01-05 08:48:12 -06:00
Seth Hoenig bc7dd881dd docs: add changelog entry 2021-01-05 08:48:12 -06:00
Seth Hoenig b4eafe6f2d consul: always include task services hook
Previously, Nomad would optimize out the services task runner
hook for tasks which were initially submitted with no services
defined. This causes a problem when the job is later updated to
include service(s) on that task, which will result in nothing
happening because the hook is not present to handle the service
registration in the .Update.

Instead, always enable the services hook. The group services
alloc runner hook is already always enabled.

Fixes #9707
2021-01-05 08:47:19 -06:00
Gunadhya 3ac3c93485
Added Enterprise Badges in Docs (#9706) 2021-01-05 09:44:37 -05:00
Chris Baker b886e5a4fc
Merge pull request #9724 from hashicorp/7410-simple-consistency-test
simple stale read test
2021-01-05 08:01:21 -06:00
Chris Baker fd6beefe11 simple test to ensure that scaling endpoint methods support IsRead for
stale read support
2021-01-05 13:42:18 +00:00
Tim Gross c2952d0539
resolve comments from code review 2021-01-04 18:52:14 -05:00
Luiz Aoqui 11b8bcddf8
docs: update file scaling policy docs 2021-01-04 18:52:11 -05:00
Chris Baker 9fea300de4
Merge pull request #9671 from hashicorp/b-9610-template-interpolation-paths-refactor
address interpolation of artifact and template src/dest
2021-01-04 17:00:45 -06:00
Chris Baker 57b70a27ec modified e2e test so that it explicitly tested the use case in #6929 2021-01-04 22:25:39 +00:00
Chris Baker 02980b55cb added documenting unit tests for new TaskEnv.ClientPath method 2021-01-04 22:25:38 +00:00
Chris Baker 60095f47a5 changelog 2021-01-04 22:25:37 +00:00
Chris Baker 5e73c62f2b Update client/taskenv/env.go
Co-authored-by: Michael Schurter <mschurter@hashicorp.com>
2021-01-04 22:25:36 +00:00
Chris Baker c7072258af enabled broken test that is no longer broken 2021-01-04 22:25:35 +00:00
Chris Baker 9b125b8837 update template and artifact interpolation to use client-relative paths
resolves #9839
resolves #6929
resolves #6910

e2e: template env interpolation path testing
2021-01-04 22:25:34 +00:00
Tim Gross 724f82e32d docs: add metrics and API docs to RPC contributors checklist 2021-01-04 15:41:12 -05:00
Tim Gross 26f4ee7fb1 e2e: dnsmasq configuration fixes
* systemd units require absolute paths
* ensure directory exists for dnsmasq
2021-01-04 15:40:57 -05:00