Commit Graph

129 Commits

Author SHA1 Message Date
Seth Hoenig
0bcfd9a266 build: apt update before apt install (#23806) 2024-08-14 08:58:15 -05:00
Piotr Kazmierczak
7772711c89 plugins: fix nomadTopologyToProto panic on systems that don't support NUMA (#23399)
After changes introduced in #23284 we no longer need to make a if
!st.SupportsNUMA() check in the GetNodes() topology method. In fact this check
will now cause panic in nomadTopologyToProto method on systems that don't
support NUMA.
2024-07-09 08:41:52 +02:00
Charlie Voiselle
9bdaab4f9c [actions] Update projects GitHub actions (#23483)
* Updated actions

* actions/checkout v4.1.1 ==> v4.1.7
* actions/download-artifact v3.0.2 ==> v4.1.7
* actions/setup-go v4.0.1 ==> v5.0.1
* actions/setup-node v3.7.0 ==> v4.0.2
* actions/upload-artifact v3.1.2 ==> v4.3.3
* andstor/file-existence-action v2.0.0 ==> v3.0.0
* browser-actions/setup-chrome v1.2.0 ==> v1.7.1
* dessant/lock-threads v4.0.1 ==> v5.0.1
* marocchino/sticky-pull-request-comment v2.6.2 ==> v2.9.0
* mshick/add-pr-comment v2.8.1 ==> v2.8.2
* nanasess/setup-chromedriver v2.1.2 ==> v2.2.2
* slackapi/slack-github-action v1.24.0 ==> v1.26.0

* Update HashiCorp actions

* hashicorp/actions-docker-build v1 ==> v2.0.0
* hashicorp/actions-generate-metadata v1.1.1 ==> v1.1.1(pinned)
* hashicorp/actions-packaging-linux v1 ==> v1.8.0
* hashicorp/setup-copywrite v1.1.2 ==> v1.1.3

* fix parameter
2024-07-01 22:32:10 -04:00
Tim Gross
eedbd36fef qemu: pass task resources into driver for cgroup setup (#23466)
As part of the work for 1.7.0 we moved portions of the task cgroup setup down
into the executor. This requires that the executor constructor get the
`TaskConfig.Resources` struct, and this was missing from the `qemu` driver. We
fixed a panic caused by this change in #19089 before we shipped, but this fix
was effectively undo after we added plumbing for custom cgroups for `raw_exec`
in 1.8.0. As a result, running `qemu` tasks always fail on Linux.

This was undetected in testing because our CI environment doesn't have QEMU
installed. I've got all the unit tests running locally again and have added QEMU
installation when we're running the drivers tests.

Fixes: https://github.com/hashicorp/nomad/issues/23250
2024-07-01 11:41:10 -04:00
Piotr Kazmierczak
cc01c09f8b windows: remove winappcontainer and winexec helpers (#23448)
This removes helper winappcontainer and winexec helper code, since it is no longer needed after #23432
2024-06-28 18:49:56 +02:00
Matt McQuillan
9224da6bf1 change to sync on only the GitHub link 2024-06-26 10:33:56 -04:00
Matt McQuillan
7ccef279ef removing 'test' from sync name 2024-06-26 10:31:01 -04:00
James Rasell
54115a1b37 github: use larger instance type for prepare-release release step. (#23374) 2024-06-18 14:36:40 +01:00
Matt McQuillan
55edc0289a Update .github/workflows/jira-sync.yml
From linting, quoting the env var

Co-authored-by: Tim Gross <tgross@hashicorp.com>
2024-06-10 15:16:58 -04:00
Matt McQuillan
6af76c02d1 Adding GHA workflow to sync with Jira 2024-06-10 13:44:49 -04:00
Tim Gross
34f34440ac build: remove 32-bit ARM builds (#23189)
We no longer intend to release 32-bit builds for any platform. We'd previously
removed the builds for i386 on both Linux and Windows, but never got around to
removing the ARM builds. Add a note about this deprecation in the release notes
for 1.8.x.
2024-06-05 15:47:20 -04:00
claire labry
e9d6c39dba SMRE/BPA Onboarding LTS (#20595)
Configuration changes to use backport assistant with LTS support. These include:

* adding a manifest file for active releases
* adding configuration to send backport to ENT repo
2024-05-17 08:21:42 -04:00
Dianne Laguerta
cabdd7eddb migrate GHA workflows to using single runner labels (#20581) 2024-05-16 13:35:10 +01:00
Daniel Bennett
bd802e43d0 add LICENSE to release artifacts (#20345)
* add LICENSE(.txt) to zip that goes on releases.hashicorp.com
* add LICENSE(.txt) to linux packages and docker image
* add some more docker labels (including license)
2024-04-12 10:57:15 -05:00
Seth Hoenig
06a4fcb7d5 build: update the actions/checkout version (#20067) 2024-03-04 13:01:38 -06:00
Seth Hoenig
a66f7ba888 ci: update macos runners to macos-14 (apple silicon) (#20054) 2024-02-29 14:31:59 -06:00
Tim Gross
df86503349 template: sandbox template rendering
The Nomad client renders templates in the same privileged process used for most
other client operations. During internal testing, we discovered that a malicious
task can create a symlink that can cause template rendering to read and write to
arbitrary files outside the allocation sandbox. Because the Nomad agent can be
restarted without restarting tasks, we can't simply check that the path is safe
at the time we write without encountering a time-of-check/time-of-use race.

To protect Nomad client hosts from this attack, we'll now read and write
templates in a subprocess:

* On Linux/Unix, this subprocess is sandboxed via chroot to the allocation
  directory. This requires that Nomad is running as a privileged process. A
  non-root Nomad agent will warn that it cannot sandbox the template renderer.

* On Windows, this process is sandboxed via a Windows AppContainer which has
  been granted access to only to the allocation directory. This does not require
  special privileges on Windows. (Creating symlinks in the first place can be
  prevented by running workloads as non-Administrator or
  non-ContainerAdministrator users.)

Both sandboxes cause encountered symlinks to be evaluated in the context of the
sandbox, which will result in a "file not found" or "access denied" error,
depending on the platform. This change will also require an update to
Consul-Template to allow callers to inject a custom `ReaderFunc` and
`RenderFunc`.

This design is intended as a workaround to allow us to fix this bug without
creating backwards compatibility issues for running tasks. A future version of
Nomad may introduce a read-only mount specifically for templates and artifacts
so that tasks cannot write into the same location that the Nomad agent is.

Fixes: https://github.com/hashicorp/nomad/issues/19888
Fixes: CVE-2024-1329
2024-02-08 10:40:24 -05:00
Tim Gross
334c383eb6 template: run template tests on Windows where possible (#19856)
We don't run the whole suite of unit tests on all platforms to keep CI times
reasonable, so the only things we've been running on Windows are
platform-specific.

I'm working on some platform-specific `template` related work and having these
tests run on Windows will reduce the risk of regressions. Our Windows CI box
doesn't have Consul or Vault, so I've skipped those tests for the time being,
and can follow up with that later. There's also a test with assertions looking
for specific paths, and the results are different on Windows. I've skipped those
for the moment as well and will follow up under a separate PR.

Also swap `testify` for `shoenig/test`
2024-02-02 09:22:03 -05:00
Seth Hoenig
0c08f94c8e build: use setup-golang@v3 to handle auto caching (#19707)
* wip: try on branch

* build: use setup-golang@v3 to handle auto caching
2024-01-11 08:51:56 -06:00
Seth Hoenig
23e5ffbfd0 build: bump setup-golang action version to v2 (#19568) 2024-01-02 09:41:50 -06:00
Phil Renaud
12e43aa07f Re-add wildcard for test-ui path restrictions (#19085) 2023-11-14 11:28:53 -05:00
Phil Renaud
6cd706f460 Only run test-ui, and percy, in the event that a push/pr touches the ui directory (#19038) 2023-11-08 20:12:54 -05:00
Tim Gross
6c2d5a0fbb E2E: Consul compatibility matrix tests (#18799)
Set up a new test suite that exercises Nomad's compatibility with Consul. This
suite installs all currently supported versions of Consul, spins up a Consul
agent with appropriate configuration, and a Nomad agent running in dev
mode. Then it runs a Connect job against each pair.
2023-10-24 16:03:53 -04:00
modrake
51ffe4208e workaround and fixes for MPL and copywrite bot (#18775) 2023-10-17 08:02:13 +01:00
Phil Renaud
cf8dde0850 [ui] Color indicators for server/client status (#18318)
* Color the status cell for servers and nodes

* Testfix and changelog

* Leader indicator moved post-word

* Icon and badge treatment

* Capitalizing test checks

* HDS badges dont expose statusClass like we used to, so stop checking for it
2023-09-20 17:05:04 -04:00
James Rasell
96cc610b3c ci: migrate semgrep action from deprecated wrapper (#18324) 2023-08-25 15:24:23 +01:00
Luiz Aoqui
52f0bd4630 ci: update BPA (#18252) 2023-08-17 11:01:38 -04:00
Luiz Aoqui
6c34fbbc8c ci: remove backport automerge (#18247)
Backport assistant has been failing and generating wrong PRs and merges
sometimes. Removing the `-automerge` flag allows us to review and fix
backports before they are silently merged.

Examples of incorrect backporting:

https://github.com/hashicorp/nomad/pull/17925/files
950235df48

https://github.com/hashicorp/nomad/pull/18234/files
52e2ad7807
2023-08-17 10:47:15 -04:00
Seth Hoenig
6fca4fa715 test-e2e: no need to run vaultcomat tests as root (#18215)
6747ef8803 fixes the Nomad client to support using the raw_exec
driver while running as a non-root user. Remove the use of sudo
in the test-e2e workflow for running integration (vaultcompat)
tests.
2023-08-15 16:00:54 -05:00
Seth Hoenig
77e139ea25 build: use modtool to format go.mod file (#18195) 2023-08-15 07:26:46 -05:00
Sarah Thompson
fd1ae3427b update linux package license to BUSL-1.1 (#18192)
update copywrite.hcl to exclude MPL subdirs
2023-08-14 07:08:58 -05:00
Seth Hoenig
37dd4c4a69 e2e: modernize vaultcompat testing (#18179)
* e2e: modernize vaultcompat testing

* e2e: cr fixes for vaultcompat
2023-08-09 09:24:51 -05:00
Tim Gross
b17c0f7ff9 GHA pinning updates (#18093)
Trusted Supply Chain Component Registry (TSCCR) enforcement starts Monday and an
internal report shows our semgrep action is pinned to a version that's not
currently permitted. Update all the action versions to whatever's the new
hotness to maximum the time-to-live on these until we have automated pinning
setup.

Also version bumps our chromedriver action, which randomly broke upstream today.
2023-07-28 11:49:57 -04:00
James Rasell
74335b3bfe ci: add copywrite action to check file headers. (#17889) 2023-07-12 16:02:43 +01:00
Daniel Kimsey
995b936aca Smoke test binaries for EL7 compatiblity (#17706)
This adds a quick smoke test of our binaries to verify we haven't exceeeded the
maximum GLIBC (2.17) version during linking which would break our ability to
execute on EL7 machines.
2023-07-12 10:51:26 -04:00
Daniel Bennett
34105f1d43 ci: more self-hosted iops for checks workflow (#17852) 2023-07-10 10:21:04 -05:00
Daniel Bennett
243429be11 ci: pull secrets from Vault in nomad-enterprise (#17841) 2023-07-07 14:27:12 -05:00
Daniel Bennett
03b8a9add0 ci: windows tests on public runners (#17829)
currently our self-hosted windows runners lack `docker`,
so for now just revert to public runners.
2023-07-06 17:06:55 -05:00
Daniel Bennett
3d87b3d91f ci: clean GOCACHE before build (#17808)
this is basically to avoid Fear/Uncertainty/Doubt

the github action actions/setup-go
(and, with a different chache key, hashicorp/setup-golang)
caches both GOMODCACHE (go source files), which is good,
and GOCACHE (build outputs), which *might* be bad,
if the cache was built on an OS with an older glibc
than we want to support. from `go help cache`:
> [...] the build cache does not detect changes to
> C libraries imported with cgo.
2023-07-06 12:47:43 -05:00
Daniel Bennett
4738d305c5 ci: dynamic runs-on values for oss/ent (#17775)
so in enterprise we can use Vault for secrets,
without merge conflicts from oss->ent.

also:
* use hashicorp/setup-golang
* setup-js for self-hosted runners
  they don't come with yarn, nor chrome,
  and might not always match node version.
2023-07-06 12:41:17 -05:00
Sarah Thompson
9e5fc77689 Update the revision used by the docker build action. (#17755)
Update the revision used by the docker action. This should always reflect the commit that's being built as this may differ from the default <github.sha> that the workflow was invoked at.

Goes with https://github.com/hashicorp/actions-docker-build/pull/59 - and should not be merged until this PR is merged and a new version of the action is cut.
2023-06-29 09:19:54 -04:00
Tim Gross
81d3575def release: submit build workflow from the file on the release's own branch 2023-06-28 11:06:13 -04:00
Luiz Aoqui
b7c2d65a0e build: add Docker image (#17017)
Co-authored-by: Daniel Kimsey <90741+dekimsey@users.noreply.github.com>
2023-06-23 15:57:09 -04:00
Tim Gross
c3d81578f1 release pipeline: fix ref arguments in invoking workflow (#17684)
Although #17669 fixed the permissions of the release pipeline to push new
commits, there was still an error when invoking the `build` workflow.

The format of the reference was changed in #17103 such that we're sending the
git ref (a SHA) and not the "--ref" argument required by the GH actions workflow
API, which in this case is apparently specially defined as "The branch or tag
name which contains the version of the workflow file you'd like to run" and not
what git calls a "ref".

This changeset:
* Removes the third-party action entirely so that we're using GitHub's own
  tooling. This removes one more thing from the supply chain to pin and ensures a
  1:1 mapping of args to what's documented by GitHub.
* Removes the `--ref` argument entirely, which causes it to default to the
  current branch that the release workflow is running on (which is always what
  we want).
2023-06-22 15:33:19 -04:00
Luiz Aoqui
717e1567bb ci: set continue-on-error: true on test-ui (#17646)
Since the matrix exercises different test cases, it's better to allow
all partitions to completely run, even if one of them fails, so it's
easier to catch multiple test failures.
2023-06-22 11:31:49 -04:00
Tim Gross
b23fe72fb5 release pipeline: release workflow needs write permissions (#17669)
In #17103 we set read-only permissions on all the workflows. Unfortunately we
missed that the `release` workflow makes git commits and pushes them to the
repository, so it needs to have write permissions.
2023-06-22 10:40:45 -04:00
Phil Renaud
fe49f22247 Moves to the current LTS release of Node for our build and release workflows (#17639) 2023-06-21 15:17:24 -04:00
Michael Lange
6c53c1e3d7 Tag the GHA run for percy to use
Percy uses this to stitch parallel test runs back together into a single
report.
2023-06-20 15:38:05 -07:00
Michael Lange
d5767accce Simplify workflows
After renovating everything, it's evident that the ember-exam
sub-workflow can be inlined without any pesky duplication.
2023-06-20 15:05:17 -07:00
Michael Lange
167f5bdfb2 Pipe secrets through to exam job 2023-06-20 14:49:57 -07:00