Commit Graph

2233 Commits

Author SHA1 Message Date
Jasmine Dahilig
ce55bf5fba Merge pull request #5664 from hashicorp/f-http-hcl-region
backfill region from hcl for jobUpdate and jobPlan
2019-06-13 12:25:01 -07:00
Jasmine Dahilig
c467a94e2b backfill region from job hcl in jobUpdate and jobPlan endpoints
- updated region in job metadata that gets persisted to nomad datastore
- fixed many unrelated unit tests that used an invalid region value
(they previously passed because hcl wasn't getting picked up and
the job would default to global region)
2019-06-13 08:03:16 -07:00
Danielle
17f96165df Merge pull request #5829 from hashicorp/dani/b-5819
consul: Include port-label in service registration
2019-06-13 16:20:45 +02:00
Danielle Lancashire
efdfef868f consul: Include port-label in service registration
It is possible to provide multiple identically named services with
different port assignments in a Nomad configuration.

We introduced a regression when migrating to stable service identifiers where
multiple services with the same name would conflict, and the last definition
would take precedence.

This commit includes the port label in the stable service identifier to
allow the previous behaviour where this was supported, for example
providing:

```hcl
service {
  name = "redis-cache"
  tags = ["global", "cache"]
  port = "db"
  check {
    name     = "alive"
    type     = "tcp"
    interval = "10s"
    timeout  = "2s"
  }
}

service {
  name = "redis-cache"
  tags = ["global", "foo"]
  port = "foo"

  check {
    name     = "alive"
    type     = "tcp"
    port     = "db"
    interval = "10s"
    timeout  = "2s"
  }
}

service {
  name = "redis-cache"
  tags = ["global", "bar"]
  port = "bar"

  check {
    name     = "alive"
    type     = "tcp"
    port     = "db"
    interval = "10s"
    timeout  = "2s"
  }
}
```

in a nomad task definition is now completely valid. Each service
definition with the same name must still have a unique port label however.
2019-06-13 15:24:54 +02:00
Nick Ethier
e19921b47c Optional Consul service tags for nomad server and agent services (#5706)
Optional Consul service tags for nomad server and agent services
2019-06-13 09:00:35 -04:00
Preetha
34206f3015 Merge pull request #5820 from hashicorp/r-assorted-changes-20190612_1
Assorted minor changes
2019-06-12 10:33:16 -05:00
Danielle Lancashire
0f3d45bab8 alloc-lifecycle: Fix restart with empty body
Currently when you submit a manual request to the alloc lifecycle API
with a version of Curl that will submit empty bodies, the alloc restart
api will fail with an EOF error.

This behaviour is undesired, as it is reasonable to not submit a body at
all when restarting an entire allocation rather than an individual task.

This fixes it by ignoring EOF (not unexpected EOF) errors and treating
them as entire task restarts.
2019-06-12 15:35:00 +02:00
Mahmood Ali
56bdf0c5f6 tests: parsing dir should be equivalent to parsing individual files 2019-06-12 08:19:09 -04:00
Mahmood Ali
093a760b35 tests: avoid manipulating package variables 2019-06-12 08:16:32 -04:00
Lang Martin
8b49c5e64a command add comments re: defaults to LoadConfig 2019-06-11 22:35:43 -04:00
Lang Martin
62eb6081fa config_parse_test update comment for accuracy 2019-06-11 22:30:20 -04:00
Lang Martin
cedd2ba17f config_parse get rid of ParseConfigDefault 2019-06-11 22:00:23 -04:00
Lang Martin
a25b4d9d49 Revert "config explicitly merge defaults once when using a config directory"
This reverts commit 006a9a1d45.
2019-06-11 22:00:23 -04:00
Lang Martin
d1ee78ab30 agent/testdata add a configuration directory for testing 2019-06-11 16:34:04 -04:00
Lang Martin
4bfbeb649b config merge maintains *HCL string fields used for duration conversion 2019-06-11 16:34:04 -04:00
Lang Martin
e9fa8e5621 config_parse_test, handle defaults 2019-06-11 16:34:04 -04:00
Lang Martin
006a9a1d45 config explicitly merge defaults once when using a config directory 2019-06-11 15:42:27 -04:00
Lang Martin
5a3a47c7a4 config_parse split out defaults from ParseConfig 2019-06-11 15:42:27 -04:00
Lang Martin
0606f50f46 config parse_test check for string coercion in client.meta 2019-06-10 13:12:38 -04:00
Michael Schurter
1186d77133 nomad: disable service+batch preemption by default
Enterprise only.

Disable preemption for service and batch jobs by default.

Maintain backward compatibility in a x.y.Z release. Consider switching
the default for new clusters in the future.
2019-06-04 15:54:50 -07:00
Mahmood Ali
5a597f4947 client config flag to disable remote exec
This exposes a client flag to disable nomad remote exec support in
environments where access to tasks ought to be restricted.

I used `disable_remote_exec` client flag that defaults to allowing
remote exec. Opted for a client config that can be used to disable
remote exec globally, or to a subset of the cluster if necessary.
2019-06-03 15:31:39 -04:00
Nomad Release bot
98e7525131 Generate files for 0.9.2-rc1 release 2019-05-22 19:29:30 +00:00
Lang Martin
c086b5f483 api use job.update as the default for taskgroup.update 2019-05-22 12:34:57 -04:00
Lang Martin
9621c073fe add update AutoPromote bool 2019-05-22 12:32:08 -04:00
Mahmood Ali
30b148c8d4 Restore tty start before emitting errors
Otherwise, the error message appears indented unexpectedly.
2019-05-17 11:58:31 -04:00
Mahmood Ali
0b4bebd3aa Fix typos and comments
Co-Authored-By: Michael Schurter <michael.schurter@gmail.com>
2019-05-16 17:06:03 -04:00
Mahmood Ali
eedd8e9e66 Implement escaping chrarcter for alloc exec 2019-05-16 16:22:52 -04:00
Preetha
abaf5dcff1 Merge pull request #5702 from hashicorp/f-filter-by-create-index
Filter deployments by create index
2019-05-15 21:50:41 -05:00
Preetha Appan
9abd35285f Add -all to help text and flags 2019-05-15 21:16:57 -05:00
Mahmood Ali
c1c9d9b07d fix typo 2019-05-15 13:01:05 -04:00
Mahmood Ali
72b2fb1946 Merge pull request #5633 from hashicorp/f-nomad-exec-parts-02-cli
nomad exec part 2: CLI
2019-05-15 12:50:42 -04:00
Mahmood Ali
d675d28ff3 Handle Terminal Output state in Windows 2019-05-15 10:37:37 -04:00
Mahmood Ali
8bbc78a48a Add clarifying comments for negating -i or -t 2019-05-15 10:35:12 -04:00
Preetha Appan
ea37019d7f Fix one more test set up 2019-05-14 16:13:41 -05:00
Nick Ethier
40a16ddc27 fixup #5172 and rebase against master 2019-05-14 14:37:34 -04:00
Nick Ethier
e30cc90a7e Merge branch 'master' into pr/5172
* master: (912 commits)
  Update redirects.txt
  Added redirect for Spark guide link
  client: log when server list changes
  docs: mention regression in task config validation
  fix update to changelog
  update CHANGELOG with datacenter config validation https://github.com/hashicorp/nomad/pull/5665
  typo: "atleast" -> "at least"
  implement nomad exec for rkt
  docs: fixed typo
  use pty/tty terminology similar to github.com/kr/pty
  vendor github.com/kr/pty
  drivers: implement streaming exec for executor based drivers
  executors: implement streaming exec
  executor: scaffolding for executor grpc handling
  client: expose allocated memory per task
  client improve a comment in updateNetworks
  stalebot: Add 'thinking' as an exempt label (#5684)
  Added Sparrow link
  update links to use new canonical location
  Add redirects for restructing done in GH-5667
  ...
2019-05-14 14:10:33 -04:00
Preetha Appan
dee16743b4 Fix test setup to have correct jobcreateindex for deployments 2019-05-13 18:53:47 -05:00
Preetha Appan
af2ed66749 Add flag similar to --all for allocs to be able to filter deployments by latest 2019-05-13 18:33:41 -05:00
Mahmood Ali
12114354ab Merge pull request #5668 from hashicorp/flaky-test-20190430
fix flaky test by allowing for call invocation overhead
2019-05-13 12:33:44 -04:00
Mahmood Ali
494642b11c typo: "atleast" -> "at least" 2019-05-13 10:01:19 -04:00
Mahmood Ali
bad77f1ece add CLI commands for nomad exec 2019-05-12 22:04:50 -04:00
Mahmood Ali
5abbee5d39 Merge pull request #5632 from hashicorp/f-nomad-exec-parts-01-base
nomad exec part 1: plumbing and docker driver
2019-05-09 18:09:27 -04:00
Mahmood Ali
bfb4f0ca2d agent: add websocket handler for nomad exec
This adds a websocket endpoint for handling `nomad exec`.

The endpoint is a websocket interface, as we require a bi-directional
streaming (to handle both input and output), which is not very appropriate for
plain HTTP 1.0. Using websocket makes implementing the web ui a bit simpler. I
considered using golang http hijack capability to treat http request as a plain
connection, but the web interface would be too complicated potentially.

Furthermore, the API endpoint operates against the raw core nomad exec streaming
datastructures, defined in protobuf, with json serializer.  Our APIs use json
interfaces in general, and protobuf generates json friendly golang structs.
Reusing the structs here simplify interface and reduce conversion overhead.
2019-05-09 16:49:08 -04:00
Danielle
62274e9452 Merge pull request #5536 from hashicorp/dani/consul
Consul Catalog Integration Fixes
2019-05-09 13:22:54 +02:00
Danielle Lancashire
3d3b2ca239 consul: Document example check id 2019-05-09 13:22:22 +02:00
Mahmood Ali
538b5c3eba fix flaky test by allowing for call invocation overhead 2019-05-08 18:04:37 -04:00
Preetha
237d8ca2ec Merge pull request #5628 from hashicorp/f-preemption-config
Add config to disable preemption for batch/service jobs
2019-05-06 15:40:35 -05:00
Lang Martin
84306b0bfb Merge pull request #5601 from hashicorp/b-config-parse-direct-hcl
config parse direct hcl
2019-05-06 12:05:19 -04:00
Preetha Appan
a9d45c5048 Rename to match system scheduler config.
Also added docs
2019-05-03 14:06:12 -05:00
Danielle Lancashire
14c231aeb9 consul: Do not deregister external checks
This commit causes sync to skip deregistering checks that are not
managed by nomad, such as service maintenance mode checks.  This is
handled in the same way as service registrations - by doing a Nomad
specific prefix match.
2019-05-02 16:54:18 +02:00