diff --git a/.changelog/24415.txt b/.changelog/24415.txt deleted file mode 100644 index 2d158f8581c..00000000000 --- a/.changelog/24415.txt +++ /dev/null @@ -1,3 +0,0 @@ -```release-note:bug -client: fixed a bug where AMD CPUs were not correctly fingerprinting base speed -``` diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md deleted file mode 100644 index 6f45b095e98..00000000000 --- a/.github/pull_request_template.md +++ /dev/null @@ -1,35 +0,0 @@ -### Description - - -### Testing & Reproduction steps - - -### Links - - -### Contributor Checklist -- [ ] **Changelog Entry** If this PR changes user-facing behavior, please generate and add a - changelog entry using the `make cl` command. -- [ ] **Testing** Please add tests to cover any new functionality or to demonstrate bug fixes and - ensure regressions will be caught. -- [ ] **Documentation** If the change impacts user-facing functionality such as the CLI, API, UI, - and job configuration, please update the Nomad website documentation to reflect this. Refer to - the [website README](../website/README.md) for docs guidelines. Please also consider whether the - change requires notes within the [upgrade guide](../website/content/docs/upgrade/upgrade-specific.mdx). - -### Reviewer Checklist -- [ ] **Backport Labels** Please add the correct backport labels as described by the internal - backporting document. -- [ ] **Commit Type** Ensure the correct merge method is selected which should be "squash and merge" - in the majority of situations. The main exceptions are long-lived feature branches or merges where - history should be preserved. -- [ ] **Enterprise PRs** If this is an enterprise only PR, please add any required changelog entry - within the public repository. diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fc64826b838..e2da17aca4f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -90,7 +90,7 @@ jobs: with: ref: ${{ github.event.inputs.build-ref }} - name: Setup go - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 + uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 with: go-version: ${{ needs.get-go-version.outputs.go-version }} @@ -98,7 +98,7 @@ jobs: run: make deps - name: Setup node and yarn - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 + uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 with: node-version: "18" cache-dependency-path: "ui/yarn.lock" @@ -142,7 +142,7 @@ jobs: with: ref: ${{ github.event.inputs.build-ref }} - name: Setup go - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 + uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 with: go-version: ${{ needs.get-go-version.outputs.go-version }} @@ -150,7 +150,7 @@ jobs: run: make deps - name: Setup node and yarn - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 + uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 with: node-version: "18" cache-dependency-path: "ui/yarn.lock" @@ -265,7 +265,7 @@ jobs: run: git config --global url.'https://${{ env.ELEVATED_GITHUB_TOKEN }}@github.com'.insteadOf 'https://github.com' - name: Setup go - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 + uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 with: go-version: ${{ needs.get-go-version.outputs.go-version }} @@ -273,7 +273,7 @@ jobs: run: make deps - name: Setup node and yarn - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 + uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 with: node-version: "18" cache-dependency-path: "ui/yarn.lock" @@ -356,7 +356,7 @@ jobs: goos: [linux] goarch: [amd64] steps: - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 + - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 with: go-version: ${{needs.get-go-version.outputs.go-version}} - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index edfc984c173..ccb948ce35c 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -41,9 +41,9 @@ jobs: - name: Git config token if: endsWith(github.repository, '-enterprise') run: git config --global url.'https://${{ env.ELEVATED_GITHUB_TOKEN }}@github.com'.insteadOf 'https://github.com' - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 + - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 with: - cache: ${{ contains(runner.name, 'Github Actions') }} + cache: true go-version-file: .go-version cache-dependency-path: '**/go.sum' - name: Run make check diff --git a/.github/workflows/ember-test-audit.yml b/.github/workflows/ember-test-audit.yml index ce1fa0ff546..6c1dce0a8c4 100644 --- a/.github/workflows/ember-test-audit.yml +++ b/.github/workflows/ember-test-audit.yml @@ -20,7 +20,7 @@ jobs: ref: ${{ github.event.pull_request.base.sha }} - uses: nanasess/setup-chromedriver@42cc2998329f041de87dc3cfa33a930eacd57eaa # v2.2.2 - name: Use Node.js - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 + uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 with: node-version: '18' - run: yarn --frozen-lockfile @@ -37,7 +37,7 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - uses: nanasess/setup-chromedriver@42cc2998329f041de87dc3cfa33a930eacd57eaa # v2.2.2 - name: Use Node.js - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 + uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 with: node-version: '18' - run: yarn --frozen-lockfile diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 435986e6678..cab2b6062de 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -82,12 +82,12 @@ jobs: echo "go-version=$(cat .go-version)" >> "$GITHUB_OUTPUT" - name: Setup go - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 + uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 with: go-version: ${{ steps.get-go-version.outputs.go-version }} - name: Setup node and yarn - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 + uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 with: node-version: "18" cache-dependency-path: "ui/yarn.lock" diff --git a/.github/workflows/security-scan.yml b/.github/workflows/security-scan.yml index a458be15f76..0b32e1e0601 100644 --- a/.github/workflows/security-scan.yml +++ b/.github/workflows/security-scan.yml @@ -37,7 +37,7 @@ jobs: steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 + - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 with: cache: ${{ contains(runner.name, 'Github Actions') }} go-version-file: .go-version diff --git a/.github/workflows/test-core.yaml b/.github/workflows/test-core.yaml index 9b006697d10..56972391358 100644 --- a/.github/workflows/test-core.yaml +++ b/.github/workflows/test-core.yaml @@ -59,7 +59,7 @@ jobs: timeout-minutes: 20 steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 + - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 with: cache: ${{ contains(runner.name, 'Github Actions') }} go-version-file: .go-version @@ -74,7 +74,7 @@ jobs: timeout-minutes: 8 steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 + - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 with: cache: true go-version-file: .go-version @@ -102,7 +102,7 @@ jobs: - quick steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 + - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 with: cache: ${{ contains(runner.name, 'Github Actions') }} go-version-file: .go-version diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index 10a5dbc195d..ab08c3047b3 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -53,7 +53,7 @@ jobs: - name: Git config token if: endsWith(github.repository, '-enterprise') run: git config --global url.'https://${{ env.ELEVATED_GITHUB_TOKEN }}@github.com'.insteadOf 'https://github.com' - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 + - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 with: cache: ${{ contains(runner.name, 'Github Actions') }} go-version-file: .go-version @@ -70,7 +70,7 @@ jobs: - name: Git config token if: endsWith(github.repository, '-enterprise') run: git config --global url.'https://${{ secrets.ELEVATED_GITHUB_TOKEN }}@github.com'.insteadOf 'https://github.com' - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 + - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 with: cache: ${{ contains(runner.name, 'Github Actions') }} go-version-file: .go-version diff --git a/.github/workflows/test-ui.yml b/.github/workflows/test-ui.yml index 5478460877c..f52096c47ab 100644 --- a/.github/workflows/test-ui.yml +++ b/.github/workflows/test-ui.yml @@ -2,14 +2,14 @@ name: test-ui on: pull_request: paths: - - "ui/**" + - 'ui/**' push: branches: - main - release/** - test-ui paths: - - "ui/**" + - 'ui/**' jobs: pre-test: @@ -36,6 +36,7 @@ jobs: - pre-test runs-on: ${{ endsWith(github.repository, '-enterprise') && fromJSON('["self-hosted", "ondemand", "linux", "type=m7a.2xlarge;m6a.2xlarge"]') || 'ubuntu-latest' }} timeout-minutes: 30 + continue-on-error: true defaults: run: working-directory: ui @@ -43,8 +44,6 @@ jobs: matrix: partition: [1, 2, 3, 4] split: [4] - # Note: If we ever change the number of partitions, we'll need to update the - # finalize.combine step to match steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - uses: ./.github/actions/setup-js @@ -64,19 +63,8 @@ jobs: env: PERCY_TOKEN: ${{ env.PERCY_TOKEN || secrets.PERCY_TOKEN }} PERCY_PARALLEL_NONCE: ${{ needs.pre-test.outputs.nonce }} - run: | - yarn exam:parallel --split=${{ matrix.split }} --partition=${{ matrix.partition }} --json-report=test-results/test-results.json - continue-on-error: true - - name: Express timeout failure - if: ${{ failure() }} - run: exit 1 - - name: Upload partition test results - if: github.event_name == 'push' && github.ref == 'refs/heads/main' - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 - with: - name: test-results-${{ matrix.partition }} - path: ui/test-results/test-results.json - retention-days: 90 + run: yarn exam:parallel --split=${{ matrix.split }} --partition=${{ matrix.partition }} + finalize: needs: - pre-test @@ -100,24 +88,6 @@ jobs: jwtGithubAudience: ${{ vars.CI_VAULT_AUD }} secrets: |- kv/data/teams/nomad/ui PERCY_TOKEN ; - - name: Download all test results - if: github.event_name == 'push' && github.ref == 'refs/heads/main' - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - pattern: test-results-* - path: test-results - - - name: Combine test results for comparison - if: github.event_name == 'push' && github.ref == 'refs/heads/main' - run: node ../scripts/combine-ui-test-results.js - - name: Upload combined results for comparison - if: github.event_name == 'push' && github.ref == 'refs/heads/main' - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 - with: - name: test-results-${{ github.sha }} - path: ui/combined-test-results.json - retention-days: 90 - - name: finalize env: PERCY_TOKEN: ${{ env.PERCY_TOKEN || secrets.PERCY_TOKEN }} diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 39dc4d93007..7d908185f65 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -52,7 +52,7 @@ jobs: - run: git config --global core.autocrlf false - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Setup go - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 + uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 with: go-version-file: ".go-version" - name: Show installed Go version diff --git a/CHANGELOG.md b/CHANGELOG.md index 3806cbb6e13..5c04911b4e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -94,18 +94,6 @@ BUG FIXES: * template: Fixed a panic on client restart when using change_mode=script [[GH-24057](https://github.com/hashicorp/nomad/issues/24057)] * ui: Fixes an issue where variables paths would not let namespaced users write variables unless they also had wildcard namespace variable write permissions [[GH-24073](https://github.com/hashicorp/nomad/issues/24073)] -## 1.8.7 Enterprise (November 8, 2024) - -SECURITY: - -* csi: Fixed a bug where a user with csi-write-volume permissions to one namespace can create volumes in another namespace (CVE-2024-10975) [[GH-24396](https://github.com/hashicorp/nomad/issues/24396)] - -BUG FIXES: - -* connect: add validation to ensure that connect native services specify a port [[GH-24329](https://github.com/hashicorp/nomad/issues/24329)] -* keyring: Fixed a panic on server startup when decrypting AEAD key data with empty RSA block [[GH-24383](https://github.com/hashicorp/nomad/issues/24383)] -* scheduler: fixed a bug where resource calculation did not account correctly for poststart tasks [[GH-24297](https://github.com/hashicorp/nomad/issues/24297)] - ## 1.8.6 Enterprise(October 21, 2024) IMPROVEMENTS: @@ -245,7 +233,7 @@ BUG FIXES: * server: Fixed a bug where expiring heartbeats for garbage collected nodes could panic the server [[GH-23383](https://github.com/hashicorp/nomad/issues/23383)] * template: Fix template rendering on Windows [[GH-23432](https://github.com/hashicorp/nomad/issues/23432)] * ui: Actions run from jobs with explicit name properties now work from the web UI [[GH-23553](https://github.com/hashicorp/nomad/issues/23553)] -* ui: Don't show keyboard nav hints when taking a screenshot [[GH-23365](https://github.com/hashicorp/nomad/issues/23365)] +* ui: Dont show keyboard nav hints when taking a screenshot [[GH-23365](https://github.com/hashicorp/nomad/issues/23365)] * ui: Fix an issue where a remotely purged job would prevent redirect from taking place in the web UI [[GH-23492](https://github.com/hashicorp/nomad/issues/23492)] * ui: Fix an issue where access to Job Templates in the UI was restricted to variable.write access [[GH-23458](https://github.com/hashicorp/nomad/issues/23458)] * ui: Fix the Upload Jobspec button on the Run Job page [[GH-23548](https://github.com/hashicorp/nomad/issues/23548)] @@ -342,18 +330,6 @@ BUG FIXES: * ui: Show the namespace in the web UI exec command hint [[GH-20218](https://github.com/hashicorp/nomad/issues/20218)] * windows: Fixed a regression where scanning task processes was inefficient [[GH-20619](https://github.com/hashicorp/nomad/issues/20619)] -## 1.7.15 (November 8, 2024) - -SECURITY: - -* csi: Fixed a bug where a user with csi-write-volume permissions to one namespace can create volumes in another namespace (CVE-2024-10975) [[GH-24396](https://github.com/hashicorp/nomad/issues/24396)] - -BUG FIXES: - -* connect: add validation to ensure that connect native services specify a port [[GH-24329](https://github.com/hashicorp/nomad/issues/24329)] -* deps: Fixed a bug where restarting Nomad could cause an unrelated process with the same PID as a failed executor to be killed [[GH-24265](https://github.com/hashicorp/nomad/issues/24265)] -* scheduler: fixed a bug where resource calculation did not account correctly for poststart tasks [[GH-24297](https://github.com/hashicorp/nomad/issues/24297)] - ## 1.7.14 Enterprise (October 21, 2024) IMPROVEMENTS: @@ -645,7 +621,7 @@ IMPROVEMENTS: * audit (Enterprise): Added ACL token role links to audit log auth objects [[GH-19415](https://github.com/hashicorp/nomad/issues/19415)] * ui: Added a new example template with Task Actions [[GH-19153](https://github.com/hashicorp/nomad/issues/19153)] -* ui: Don't allow new jobspec download until template is populated, and remove group count from jobs index [[GH-19377](https://github.com/hashicorp/nomad/issues/19377)] +* ui: dont allow new jobspec download until template is populated, and remove group count from jobs index [[GH-19377](https://github.com/hashicorp/nomad/issues/19377)] * ui: make the exec window look nicer on mobile screens [[GH-19332](https://github.com/hashicorp/nomad/issues/19332)] BUG FIXES: @@ -720,7 +696,7 @@ IMPROVEMENTS: * ui: for system and sysbatch jobs, now show client name on hover in job panel [[GH-19051](https://github.com/hashicorp/nomad/issues/19051)] * ui: nicer comment styles in UI example jobs [[GH-19037](https://github.com/hashicorp/nomad/issues/19037)] * ui: show plan output warnings alongside placement failures and dry-run info when running a job through the web ui [[GH-19225](https://github.com/hashicorp/nomad/issues/19225)] -* ui: simplify presentation of task event times (10m2.230948s becomes 10m2s etc.) [[GH-18595](https://github.com/hashicorp/nomad/issues/18595)] +* ui: simplify presentation of task event times (10m2.230948s bceomes 10m2s etc.) [[GH-18595](https://github.com/hashicorp/nomad/issues/18595)] * vars: Added a locking feature for Nomad Variables [[GH-18520](https://github.com/hashicorp/nomad/issues/18520)] DEPRECATIONS: diff --git a/CODEOWNERS b/CODEOWNERS index 1c47e5409da..73cfb9f9e0d 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -2,15 +2,3 @@ /.release/ @hashicorp/github-nomad-core @hashicorp/nomad-eng /.github/workflows/build.yml @hashicorp/github-nomad-core @hashicorp/nomad-eng - -# codeowner default -* @hashicorp/github-nomad-core @hashicorp/nomad-eng - -# web presence - -/website/ @hashicorp/web-presence @hashicorp/github-nomad-core @hashicorp/nomad-eng - -# education - -/website/content/ @hashicorp/nomad-docs @hashicorp/web-presence @hashicorp/github-nomad-core @hashicorp/nomad-eng -/website/public/ @hashicorp/nomad-docs @hashicorp/web-presence @hashicorp/github-nomad-core @hashicorp/nomad-eng diff --git a/client/allocrunner/networking_iptables_test.go b/client/allocrunner/networking_iptables_test.go index fc9d4ce3fb5..c7751892cb9 100644 --- a/client/allocrunner/networking_iptables_test.go +++ b/client/allocrunner/networking_iptables_test.go @@ -1,8 +1,6 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: BUSL-1.1 -//go:build linux - package allocrunner import ( diff --git a/client/allocrunner/taskrunner/sids_hook_test.go b/client/allocrunner/taskrunner/sids_hook_test.go index 35d0b88294c..0df13f3cb5d 100644 --- a/client/allocrunner/taskrunner/sids_hook_test.go +++ b/client/allocrunner/taskrunner/sids_hook_test.go @@ -1,8 +1,8 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: BUSL-1.1 -//go:build linux -// +build linux +//go:build !windows +// +build !windows // todo(shoenig): Once Connect is supported on Windows, we'll need to make this // set of tests work there too. diff --git a/client/allocrunner/taskrunner/task_runner_test.go b/client/allocrunner/taskrunner/task_runner_test.go index 073014bcda5..ee29756519b 100644 --- a/client/allocrunner/taskrunner/task_runner_test.go +++ b/client/allocrunner/taskrunner/task_runner_test.go @@ -1,8 +1,6 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: BUSL-1.1 -//go:build linux - package taskrunner import ( diff --git a/client/lib/numalib/detect_linux.go b/client/lib/numalib/detect_linux.go index aacb0bc6c31..1c697127953 100644 --- a/client/lib/numalib/detect_linux.go +++ b/client/lib/numalib/detect_linux.go @@ -30,18 +30,16 @@ func PlatformScanners() []SystemScanner { } const ( - sysRoot = "/sys/devices/system" - nodeOnline = sysRoot + "/node/online" - cpuOnline = sysRoot + "/cpu/online" - distanceFile = sysRoot + "/node/node%d/distance" - cpulistFile = sysRoot + "/node/node%d/cpulist" - cpuDriverFile = sysRoot + "/cpu/cpu%d/cpufreq/scaling_driver" - cpuMaxFile = sysRoot + "/cpu/cpu%d/cpufreq/cpuinfo_max_freq" - cpuCpccNominalFile = sysRoot + "/cpu/cpu%d/acpi_cppc/nominal_freq" - cpuIntelBaseFile = sysRoot + "/cpu/cpu%d/cpufreq/base_frequency" - cpuSocketFile = sysRoot + "/cpu/cpu%d/topology/physical_package_id" - cpuSiblingFile = sysRoot + "/cpu/cpu%d/topology/thread_siblings_list" - deviceFiles = "/sys/bus/pci/devices" + sysRoot = "/sys/devices/system" + nodeOnline = sysRoot + "/node/online" + cpuOnline = sysRoot + "/cpu/online" + distanceFile = sysRoot + "/node/node%d/distance" + cpulistFile = sysRoot + "/node/node%d/cpulist" + cpuMaxFile = sysRoot + "/cpu/cpu%d/cpufreq/cpuinfo_max_freq" + cpuBaseFile = sysRoot + "/cpu/cpu%d/cpufreq/base_frequency" + cpuSocketFile = sysRoot + "/cpu/cpu%d/topology/physical_package_id" + cpuSiblingFile = sysRoot + "/cpu/cpu%d/topology/thread_siblings_list" + deviceFiles = "/sys/bus/pci/devices" ) // pathReaderFn is a path reader function, injected into all value getters to @@ -133,8 +131,8 @@ func (*Sysfs) discoverCores(st *Topology, readerFunc pathReaderFn) { st.nodeIDs = idset.From[hw.NodeID]([]hw.NodeID{0}) const node = 0 const socket = 0 - - base, cpuMax := discoverCoreSpeeds(core, readerFunc) + cpuMax, _ := getNumeric[hw.KHz](cpuMaxFile, 64, readerFunc, core) + base, _ := getNumeric[hw.KHz](cpuBaseFile, 64, readerFunc, core) st.insert(node, socket, core, Performance, cpuMax, base) st.Nodes = st.nodeIDs.Slice() return nil @@ -151,8 +149,9 @@ func (*Sysfs) discoverCores(st *Topology, readerFunc pathReaderFn) { _ = cores.ForEach(func(core hw.CoreID) error { // best effort, zero values are defaults socket, _ := getNumeric[hw.SocketID](cpuSocketFile, 8, readerFunc, core) + cpuMax, _ := getNumeric[hw.KHz](cpuMaxFile, 64, readerFunc, core) + base, _ := getNumeric[hw.KHz](cpuBaseFile, 64, readerFunc, core) siblings, _ := getIDSet[hw.CoreID](cpuSiblingFile, readerFunc, core) - base, cpuMax := discoverCoreSpeeds(core, readerFunc) // if we get an incorrect core number, this means we're not getting the right // data from SysFS. In this case we bail and set default values. @@ -168,28 +167,6 @@ func (*Sysfs) discoverCores(st *Topology, readerFunc pathReaderFn) { } } -func discoverCoreSpeeds(core hw.CoreID, readerFunc pathReaderFn) (hw.KHz, hw.KHz) { - baseSpeed := hw.KHz(0) - maxSpeed := hw.KHz(0) - - driver, _ := getString(cpuDriverFile, readerFunc, core) - - switch driver { - case "acpi-cpufreq": - // Indicates the highest sustained performance level of the processor - baseSpeedMHz, _ := getNumeric[hw.MHz](cpuCpccNominalFile, 64, readerFunc, core) - baseSpeed = baseSpeedMHz.KHz() - default: - // COMPAT(1.9.x): while the `base_frequency` file is specific to the `intel_pstate` scaling driver, we should - // preserve the default while we may uncover more scaling driver specific implementations. - baseSpeed, _ = getNumeric[hw.KHz](cpuIntelBaseFile, 64, readerFunc, core) - } - - maxSpeed, _ = getNumeric[hw.KHz](cpuMaxFile, 64, readerFunc, core) - - return baseSpeed, maxSpeed -} - func getIDSet[T idset.ID](path string, readerFunc pathReaderFn, args ...any) (*idset.Set[T], error) { path = fmt.Sprintf(path, args...) s, err := readerFunc(path) diff --git a/client/lib/numalib/detect_linux_test.go b/client/lib/numalib/detect_linux_test.go index ceffd02c5c2..e253cacb622 100644 --- a/client/lib/numalib/detect_linux_test.go +++ b/client/lib/numalib/detect_linux_test.go @@ -68,37 +68,6 @@ func goodSysData(path string) ([]byte, error) { }[path], nil } -func goodSysDataAMD(path string) ([]byte, error) { - return map[string][]byte{ - "/sys/devices/system/node/online": []byte("0-1"), - "/sys/devices/system/cpu/online": []byte("0-3"), - "/sys/devices/system/node/node0/distance": []byte("10"), - "/sys/devices/system/node/node0/cpulist": []byte("0-3"), - "/sys/devices/system/node/node1/distance": []byte("10"), - "/sys/devices/system/node/node1/cpulist": []byte("0-3"), - "/sys/devices/system/cpu/cpu0/acpi_cppc/nominal_freq": []byte("2450"), - "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq": []byte("3500000"), - "/sys/devices/system/cpu/cpu0/cpufreq/scaling_driver": []byte("acpi-cpufreq"), - "/sys/devices/system/cpu/cpu0/topology/physical_package_id": []byte("0"), - "/sys/devices/system/cpu/cpu0/topology/thread_siblings_list": []byte("0,2"), - "/sys/devices/system/cpu/cpu1/acpi_cppc/nominal_freq": []byte("2450"), - "/sys/devices/system/cpu/cpu1/cpufreq/cpuinfo_max_freq": []byte("3500000"), - "/sys/devices/system/cpu/cpu1/cpufreq/scaling_driver": []byte("acpi-cpufreq"), - "/sys/devices/system/cpu/cpu1/topology/physical_package_id": []byte("0"), - "/sys/devices/system/cpu/cpu1/topology/thread_siblings_list": []byte("1,3"), - "/sys/devices/system/cpu/cpu2/acpi_cppc/nominal_freq": []byte("2450"), - "/sys/devices/system/cpu/cpu2/cpufreq/cpuinfo_max_freq": []byte("3500000"), - "/sys/devices/system/cpu/cpu2/cpufreq/scaling_driver": []byte("acpi-cpufreq"), - "/sys/devices/system/cpu/cpu2/topology/physical_package_id": []byte("0"), - "/sys/devices/system/cpu/cpu2/topology/thread_siblings_list": []byte("0,2"), - "/sys/devices/system/cpu/cpu3/acpi_cppc/nominal_freq": []byte("2450"), - "/sys/devices/system/cpu/cpu3/cpufreq/cpuinfo_max_freq": []byte("3500000"), - "/sys/devices/system/cpu/cpu3/cpufreq/scaling_driver": []byte("acpi-cpufreq"), - "/sys/devices/system/cpu/cpu3/topology/physical_package_id": []byte("0"), - "/sys/devices/system/cpu/cpu3/topology/thread_siblings_list": []byte("1,3"), - }[path], nil -} - func TestSysfs_discoverOnline(t *testing.T) { st := MockTopology(&idset.Set[hw.NodeID]{}, SLIT{}, []Core{}) goodIDSet := idset.From[hw.NodeID]([]uint8{0, 1}) @@ -226,44 +195,6 @@ func TestSysfs_discoverCores(t *testing.T) { }, }, }}, - {"two nodes and good sys AMD data", twoNodes, goodSysDataAMD, &Topology{ - nodeIDs: twoNodes, - Nodes: twoNodes.Slice(), - Cores: []Core{ - { - SocketID: 1, - NodeID: 0, - ID: 0, - Grade: Performance, - BaseSpeed: 2450, - MaxSpeed: 3500, - }, - { - SocketID: 1, - NodeID: 0, - ID: 1, - Grade: Performance, - BaseSpeed: 2450, - MaxSpeed: 3500, - }, - { - SocketID: 1, - NodeID: 0, - ID: 2, - Grade: Performance, - BaseSpeed: 2450, - MaxSpeed: 3500, - }, - { - SocketID: 1, - NodeID: 0, - ID: 3, - Grade: Performance, - BaseSpeed: 2450, - MaxSpeed: 3500, - }, - }, - }}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/client/lib/numalib/hw/speeds.go b/client/lib/numalib/hw/speeds.go index c3b1a029253..23bd010a86c 100644 --- a/client/lib/numalib/hw/speeds.go +++ b/client/lib/numalib/hw/speeds.go @@ -16,10 +16,6 @@ func (khz KHz) MHz() MHz { return MHz(khz / 1000) } -func (mhz MHz) KHz() KHz { - return KHz(mhz * 1000) -} - func (khz KHz) String() string { return strconv.FormatUint(uint64(khz.MHz()), 10) } diff --git a/dev/hooks/pre-push b/dev/hooks/pre-push index 2a62a40f335..0f6cc35f4be 100755 --- a/dev/hooks/pre-push +++ b/dev/hooks/pre-push @@ -31,7 +31,6 @@ if [ -f version/version_ent.go ]; then fi # do not push directly to main, stable-*, release/* -# do not push Enterprise tags # ==================== while read local_ref local_sha remote_ref remote_sha do @@ -46,13 +45,5 @@ do if echo "$remote_ref"|grep -q 'refs/heads/release/.*'; then fail "refusing to push directly to a branch prefixed \`release/\`" fi - - if echo "$remote_ref" | grep -q 'refs/tags/v.*\+ent'; then - fail "refusing to push Nomad Enterprise tag" - fi - - if echo "$remote_ref" | grep -q 'refs/tags/v.*\+pro'; then - fail "refusing to push Nomad Enterprise (pro) tag" - fi - done + diff --git a/drivers/shared/executor/executor_test.go b/drivers/shared/executor/executor_test.go index 6c21a9a9a9f..a0e17e66696 100644 --- a/drivers/shared/executor/executor_test.go +++ b/drivers/shared/executor/executor_test.go @@ -1,7 +1,7 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 -//go:build linux +//go:build !windows package executor diff --git a/e2e/allocexec/docker_exec_test.go b/e2e/allocexec/docker_exec_test.go index 17c165af4ba..2956d700d81 100644 --- a/e2e/allocexec/docker_exec_test.go +++ b/e2e/allocexec/docker_exec_test.go @@ -7,7 +7,6 @@ import ( "archive/tar" "bytes" "context" - "fmt" "strings" "testing" "time" @@ -28,14 +27,13 @@ func TestDockerAllocExec(t *testing.T) { } func testDockerExecStdin(t *testing.T) { - sub, cleanup := jobs3.Submit(t, "./input/sleepytar.hcl") + _, cleanup := jobs3.Submit(t, "./input/sleepytar.hcl") t.Cleanup(cleanup) client, err := nomadapi.NewClient(nomadapi.DefaultConfig()) must.NoError(t, err) - filter := fmt.Sprintf("JobID == \"%s\"", sub.JobID()) - allocations, _, err := client.Allocations().List(&nomadapi.QueryOptions{Filter: filter}) + allocations, _, err := client.Allocations().List(nil) must.NoError(t, err) must.SliceLen(t, 1, allocations) @@ -87,7 +85,7 @@ func testDockerExecStdin(t *testing.T) { nil, nil, ) - must.NoError(t, err, must.Sprintf("error executing command inside the container: %v", err)) + must.NoError(t, err) must.Zero(t, exitCode) // check the output of tar diff --git a/e2e/terraform/README.md b/e2e/terraform/README.md index a5785654557..b7d77a22bde 100644 --- a/e2e/terraform/README.md +++ b/e2e/terraform/README.md @@ -55,26 +55,18 @@ client_count_ubuntu_jammy_amd64 = "4" client_count_windows_2016_amd64 = "1" ``` -You will also need a Consul Enterprise license file and a Nomad Enterprise license file. +You will also need a Consul Enterprise license file. Optionally, edit the `nomad_local_binary` variable in the `terraform.tfvars` file to change the path to the local binary of -Nomad you'd like to upload, but keep in mind it has to match the OS and the CPU architecture of the nodes (amd64 linux). +Nomad you'd like to upload. Run Terraform apply to deploy the infrastructure: ```sh cd e2e/terraform/ terraform init -terraform apply -var="consul_license=$(cat full_path_to_consul.hclic)" -var="nomad_license=$(cat full_path_to_nomad.hclic)" -``` - -Alternative you can also run `make apply_full` from the terraform directory: - -``` -export NOMAD_LICENSE_PATH=./nomad.hclic -export CONSUL_LICENSE_PATH=./consul.hclic -make apply_full +terraform apply ``` > Note: You will likely see "Connection refused" or "Permission denied" errors diff --git a/e2e/terraform/terraform.tfvars b/e2e/terraform/terraform.tfvars index cb270665a80..324bb7c7ce3 100644 --- a/e2e/terraform/terraform.tfvars +++ b/e2e/terraform/terraform.tfvars @@ -3,8 +3,13 @@ # this default tfvars file expects that you have built nomad # with `make dev` or similar (../../ = this repository root) -# before running `terraform apply` and created the /pkg/goos_goarch/binary -# folder +# before running `terraform apply` nomad_local_binary = "../../pkg/linux_amd64/nomad" -nomad_local_binary_client_windows_2016_amd64 = ["../../pkg/windows_amd64/nomad.exe"] \ No newline at end of file +nomad_local_binary_client_windows_2016_amd64 = ["../../pkg/windows_amd64/nomad.exe"] + +# The Consul server is Consul Enterprise, so provide a license via --var: +# consul_license = + +# For testing Nomad enterprise, also set via --var: +# nomad_license = diff --git a/e2e/ui/run.sh b/e2e/ui/run.sh index a2f5980cef1..a976393c786 100755 --- a/e2e/ui/run.sh +++ b/e2e/ui/run.sh @@ -33,7 +33,7 @@ EOF } -IMAGE="mcr.microsoft.com/playwright:v1.49.0-jammy" +IMAGE="mcr.microsoft.com/playwright:v1.48.0-noble" pushd $(dirname "${BASH_SOURCE[0]}") > /dev/null run_tests() { diff --git a/go.mod b/go.mod index 6f30a68750e..c28df35fbf9 100644 --- a/go.mod +++ b/go.mod @@ -93,7 +93,7 @@ require ( github.com/kr/pretty v0.3.1 github.com/kr/text v0.2.0 github.com/mattn/go-colorable v0.1.13 - github.com/miekg/dns v1.1.62 + github.com/miekg/dns v1.1.56 github.com/mitchellh/cli v1.1.5 github.com/mitchellh/colorstring v0.0.0-20150917214807-8631ce90f286 github.com/mitchellh/copystructure v1.2.0 diff --git a/go.sum b/go.sum index 217932a76fa..daa17343966 100644 --- a/go.sum +++ b/go.sum @@ -861,8 +861,8 @@ github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRC github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= -github.com/miekg/dns v1.1.62 h1:cN8OuEF1/x5Rq6Np+h1epln8OiyPWV+lROx9LxcGgIQ= -github.com/miekg/dns v1.1.62/go.mod h1:mvDlcItzm+br7MToIKqkglaGhlFMHJ9DTNNWONWXbNQ= +github.com/miekg/dns v1.1.56 h1:5imZaSeoRNvpM9SzWNhEcP9QliKiz20/dA2QabIGVnE= +github.com/miekg/dns v1.1.56/go.mod h1:cRm6Oo2C8TY9ZS/TqsSrseAcncm74lfK5G+ikN2SWWY= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/cli v1.1.5 h1:OxRIeJXpAMztws/XHlN2vu6imG5Dpq+j61AzAX5fLng= github.com/mitchellh/cli v1.1.5/go.mod h1:v8+iFts2sPIKUV1ltktPXMCC8fumSKFItNcD2cLtRR4= diff --git a/nomad/periodic_test.go b/nomad/periodic_test.go index 62a9dd68291..1718c434ca9 100644 --- a/nomad/periodic_test.go +++ b/nomad/periodic_test.go @@ -19,7 +19,6 @@ import ( "github.com/hashicorp/nomad/nomad/mock" "github.com/hashicorp/nomad/nomad/structs" "github.com/hashicorp/nomad/testutil" - "github.com/shoenig/test/must" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -89,13 +88,6 @@ func (m *MockJobEvalDispatcher) dispatchedJobs(parent *structs.Job) []*structs.J return jobs } -func (m *MockJobEvalDispatcher) hasJob(id structs.NamespacedID) bool { - m.lock.Lock() - defer m.lock.Unlock() - _, ok := m.Jobs[id] - return ok -} - type times []time.Time func (t times) Len() int { return len(t) } @@ -270,32 +262,39 @@ func TestPeriodicDispatch_Add_TriggersUpdate(t *testing.T) { job := testPeriodicJob(time.Now().Add(10 * time.Second)) // Add it. - must.NoError(t, p.Add(job)) + if err := p.Add(job); err != nil { + t.Fatalf("Add failed %v", err) + } // Update it to be sooner and re-add. expected := time.Now().Round(1 * time.Second).Add(1 * time.Second) - job = job.Copy() job.Periodic.Spec = fmt.Sprintf("%d", expected.Unix()) - must.NoError(t, p.Add(job)) + if err := p.Add(job); err != nil { + t.Fatalf("Add failed %v", err) + } // Check that nothing is created. tuple := structs.NamespacedID{ ID: job.ID, Namespace: job.Namespace, } - must.False(t, m.hasJob(tuple), - must.Sprint("periodic dispatcher created eval too early")) + if _, ok := m.Jobs[tuple]; ok { + t.Fatalf("periodic dispatcher created eval at the wrong time") + } time.Sleep(2 * time.Second) // Check that job was launched correctly. times, err := m.LaunchTimes(p, job.Namespace, job.ID) - must.NoError(t, err, - must.Sprint("failed to get launch times for job")) - must.Len(t, 1, times, - must.Sprint("incorrect number of launch times for job")) - must.Eq(t, expected, times[0], - must.Sprint("periodic dispatcher created eval for wrong time")) + if err != nil { + t.Fatalf("failed to get launch times for job %q", job.ID) + } + if len(times) != 1 { + t.Fatalf("incorrect number of launch times for job %q", job.ID) + } + if times[0] != expected { + t.Fatalf("periodic dispatcher created eval for time %v; want %v", times[0], expected) + } } func TestPeriodicDispatch_Remove_Untracked(t *testing.T) { diff --git a/nomad/structs/acl.go b/nomad/structs/acl.go index eed00046fa8..b60c1c2f1aa 100644 --- a/nomad/structs/acl.go +++ b/nomad/structs/acl.go @@ -474,16 +474,6 @@ func (a *ACLToken) UnmarshalJSON(data []byte) (err error) { return nil } -func (a *ACLToken) Sanitize() *ACLToken { - if a == nil { - return nil - } - - out := a.Copy() - out.SecretID = "" - return out -} - // ACLRole is an abstraction for the ACL system which allows the grouping of // ACL policies into a single object. ACL tokens can be created and linked to // a role; the token then inherits all the permissions granted by the policies. diff --git a/nomad/structs/config/workload_id.go b/nomad/structs/config/workload_id.go index 5a3f92dbee2..872acd81ef9 100644 --- a/nomad/structs/config/workload_id.go +++ b/nomad/structs/config/workload_id.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/nomad/helper/pointer" ) -// WorkloadIdentityConfig is the agent configuration block used to define +// WorkloadIdentityConfig is the agent configuraion block used to define // default workload identities. // // This based on the WorkloadIdentity struct from nomad/structs/workload_id.go diff --git a/nomad/structs/event.go b/nomad/structs/event.go index 466421d38a5..1eca62046f9 100644 --- a/nomad/structs/event.go +++ b/nomad/structs/event.go @@ -155,7 +155,8 @@ type ServiceRegistrationStreamEvent struct { // NewACLTokenEvent takes a token and creates a new ACLTokenEvent. It creates // a copy of the passed in ACLToken and empties out the copied tokens SecretID func NewACLTokenEvent(token *ACLToken) *ACLTokenEvent { - c := token.Sanitize() + c := token.Copy() + c.SecretID = "" return &ACLTokenEvent{ ACLToken: c, diff --git a/scripts/combine-ui-test-results.js b/scripts/combine-ui-test-results.js deleted file mode 100644 index 8d78f423cce..00000000000 --- a/scripts/combine-ui-test-results.js +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env node -/** - * Copyright (c) HashiCorp, Inc. - * SPDX-License-Identifier: BUSL-1.1 - */ - -'use strict'; -const fs = require('fs'); - -const NUM_PARTITIONS = 4; - -function combineResults() { - const results = []; - let duration = 0; - let aggregateSummary = { total: 0, passed: 0, failed: 0 }; - - for (let i = 1; i <= NUM_PARTITIONS; i++) { - try { - const data = JSON.parse( - fs.readFileSync(`../test-results/test-results-${i}/test-results.json`).toString() - ); - results.push(...data.tests); - duration += data.duration; - aggregateSummary.total += data.summary.total; - aggregateSummary.passed += data.summary.passed; - aggregateSummary.failed += data.summary.failed; - } catch (err) { - console.error(`Error reading partition ${i}:`, err); - } - } - - const output = { - timestamp: new Date().toISOString(), - sha: process.env.GITHUB_SHA, - summary: { - total: aggregateSummary.total, - passed: aggregateSummary.passed, - failed: aggregateSummary.failed - }, - duration, - tests: results - }; - - fs.writeFileSync('../ui/combined-test-results.json', JSON.stringify(output, null, 2)); -} - -if (require.main === module) { - combineResults(); -} - -module.exports = combineResults; diff --git a/ui/app/index.html b/ui/app/index.html index df5eb739390..9d49fe8a579 100644 --- a/ui/app/index.html +++ b/ui/app/index.html @@ -24,7 +24,6 @@ {{content-for "body"}} - {{content-for "body-footer"}} diff --git a/ui/test-reporter.js b/ui/test-reporter.js deleted file mode 100644 index ddad7268714..00000000000 --- a/ui/test-reporter.js +++ /dev/null @@ -1,159 +0,0 @@ -/** - * Copyright (c) HashiCorp, Inc. - * SPDX-License-Identifier: BUSL-1.1 - */ - -/* eslint-env node */ -/* eslint-disable no-console */ - -const fs = require('fs'); -const path = require('path'); - -class JsonReporter { - constructor(out, socket, config) { - this.out = out || process.stdout; - this.results = []; - - // Get output file from Testem config, which is set by the --json-report=path argument - this.outputFile = config?.fileOptions?.custom_report_file; - this.generateReport = !!this.outputFile; - - if (this.generateReport) { - console.log( - `[Reporter] Initializing with output file: ${this.outputFile}` - ); - - try { - fs.mkdirSync(path.dirname(this.outputFile), { recursive: true }); - - // Initialize the results file - fs.writeFileSync( - this.outputFile, - JSON.stringify( - { - summary: { total: 0, passed: 0, failed: 0 }, - timestamp: new Date().toISOString(), - tests: [], - }, - null, - 2 - ) - ); - console.log('[Reporter] Initialized results file'); - } catch (err) { - console.error('[Reporter] Error initializing results file:', err); - } - } else { - console.log('[Reporter] No report file configured, skipping JSON output'); - } - - process.on('SIGINT', () => { - console.log('[Reporter] Received SIGINT, finishing up...'); - this.finish(); - process.exit(0); - }); - - this.testCounter = 0; - this.startTime = Date.now(); - } - - filterLogs(logs) { - return logs.filter((log) => { - // Filter out token-related logs - if ( - log.text && - (log.text.includes('Accessor:') || - log.text.includes('log in with a JWT') || - log.text === 'TOKENS:' || - log.text === '=====================================') - ) { - return false; - } - - // Keep non-warning logs that aren't token-related - return log.type !== 'warn'; - }); - } - - report(prefix, data) { - if (!data || !data.name) { - console.log(`[Reporter] Skipping invalid test result: ${data.name}`); - return; - } - - this.testCounter++; - console.log(`[Reporter] Test #${this.testCounter}: ${data.name}`); - - const partitionMatch = data.name.match(/^Exam Partition (\d+) - (.*)/); - - const result = { - name: partitionMatch ? partitionMatch[2] : data.name.trim(), - partition: partitionMatch ? parseInt(partitionMatch[1], 10) : null, - browser: prefix, - passed: !data.failed, - duration: data.runDuration, - error: data.failed ? data.error : null, - logs: this.filterLogs(data.logs || []), - }; - - if (result.passed) { - console.log('- [PASS]'); - } else { - console.log('- [FAIL]'); - console.log('- Error:', result.error); - console.log('- Logs:', result.logs); - } - - this.results.push(result); - } - - writeCurrentResults() { - console.log('[Reporter] Writing current results...'); - try { - const passed = this.results.filter((r) => r.passed).length; - const failed = this.results.filter((r) => !r.passed).length; - const total = this.results.length; - const duration = Date.now() - this.startTime; - - const output = { - summary: { total, passed, failed }, - timestamp: new Date().toISOString(), - duration, - tests: this.results, - }; - - if (this.generateReport) { - fs.writeFileSync(this.outputFile, JSON.stringify(output, null, 2)); - } - - // Print a summary - console.log('\n[Reporter] Test Summary:'); - console.log(`- Total: ${total}`); - console.log(`- Passed: ${passed}`); - console.log(`- Failed: ${failed}`); - console.log(`- Duration: ${duration}ms`); - if (failed > 0) { - console.log('\n[Reporter] Failed Tests:'); - this.results - .filter((r) => !r.passed) - .forEach((r) => { - console.log(`❌ ${r.name}`); - if (r.error) { - console.error(r.error); - } - }); - } - - console.log('[Reporter] Successfully wrote results'); - } catch (err) { - console.error('[Reporter] Error writing results:', err); - } - } - finish() { - console.log('[Reporter] Finishing up...'); - this.writeCurrentResults(); - console.log('[Reporter] Done.'); - } -} - -module.exports = JsonReporter; diff --git a/ui/testem.js b/ui/testem.js index c937a5760fe..7d1869af9ef 100644 --- a/ui/testem.js +++ b/ui/testem.js @@ -3,24 +3,7 @@ * SPDX-License-Identifier: BUSL-1.1 */ -// @ts-check - 'use strict'; -const JsonReporter = require('./test-reporter'); - -/** - * Get the path for the test results file based on the command line arguments - * @returns {string} The path to the test results file - */ -const getReportPath = () => { - const jsonReportArg = process.argv.find((arg) => - arg.startsWith('--json-report=') - ); - if (jsonReportArg) { - return jsonReportArg.split('=')[1]; - } - return null; -}; const config = { test_page: 'tests/index.html?hidepassed', @@ -30,12 +13,6 @@ const config = { browser_start_timeout: 120, parallel: -1, framework: 'qunit', - reporter: JsonReporter, - custom_report_file: getReportPath(), - // NOTE: we output this property as custom_report_file instead of report_file. - // See https://github.com/testem/testem/issues/1073, report_file + custom reporter results in double output. - debug: true, - browser_args: { // New format in testem/master, but not in a release yet // Chrome: { diff --git a/website/content/docs/concepts/security.mdx b/website/content/docs/concepts/security.mdx index fdb707f1b1b..ac5f52ade99 100644 --- a/website/content/docs/concepts/security.mdx +++ b/website/content/docs/concepts/security.mdx @@ -9,7 +9,7 @@ description: >- authentication. --- -# Security Model +## Overview Nomad is a flexible workload orchestrator to deploy and manage any containerized or legacy application using a single, unified workflow. It can run diverse diff --git a/website/content/docs/enterprise/sentinel.mdx b/website/content/docs/enterprise/sentinel.mdx index 2ae87fe0cd9..30fcf3c5e18 100644 --- a/website/content/docs/enterprise/sentinel.mdx +++ b/website/content/docs/enterprise/sentinel.mdx @@ -5,7 +5,7 @@ description: >- Learn about Nomad Sentinel Policy Objects --- -# Sentinel +## Sentinel In Nomad Enterprise, operators can create Sentinel policies for fine-grained policy enforcement. Sentinel policies build on top of the ACL system and allow diff --git a/website/content/docs/job-specification/ui.mdx b/website/content/docs/job-specification/ui.mdx index b2fe276b662..c9792168b2d 100644 --- a/website/content/docs/job-specification/ui.mdx +++ b/website/content/docs/job-specification/ui.mdx @@ -46,5 +46,3 @@ job "docs" { # ... } ``` - -![Job UI links and description rendered in the Web UI](/img/nomad-ui-block.png) diff --git a/website/package-lock.json b/website/package-lock.json index 009d9319695..d15f7e408aa 100644 --- a/website/package-lock.json +++ b/website/package-lock.json @@ -13,7 +13,7 @@ "dart-linkcheck": "^2.0.15", "husky": "^9.0.7", "next": "14.0.4", - "prettier": "^3.4.1" + "prettier": "^3.2.4" }, "engines": { "node": ">=18.x <=20.x", @@ -9806,9 +9806,9 @@ } }, "node_modules/prettier": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.1.tgz", - "integrity": "sha512-G+YdqtITVZmOJje6QkXQWzl3fSfMxFwm1tjTyo9exhkmWSqC4Yhd1+lug++IlR2mvRVAxEDDWYkQdeSztajqgg==", + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.4.tgz", + "integrity": "sha512-FWu1oLHKCrtpO1ypU6J0SbK2d9Ckwysq6bHj/uaCP26DxrPpppCLQRGVuqAxSTvhF00AcvDRyYrLNW7ocBhFFQ==", "dev": true, "bin": { "prettier": "bin/prettier.cjs" diff --git a/website/package.json b/website/package.json index dd77a403e0e..099e57a32f4 100644 --- a/website/package.json +++ b/website/package.json @@ -13,7 +13,7 @@ "dart-linkcheck": "^2.0.15", "husky": "^9.0.7", "next": "14.0.4", - "prettier": "^3.4.1" + "prettier": "^3.2.4" }, "scripts": { "build": "./scripts/website-build.sh", diff --git a/website/public/img/nomad-ui-block.png b/website/public/img/nomad-ui-block.png deleted file mode 100644 index f69a2169399..00000000000 Binary files a/website/public/img/nomad-ui-block.png and /dev/null differ