Skip to content

Commit 8c9c39f

Browse files
committed
Remove sweeper
1 parent 99c21f9 commit 8c9c39f

16 files changed

+0
-960
lines changed

.werft/jobs/build/deploy-to-preview-environment.ts

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,6 @@ export async function deployToPreviewEnvironment(werft: Werft, jobConfig: JobCon
8383
| yq r - data['.dockerconfigjson'] \
8484
| base64 -d)" | base64 -w 0`, { silent: true }).stdout.trim();
8585

86-
const sweeperImage = exec(`tar xfO /tmp/dev.tar.gz ./sweeper.txt`).stdout.trim();
87-
8886
const deploymentConfig: DeploymentConfig = {
8987
version,
9088
destname,
@@ -94,7 +92,6 @@ export async function deployToPreviewEnvironment(werft: Werft, jobConfig: JobCon
9492
url,
9593
analytics,
9694
cleanSlateDeployment,
97-
sweeperImage,
9895
installEELicense,
9996
imagePullAuth,
10097
withPayment,
@@ -358,34 +355,6 @@ async function deployToDevWithInstaller(werft: Werft, jobConfig: JobConfig, depl
358355
}
359356
addAgentSmithToken(werft, deploymentConfig.namespace, installer.options.kubeconfigPath, tokenHash)
360357

361-
// TODO: Fix sweeper, it does not appear to be doing clean-up
362-
werft.log('sweeper', 'installing Sweeper');
363-
const sweeperVersion = deploymentConfig.sweeperImage.split(":")[1];
364-
werft.log('sweeper', `Sweeper version: ${sweeperVersion}`);
365-
366-
// prepare args
367-
const args = {
368-
"period": "10m",
369-
"timeout": "48h", // period of inactivity that triggers a removal
370-
branch: jobConfig.repository.branch, // the branch to check for deletion
371-
owner: jobConfig.repository.owner,
372-
repo: jobConfig.repository.repo,
373-
};
374-
const argsStr = Object.entries(args).map(([k, v]) => `\"--${k}\", \"${v}\"`).join(", ");
375-
const allArgsStr = `--set args="{${argsStr}}" --set githubToken.secret=github-sweeper-read-branches --set githubToken.key=token`;
376-
377-
// TODO: Implement sweeper logic for VMs in Harvester
378-
if (!withVM) {
379-
// copy GH token into namespace
380-
exec(`kubectl --kubeconfig ${CORE_DEV_KUBECONFIG_PATH} --namespace werft get secret github-sweeper-read-branches -o yaml \
381-
| yq w - metadata.namespace ${namespace} \
382-
| yq d - metadata.uid \
383-
| yq d - metadata.resourceVersion \
384-
| yq d - metadata.creationTimestamp \
385-
| kubectl --kubeconfig ${CORE_DEV_KUBECONFIG_PATH} apply -f -`);
386-
exec(`/usr/local/bin/helm3 --kubeconfig ${CORE_DEV_KUBECONFIG_PATH} upgrade --install --set image.version=${sweeperVersion} --set command="werft run github -a namespace=${namespace} --remote-job-path .werft/wipe-devstaging.yaml github.com/gitpod-io/gitpod:main" ${allArgsStr} sweeper ./dev/charts/sweeper`);
387-
}
388-
389358
werft.done(phases.DEPLOY);
390359

391360
async function cleanStateEnv(kubeconfig: string, shellOpts: ExecOptions) {
@@ -561,30 +530,6 @@ async function deployToDevWithHelm(werft: Werft, jobConfig: JobConfig, deploymen
561530

562531
exec(`helm dependencies up`);
563532
exec(`/usr/local/bin/helm3 --kubeconfig ${CORE_DEV_KUBECONFIG_PATH} upgrade --install --timeout 10m -f ../.werft/jobs/build/helm/${nodeAffinityValues[nodepoolIndex]} -f ../.werft/jobs/build/helm/values.dev.yaml ${flags} ${helmInstallName} .`);
564-
565-
werft.log('helm', 'installing Sweeper');
566-
const sweeperVersion = deploymentConfig.sweeperImage.split(":")[1];
567-
werft.log('helm', `Sweeper version: ${sweeperVersion}`);
568-
569-
// prepare args
570-
const args = {
571-
"period": "10m",
572-
"timeout": "48h", // period of inactivity that triggers a removal
573-
branch: jobConfig.repository.branch, // the branch to check for deletion
574-
owner: jobConfig.repository.owner,
575-
repo: jobConfig.repository.repo,
576-
};
577-
const argsStr = Object.entries(args).map(([k, v]) => `\"--${k}\", \"${v}\"`).join(", ");
578-
const allArgsStr = `--set args="{${argsStr}}" --set githubToken.secret=github-sweeper-read-branches --set githubToken.key=token`;
579-
580-
// copy GH token into namespace
581-
exec(`kubectl --kubeconfig ${CORE_DEV_KUBECONFIG_PATH} --namespace werft get secret github-sweeper-read-branches -o yaml \
582-
| yq w - metadata.namespace ${namespace} \
583-
| yq d - metadata.uid \
584-
| yq d - metadata.resourceVersion \
585-
| yq d - metadata.creationTimestamp \
586-
| kubectl --kubeconfig ${CORE_DEV_KUBECONFIG_PATH} apply -f -`);
587-
exec(`/usr/local/bin/helm3 --kubeconfig ${CORE_DEV_KUBECONFIG_PATH} upgrade --install --set image.version=${sweeperVersion} --set command="werft run github -a namespace=${namespace} --remote-job-path .werft/wipe-devstaging.yaml github.com/gitpod-io/gitpod:main" ${allArgsStr} sweeper ../dev/charts/sweeper`);
588533
}
589534

590535
function addDeploymentFlags() {
@@ -684,7 +629,6 @@ interface DeploymentConfig {
684629
url: string;
685630
analytics?: string;
686631
cleanSlateDeployment: boolean;
687-
sweeperImage: string;
688632
installEELicense: boolean;
689633
imagePullAuth: string;
690634
withPayment: boolean;

.werft/wipe-devstaging.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ async function devCleanup() {
3131
await wipePreviewCluster(env(""))
3232
}
3333

34-
// sweeper runs in the dev cluster so we need to delete the k3s cluster first and then delete self contained namespace
35-
3634
Tracing.initialize()
3735
.then(() => {
3836
werft = new Werft("wipe-devstaging")

chart/templates/db-deny-all-allow-explicit-networkpolicy.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,4 @@ spec:
5252
matchLabels:
5353
app: {{ template "gitpod.fullname" . }}
5454
component: postman
55-
{{ if eq .Values.installation.stage "devstaging" -}}
56-
- podSelector:
57-
matchLabels:
58-
app: sweeper
59-
{{- end -}}
6055
{{- end -}}

codecov.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,6 @@ flags:
9898
dev-poolkeeper-app:
9999
paths:
100100
- dev/poolkeeper/
101-
dev-sweeper-app:
102-
paths:
103-
- dev/sweeper/
104101
dev-version-manifest-app:
105102
paths:
106103
- dev/version-manifest/

dev/BUILD.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@ packages:
44
deps:
55
- dev/image:docker
66
- dev/poolkeeper:docker
7-
- dev/sweeper:docker
87
- :dev-utils
9-
config:
10-
commands:
11-
- ["sh", "-c", "tail -n1 dev-sweeper--docker/imgnames.txt > sweeper.txt"]
128
- name: all-app
139
type: generic
1410
deps:

dev/charts/sweeper/.helmignore

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

dev/charts/sweeper/Chart.yaml

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

dev/charts/sweeper/templates/_helpers.tpl

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

dev/charts/sweeper/templates/deployment.yaml

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

dev/charts/sweeper/values.yaml

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

dev/sweeper/BUILD.yaml

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

0 commit comments

Comments
 (0)