This project is mirrored from https://gitee.com/mirrors/nomad.git. Pull mirroring failed .
Repository mirroring has been paused due to too many failed attempts. It can be resumed by a project maintainer.
  1. 12 Mar, 2021 1 commit
  2. 08 Mar, 2021 1 commit
  3. 14 Jan, 2021 1 commit
    • Kris Hicks's avatar
      Fix some errcheck errors (#9811) · 2cd7136b
      Kris Hicks authored
      * Throw away result of multierror.Append
      
      When given a *multierror.Error, it is mutated, therefore the return
      value is not needed.
      
      * Simplify MergeMultierrorWarnings, use StringBuilder
      
      * Hash.Write() never returns an error
      
      * Remove error that was always nil
      
      * Remove error from Resources.Add signature
      
      When this was originally written it could return an error, but that was
      refactored away, and callers of it as of today never handle the error.
      
      * Throw away results of io.Copy during Bridge
      
      * Handle errors when computing node class in test
      2cd7136b
  4. 04 Jan, 2021 1 commit
  5. 10 Dec, 2020 1 commit
  6. 09 Dec, 2020 1 commit
  7. 25 Nov, 2020 2 commits
    • Mahmood Ali's avatar
      use comment ignores (#9448) · 6d57a1c6
      Mahmood Ali authored
      Use targetted ignore comments for the cases where we are bound by
      backward compatibility.
      
      I've left some file based linters, especially when the file is riddled
      with linter voilations (e.g. enum names), or if it's a property of the
      file (e.g. package and file names).
      
      I encountered an odd behavior related to RPC_REQUEST_RESPONSE_UNIQUE and
      RPC_REQUEST_STANDARD_NAME.  Apparently, if they target a `stream` type,
      we must separate them into separate lines so that the ignore comment
      targets the type specifically.
      6d57a1c6
    • Mahmood Ali's avatar
      honor task user when execing into raw_exec task (#9439) · edaa1658
      Mahmood Ali authored
      Fix #9210 .
      
      This update the executor so it honors the User when using nomad alloc exec. The bug was that the exec task didn't honor the init command when execing.
      edaa1658
  8. 23 Nov, 2020 1 commit
  9. 17 Nov, 2020 1 commit
  10. 10 Nov, 2020 1 commit
    • Kris Hicks's avatar
      protos: Update .proto files not to use Go package name (#9301) · b3825e74
      Kris Hicks authored
      Previously, it was required that you `go get github.com/hashicorp/nomad` to be
      able to build protos, as the protoc invocation added an include directive that
      pointed to `$GOPATH/src`, which is how dependent protos were discovered. As
      Nomad now uses Go modules, it won't necessarily be cloned to `$GOPATH`.
      (Additionally, if you _had_ go-gotten Nomad at some point, protoc compilation
      would have possibly used the _wrong_ protos, as those wouldn't necessarily be
      the most up-to-date ones.)
      
      This change modifies the proto files and the `protoc` invocation to handle
      discovering dependent protos via protoc plugin modifier statements that are
      specific to the protoc plugin being used.
      
      In this change, `make proto` was run to recompile the protos, which results in
      changes only to the gzipped `FileDescriptorProto`.
      b3825e74
  11. 14 Oct, 2020 1 commit
  12. 12 Oct, 2020 1 commit
  13. 08 Oct, 2020 1 commit
    • Tim Gross's avatar
      csi: loosen ValidateVolumeCapability requirements (#9049) · bf62f46a
      Tim Gross authored
      The CSI specification for `ValidateVolumeCapability` says that we shall
      "reconcile successful capability-validation responses by comparing the
      validated capabilities with those that it had originally requested" but leaves
      the details of that reconcilation unspecified. This API is not implemented in
      Kubernetes, so controller plugins don't have a real-world implementation to
      verify their behavior against.
      
      We have found that CSI plugins in the wild may return "successful" but
      incomplete `VolumeCapability` responses, so we can't require that all
      capabilities we expect have been validated, only that the ones that have been
      validated match. This appears to violate the CSI specification but until
      that's been resolved in upstream we have to loosen our validation
      requirements. The tradeoff is that we're more likely to have runtime errors
      during `NodeStageVolume` instead of at the time of volume registration.
      bf62f46a
  14. 01 Oct, 2020 1 commit
    • Mahmood Ali's avatar
      Compare to the correct host network setting · a181ff3f
      Mahmood Ali authored
      In systemd-resolved hosts with no DNS customizations, the docker driver
      DNS setting should be compared to /run/systemd/resolve/resolv.conf while
      exec/java drivers should be compared to /etc/resolv.conf.
      
      When system-resolved is enabled, /etc/resolv.conf is a stub that points
      to 127.0.0.53. Docker avoids this stub because this address isn't
      accessible from the container.  The exec/java drivers that don't create
      network isolations use the stub though in the default configuration.
      a181ff3f
  15. 11 Aug, 2020 1 commit
  16. 07 Aug, 2020 1 commit
    • Tim Gross's avatar
      csi: client RPCs should return wrapped errors for checking (#8605) · 079f60cd
      Tim Gross authored
      When the client-side actions of a CSI client RPC succeed but we get
      disconnected during the RPC or we fail to checkpoint the claim state, we want
      to be able to retry the client RPC without getting blocked by the client-side
      state (ex. mount points) already having been cleaned up in previous calls.
      079f60cd
  17. 21 Jul, 2020 1 commit
  18. 22 Jun, 2020 1 commit
    • Tim Gross's avatar
      csi: add VolumeContext to NodeStage/Publish RPCs (#8239) · ffd783e6
      Tim Gross authored
      In #7957 we added support for passing a volume context to the controller RPCs.
      This is an opaque map that's created by `CreateVolume` or, in Nomad's case,
      in the volume registration spec.
      
      However, we missed passing this field to the `NodeStage` and `NodePublish` RPC,
      which prevents certain plugins (such as MooseFS) from making node RPCs.
      ffd783e6
  19. 18 Jun, 2020 1 commit
  20. 26 May, 2020 1 commit
    • Mahmood Ali's avatar
      cleanup driver eventor goroutines · d6c75e30
      Mahmood Ali authored
      This fixes few cases where driver eventor goroutines are leaked during
      normal operations, but especially so in tests.
      
      This change makes few modifications:
      
      First, it switches drivers to use `Context`s to manage shutdown events.
      Previously, it relied on callers invoking `.Shutdown()` function that is
      specific to internal drivers only and require casting.  Using `Contexts`
      provide a consistent idiomatic way to manage lifecycle for both internal
      and external drivers.
      
      Also, I discovered few places where we don't clean up a temporary driver
      instance in the plugin catalog code, where we dispense a driver to
      inspect and validate the schema config without properly cleaning it up.
      d6c75e30
  21. 21 May, 2020 1 commit
    • Tim Gross's avatar
      volumes: return better error messages for unsupported task drivers (#8030) · 8860b72b
      Tim Gross authored
      When an allocation runs for a task driver that can't support volume mounts,
      the mounting will fail in a way that can be hard to understand. With host
      volumes this usually means failing silently, whereas with CSI the operator
      gets inscrutable internals exposed in the `nomad alloc status`.
      
      This changeset adds a MountConfig field to the task driver Capabilities
      response. We validate this when the `csi_hook` or `volume_hook` fires and
      return a user-friendly error.
      
      Note that we don't currently have a way to get driver capabilities up to the
      server, except through attributes. Validating this when the user initially
      submits the jobspec would be even better than what we're doing here (and could
      be useful for all our other capabilities), but that's out of scope for this
      changeset.
      
      Also note that the MountConfig enum starts with "supports all" in order to
      support community plugins in a backwards compatible way, rather than...
      8860b72b
  22. 19 May, 2020 1 commit
  23. 18 May, 2020 1 commit
    • Tim Gross's avatar
      csi: improve plugin error messages and volume validation (#7984) · 64c6a8db
      Tim Gross authored
      Some CSI plugins don't return much for errors over the gRPC socket
      above and beyond the bare minimum error codes. This changeset improves
      the operator experience by unpacking the error codes when available
      and wrapping the error with some user-friendly direction.
      
      Improving these errors also revealed a bad comparison with
      `require.Error` when `require.EqualError` should be used in the test
      code for plugin errors. This defect in turn was hiding a bug in volume
      validation where we're being overly permissive in allowing mount
      flags, which is now fixed.
      64c6a8db
  24. 15 May, 2020 1 commit
    • Tim Gross's avatar
      csi: support for VolumeContext and VolumeParameters (#7957) · 103d873e
      Tim Gross authored
      The MVP for CSI in the 0.11.0 release of Nomad did not include support
      for opaque volume parameters or volume context. This changeset adds
      support for both.
      
      This also moves args for ControllerValidateCapabilities into a struct.
      The CSI plugin `ControllerValidateCapabilities` struct that we turn
      into a CSI RPC is accumulating arguments, so moving it into a request
      struct will reduce the churn of this internal API, make the plugin
      code more readable, and make this method consistent with the other
      plugin methods in that package.
      103d873e
  25. 14 May, 2020 2 commits
    • Tim Gross's avatar
      csi: use a blocking initial connection with timeout · eb2f77a0
      Tim Gross authored
      The plugin supervisor lazily connects to plugins, but this means we
      only get "Unavailable" back from the gRPC call in cases where the
      plugin can never be reached (for example, if the Nomad client has the
      wrong permissions for the socket).
      
      This changeset improves the operator experience by switching to a
      blocking `DialWithContext`. It eagerly connects so that we can
      validate the connection is real and get a "failed to open" error in
      case where Nomad can't establish the initial connection.
      eb2f77a0
    • Tim Gross's avatar
      csi: refactor internal client field name to ExternalID (#7958) · c514a552
      Tim Gross authored
      The CSI plugins RPCs require the use of the storage provider's volume
      ID, rather than the user-defined volume ID. Although changing the RPCs
      to use the field name `ExternalID` risks breaking backwards
      compatibility, we can use the `ExternalID` name internally for the
      client and only use `VolumeID` at the RPC boundaries.
      c514a552
  26. 11 May, 2020 2 commits
    • Tim Gross's avatar
      csi: support Secrets parameter in CSI RPCs (#7923) · a28f18ea
      Tim Gross authored
      CSI plugins can require credentials for some publishing and
      unpublishing workflow RPCs. Secrets are configured at the time of
      volume registration, stored in the volume struct, and then passed
      around as an opaque map by Nomad to the plugins.
      a28f18ea
    • Mahmood Ali's avatar
      When serializing msgpack, only consider codec tag · 88808b2d
      Mahmood Ali authored
      When serializing structs with msgpack, only consider type tags of
      `codec`.
      
      Hashicorp/go-msgpack (based on ugorji/go) defaults to interpretting
      `codec` tag if it's available, but falls to using `json` if `codec`
      isn't present.
      
      This behavior is surprising in cases where we want to serialize json
      differently from msgpack, e.g. serializing `ConsulExposeConfig`.
      88808b2d
  27. 05 May, 2020 1 commit
    • Tim Gross's avatar
      csi: fix mount validation (#7869) · 1585d343
      Tim Gross authored
      Several of the CSI `VolumeCapability` methods return pointers, which
      we were then comparing to pointers in the request rather than
      dereferencing them and comparing their contents.
      
      This changeset does a more fine-grained comparison of the request vs
      the capabilities, and adds better error messaging.
      1585d343
  28. 30 Apr, 2020 1 commit
    • Tim Gross's avatar
      csi: check returned volume capability validation (#7831) · f592dd90
      Tim Gross authored
      This changeset corrects handling of the `ValidationVolumeCapabilities`
      response:
      
      * The CSI spec for the `ValidationVolumeCapabilities` requires that
        plugins only set the `Confirmed` field if they've validated all
        capabilities. The Nomad client improperly assumes that the lack of a
        `Confirmed` field should be treated as a failure. This breaks the
        Azure and Linode block storage plugins, which don't set this
        optional field.
      
      * The CSI spec also requires that the orchestrator check the validation
        responses to guard against older versions of a plugin reporting
        "valid" for newer fields it doesn't understand.
      f592dd90
  29. 20 Apr, 2020 1 commit
  30. 01 Apr, 2020 1 commit
  31. 31 Mar, 2020 2 commits
  32. 30 Mar, 2020 1 commit
    • Tim Gross's avatar
      csi: add grpc retries to client controller RPCs (#7549) · ffa13adf
      Tim Gross authored
      The CSI Specification defines various gRPC Errors and how they may be retried. After auditing all our CSI RPC calls in #6863, this changeset:
      
      * adds retries and backoffs to the where they were needed but not implemented
      * annotates those CSI RPCs that do not need retries so that we don't wonder whether it's been left off accidentally
      * added a timeout and cancellation context to the `Probe` call, which didn't have one.
      ffa13adf
  33. 23 Mar, 2020 4 commits
    • Lang Martin's avatar
      csi: add mount_options to volumes and volume requests (#7398) · 1bef8b88
      Lang Martin authored
      Add mount_options to both the volume definition on registration and to the volume block in the group where the volume is requested. If both are specified, the options provided in the request replace the options defined in the volume. They get passed to the NodePublishVolume, which causes the node plugin to actually mount the volume on the host.
      
      Individual tasks just mount bind into the host mounted volume (unchanged behavior). An operator can mount the same volume with different options by specifying it twice in the group context.
      
      closes #7007
      
      * nomad/structs/volumes: add MountOptions to volume request
      
      * jobspec/test-fixtures/basic.hcl: add mount_options to volume block
      
      * jobspec/parse_test: add expected MountOptions
      
      * api/tasks: add mount_options
      
      * jobspec/parse_group: use hcl decode not mapstructure, mount_options
      
      * client/allocrunner/csi_hook: pass MountOptions through
      
      client/allocrunner/csi_hook: add a VolumeMount...
      1bef8b88
    • Tim Gross's avatar
      csi: stub fingerprint on instance manager shutdown (#7388) · a280cf06
      Tim Gross authored
      Run the plugin fingerprint one last time with a closed client during
      instance manager shutdown. This will return quickly and will give us a
      correctly-populated `PluginInfo` marked as unhealthy so the Nomad
      client can update the server about plugin health.
      a280cf06
    • Tim Gross's avatar
      csi: add Provider field to CSI CLIs and APIs (#7285) · d6c9952d
      Tim Gross authored
      Derive a provider name and version for plugins (and the volumes that
      use them) from the CSI identity API `GetPluginInfo`. Expose the vendor
      name as `Provider` in the API and CLI commands.
      d6c9952d
    • Danielle Lancashire's avatar
      csi: VolumeCapabilities for ControllerPublishVolume · 20ec9a21
      Danielle Lancashire authored
      This commit introduces support for providing VolumeCapabilities during
      requests to `ControllerPublishVolumes` as this is a required field.
      20ec9a21