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. 19 Apr, 2022 2 commits
  2. 14 Apr, 2022 3 commits
  3. 08 Mar, 2022 1 commit
  4. 10 Feb, 2022 7 commits
    • Nomad Release Bot's avatar
      Release v1.1.12 · 8469293a
      Nomad Release Bot authored
      8469293a
    • Nomad Release bot's avatar
      Generate files for 1.1.12 release · 207f0b00
      Nomad Release bot authored
      207f0b00
    • Luiz Aoqui's avatar
      docs: add 1.1.12 to changelog · c5479d30
      Luiz Aoqui authored
      c5479d30
    • Tim Gross's avatar
      scheduler: prevent panic in spread iterator during alloc stop · 9565ce3f
      Tim Gross authored
      The spread iterator can panic when processing an evaluation, resulting
      in an unrecoverable state in the cluster. Whenever a panicked server
      restarts and quorum is restored, the next server to dequeue the
      evaluation will panic.
      
      To trigger this state:
      * The job must have `max_parallel = 0` and a `canary >= 1`.
      * The job must not have a `spread` block.
      * The job must have a previous version.
      * The previous version must have a `spread` block and at least one
        failed allocation.
      
      In this scenario, the desired changes include `(place 1+) (stop
      1+), (ignore n) (canary 1)`. Before the scheduler can place the canary
      allocation, it tries to find out which allocations can be
      stopped. This passes back through the stack so that we can determine
      previous-node penalties, etc. We call `SetJob` on the stack with the
      previous version of the job, which will include assessing the `spread`
      block (even though the results are unused). The task group spread info
      state from that pass through the spread iterator is not reset when we
      call `SetJob` again. When the new job version iterates over the
      `groupPropertySets`, it will get an empty `spreadAttributeMap`,
      resulting in an unexpected nil pointer dereference.
      
      This changeset resets the spread iterator internal state when setting
      the job, logging with a bypass around the bug in case we hit similar
      cases, and a test that panics the scheduler without the patch.
      9565ce3f
    • Luiz Aoqui's avatar
      api: prevent excessice CPU load on job parse · 820c8e4f
      Luiz Aoqui authored
      Add new namespace ACL requirement for the /v1/jobs/parse endpoint and
      return early if HCLv2 parsing fails.
      
      The endpoint now requires the new `parse-job` ACL capability or
      `submit-job`.
      820c8e4f
    • Seth Hoenig's avatar
      client: check escaping of alloc dir using symlinks · fcb3a5d0
      Seth Hoenig authored
      This PR adds symlink resolution when doing validation of paths
      to ensure they do not escape client allocation directories.
      fcb3a5d0
    • Seth Hoenig's avatar
      client: fix race condition in use of go-getter · 1064431c
      Seth Hoenig authored
      go-getter creates a circular dependency between a Client and Getter,
      which means each is inherently thread-unsafe if you try to re-use
      on or the other.
      
      This PR fixes Nomad to no longer make use of the default Getter objects
      provided by the go-getter package. Nomad must create a new Client object
      on every artifact download, as the Client object controls the Src and Dst
      among other things. When Caling Client.Get, the Getter modifies its own
      Client reference, creating the circular reference and race condition.
      
      We can still achieve most of the desired connection caching behavior by
      re-using a shared HTTP client with transport pooling enabled.
      1064431c
  5. 31 Jan, 2022 4 commits
  6. 28 Jan, 2022 10 commits
    • Tim Gross's avatar
      docs: add 1.1.11 to changelog · e860d073
      Tim Gross authored
      e860d073
    • Tim Gross's avatar
      96c5c628
    • Tim Gross's avatar
      docs: missing changelog for #11892 (#11959) · 5c6aeebb
      Tim Gross authored
      5c6aeebb
    • Tim Gross's avatar
      CSI: node unmount from the client before unpublish RPC (#11892) · c2b850b1
      Tim Gross authored
      When an allocation stops, the `csi_hook` makes an unpublish RPC to the
      servers to unpublish via the CSI RPCs: first to the node plugins and
      then the controller plugins. The controller RPCs must happen after the
      node RPCs so that the node has had a chance to unmount the volume
      before the controller tries to detach the associated device.
      
      But the client has local access to the node plugins and can
      independently determine if it's safe to send unpublish RPC to those
      plugins. This will allow the server to treat the node plugin as
      abandoned if a client is disconnected and `stop_on_client_disconnect`
      is set. This will let the server try to send unpublish RPCs to the
      controller plugins, under the assumption that the client will be
      trying to unmount the volume on its end first.
      
      Note that the CSI `NodeUnpublishVolume`/`NodeUnstageVolume` RPCs can 
      return ignorable errors in the case where the volume has already been
      unmounted from the node. Handle all other errors by retrying until we
      get success so as to give operators the opportunity to reschedule a
      failed node plugin (ex. in the case where they accidentally drained a
      node without `-ignore-system`). Fan-out the work for each volume into
      its own goroutine so that we can release a subset of volumes if only
      one is stuck.
      c2b850b1
    • Tim Gross's avatar
      CSI: tests to exercise csi_hook (#11788) · 8af384a9
      Tim Gross authored
      Small refactoring of the allocrunner hook for CSI to make it more
      testable, and a unit test that covers most of its logic.
      8af384a9
    • Tim Gross's avatar
      CSI: move terminal alloc handling into denormalization (#11931) · 2c6de3e8
      Tim Gross authored
      * The volume claim GC method and volumewatcher both have logic
      collecting terminal allocations that duplicates most of the logic
      that's now in the state store's `CSIVolumeDenormalize` method. Copy
      this logic into the state store so that all code paths have the same
      view of the past claims.
      * Remove logic in the volume claim GC that now lives in the state
      store's `CSIVolumeDenormalize` method.
      * Remove logic in the volumewatcher that now lives in the state
      store's `CSIVolumeDenormalize` method.
      * Remove logic in the node unpublish RPC that now lives in the state
      store's `CSIVolumeDenormalize` method.
      2c6de3e8
    • Tim Gross's avatar
      csi: ensure that PastClaims are populated with correct mode (#11932) · 26b50083
      Tim Gross authored
      In the client's `(*csiHook) Postrun()` method, we make an unpublish
      RPC that includes a claim in the `CSIVolumeClaimStateUnpublishing`
      state and using the mode from the client. But then in the
      `(*CSIVolume) Unpublish` RPC handler, we query the volume from the
      state store (because we only get an ID from the client). And when we
      make the client RPC for the node unpublish step, we use the _current
      volume's_ view of the mode. If the volume's mode has been changed
      before the old allocations can have their claims released, then we end
      up making a CSI RPC that will never succeed.
      
      Why does this code path get the mode from the volume and not the
      claim? Because the claim written by the GC job in `(*CoreScheduler)
      csiVolumeClaimGC` doesn't have a mode. Instead it just writes a claim
      in the unpublishing state to ensure the volumewatcher detects a "past
      claim" change and reaps all the claims on the volumes.
      
      Fix this by ensuring that the `CSIVolumeDenormalize` creates past
      claims for all nil allocations with a correct access mode set.
      26b50083
    • Tim Gross's avatar
      CSI: resolve invalid claim states (#11890) · 6e0119de
      Tim Gross authored
      * csi: resolve invalid claim states on read
      
      It's currently possible for CSI volumes to be claimed by allocations
      that no longer exist. This changeset asserts a reasonable state at
      the state store level by registering these nil allocations as "past
      claims" on any read. This will cause any pass through the periodic GC
      or volumewatcher to trigger the unpublishing workflow for those claims.
      
      * csi: make feasibility check errors more understandable
      
      When the feasibility checker finds we have no free write claims, it
      checks to see if any of those claims are for the job we're currently
      scheduling (so that earlier versions of a job can't block claims for
      new versions) and reports a conflict if the volume can't be scheduled
      so that the user can fix their claims. But when the checker hits a
      claim that has a GCd allocation, the state is recoverable by the
      server once claim reaping completes and no user intervention is
      required; the blocked eval should complete. Differentiate the
      scheduler error produced by these two conditions.
      6e0119de
    • Tim Gross's avatar
      csi: update leader's ACL in volumewatcher (#11891) · 41c2daf4
      Tim Gross authored
      The volumewatcher that runs on the leader needs to make RPC calls
      rather than writing to raft (as we do in the deploymentwatcher)
      because the unpublish workflow needs to make RPC calls to the
      clients. This requires that the volumewatcher has access to the
      leader's ACL token.
      
      But when leadership transitions, the new leader creates a new leader
      ACL token. This ACL token needs to be passed into the volumewatcher
      when we enable it, otherwise the volumewatcher can find itself with a
      stale token.
      41c2daf4
    • Tim Gross's avatar
      csi: reap unused volume claims at leadership transitions (#11776) · ad8166de
      Tim Gross authored
      When `volumewatcher.Watcher` starts on the leader, it starts a watch
      on every volume and triggers a reap of unused claims on any change to
      that volume. But if a reaping is in-flight during leadership
      transitions, it will fail and the event that triggered the reap will
      be dropped. Perform one reap of unused claims at the start of the
      watcher so that leadership transitions don't drop this event.
      ad8166de
  7. 26 Jan, 2022 1 commit
  8. 21 Jan, 2022 1 commit
  9. 19 Jan, 2022 2 commits
  10. 18 Jan, 2022 9 commits