Commit Graph

668 Commits

Author SHA1 Message Date
Michael Schurter 765473e8b0 jobspec: lower min cpu resources from 10->1
Since CPU resources are usually a soft limit it is desirable to allow
setting it as low as possible to allow tasks to run only in "idle" time.

Setting it to 0 is still not allowed to avoid potential unintentional
side effects with allowing a zero value. While there may not be any side
effects this commit attempts to minimize risk by avoiding the issue.

This does *not* change the defaults.
2020-09-30 12:15:13 -07:00
Luiz Aoqui 88d4eecfd0
add scaling policy type 2020-09-29 17:57:46 -04:00
Mahmood Ali 1bbe56f4d8
Merge pull request #8878 from greut/bump-go-discover
feat: upgrade consul 1.7, and go-discover
2020-09-18 14:15:22 -05:00
Mahmood Ali f5700611c0
api: target servers for allocation requests (#8897)
Allocation requests should target servers, which then can forward the
request to the appropriate clients.

Contacting clients directly is fragile and prune to failures: e.g.
clients maybe firewalled and not accessible from the API client, or have
some internal certificates not trusted by the API client.

FWIW, in contexts where we anticipate lots of traffic (e.g. logs, or
exec), the api package attempts contacting the client directly but then
fallsback to using the server. This approach seems excessive in these
simple GET/PUT requests.

Fixes #8894
2020-09-16 09:34:17 -04:00
Yoan Blanc 0f217a6b96
feat: upgrade consul 1.7, and go-discover
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
2020-09-13 11:40:47 +02:00
Tim Gross 572ae37856
Merge pull request #8860 E2E: rescheduling tests 2020-09-10 13:43:55 -04:00
Tim Gross b927a4c061 remove direct dependency on ginkgo 2020-09-10 13:00:42 -04:00
Benjamin Buzbee 4c91f20c44
Add API support for cancelation contexts passed via QueryOptions and WriteOptions (#8836)
Copy Consul API's format: QueryOptions.WithContext(context) will now return
a new QueryOption whose HTTP requests will be canceled with the context
provided (and similar for WriteOptions)
2020-09-09 16:22:07 -04:00
Mahmood Ali b45d6c30a7 run `make vendor` 2020-09-01 11:48:47 -04:00
Mahmood Ali 39e2c64a39 Update cronexpr to pick up month zero padding fix 2020-09-01 11:48:28 -04:00
Tim Gross b77fe023b5
MRD: move 'job stop -global' handling into RPC (#8776)
The initial implementation of global job stop for MRD looped over all the
regions in the CLI for expedience. This changeset includes the OSS parts of
moving this into the RPC layer so that API consumers don't have to implement
this logic themselves.
2020-08-28 14:28:13 -04:00
Lang Martin 7d483f93c0
csi: plugins track jobs in addition to allocations, and use job information to set expected counts (#8699)
* nomad/structs/csi: add explicit job support
* nomad/state/state_store: capture job updates directly
* api/nodes: CSIInfo needs the AllocID
* command/agent/csi_endpoint: AllocID was missing
Co-authored-by: Tim Gross <tgross@hashicorp.com>
2020-08-27 17:20:00 -04:00
Seth Hoenig 4bfe830074 consul/connect: update consul to match current 2020-08-24 10:48:27 -05:00
Seth Hoenig c4fa644315 consul/connect: remove envoy dns option from gateway proxy config 2020-08-24 09:11:55 -05:00
Seth Hoenig 5b072029f2 consul/connect: add initial support for ingress gateways
This PR adds initial support for running Consul Connect Ingress Gateways (CIGs) in Nomad. These gateways are declared as part of a task group level service definition within the connect stanza.

```hcl
service {
  connect {
    gateway {
      proxy {
        // envoy proxy configuration
      }
      ingress {
        // ingress-gateway configuration entry
      }
    }
  }
}
```

A gateway can be run in `bridge` or `host` networking mode, with the caveat that host networking necessitates manually specifying the Envoy admin listener (which cannot be disabled) via the service port value.

Currently Envoy is the only supported gateway implementation in Consul, and Nomad only supports running Envoy as a gateway using the docker driver.

Aims to address #8294 and tangentially #8647
2020-08-21 16:21:54 -05:00
Shengjing Zhu 311fe43b3c Vendor sync 2020-08-20 00:31:07 +08:00
Drew Bailey 1c95bdb616
upgrade go metrics to 0.3.4 (#8637) 2020-08-11 13:26:45 -04:00
Tim Gross 443fdaa86b
csi: nomad volume detach command (#8584)
The soundness guarantees of the CSI specification leave a little to be desired
in our ability to provide a 100% reliable automated solution for managing
volumes. This changeset provides a new command to bridge this gap by providing
the operator the ability to intervene.

The command doesn't take an allocation ID so that the operator doesn't have to
keep track of alloc IDs that may have been GC'd. Handle this case in the
unpublish RPC by sending the client RPC for all the terminal/nil allocs on the
selected node.
2020-08-11 10:18:54 -04:00
Seth Hoenig fd4804bf26 consul: able to set pass/fail thresholds on consul service checks
This change adds the ability to set the fields `success_before_passing` and
`failures_before_critical` on Consul service check definitions. This is a
feature added to Consul v1.7.0 and later.
  https://www.consul.io/docs/agent/checks#success-failures-before-passing-critical

Nomad doesn't do much besides pass the fields through to Consul.

Fixes #6913
2020-08-10 14:08:09 -05:00
Seth Hoenig fb1c85a956 deps: upgrade import of consul/api
Upgrade our consul/api import to the equivelent of consul@v1.8.1 which includes
a bug fix necessary for #6913. If consul would publish a proper api/ submodule tag
we could reference that.
2020-08-06 21:02:33 -05:00
Drew Bailey b296558b8e
oss compoments for multi-vault namespaces
adds in oss components to support enterprise multi-vault namespace feature

upgrade specific doc on vault multi-namespaces

vault docs

update test to reflect new error
2020-07-24 10:14:59 -04:00
Mahmood Ali e9bf3a42f5
Merge pull request #8333 from hashicorp/b-test-tweak-20200701
tests: avoid os.Exit in a test
2020-07-10 11:18:28 -04:00
Tim Gross b6d9e546aa
fix volume deregister -force params in API (#8380)
The CSI `volume deregister -force` flag was using the documented parameter
`force` everywhere except in the API, where it was incorrectly passing `purge`
as the query parameter.
2020-07-08 10:08:22 -04:00
Chris Baker 9100b6b7c0 changes to make sure that Max is present and valid, to improve error messages
* made api.Scaling.Max a pointer, so we can detect (and complain) when it is neglected
* added checks to HCL parsing that it is present
* when Scaling.Max is absent/invalid, don't return extraneous error messages during validation
* tweak to multiregion handling to ensure that the count is valid on the interpolated regional jobs

resolves #8355
2020-07-04 19:05:50 +00:00
Lang Martin 6c22cd587d
api: `nomad debug` new /agent/host (#8325)
* command/agent/host: collect host data, multi platform

* nomad/structs/structs: new HostDataRequest/Response

* client/agent_endpoint: add RPC endpoint

* command/agent/agent_endpoint: add Host

* api/agent: add the Host endpoint

* nomad/client_agent_endpoint: add Agent Host with forwarding

* nomad/client_agent_endpoint: use findClientConn

This changes forwardMonitorClient and forwardProfileClient to use
findClientConn, which was cribbed from the common parts of those
funcs.

* command/debug: call agent hosts

* command/agent/host: eliminate calling external programs
2020-07-02 09:51:25 -04:00
Mahmood Ali 026d8c6eed tests: avoid os.Exit in a test 2020-07-01 15:25:13 -04:00
Tim Gross 23be116da0
csi: add -force flag to volume deregister (#8295)
The `nomad volume deregister` command currently returns an error if the volume
has any claims, but in cases where the claims can't be dropped because of
plugin errors, providing a `-force` flag gives the operator an escape hatch.

If the volume has no allocations or if they are all terminal, this flag
deletes the volume from the state store, immediately and implicitly dropping
all claims without further CSI RPCs. Note that this will not also
unmount/detach the volume, which we'll make the responsibility of a separate
`nomad volume detach` command.
2020-07-01 12:17:51 -04:00
Nick Ethier 89118016fc
command: correctly show host IP in ports output /w multi-host networks (#8289) 2020-06-25 15:16:01 -04:00
Seth Hoenig 3872b493e5
Merge pull request #8011 from hashicorp/f-cnative-host
consul/connect: implement initial support for connect native
2020-06-24 10:33:12 -05:00
Seth Hoenig 6c5ab7f45e consul/connect: split connect native flag and task in service 2020-06-23 10:22:22 -05:00
Mahmood Ali e7a3d6e358 Update github.com/syndtr/gocapability
runc requires a more recent version
2020-06-22 17:10:41 -04:00
Mahmood Ali 7423f38771 Upgrade libcontainer dependency
Upgrade libcontainer dependency to pick up fix for CVE-2019-19921 .
2020-06-22 16:56:54 -04:00
Seth Hoenig 4d71f22a11 consul/connect: add support for running connect native tasks
This PR adds the capability of running Connect Native Tasks on Nomad,
particularly when TLS and ACLs are enabled on Consul.

The `connect` stanza now includes a `native` parameter, which can be
set to the name of task that backs the Connect Native Consul service.

There is a new Client configuration parameter for the `consul` stanza
called `share_ssl`. Like `allow_unauthenticated` the default value is
true, but recommended to be disabled in production environments. When
enabled, the Nomad Client's Consul TLS information is shared with
Connect Native tasks through the normal Consul environment variables.
This does NOT include auth or token information.

If Consul ACLs are enabled, Service Identity Tokens are automatically
and injected into the Connect Native task through the CONSUL_HTTP_TOKEN
environment variable.

Any of the automatically set environment variables can be overridden by
the Connect Native task using the `env` stanza.

Fixes #6083
2020-06-22 14:07:44 -05:00
Chris Baker b79e25efb9 `make sync` 2020-06-19 23:27:00 +00:00
Michael Schurter 562704124d
Merge pull request #8208 from hashicorp/f-multi-network
multi-interface network support
2020-06-19 15:46:48 -07:00
Mahmood Ali 3824e0362c
Revert "client: defensive against getting stale alloc updates" 2020-06-19 15:39:44 -04:00
Nick Ethier 6e3313c672
vendor: sync api changes 2020-06-19 11:31:39 -04:00
Drew Bailey c2d7b61939
allow raw body instead of JSON encoded string (#8211) 2020-06-19 10:57:09 -04:00
Tim Gross 8a354f828f
store ACL Accessor ID from Job.Register with Job (#8204)
In multiregion deployments when ACLs are enabled, the deploymentwatcher needs
an appropriately scoped ACL token with the same `submit-job` rights as the
user who submitted it. The token will already be replicated, so store the
accessor ID so that it can be retrieved by the leader.
2020-06-19 07:53:29 -04:00
Mahmood Ali 38a01c050e
Merge pull request #8192 from hashicorp/f-status-allnamespaces-2
CLI Allow querying all namespaces for jobs and allocations - Try 2
2020-06-18 20:16:52 -04:00
Michael Schurter 0ed023c61a deps: updated libnetwork dep
Adding missing vendor files as well.
2020-06-18 11:05:31 -07:00
Nick Ethier 0bc0403cc3 Task DNS Options (#7661)
Co-Authored-By: Tim Gross <tgross@hashicorp.com>
Co-Authored-By: Seth Hoenig <shoenig@hashicorp.com>
2020-06-18 11:01:31 -07:00
Mahmood Ali 7a33a75449 cli: jobs allow querying jobs in all namespaces 2020-06-17 16:31:01 -04:00
Mahmood Ali e784fe331a use '*' to indicate all namespaces
This reverts the introduction of AllNamespaces parameter that was merged
earlier but never got released.
2020-06-17 16:27:43 -04:00
Tim Gross 7b12445f29 multiregion: change AutoRevert to OnFailure 2020-06-17 11:05:45 -04:00
Tim Gross b09b7a2475 Multiregion job registration
Integration points for multiregion jobs to be registered in the enterprise
version of Nomad:
* hook in `Job.Register` for enterprise to send job to peer regions
* remove monitoring from `nomad job run` and `nomad job stop` for multiregion jobs
2020-06-17 11:04:58 -04:00
Tim Gross b93efc16d5 multiregion CLI: nomad deployment unblock 2020-06-17 11:03:44 -04:00
Drew Bailey 9263fcb0d3 Multiregion deploy status and job status CLI 2020-06-17 11:03:34 -04:00
Tim Gross 6851024925 Multiregion structs
Initial struct definitions, jobspec parsing, validation, and conversion
between Nomad structs and API structs for multi-region deployments.
2020-06-17 11:00:14 -04:00
Chris Baker 9fc66bc1aa support in API client and Job.Register RPC for PreserveCounts 2020-06-16 18:45:28 +00:00
Chris Baker 377f881fbd removed api.RegisterJobRequest in favor of api.JobRegisterRequest
modified `job inspect` and `job run -output` to use anonymous struct to keep previous behavior
2020-06-16 18:45:17 +00:00
Chris Baker 1e3563e08c wip: added PreserveCounts to struct.JobRegisterRequest, development test for Job.Register 2020-06-16 18:45:17 +00:00
Mahmood Ali 5cf04b5762 api: add snapshot restore 2020-06-07 15:47:07 -04:00
Mahmood Ali 82c87cf97b
Vendor gopsutil with go mod fix (#8108)
Point to gopsutil fork with shirou/gopsutil#889 changes. I used hashicorp/gopsutil rather than pointing to https://github.com/Lomanic/gopsutil/tree/issue832 directly just in case..
2020-06-03 16:09:27 -04:00
Mahmood Ali ee453f2932
run go mod vendor (#8107) 2020-06-03 15:34:39 -04:00
Seth Hoenig 435c0d9fc8 deps: Switch to Go modules for dependency management
This PR switches the Nomad repository from using govendor to Go modules
for managing dependencies. Aspects of the Nomad workflow remain pretty
much the same. The usual Makefile targets should continue to work as
they always did. The API submodule simply defers to the parent Nomad
version on the repository, keeping the semantics of API versioning that
currently exists.
2020-06-02 14:30:36 -05:00
Yoan Blanc e983dc2cf5
docker pick https://github.com/moby/moby/pull/40021
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
2020-06-01 22:43:58 +02:00
Yoan Blanc 53355b998d
docker/cli v19.03.10
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
2020-06-01 22:43:56 +02:00
Yoan Blanc f48f964161
docker v19.03.10
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
2020-06-01 22:43:31 +02:00
Yoan Blanc 3d60a77b3e
docker v19.03.9
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
2020-06-01 22:43:28 +02:00
Mahmood Ali 1ca6162793
Merge pull request #8043 from greut/distribution-v2.7.1
vendor: pin docker/distribution to v2.7.1
2020-05-31 21:20:54 -04:00
Seth Hoenig 4cca46ae61 deps: update go-getter for redirects fix
Fixes #7854

Nomad requires a version of go-getter that is currently in PR (https://github.com/hashicorp/go-getter/pull/256)
We also require some recent bug fix to go-getter around the handling of URL redirects.

Update our vendor'd copy of go-getter to the newly rebased umask changes so that we can incorporate
the latest changes for go-getter.
2020-05-28 08:24:40 -05:00
Drew Bailey 34871f89be
Oss license support for ent builds (#8054)
* changes necessary to support oss licesning shims

revert nomad fmt changes

update test to work with enterprise changes

update tests to work with new ent enforcements

make check

update cas test to use scheduler algorithm

back out preemption changes

add comments

* remove unused method
2020-05-27 13:46:52 -04:00
Yoan Blanc 27568d83d8
vendor: pin docker/distribution to v2.7.1
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
2020-05-24 09:30:05 +02:00
Mahmood Ali 751f337f1c Update hcl2 vendoring
The hcl2 library has moved from http://github.com/hashicorp/hcl2 to https://github.com/hashicorp/hcl/tree/hcl2.

This updates Nomad's vendoring to start using hcl2 library.  Also
updates some related libraries (e.g. `github.com/zclconf/go-cty/cty` and
`github.com/apparentlymart/go-textseg`).
2020-05-19 15:00:03 -04:00
Mahmood Ali 326793939e vendor: use tagged cronexpr, v1.1.0
Also, update to the version with modification notice
2020-05-12 16:20:00 -04:00
Mahmood Ali c8fb132956 Update cronexpr to point to hashicorp/cronexpr 2020-05-07 17:50:45 -04:00
ccn 889816d65c Remove unused internal subpackages 2020-04-29 20:21:44 +08:00
ccn a4c36add17 Vendor: update fsouza/go-dockerclient to v1.6.5 2020-04-29 18:54:55 +08:00
Mahmood Ali e4f28e24a3 Vendor: update armon/go-metrics to v0.3.3
To pick up a lock contention fix in prometheus sink:
https://github.com/armon/go-metrics/pull/107 .
2020-04-26 08:54:50 -04:00
Mahmood Ali 735a478cc2 Upgrade all golang.org/x packages
Upgrade all golang.org/x packages to pick up fixes and improvements.
Some packages date back to 2018 and so much improvement happened since
then!
2020-04-09 15:23:25 -04:00
Mahmood Ali 63d15d7e5c vendor: upgrade golang.org/net/...
golang.org/net packages are ancient - upgrading them to pick up
important fixes, e.g. https://go-review.googlesource.com/c/go/+/87298/
2020-04-09 14:57:39 -04:00
Mahmood Ali 14a461d6c4
Merge pull request #7560 from hashicorp/vendor-go-msgpack-v1.1.5
vendor: explicit use of hashicorp/go-msgpack
2020-03-31 10:09:05 -04:00
Mahmood Ali 64dd10ac92 vendor: use tagged hashicorp/go-msgpack
This is to ease go mod migration
2020-03-31 09:51:17 -04:00
Yoan Blanc 761d014071 vendor: explicit use of hashicorp/go-msgpack
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
2020-03-31 09:45:21 -04:00
Mahmood Ali a6edc29b0a Fix docker/docker compile issue
Use docker master branch for specific branches, so we can pick up the
fix in https://github.com/moby/moby/pull/40021 .
2020-03-30 16:27:05 -04:00
Mahmood Ali bbd48deed0 vendor: github.com/containerd/continuity pkgs 2020-03-30 15:30:50 -04:00
Mahmood Ali 8f57f78087 vendors: update fsouza/go-docker-client to v.1.6.3 2020-03-30 15:10:53 -04:00
Mahmood Ali 4d90bf3699 vendoring: Update docker packages to v19.03.8
Also, since github.com/docker/docker is the canonical package names and
is transparently forwarded to github.com/moby/moby, I removed the
moby/moby references in origin.
2020-03-30 15:02:56 -04:00
Mahmood Ali 65d2fb5e32
Merge pull request #7531 from greut/docker-v19.03.8
Docker v19.03.8
2020-03-30 14:45:10 -04:00
Mahmood Ali 2f557751ca Update testify library to v1.5.1
Pick up a panic fix of f1bd0923b8

Some CirleCI builds fail somewhat mysteriously, e.g. https://circleci.com/gh/hashicorp/nomad/52676 , due to this bug.  The test json file emit the following:

```
{"Time":"2020-03-28T12:03:08.602544522Z","Action":"output","Package":"github.com/hashicorp/nomad/client/allocrunner","Test":"TestGroupServiceHook_Update08Alloc","Output":"panic: send on closed channel\n"}
{"Time":"2020-03-28T12:03:08.602576075Z","Action":"output","Package":"github.com/hashicorp/nomad/client/allocrunner","Test":"TestGroupServiceHook_Update08Alloc","Output":"\n"}
{"Time":"2020-03-28T12:03:08.602584429Z","Action":"output","Package":"github.com/hashicorp/nomad/client/allocrunner","Test":"TestGroupServiceHook_Update08Alloc","Output":"goroutine 403 [running]:\n"}
{"Time":"2020-03-28T12:03:08.602590561Z","Action":"output","Package":"github.com/hashicorp/nomad/client/allocrunner","Test":"TestGroupServiceHook_Update08Alloc","Output":"github.com/hashicorp/nomad/vendor/github.com/stretchr/testify/assert.Eventually.func1(0xc000a78000, 0xc0009cf160)\n"}
{"Time":"2020-03-28T12:03:08.602598464Z","Action":"output","Package":"github.com/hashicorp/nomad/client/allocrunner","Test":"TestGroupServiceHook_Update08Alloc","Output":"\t/home/circleci/go/src/github.com/hashicorp/nomad/vendor/github.com/stretchr/testify/assert/assertions.go:1494 +0x47\n"}
{"Time":"2020-03-28T12:03:08.602604952Z","Action":"output","Package":"github.com/hashicorp/nomad/client/allocrunner","Test":"TestGroupServiceHook_Update08Alloc","Output":"created by github.com/hashicorp/nomad/vendor/github.com/stretchr/testify/assert.Eventually\n"}
```
2020-03-30 07:06:52 -04:00
Yoan Blanc 1d92edbbbe
docker: v19.03.8
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
2020-03-28 17:29:04 +01:00
Yoan Blanc ffe1bd9470
vendor: go-connections v0.4.0
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
2020-03-28 08:09:13 +01:00
Mahmood Ali d2fd04745c
Merge pull request #7238 from hashicorp/vendor-hcl-20190228
Update github.com/hashicorp/hcl
2020-03-23 20:00:33 -04:00
Mahmood Ali 791d2d1555 vendor golang.org/x/crypto/ed25519/internal/edwards25519 2020-03-23 16:29:10 -04:00
Mahmood Ali 4ca15cf28e vendor: remove appengine unused package 2020-03-23 16:28:43 -04:00
Mahmood Ali a53738aebd explicitly set github.com/pkg/errors version 2020-03-23 16:28:42 -04:00
Mahmood Ali bed536812d remove unused packages 2020-03-23 16:28:11 -04:00
Mahmood Ali b03fca2913 update github.com/pkg/errors 2020-03-23 16:27:47 -04:00
Mahmood Ali 0d8430fe36 bad package 2020-03-23 16:27:24 -04:00
Lang Martin 55ed831c56 vendor: Add github.com/grpc-ecosystem/go-grpc-middleware/retry 2020-03-23 13:58:28 -04:00
Danielle Lancashire e2450bb251 vendor: go-hclog 0.10.1 -> 0.11.0 2020-03-23 13:58:28 -04:00
Danielle Lancashire 438657d822 vendor: Init csi protobufs 2020-03-23 13:58:28 -04:00
Mahmood Ali fd5d033e32
Revert "vendor: fsouza/go-docker-client v1.6.3" 2020-03-23 10:48:47 -04:00
Yoan Blanc 2e1a139c66
govendor sync
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
2020-03-23 08:42:18 +01:00
Yoan Blanc fd671b40d3
vendor: docker/docker -> moby/moby
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
2020-03-23 08:37:55 +01:00
Yoan Blanc 1bc3a1f615
vendor: upgrade some parts of docker
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
2020-03-22 10:18:06 +01:00
Yoan Blanc 392e95d496
fixup! vendor: fsouza/go-docker-client v1.6.3
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
2020-03-22 09:29:49 +01:00
Yoan Blanc 8e744d1877
vendor: fsouza/go-docker-client v1.6.3
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
2020-03-22 09:25:46 +01:00
Yoan Blanc 9507509e09
fixup! vendor: add golang.org/x/crypto/ed25519
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
2020-03-21 18:03:09 +01:00
Yoan Blanc 1c395710ea
vendor: add golang.org/x/crypto/ed25519
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
2020-03-21 18:00:41 +01:00
Yoan Blanc 67692789b7
vendor: vault api and sdk
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
2020-03-21 17:57:48 +01:00
Yoan Blanc 17b013617c
vendor: opencontainrs/runc v1.0.0-rc7
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
2020-03-21 15:43:02 +01:00
Yoan Blanc 7c2859ec95
remove all opencontainers/runc
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
2020-03-21 15:33:30 +01:00
Yoan Blanc 379bb0589e
vendor: update containerd/console
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
2020-03-20 08:27:10 +01:00
Yoan Blanc f9c7e6e12e
vendors: avoir vendors from docker's vendors
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
2020-03-19 14:31:58 +01:00
Mahmood Ali 45787e96eb Vendor shirou/gopsutil c files
This change adds Darwin and FreeBSD C code of gopsutil library, that is
needed for these platforms.  `shirou/gopsutil` uses some C code that
isn't in a go package, so don't get vendored automatically.
2020-03-16 09:43:44 -04:00
Yoan Blanc 4593f588c9
bump golang.org/x/sys
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
2020-03-15 09:53:21 +01:00
Yoan Blanc f85cbddaf1
gopsutils: v2.20.2
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
2020-03-15 09:36:59 +01:00
Yoan Blanc c8e69a0427
docker: v18.09.9
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
2020-03-15 08:23:11 +01:00
Yoan Blanc 490369515c
fixup! vendor: vendor.json cleanup
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
2020-03-14 17:58:24 +01:00
Yoan Blanc 4c9754bcfb
vendor: vendor.json cleanup
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
2020-03-14 14:38:05 +01:00
Michael Schurter b72b3e765c
Merge pull request #7170 from fredrikhgrelland/consul_template_upgrade
Update consul-template to v0.24.1 and remove deprecated vault grace
2020-03-10 14:15:47 -07:00
Mahmood Ali 88cfe504a0 update grpc
Upgrade grpc to v1.27.1 and protobuf plugins to v1.3.4.
2020-03-03 08:39:54 -05:00
Mahmood Ali d32f0ff079 Update github.com/hashicorp/hcl
hashicorp/hcl library added some better validation for error and illegal
characters.  The diff is primarily improved error reporting.  The
parser.go change includes a case where illegal characters were silently
dropped, but now get reported as invalid characters.
2020-02-28 15:40:01 -05:00
Fredrik Hoem Grelland edb3bd0f3f Update consul-template to v0.24.1 and remove deprecated vault_grace (#7170) 2020-02-23 16:24:53 +01:00
Mahmood Ali 98ad59b1de update rest of consul packages 2020-02-16 16:25:04 -06:00
Mahmood Ali 3dcc65d58d Update consul autopilot dependency 2020-02-16 15:41:43 -06:00
Mahmood Ali f12bf4a629 update raft to latest 2020-02-13 18:56:52 -05:00
Michael Schurter c82b14b0c4 core: add limits to unauthorized connections
Introduce limits to prevent unauthorized users from exhausting all
ephemeral ports on agents:

 * `{https,rpc}_handshake_timeout`
 * `{http,rpc}_max_conns_per_client`

The handshake timeout closes connections that have not completed the TLS
handshake by the deadline (5s by default). For RPC connections this
timeout also separately applies to first byte being read so RPC
connections with TLS enabled have `rpc_handshake_time * 2` as their
deadline.

The connection limit per client prevents a single remote TCP peer from
exhausting all ephemeral ports. The default is 100, but can be lowered
to a minimum of 26. Since streaming RPC connections create a new TCP
connection (until MultiplexV2 is used), 20 connections are reserved for
Raft and non-streaming RPCs to prevent connection exhaustion due to
streaming RPCs.

All limits are configurable and may be disabled by setting them to `0`.

This also includes a fix that closes connections that attempt to create
TLS RPC connections recursively. While only users with valid mTLS
certificates could perform such an operation, it was added as a
safeguard to prevent programming errors before they could cause resource
exhaustion.
2020-01-30 10:38:25 -08:00
Mahmood Ali 8e78fb15bf Update go-discover library
To pick up go.net change so we can cross compile to arm64
2020-01-08 14:49:04 -05:00
Mahmood Ali 0ec9532ab1
Merge pull request #6831 from hashicorp/add_inmemory_certificate
Add option to set certificate in-memory
2019-12-19 08:54:32 -05:00
Drew Bailey 31777c3fdb
update go-hclog to latest release 2019-12-18 12:53:33 -05:00
Michel Vocks 3864d91d03 Add option to set certificate in-memory via SDK 2019-12-16 10:59:27 +01:00
Mahmood Ali a7361612b6
Merge pull request #6556 from hashicorp/c-vendor-multierror-20191025
Update go-multierror library
2019-12-13 11:32:42 -05:00
Mahmood Ali ea30ab9c56 Update go-multierror to 72917a1
To pick up https://github.com/hashicorp/go-multierror/pull/28
2019-12-13 10:13:31 -05:00
Mahmood Ali a7d8513ced vendor: Update go-discover for AWS SDK change
Update go-discover to pull in latest AWS SDK change through its vendored
path, along with other provider changes.
2019-12-03 13:49:52 -05:00
Mahmood Ali 3f15326248 Update AWS SDK library to v1.25.41
Update github.com/aws/aws-sdk-go and github.com/hashicorp/go-discover to
pick up support for EC2 Metadata Instance Service v2 changes.

Follow up to https://github.com/hashicorp/go-discover/pull/128 .
2019-12-03 13:35:03 -05:00
Michael Schurter 98321f9729 vendor: update go-version to include NewSemver 2019-11-19 08:40:18 -08:00
Drew Bailey 37de02c8f7
updates consul template deps to v0.22.1
pin to v0.22.1
2019-11-14 08:58:34 -05:00
Charlie Voiselle 835831a3d8 Added service wrapper code (#6220)
This is the basic code to add the Windows Service Manager hooks to Nomad.

Includes vendoring golang.org/x/sys/windows/svc and added Docs:
* guide for installing as a windows service.
* configuration for logging to file from PR #6429
2019-11-11 15:16:07 -05:00
Drew Bailey da6229d704
update go-hclog dep
remove duplicate lock
2019-11-05 09:51:52 -05:00
Drew Bailey 3b9c33a5f0
new hclog with standardlogger intercept 2019-11-05 09:51:49 -05:00
Drew Bailey 786989dbe3
New monitor pkg for shared monitor functionality
Adds new package that can be used by client and server RPC endpoints to
facilitate monitoring based off of a logger

clean up old code

small comment about write

rm old comment about minsize

rename to Monitor

Removes connection logic from monitor command

Keep connection logic in endpoints, use a channel to send results from
monitoring

use new multisink logger and interfaces

small test for dropped messages

update go-hclogger and update sink/intercept logger interfaces
2019-11-05 09:51:49 -05:00
Drew Bailey 976c43157c
remove log_writer
prefix output with proper spacing

update gzip handler, adjust first byte flow to allow gzip handler bypass

wip, first stab at wiring up rpc endpoint
2019-11-05 09:51:48 -05:00
Drew Bailey 0de94466b2
Display error when remote side ended monitor
multisink logger

remove usage of logwriter
2019-11-05 09:51:48 -05:00
Drew Bailey f60e44afc7
Adds nomad monitor command
Adds nomad monitor command. Like consul monitor, this command allows you
to stream logs from a nomad agent in real time with a a specified log
level

add endpoint tests

Upgrade go-hclog to latest version

The current version of go-hclog pads log prefixes to equal lengths
so info becomes [INFO ] and debug becomes [DEBUG]. This breaks
hashicorp/logutils/level.go Check function. Upgrading to the latest
version removes this padding and fixes log filtering that uses logutils
Check
2019-11-05 09:51:47 -05:00
Drew Bailey b0184e2032
Adds AgentMonitor Endpoint
AgentMonitor is an endpoint to stream logs for a given agent. It allows
callers to pass in a supplied log level, which may be different than the
agents config allowing for temporary debugging with lower log levels.

Pass in logWriter when setting up Agent
2019-11-05 09:51:46 -05:00
Drew Bailey 8c3e1b382a
Update gziphandler to latest version
This version of gziphandler includes a fix that fixes GzipResponseWriter
to implement CloseNotifier

https://github.com/nytimes/gziphandler/pull/63
2019-11-05 09:51:46 -05:00
Mahmood Ali 1f267bad58 Update go-multierror library
Update multierror to latest as of now.  Our version is very old and
dates back to Sep 2015[1].  Here, we aim to pick up a panic fix found in
n https://github.com/hashicorp/go-multierror/pull/11 (Dec 2016).

This is a purely hygiene maintenance change.  I am unaware of any causes
of the panic in our current dependencies.  Though, some private internal
libraries did rely on the "recent" behavior of go-multierror, and I
aimed to update here to ease our adoption of other libraries later.

[1] d30f09973e
2019-10-25 09:25:42 -04:00
Mahmood Ali e1fbe94457 upgrade go-plugin to latest, 8091134
Upgrade go-plugin to latest to pick up Windows fix in
https://github.com/hashicorp/go-plugin/pull/125 .
2019-10-04 13:26:49 -04:00
Mahmood Ali 4c548b9c75 Fix hashicorp/go-msgpack import
Golang 1.13 is pickier with importpaths and aliasing and fails
compilation currently.

Here, for go-msgpack dependency, we use upstream ugorji/go with a single
change
23165f7bc3
.

For consistency and to ease noticing descripency, I made ugorji/go and
hashicorp/go-msgpack reference the same sha.

This is a dependency management update and has no functional change to
product.
2019-09-27 09:08:30 -04:00
Nick Ethier e440ba80f1
ar: refactor network bridge config to use go-cni lib (#6255)
* ar: refactor network bridge config to use go-cni lib

* ar: use eth as the iface prefix for bridged network namespaces

* vendor: update containerd/go-cni package

* ar: update network hook to use TODO contexts when calling configurator

* unnecessary conversion
2019-09-04 16:33:25 -04:00
Lang Martin a1936e3add
Merge pull request #6215 from hashicorp/f-upgrade-go-getter
upgrade go-getter, leave compiled protobuf at version 1.2
2019-08-28 11:01:31 -04:00
Nick Ethier cf014c7fd5
ar: ensure network forwarding is allowed for bridged allocs (#6196)
* ar: ensure network forwarding is allowed in iptables for bridged allocs

* ensure filter rule exists at setup time
2019-08-28 10:51:34 -04:00
Lang Martin 5ae153900f match pinned versions for sub-modules 2019-08-27 12:58:12 -04:00
Lang Martin c79eb24816 govendor fetch github.com/hashicorp/go-getter@f5101da, protobuf 1.2 2019-08-26 17:54:21 -04:00
Mahmood Ali 3791a70aa9
Merge pull request #5676 from hashicorp/f-b-upgrade-ugorji-dep-20190508
Update ugorji/go to latest
2019-08-23 18:29:49 -04:00
Lang Martin f807d9208f govendor fetch github.com/hashicorp/go-getter@6be654f 2019-08-23 15:59:03 -04:00
Chris Baker ee0bfe1926
Merge pull request #6152 from dwagin/master
Bump up github.com/hashicorp/go-syslog for better BSD support
2019-08-20 14:22:03 -04:00