Skip to content

Commit b6c28ad

Browse files
authored
Merge branch 'main' into jp/sync-profile
2 parents 0418290 + 3363bd9 commit b6c28ad

File tree

243 files changed

+9556
-2486
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

243 files changed

+9556
-2486
lines changed

.github/CODEOWNERS

+2
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@
9494
/.werft/webapp-* @gitpod-io/engineering-webapp
9595
/.werft/workspace-* @gitpod-io/engineering-workspace
9696
/.werft/self-hosted-* @gitpod-io/engineering-self-hosted
97+
/.werft/*installer-tests* @gitpod-io/engineering-self-hosted
98+
/.werft/jobs/build/self-hosted-* @gitpod-io/engineering-self-hosted
9799

98100
#
99101
# Automation

.github/workflows/code-nightly.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- run: |
3232
gcloud auth configure-docker --quiet
3333
export LEEWAY_WORKSPACE_ROOT=$(pwd)
34-
headCommit=$(curl -H 'Accept: application/vnd.github.VERSION.sha' https://api.github.com/repos/gitpod-io/openvscode-server/commits/gp-code/main)
34+
headCommit=$(curl -H 'Accept: application/vnd.github.VERSION.sha' https://api.github.com/repos/gitpod-io/openvscode-server/commits/gp-code/release/1.71)
3535
cd components/ide/code
3636
leeway build -Dversion=nightly -DimageRepoBase=eu.gcr.io/gitpod-core-dev/build -DcodeCommit=$headCommit -DcodeQuality=insider .:docker
3737
- name: Get previous job's status

.werft/aks-installer-tests.yaml

+48-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,36 @@
11
# debug using `werft run github -f -s .werft/installer-tests.ts -j .werft/aks-installer-tests.yaml -a debug=true`
2+
args:
3+
- name: subdomain
4+
desc: "Subdomain to use. A terraform workspace of same name will be used"
5+
required: false
6+
default: ""
7+
- name: channel
8+
desc: "Replicated channel to use"
9+
required: false
10+
default: ""
11+
- name: replicatedApp
12+
desc: "Replicated App to use"
13+
required: false
14+
default: ""
15+
- name: version
16+
desc: "Version of gitpod to install(in the case of upgrade tests, this is the initial install version and will later get upgraded to latest"
17+
required: false
18+
default: ""
19+
- name: skipTests
20+
desc: "Set this to true to skip integration tests"
21+
required: false
22+
default: false
23+
- name: upgrade
24+
desc: "Set this to true to run KOTS upgrade from the specified version to the latest version"
25+
required: false
26+
default: false
27+
- name: preview
28+
desc: "Setting preview to true creates a self-hosted preview for you to consume"
29+
required: false
30+
default: true
31+
- name: deps
32+
desc: "Specify if the dependencies(storage, db, registry) should be external or incluster. If unset, a random combination will be chosen. options:[external, incluster]"
33+
required: false
234
pod:
335
serviceAccount: werft
436
affinity:
@@ -73,6 +105,16 @@ pod:
73105
secretKeyRef:
74106
name: slack-webhook-urls
75107
key: self_hosted_jobs
108+
- name: REPLICATED_API_TOKEN
109+
valueFrom:
110+
secretKeyRef:
111+
name: replicated
112+
key: token
113+
- name: REPLICATED_APP
114+
valueFrom:
115+
secretKeyRef:
116+
name: replicated
117+
key: app
76118
command:
77119
- bash
78120
- -c
@@ -85,7 +127,12 @@ pod:
85127
86128
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
87129
88-
export TF_VAR_TEST_ID=$(echo $RANDOM | md5sum | head -c 5; echo)-azure
130+
export domain="{{ .Annotations.subdomain }}"
131+
if [[ "$domain" == "<no value>" ]]; then
132+
export TF_VAR_TEST_ID=$(echo $RANDOM | md5sum | head -c 5; echo)-azure
133+
else
134+
export TF_VAR_TEST_ID="$domain"
135+
fi
89136
90137
(cd .werft && yarn install && mv node_modules ..) | werft log slice prep
91138
printf '{{ toJson . }}' > context.json

.werft/cleanup-installer-setups.yaml renamed to .werft/cleanup-installer-tests.yaml

+11-1
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,16 @@ pod:
9898
secretKeyRef:
9999
name: slack-webhook-urls
100100
key: self_hosted_jobs
101+
- name: REPLICATED_API_TOKEN
102+
valueFrom:
103+
secretKeyRef:
104+
name: replicated
105+
key: token
106+
- name: REPLICATED_APP
107+
valueFrom:
108+
secretKeyRef:
109+
name: replicated
110+
key: app
101111
command:
102112
- bash
103113
- -c
@@ -121,4 +131,4 @@ pod:
121131
122132
npx ts-node .werft/installer-tests.ts ${TESTCONFIG}
123133
plugins:
124-
cron: "15 3 * * *"
134+
cron: "0 */12 * * *"

.werft/eks-installer-tests.yaml

+50-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,36 @@
11
# debug using `werft run github -f -s .werft/installer-tests.ts -j .werft/eks-installer-tests.yaml -a debug=true`
2+
args:
3+
- name: subdomain
4+
desc: "Subdomain to use. A terraform workspace of same name will be used"
5+
required: false
6+
default: ""
7+
- name: channel
8+
desc: "Replicated channel to use"
9+
required: false
10+
default: ""
11+
- name: replicatedApp
12+
desc: "Replicated App to use"
13+
required: false
14+
default: ""
15+
- name: version
16+
desc: "Version of gitpod to install(in the case of upgrade tests, this is the initial install version and will later get upgraded to latest"
17+
required: false
18+
default: ""
19+
- name: skipTests
20+
desc: "Set this to true to skip integration tests"
21+
required: false
22+
default: false
23+
- name: upgrade
24+
desc: "Set this to true to run KOTS upgrade from the specified version to the latest version"
25+
required: false
26+
default: false
27+
- name: preview
28+
desc: "Setting preview to true creates a self-hosted preview for you to consume"
29+
required: false
30+
default: true
31+
- name: deps
32+
desc: "Specify if the dependencies(storage, db, registry) should be external or incluster. If unset, a random combination will be chosen. options:[external, incluster]"
33+
required: false
234
pod:
335
serviceAccount: werft
436
affinity:
@@ -68,6 +100,16 @@ pod:
68100
secretKeyRef:
69101
name: slack-webhook-urls
70102
key: self_hosted_jobs
103+
- name: REPLICATED_API_TOKEN
104+
valueFrom:
105+
secretKeyRef:
106+
name: replicated
107+
key: token
108+
- name: REPLICATED_APP
109+
valueFrom:
110+
secretKeyRef:
111+
name: replicated
112+
key: app
71113
command:
72114
- bash
73115
- -c
@@ -78,7 +120,14 @@ pod:
78120
sudo chown -R gitpod:gitpod /workspace
79121
sudo apt update && apt install gettext-base
80122
81-
export TF_VAR_TEST_ID="$(echo $RANDOM | md5sum | head -c 5; echo)-aws"
123+
124+
export domain="{{ .Annotations.subdomain }}"
125+
126+
if [[ "$domain" == "<no value>" ]]; then
127+
export TF_VAR_TEST_ID="$(echo $RANDOM | md5sum | head -c 5; echo)-aws"
128+
else
129+
export TF_VAR_TEST_ID="$domain"
130+
fi
82131
83132
(cd .werft && yarn install && mv node_modules ..) | werft log slice prep
84133
printf '{{ toJson . }}' > context.json

.werft/gke-installer-tests.yaml

+48-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,36 @@
11
# debug using `werft run github -f -s .werft/installer-tests.ts -j .werft/gke-installer-tests.yaml -a debug=true`
2+
args:
3+
- name: subdomain
4+
desc: "Subdomain to use. A terraform workspace of same name will be used"
5+
required: false
6+
default: ""
7+
- name: channel
8+
desc: "Replicated channel to use"
9+
required: false
10+
default: ""
11+
- name: replicatedApp
12+
desc: "Replicated App to use"
13+
required: false
14+
default: ""
15+
- name: version
16+
desc: "Version of gitpod to install(in the case of upgrade tests, this is the initial install version and will later get upgraded to latest"
17+
required: false
18+
default: ""
19+
- name: skipTests
20+
desc: "Set this to true to skip integration tests"
21+
required: false
22+
default: false
23+
- name: upgrade
24+
desc: "Set this to true to run KOTS upgrade from the specified version to the latest version"
25+
required: false
26+
default: false
27+
- name: preview
28+
desc: "Setting preview to true creates a self-hosted preview for you to consume"
29+
required: false
30+
default: true
31+
- name: deps
32+
desc: "Specify if the dependencies(storage, db, registry) should be external or incluster. If unset, a random combination will be chosen. options:[external, incluster]"
33+
required: false
234
pod:
335
serviceAccount: werft
436
affinity:
@@ -55,6 +87,16 @@ pod:
5587
secretKeyRef:
5688
name: slack-webhook-urls
5789
key: self_hosted_jobs
90+
- name: REPLICATED_API_TOKEN
91+
valueFrom:
92+
secretKeyRef:
93+
name: replicated
94+
key: token
95+
- name: REPLICATED_APP
96+
valueFrom:
97+
secretKeyRef:
98+
name: replicated
99+
key: app
58100
command:
59101
- bash
60102
- -c
@@ -65,7 +107,12 @@ pod:
65107
sudo chown -R gitpod:gitpod /workspace
66108
sudo apt update && apt install gettext-base
67109
68-
export TF_VAR_TEST_ID=$(echo $RANDOM | md5sum | head -c 5; echo)-gcp
110+
export domain="{{ .Annotations.subdomain }}"
111+
if [[ "$domain" == "<no value>" ]]; then
112+
export TF_VAR_TEST_ID=$(echo $RANDOM | md5sum | head -c 5; echo)-gcp
113+
else
114+
export TF_VAR_TEST_ID="$domain"
115+
fi
69116
70117
(cd .werft && yarn install && mv node_modules ..) | werft log slice prep
71118
printf '{{ toJson . }}' > context.json

.werft/installer-tests.ts

+12-8
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,16 @@ const annotations: any = context.Annotations || {};
1111
const testConfig: string = process.argv.length > 2 ? process.argv[2] : "STANDARD_K3S_TEST";
1212

1313
const channel: string = annotations.channel || "unstable";
14+
const kotsApp: string = annotations.replicatedApp || "gitpod";
15+
1416
const version: string = annotations.version || "-";
1517
const preview: string = annotations.preview || "false"; // setting to true will not destroy the setup
1618
const upgrade: string = annotations.upgrade || "false"; // setting to true will not KOTS upgrade to the latest version. Set the channel to beta or stable in this case.
1719
const skipTests: string = annotations.skipTests || "false"; // setting to true skips the integration tests
1820
const deps: string = annotations.deps || ""; // options: ["external", "internal"] setting to `external` will ensure that all resource dependencies(storage, db, registry) will be external. if unset, a random selection will be used
1921

22+
const baseDomain: string = "tests.gitpod-self-hosted.com"
23+
2024
const slackHook = new Map<string, string>([
2125
["self-hosted-jobs", process.env.SH_SLACK_NOTIFICATION_PATH.trim()],
2226
["workspace-jobs", process.env.WS_SLACK_NOTIFICATION_PATH.trim()],
@@ -165,16 +169,16 @@ const INFRA_PHASES: { [name: string]: InfraConfig } = {
165169
ADD_NS_RECORD: {
166170
phase: "add-ns-record",
167171
makeTarget: "add-ns-record",
168-
description: "Adds NS record for subdomain under tests.gitpod-self-hosted.com",
172+
description: `Adds NS record for subdomain under ${baseDomain}`,
169173
},
170174
INSTALL_GITPOD_IGNORE_PREFLIGHTS: {
171175
phase: "install-gitpod-without-preflights",
172-
makeTarget: `kots-install channel=${channel} version=${version} preflights=false`, // this is a bit of a hack, for now we pass params like this
176+
makeTarget: `kots-install app=${kotsApp} channel=${channel} version=${version} preflights=false`, // this is a bit of a hack, for now we pass params like this
173177
description: "Install gitpod using kots community edition without preflights",
174178
},
175179
INSTALL_GITPOD: {
176180
phase: "install-gitpod",
177-
makeTarget: `kots-install channel=${channel} version=${version} preflights=true`,
181+
makeTarget: `kots-install app=${kotsApp} channel=${channel} version=${version} preflights=true`,
178182
description: "Install gitpod using kots community edition",
179183
},
180184
CHECK_INSTALLATION: {
@@ -320,7 +324,7 @@ export async function installerTests(config: TestConfig) {
320324
werft.phase("print-output", "Get connection details to self-hosted setup");
321325

322326
exec(
323-
`werft log result -d "self-hosted preview url" url "https://${process.env["TF_VAR_TEST_ID"]}.tests.gitpod-self-hosted.com"`,
327+
`werft log result -d "self-hosted preview url" url "https://${process.env["TF_VAR_TEST_ID"]}.${baseDomain}"`,
324328
);
325329

326330
if (testConfig == "STANDARD_K3S_TEST") {
@@ -341,6 +345,7 @@ export async function installerTests(config: TestConfig) {
341345
// if we are not doing preview, we delete the infrastructure
342346
cleanup();
343347
}
348+
344349
}
345350

346351
function runIntegrationTests() {
@@ -414,11 +419,11 @@ function randK8sVersion(config: string): string {
414419
break;
415420
}
416421
case "STANDARD_AKS_TEST": {
417-
options = ["1.21", "1.22", "1.23"]
422+
options = ["1.22", "1.23", "1.24"]
418423
break;
419424
}
420425
case "STANDARD_EKS_TEST": {
421-
options = ["1.21", "1.22", "1.23"]
426+
options = ["1.21", "1.22"] // we will start 1.23 when official Ubuntu image is out
422427
break;
423428
}
424429
case "STANDARD_K3S_TEST": {
@@ -479,7 +484,6 @@ export function sendFailureSlackAlert(phase: string, err: Error, hook: string):
479484
return
480485
}
481486

482-
const repo = context.Repository.host + "/" + context.Repository.owner + "/" + context.Repository.repo;
483487
const data = JSON.stringify({
484488
blocks: [
485489
{
@@ -561,7 +565,7 @@ export async function sendPreviewSlackAlert(): Promise<void> {
561565
fields: [
562566
{
563567
type: "mrkdwn",
564-
text: "*URL:*\n<https://" + process.env["TF_VAR_TEST_ID"] + ".tests.gitpod-self-hosted.com|Access preview setup>",
568+
text: "*URL:*\n<https://" + process.env["TF_VAR_TEST_ID"] + `.${baseDomain}|Access preview setup>`,
565569
},
566570
{
567571
type: "mrkdwn",

0 commit comments

Comments
 (0)