Skip to content

Commit 6a203c3

Browse files
backport of commit 6de7523
1 parent a7ad560 commit 6a203c3

File tree

22 files changed

+76
-245
lines changed

22 files changed

+76
-245
lines changed

.changelog/25792.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

.github/workflows/backport.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
backport:
1212
if: github.event.pull_request.merged
1313
runs-on: ubuntu-22.04
14-
container: hashicorpdev/backport-assistant:v0.5.7
14+
container: hashicorpdev/backport-assistant:0.4.1
1515
steps:
1616
- name: Backport changes to stable-website
1717
run: |

.github/workflows/copywrite.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
name: Check Copywrite Headers
22

33
on:
4-
pull_request:
5-
push:
6-
branches:
7-
- 'main'
8-
- 'release/**'
4+
push: {}
95

106
jobs:
117
copywrite:

.github/workflows/jira-sync.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,16 @@ jobs:
3131
if: github.event.action == 'labeled' && github.event.label.name == 'hcc/jira'
3232
uses: tomhjp/gh-action-jira-create@3ed1789cad3521292e591a7cfa703215ec1348bf # v0.2.1
3333
with:
34-
project: NMD
34+
project: NET
3535
issuetype: "${{ steps.set-ticket-type.outputs.TYPE }}"
3636
summary: "${{ github.event.repository.name }} [${{ steps.set-ticket-type.outputs.TYPE }} #${{ github.event.issue.number }}]: ${{ github.event.issue.title }}"
3737
description: "${{ github.event.issue.body || github.event.pull_request.body }}\n\n_Created in GitHub by ${{ github.actor }}._"
38-
# customfield_10089 is "Issue Link"
39-
# customfield_10371 is "Source" (use JIRA API to retrieve)
40-
# customerfield_10091 is "Team (R&D)
41-
# customfield_10001 is Team (jira default teams?)
38+
# customfield_10089 is "Issue Link", customfield_10371 is "Source" (use JIRA API to retrieve), customerfield_10091 is "Team (R&D)
4239
extraFields: '{ "customfield_10089": "${{ github.event.issue.html_url || github.event.pull_request.html_url }}",
43-
"customfield_10001": "72e166fb-d26c-4a61-b0de-7a290d91708f",
40+
"customfield_10371": { "value": "GitHub" },
41+
"customfield_10091": ["NomadMinor"],
4442
"components": [{ "name": "nomad" }],
45-
"labels": ["community", "GitHub"] }'
43+
"labels": ["community"] }'
4644
env:
4745
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
4846
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}

.release/versions.hcl

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,14 @@
66

77
schema = 1
88
active_versions {
9-
version "1.10.x" {
10-
ce_active = true
11-
lts = true
12-
}
139
version "1.9.x" {
14-
ce_active = true # needed for docs
10+
ce_active = true
1511
}
1612
version "1.8.x" {
17-
ce_active = true # needed for docs
13+
ce_active = true
1814
lts = true
1915
}
16+
version "1.7.x" {
17+
ce_active = true
18+
}
2019
}

e2e/docker/docker_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ func runRegistry(t *testing.T) {
5353

5454
t.Logf("Setting up insecure private registry at %v", address)
5555

56-
// run the sed job to fix the auth.json file with the correct address and
57-
// make sure the registry is marked as insecure for docker, otherwise pulls
58-
// will fail.
56+
// run the sed job to fixup the auth.json file with correct address and make
57+
// sure the registry is marked as insecure for docker, otherwise pulls will
58+
// fail
5959
_, sedCleanup := jobs3.Submit(t,
6060
"../docker_registry/registry-auths.hcl",
6161
jobs3.Var("registry_address", address),
@@ -80,7 +80,7 @@ func runRegistry(t *testing.T) {
8080
}
8181

8282
func testRedis(t *testing.T) {
83-
job, cleanup := jobs3.Submit(t, "./input/redis.hcl", jobs3.Timeout(30*time.Second))
83+
job, cleanup := jobs3.Submit(t, "./input/redis.hcl")
8484
t.Cleanup(cleanup)
8585

8686
logs := job.TaskLogs("cache", "redis")

e2e/dynamic_host_volumes/dynamic_host_volumes_test.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import (
1414
"github.com/hashicorp/nomad/e2e/e2eutil"
1515
"github.com/hashicorp/nomad/e2e/v3/jobs3"
1616
"github.com/hashicorp/nomad/e2e/v3/volumes3"
17-
"github.com/shoenig/test"
1817
"github.com/shoenig/test/must"
1918
"github.com/shoenig/test/wait"
2019
)
@@ -61,11 +60,6 @@ func TestDynamicHostVolumes_RegisterWorkflow(t *testing.T) {
6160
must.NoError(t, err)
6261
t.Logf("[%v] ACL policy for job %q created", time.Since(start), submitted.JobID())
6362

64-
t.Cleanup(func() {
65-
_, err := nomad.ACLPolicies().Delete("register-volumes-policy", nil)
66-
test.NoError(t, err)
67-
})
68-
6963
must.NoError(t, e2eutil.Dispatch(submitted.JobID(),
7064
map[string]string{
7165
"vol_name": "registered-volume",

e2e/exec2/exec2_test.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,15 @@ func testCountdash(t *testing.T) {
8181
}
8282

8383
func testHTTP(t *testing.T) {
84-
job, httpCleanup := jobs3.Submit(t, "./input/http.hcl")
85-
t.Cleanup(httpCleanup)
84+
job, _ := jobs3.Submit(t,
85+
"./input/http.hcl",
86+
jobs3.DisableCleanup(),
87+
)
8688

87-
job2, httpCurlCleanup := jobs3.Submit(t, "./input/http_curl.hcl")
88-
t.Cleanup(httpCurlCleanup)
89+
job2, _ := jobs3.Submit(t,
90+
"./input/http_curl.hcl",
91+
jobs3.DisableCleanup(),
92+
)
8993

9094
logs := job.TaskLogs("backend", "http")
9195
must.StrContains(t, logs.Stderr, `"GET / HTTP/1.1" 200 -`) // healthcheck

e2e/terraform/provision-infra/provision-nomad/etc/nomad.d/base.hcl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,5 @@ telemetry {
3030
}
3131

3232
ui {
33-
enabled = true
3433
show_cli_hints = false
3534
}

e2e/ui/package-lock.json

Lines changed: 23 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

e2e/ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"devDependencies": {
3-
"@playwright/test": "^1.52.0"
3+
"@playwright/test": "^1.51.0"
44
}
55
}

e2e/ui/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ EOF
3333
}
3434

3535

36-
IMAGE="mcr.microsoft.com/playwright:v1.52.0-jammy"
36+
IMAGE="mcr.microsoft.com/playwright:v1.51.0-jammy"
3737
pushd $(dirname "${BASH_SOURCE[0]}") > /dev/null
3838

3939
run_tests() {

enos/modules/test_cluster_health/scripts/allocs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ while true; do
3838
checkAllocsCount && break
3939

4040
if [ "$elapsed_time" -ge "$MAX_WAIT_TIME" ]; then
41-
error_exit "Some allocs are not running: $(nomad alloc status -json | jq -r '.[] | "\(.ID) \(.Name) \(.ClientStatus)"')"
41+
error_exit "Some allocs are not running:\n$(nomad alloc status -json | jq -r '.[] | select(.ClientStatus != "running") | .ID')"
4242
fi
4343

4444
echo "Running allocs: $allocs_length, expected $ALLOC_COUNT. Waiting for $elapsed_time Retrying in $POLL_INTERVAL seconds..."

enos/modules/upgrade_client/main.tf

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ resource "enos_local_exec" "set_metadata" {
5151
scripts = [abspath("${path.module}/scripts/set_metadata.sh")]
5252
}
5353

54-
resource "enos_local_exec" "get_alloc_info" {
54+
resource "enos_local_exec" "get_alloc_ids" {
5555

5656
environment = merge(
5757
local.nomad_env,
@@ -61,13 +61,14 @@ resource "enos_local_exec" "get_alloc_info" {
6161
)
6262

6363
inline = [
64-
"nomad alloc status -json | jq -r --arg NODE_ID \"$(nomad node status -allocs -address https://$CLIENT_IP:4646 -self -json | jq -r '.ID')\" '[ .[] | select(.NodeID == $NODE_ID) | {ID: .ID, Name: .Name, ClientStatus: .ClientStatus, TaskStates: .TaskStates}]'"]
64+
"nomad alloc status -json | jq -r --arg NODE_ID \"$(nomad node status -allocs -address https://$CLIENT_IP:4646 -self -json | jq -r '.ID')\" '[.[] | select(.ClientStatus == \"running\" and .NodeID == $NODE_ID) | .ID] | join(\" \")'"
65+
]
6566
}
6667

6768
module "upgrade_client" {
6869
depends_on = [
6970
enos_local_exec.set_metadata,
70-
enos_local_exec.get_alloc_info,
71+
enos_local_exec.get_alloc_ids,
7172
]
7273

7374
source = "../upgrade_instance"
@@ -107,7 +108,7 @@ resource "enos_local_exec" "verify_allocs" {
107108
local.nomad_env,
108109
{
109110
CLIENT_IP = var.client
110-
ALLOCS = enos_local_exec.get_alloc_info.stdout
111+
ALLOCS = enos_local_exec.get_alloc_ids.stdout
111112
})
112113

113114
scripts = [abspath("${path.module}/scripts/verify_allocs.sh")]

enos/modules/upgrade_client/scripts/verify_allocs.sh

100755100644
Lines changed: 3 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -48,59 +48,22 @@ done
4848

4949
echo "Client $client_id at $CLIENT_IP is ready"
5050

51-
allocs_count=$(echo $ALLOCS |jq '[ .[] | select(.ClientStatus == "running")] | length')
52-
echo "$allocs_count allocs found before upgrade $ALLOCS"
53-
54-
# Quality: "nomad_alloc_reconnect: A GET call to /v1/allocs will return the same IDs for running allocs before and after a client upgrade on each client"
55-
56-
checkAllocsCount() {
57-
local allocs
58-
running_allocs=$(nomad alloc status -json | jq -r --arg client_id "$client_id" '[.[] | select(.ClientStatus == "running" and .NodeID == $client_id)]') \
59-
|| error_exit "Failed to check alloc status"
60-
allocs_length=$(echo "$running_allocs" | jq 'length') \
61-
|| error_exit "Invalid alloc status -json output"
62-
63-
if [ "$allocs_length" -eq "$allocs_count" ]; then
64-
return 0
65-
fi
66-
67-
return 1
68-
}
69-
51+
# Quality: "nomad_alloc_reconect: A GET call to /v1/allocs will return the same IDs for running allocs before and after a client upgrade on each client"
7052
echo "Reading allocs for client at $CLIENT_IP"
7153

72-
elapsed_time=0
73-
while true; do
74-
checkAllocsCount && break
75-
76-
if [ "$elapsed_time" -ge "$MAX_WAIT_TIME" ]; then
77-
error_exit "Some allocs are not running: $(nomad alloc status -json | jq -r '.[] | "\(.ID) \(.Name) \(.ClientStatus)"')"
78-
fi
79-
80-
echo "Running allocs: $allocs_length, expected $allocs_count. Waiting for $elapsed_time Retrying in $POLL_INTERVAL seconds..."
81-
sleep $POLL_INTERVAL
82-
elapsed_time=$((elapsed_time + POLL_INTERVAL))
83-
84-
done
85-
86-
echo "Correct number of allocs found running: $allocs_length"
87-
8854
current_allocs=$(nomad alloc status -json | jq -r --arg client_id "$client_id" '[.[] | select(.ClientStatus == "running" and .NodeID == $client_id) | .ID] | join(" ")')
8955
if [ -z "$current_allocs" ]; then
9056
error_exit "Failed to read allocs for node: $client_id"
9157
fi
9258

93-
IDs=$(echo $ALLOCS | jq '[ .[] | select(.ClientStatus == "running")] | [.[].ID] | join(" ")')
94-
95-
IFS=' ' read -r -a INPUT_ARRAY <<< "${IDs[*]}"
59+
IFS=' ' read -r -a INPUT_ARRAY <<< "${ALLOCS[*]}"
9660
IFS=' ' read -r -a RUNNING_ARRAY <<< "$current_allocs"
9761

9862
sorted_input=($(printf "%s\n" "${INPUT_ARRAY[@]}" | sort))
9963
sorted_running=($(printf "%s\n" "${RUNNING_ARRAY[@]}" | sort))
10064

10165
if [[ "${sorted_input[*]}" != "${sorted_running[*]}" ]]; then
102-
full_current_allocs=$(nomad alloc status -json | jq -r --arg client_id "$client_id" '[.[] | select(.NodeID == $client_id) | { ID: .ID, Name: .Name, ClientStatus: .ClientStatus}]')
103-
error_exit "Different allocs found, expected: ${sorted_input[*]} found: ${sorted_running[*]}. Current allocs info: $full_current_allocs"
66+
error_exit "Different allocs found, expected: ${sorted_input[*]} found: ${sorted_running[*]}"
10467
fi
10568

10669
echo "All allocs reattached correctly for node at $CLIENT_IP"

enos/modules/upgrade_servers/main.tf

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,27 +36,19 @@ locals {
3636
resource "random_pet" "upgrade" {
3737
}
3838

39-
40-
4139
resource "enos_local_exec" "wait_for_leader" {
4240
environment = local.nomad_env
4341

4442
scripts = [abspath("${path.module}/scripts/wait_for_stable_cluster.sh")]
4543
}
4644

47-
resource "time_sleep" "wait_20_seconds" {
48-
depends_on = [enos_local_exec.wait_for_leader]
49-
50-
create_duration = "20s"
51-
}
52-
5345
// Forcing a snapshot from the leader drives the cluster to store the most recent
5446
// state and exercise the snapshot restore at least once when upgrading.
5547
// The resulting file wont be used.
5648
// The stale flag defaults to "false" but it is included to reinforce the fact
5749
// that it has to be taken from the leader for future readers.
5850
resource "enos_local_exec" "take_cluster_snapshot" {
59-
depends_on = [time_sleep.wait_20_seconds]
51+
depends_on = [enos_local_exec.wait_for_leader]
6052

6153
environment = local.nomad_env
6254

0 commit comments

Comments
 (0)