Commit Graph

34 Commits

Author SHA1 Message Date
Seth Hoenig
61ee443ee6 core: implement system batch scheduler
This PR implements a new "System Batch" scheduler type. Jobs can
make use of this new scheduler by setting their type to 'sysbatch'.

Like the name implies, sysbatch can be thought of as a hybrid between
system and batch jobs - it is for running short lived jobs intended to
run on every compatible node in the cluster.

As with batch jobs, sysbatch jobs can also be periodic and/or parameterized
dispatch jobs. A sysbatch job is considered complete when it has been run
on all compatible nodes until reaching a terminal state (success or failed
on retries).

Feasibility and preemption are governed the same as with system jobs. In
this PR, the update stanza is not yet supported. The update stanza is sill
limited in functionality for the underlying system scheduler, and is
not useful yet for sysbatch jobs. Further work in #4740 will improve
support for the update stanza and deployments.

Closes #2527
2021-08-03 10:30:47 -04:00
Seth Hoenig
6fdd06e760 e2e: add tests for consul namespaces from nomad oss
This PR adds a set of tests to the Consul test suite for testing
Nomad OSS's behavior around setting Consul Namespace on groups,
which is to ignore the setting (as Consul Namespaces are currently
an Enterprise feature).

Tests are generally a reduced facsimile of existing tests, modified
to check behavior of when group.consul.namespace is set and not set.
Verification is oriented around what happens in Consul; the in-depth
functional correctness of these features is left to the original tests.

Nomad ENT will get its own version of these tests in `namespaces_ent.go`.
2021-04-16 15:32:37 -06:00
Chris Baker
7f06adf1af Merge tag 'v1.0.3' into post-release-1.0.3
Version 1.0.3
2021-01-29 19:30:08 +00:00
Chris Baker
3eb9cdf740 additional e2e utils for multi-task allocs 2021-01-28 12:03:19 +00:00
Mahmood Ali
fe9929270c e2e: prefer testutil.WaitForResultRetries
Prefer testutil.WaitForResultRetries that emits more descriptive errors on
failures. `require.Evatually` fails with opaque "Condition never satisfied"
error message.
2021-01-26 10:01:14 -05:00
Seth Hoenig
74c1828431 e2e: use jobspec2 Parse for parsing jobfile in e2e utils
We directly parse job files in e2eutil, but currently using jobspec
package. Instead, use the Parse method from the jobspec2 package so
we can parse job files with new features.
2021-01-13 14:00:40 -06:00
Michael Schurter
7b648095d1 test: deflake consul e2e tests
Modernize test patterns by removing gomega and avoiding the mock_driver.
2020-08-19 14:29:22 -07:00
Seth Hoenig
fbd7f91165 e2e: add tests for connect native
Adds 2 tests around Connect Native. Both make use of the example connect native
services in https://github.com/hashicorp/nomad-connect-examples

One of them runs without Consul ACLs enabled, the other with.
2020-07-01 15:54:28 -05:00
Tim Gross
f858d4e141 e2e/csi: add waiting for alloc stop 2020-04-06 10:15:55 -04:00
Tim Gross
2468b3853c e2e: improve test reliability for CSI (#7616)
This changeset:

* adds eval status to the error messages emitted when we have
  placement failure in tests. The implementation here isn't quite
  perfect but it's a lot better than "condition not met".
* enforces the ordering of teardown of the CSI test
* doesn't pass the purge flag to one of the two CSI tests, so that we
  exercise both code paths.
2020-04-03 15:52:58 -04:00
Tim Gross
17ffbde52c e2e: remove gometa from e2eutils (#7610) 2020-04-03 10:22:22 -04:00
Drew Bailey
84cc906968 simplify job, better error 2020-02-04 13:59:39 -05:00
Drew Bailey
3609e3adc1 clean up 2020-02-04 11:59:28 -05:00
Drew Bailey
5c2075e463 get test passing, new util func to wait for not pending 2020-02-04 11:56:37 -05:00
Drew Bailey
756f5c7d79 add e2e test for system sched ineligible nodes 2020-02-04 11:56:33 -05:00
Seth Hoenig
9ccaa92ba1 e2e: remove leftover debug println statement 2020-02-03 11:15:38 -06:00
Seth Hoenig
04b526662c e2e: setup consul ACLs a little more correctly 2020-01-31 19:06:11 -06:00
Tim Gross
31f91cf4c8 e2e: fixes for race conditions in testing (#6300)
- In script checks, ensure we're running `Exec` against the new running
  allocation and not the earlier stopped one.
- In script checks, allow `Exec` calls to error due to lack of pty when
  we use the exec to kill the task.
- In `utils.go/RegisterAllocs`, force query for allocations to wait on
  wait index returned by registration call.
2019-09-10 13:45:16 -04:00
Lang Martin
4b8c9428f4 e2e/deployment DeploymentsForJob fail instead of nil, error passing 2019-06-04 14:31:42 -04:00
Lang Martin
22b6c2e6ad e2e/deployment find the second deployment, use its status 2019-06-04 13:41:52 -04:00
Lang Martin
dd2f16a031 e2e add deployment to the list of e2e tests, minor fixes 2019-05-22 12:34:57 -04:00
Lang Martin
3a3c4426bb e2e utils remove ineffectual assignment of allocs 2019-05-22 12:34:57 -04:00
Lang Martin
1a99a0f771 e2e utils error format arg match 2019-05-22 12:32:08 -04:00
Lang Martin
8b64574721 e2e util split new alloc and await placement, new WaitForDeployment 2019-05-22 12:32:08 -04:00
Michael Schurter
91d36f9f6a e2e: add NomadAgent and basic client state test
The e2e test code is absolutely hideous and leaks processes and files
on disk. NomadAgent seems useful, but the clientstate e2e tests are very
messy and slow. The last test "Corrupt" is probably the most useful as
it explicitly corrupts the state file whereas the other tests attempt to
reproduce steps thought to cause corruption in earlier releases of
Nomad.
2019-03-21 07:14:34 -07:00
Michael Schurter
35eff08386 Apply suggestions from code review
Co-Authored-By: nickethier <ncethier@gmail.com>
2019-01-23 14:09:49 -05:00
Nick Ethier
6191fe3f2c e2e: add tests for nomad driver upgrade path 2019-01-17 23:32:45 -05:00
Michael Schurter
c9dc5e4999 e2e: wait for at least N nodes to be ready
Before it was *exactly* N nodes which limited test portability between
clusters.
2019-01-08 14:39:37 -08:00
Mahmood Ali
bce7c9372d goimport file 2019-01-04 08:53:50 -05:00
Preetha Appan
21810d0edd Added waiting on client node ready state before running e2e tests 2019-01-03 16:16:20 -06:00
Preetha Appan
36b5435ed3 Increase alloc wait timeout in e2e test 2019-01-03 14:02:02 -06:00
Preetha Appan
1cfef83302 Increase timeout in e2e test 2019-01-03 11:22:21 -06:00
Danielle Tomlinson
002f19085a e2e: goimports e2eutil/utils.go 2019-01-03 13:31:49 +01:00
Preetha Appan
7ad040166d new e2e test for spread, and refactor affinity tests to share util methods 2018-12-19 21:25:32 -06:00