2022-03-18 15:39:46 +00:00
|
|
|
name: Core CI Tests
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches-ignore:
|
|
|
|
- main
|
|
|
|
- release-**
|
|
|
|
paths-ignore:
|
|
|
|
- 'README.md'
|
|
|
|
- 'CHANGELOG.md'
|
2022-04-01 14:49:40 +00:00
|
|
|
- '.changelog/**'
|
|
|
|
- '.tours/**'
|
|
|
|
- 'contributing/**'
|
|
|
|
- 'demo/**'
|
|
|
|
- 'dev/**'
|
|
|
|
- 'e2e/terraform/**'
|
2022-09-16 14:58:06 +00:00
|
|
|
- 'e2e/ui/**'
|
2022-04-01 14:49:40 +00:00
|
|
|
- 'integrations/**'
|
|
|
|
- 'pkg/**'
|
|
|
|
- 'scripts/**'
|
|
|
|
- 'terraform/**'
|
|
|
|
- 'ui/**'
|
|
|
|
- 'website/**'
|
2022-03-18 15:39:46 +00:00
|
|
|
env:
|
2022-03-24 19:58:43 +00:00
|
|
|
VERBOSE: 1
|
2022-09-22 14:40:01 +00:00
|
|
|
GO_VERSION: 1.19.1
|
2022-03-18 15:39:46 +00:00
|
|
|
GOBIN: /usr/local/bin
|
|
|
|
GOTESTARCH: amd64
|
|
|
|
CONSUL_VERSION: 1.11.3
|
|
|
|
VAULT_VERSION: 1.9.3
|
|
|
|
NOMAD_SLOW_TEST: 0
|
2022-03-24 20:08:03 +00:00
|
|
|
NOMAD_TEST_LOG_LEVEL: OFF
|
2022-03-18 15:39:46 +00:00
|
|
|
jobs:
|
2022-10-21 22:38:45 +00:00
|
|
|
mods:
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
timeout-minutes: 10
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: magnetikonline/action-golang-cache@v1
|
|
|
|
with:
|
|
|
|
go-version: ${{env.GO_VERSION}}
|
2022-10-24 13:49:01 +00:00
|
|
|
cache-key-suffix: -core
|
2022-10-21 22:38:45 +00:00
|
|
|
- name: Pre-cache Go modules
|
|
|
|
run: |
|
|
|
|
make tidy
|
|
|
|
make bootstrap
|
2022-03-18 15:39:46 +00:00
|
|
|
checks:
|
2022-10-21 22:38:45 +00:00
|
|
|
needs: [mods]
|
2022-05-05 17:56:52 +00:00
|
|
|
runs-on: ubuntu-22.04
|
2022-03-18 15:39:46 +00:00
|
|
|
timeout-minutes: 10
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0 # needs tags for checkproto
|
|
|
|
- uses: magnetikonline/action-golang-cache@v1
|
|
|
|
with:
|
|
|
|
go-version: ${{env.GO_VERSION}}
|
2022-10-21 22:38:45 +00:00
|
|
|
cache-key-suffix: -core
|
2022-03-18 15:39:46 +00:00
|
|
|
- name: Run make check
|
|
|
|
run: |
|
2022-03-19 21:29:32 +00:00
|
|
|
make missing
|
2022-03-18 15:39:46 +00:00
|
|
|
make bootstrap
|
|
|
|
make check
|
|
|
|
compile:
|
2022-10-21 22:38:45 +00:00
|
|
|
needs: [mods]
|
2022-03-18 15:39:46 +00:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2022-05-05 17:56:52 +00:00
|
|
|
os: [ubuntu-22.04, macos-11, windows-2019]
|
2022-03-18 15:39:46 +00:00
|
|
|
runs-on: ${{matrix.os}}
|
|
|
|
timeout-minutes: 20
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: magnetikonline/action-golang-cache@v1
|
|
|
|
with:
|
|
|
|
go-version: ${{env.GO_VERSION}}
|
2022-10-21 22:38:45 +00:00
|
|
|
cache-key-suffix: -core
|
2022-03-18 15:39:46 +00:00
|
|
|
- name: Run make dev
|
|
|
|
env:
|
|
|
|
GOBIN: ${{env.GOROOT}}/bin # windows kludge
|
|
|
|
run: |
|
|
|
|
make bootstrap
|
|
|
|
make dev
|
|
|
|
tests-api:
|
2022-10-21 22:38:45 +00:00
|
|
|
needs: [mods]
|
2022-05-05 17:56:52 +00:00
|
|
|
runs-on: ubuntu-22.04
|
2022-03-18 15:39:46 +00:00
|
|
|
timeout-minutes: 30
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: magnetikonline/action-golang-cache@v1
|
|
|
|
with:
|
|
|
|
go-version: ${{env.GO_VERSION}}
|
2022-10-21 22:38:45 +00:00
|
|
|
cache-key-suffix: -core
|
2022-03-18 15:39:46 +00:00
|
|
|
- name: Run API tests
|
|
|
|
env:
|
|
|
|
GOTEST_MOD: api
|
|
|
|
run: |
|
|
|
|
make bootstrap
|
|
|
|
make generate-all
|
2022-03-29 00:33:01 +00:00
|
|
|
sudo sed -i 's!Defaults!#Defaults!g' /etc/sudoers
|
|
|
|
sudo -E env "PATH=$PATH" make test-nomad-module
|
2022-03-18 15:39:46 +00:00
|
|
|
tests-pkgs:
|
2022-10-21 22:38:45 +00:00
|
|
|
needs: [mods]
|
2022-05-05 17:56:52 +00:00
|
|
|
runs-on: ubuntu-22.04
|
2022-03-18 15:39:46 +00:00
|
|
|
timeout-minutes: 30
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
pkg:
|
2022-03-19 21:29:32 +00:00
|
|
|
- acl/...
|
2022-03-18 15:39:46 +00:00
|
|
|
- client
|
2022-03-19 21:29:32 +00:00
|
|
|
- client/allocdir/...
|
|
|
|
- client/allochealth/...
|
|
|
|
- client/allocrunner/...
|
|
|
|
- client/allocwatcher/...
|
|
|
|
- client/config/...
|
|
|
|
- client/consul/...
|
|
|
|
- client/devicemanager/...
|
|
|
|
- client/dynamicplugins/...
|
|
|
|
- client/fingerprint/...
|
|
|
|
- client/interfaces/...
|
client: enable support for cgroups v2
This PR introduces support for using Nomad on systems with cgroups v2 [1]
enabled as the cgroups controller mounted on /sys/fs/cgroups. Newer Linux
distros like Ubuntu 21.10 are shipping with cgroups v2 only, causing problems
for Nomad users.
Nomad mostly "just works" with cgroups v2 due to the indirection via libcontainer,
but not so for managing cpuset cgroups. Before, Nomad has been making use of
a feature in v1 where a PID could be a member of more than one cgroup. In v2
this is no longer possible, and so the logic around computing cpuset values
must be modified. When Nomad detects v2, it manages cpuset values in-process,
rather than making use of cgroup heirarchy inheritence via shared/reserved
parents.
Nomad will only activate the v2 logic when it detects cgroups2 is mounted at
/sys/fs/cgroups. This means on systems running in hybrid mode with cgroups2
mounted at /sys/fs/cgroups/unified (as is typical) Nomad will continue to
use the v1 logic, and should operate as before. Systems that do not support
cgroups v2 are also not affected.
When v2 is activated, Nomad will create a parent called nomad.slice (unless
otherwise configured in Client conifg), and create cgroups for tasks using
naming convention <allocID>-<task>.scope. These follow the naming convention
set by systemd and also used by Docker when cgroups v2 is detected.
Client nodes now export a new fingerprint attribute, unique.cgroups.version
which will be set to 'v1' or 'v2' to indicate the cgroups regime in use by
Nomad.
The new cpuset management strategy fixes #11705, where docker tasks that
spawned processes on startup would "leak". In cgroups v2, the PIDs are
started in the cgroup they will always live in, and thus the cause of
the leak is eliminated.
[1] https://www.kernel.org/doc/html/latest/admin-guide/cgroup-v2.html
Closes #11289
Fixes #11705 #11773 #11933
2022-02-28 22:24:01 +00:00
|
|
|
- client/lib/...
|
2022-03-19 21:29:32 +00:00
|
|
|
- client/logmon/...
|
|
|
|
- client/pluginmanager/...
|
|
|
|
- client/servers/...
|
|
|
|
- client/serviceregistration/...
|
|
|
|
- client/state/...
|
|
|
|
- client/stats/...
|
|
|
|
- client/structs/...
|
|
|
|
- client/taskenv/...
|
2022-03-18 15:39:46 +00:00
|
|
|
- command
|
2022-03-19 21:29:32 +00:00
|
|
|
- command/agent/...
|
|
|
|
- command/raft_tools/...
|
|
|
|
- drivers/docker/...
|
|
|
|
- drivers/exec/...
|
|
|
|
- drivers/java/...
|
|
|
|
- drivers/mock/...
|
|
|
|
- drivers/rawexec/...
|
|
|
|
- drivers/shared/...
|
|
|
|
- drivers/qemu/...
|
2022-03-18 15:39:46 +00:00
|
|
|
- helper/...
|
|
|
|
- internal/...
|
|
|
|
- jobspec/...
|
|
|
|
- lib/...
|
|
|
|
- nomad
|
2022-03-19 21:29:32 +00:00
|
|
|
- nomad/deploymentwatcher/...
|
|
|
|
- nomad/drainer/...
|
|
|
|
- nomad/state/...
|
|
|
|
- nomad/stream/...
|
|
|
|
- nomad/structs/...
|
|
|
|
- nomad/volumewatcher/...
|
2022-03-18 15:39:46 +00:00
|
|
|
- plugins/...
|
|
|
|
- scheduler/...
|
2022-03-19 21:29:32 +00:00
|
|
|
- testutil/...
|
2022-03-18 15:39:46 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: magnetikonline/action-golang-cache@v1
|
|
|
|
with:
|
|
|
|
go-version: ${{env.GO_VERSION}}
|
2022-10-21 22:38:45 +00:00
|
|
|
cache-key-suffix: -core
|
2022-03-18 15:39:46 +00:00
|
|
|
- name: Run Matrix Tests
|
|
|
|
env:
|
|
|
|
GOTEST_PKGS: ./${{matrix.pkg}}
|
|
|
|
run: |
|
|
|
|
make bootstrap
|
|
|
|
make generate-all
|
2022-10-04 12:22:30 +00:00
|
|
|
sudo hc-install install -version ${{env.VAULT_VERSION}} -path /usr/local/bin vault
|
|
|
|
sudo hc-install install -version ${{env.CONSUL_VERSION}} -path /usr/local/bin consul
|
2022-03-18 15:39:46 +00:00
|
|
|
sudo sed -i 's!Defaults!#Defaults!g' /etc/sudoers
|
|
|
|
sudo -E env "PATH=$PATH" make test-nomad
|