Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
aledbf committed Jul 17, 2023
1 parent 008f3b2 commit a6d6a14
Show file tree
Hide file tree
Showing 18 changed files with 6 additions and 85 deletions.
4 changes: 0 additions & 4 deletions .github/actions/preview-create/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,12 @@ gcloud auth activate-service-account --key-file "${CREDENTIALS_FILE}"
previewctl get-credentials --gcp-service-account "${CREDENTIALS_FILE}"

replace="module.preview_gce[0].google_compute_instance.default"
#if [[ "${INPUT_INFRASTRUCTURE_PROVIDER}" = "harvester " ]]; then
# replace="module.preview_harvester[0].harvester_virtualmachine.harvester"
#fi

if [[ "${INPUT_RECREATE_VM:-x}" == "true" ]]; then
export TF_CLI_ARGS_plan="-replace=${replace}"
fi

export TF_VAR_preview_name="$(previewctl get-name --branch "${INPUT_NAME}")"
export TF_VAR_infra_provider="${INPUT_INFRASTRUCTURE_PROVIDER}"
export TF_INPUT=0
export TF_IN_AUTOMATION=true

Expand Down
3 changes: 0 additions & 3 deletions .github/actions/preview-create/metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ inputs:
name:
description: "The name of the preview environment to deploy Gitpod to"
required: false
infrastructure_provider:
description: "The infrastructure provider to use"
required: true
recreate_vm:
description: "Whether to recreate the VM"
required: false
Expand Down
3 changes: 0 additions & 3 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ gitpod:summary
- [ ] /werft with-local-preview
If enabled this will build `install/preview`
- [ ] /werft with-preview
- [ ] /werft with-large-vm
- [ ] /werft with-gce-vm
If enabled this will create the environment on GCE infra
- [ ] with-integration-tests=all
Valid options are `all`, `workspace`, `webapp`, `ide`, `jetbrains`, `vscode`, `ssh`
- [ ] with-monitoring
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@ jobs:
is_main_branch: ${{ (github.head_ref || github.ref) == 'refs/heads/main' }}
version: ${{ steps.branches.outputs.sanitized-branch-name }}-gha.${{github.run_number}}
preview_enable: ${{ contains( steps.pr-details.outputs.pr_body, '[x] /werft with-preview') }}
preview_infra_provider: ${{ contains( steps.pr-details.outputs.pr_body, '[x] /werft with-gce-vm') && 'gce' || 'harvester' }}
build_no_cache: ${{ contains( steps.pr-details.outputs.pr_body, '[x] leeway-no-cache') }}
build_no_test: ${{ contains( steps.pr-details.outputs.pr_body, '[x] /werft no-test') }}
with_large_vm: ${{ contains( steps.pr-details.outputs.pr_body, '[X] /werft with-large-vm') }}
publish_to_npm: ${{ contains( steps.pr-details.outputs.pr_body, '[X] /werft publish-to-npm') }}
publish_to_jbmp: ${{ contains( steps.pr-details.outputs.pr_body, '[X] /werft publish-to-jb-marketplace') }}
with_dedicated_emulation: ${{ contains( steps.pr-details.outputs.pr_body, '[X] with-dedicated-emulation') }}
Expand Down Expand Up @@ -104,8 +102,6 @@ jobs:
uses: ./.github/actions/preview-create
with:
name: ${{ github.head_ref || github.ref_name }}
infrastructure_provider: ${{ needs.configuration.outputs.preview_infra_provider }}
large_vm: ${{ needs.configuration.outputs.with_large_vm }}
recreate_vm: ${{ inputs.recreate_vm }}
sa_key: ${{ secrets.GCP_CREDENTIALS }}
leeway_segment_key: ${{ secrets.LEEWAY_SEGMENT_KEY }}
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ide-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ jobs:
uses: ./.github/actions/preview-create
with:
name: ${{ needs.configuration.outputs.name }}
infrastructure_provider: gce
large_vm: true
- name: Deploy Gitpod to the preview environment
id: deploy-gitpod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,6 @@ jobs:
## Werft options:
- [x] /werft publish-to-jb-marketplace
- [x] /werft with-preview
- [x] /werft with-large-vm
- [x] /werft with-gce-vm
- [x] with-integration-tests=jetbrains
- [x] latest-ide-version=${{ contains(inputs.pluginId, 'latest') }}
Expand Down Expand Up @@ -145,8 +143,6 @@ jobs:
## Werft options:
- [x] /werft with-preview
- [x] /werft with-large-vm
- [x] /werft with-gce-vm
- [x] with-integration-tests=jetbrains
- [x] latest-ide-version=${{ contains(inputs.pluginId, 'latest') }}
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/jetbrains-updates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ jobs:
* with-preview - whether to create a preview environment for this PR
-->
- [x] /werft with-preview
- [x] /werft with-large-vm
- [x] /werft with-gce-vm
- [x] with-integration-tests=jetbrains
- [x] latest-ide-version=false
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/preview-env-check-regressions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ on:
version:
required: true
description: "The version of Gitpod to install"
infrastructure_provider:
description: "The infrastructure provider to use. Valid options: harvester, gcp"
required: false
default: gcp

jobs:
create-runner:
Expand All @@ -30,7 +26,6 @@ jobs:
skip: ${{ steps.configuration.outputs.skip }}
name: ${{ steps.configuration.outputs.name }}
version: ${{ steps.configuration.outputs.version }}
infrastructure_provider: ${{ steps.configuration.outputs.infrastructure_provider }}
steps:
- name: "Set outputs"
id: configuration
Expand All @@ -40,15 +35,13 @@ jobs:
{
echo "version=${{ github.event.inputs.version }}"
echo "name=${{ github.event.inputs.name }}"
echo "infrastructure_provider=${{ github.event.inputs.infrastructure_provider }}"
echo "skip=false"
} >> $GITHUB_OUTPUT
else
# The workflow was triggered by workflow_run
{
echo "version=main-gha.${{ github.event.workflow_run.run_number }}"
echo "name=preview-regression-check-main-${{ github.run_id }}-${{ github.run_attempt }}"
echo "infrastructure_provider=harvester"
echo "skip=${{ github.event.workflow_run.conclusion == 'failure' }}"
} >> $GITHUB_OUTPUT
fi
Expand All @@ -70,7 +63,6 @@ jobs:
uses: ./.github/actions/preview-create
with:
name: ${{ needs.configuration.outputs.name }}
infrastructure_provider: ${{ needs.configuration.outputs.infrastructure_provider }}
large_vm: false
- name: Deploy Gitpod to the preview environment
id: deploy-gitpod
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/workspace-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ jobs:
uses: ./.github/actions/preview-create
with:
name: ${{ needs.configuration.outputs.name }}
infrastructure_provider: gce
large_vm: true
- name: Deploy Gitpod to the preview environment
if: github.event.inputs.skip_deploy != 'true'
Expand Down
1 change: 0 additions & 1 deletion .werft/jobs/build/prepare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ async function createVM(werft: Werft, config: JobConfig) {
"GOOGLE_APPLICATION_CREDENTIALS": GCLOUD_SERVICE_ACCOUNT_PATH,
"TF_VAR_cert_issuer": config.certIssuer,
"TF_VAR_preview_name": config.previewEnvironment.destname,
"TF_VAR_with_large_vm": `${config.withLargeVM}`,
"TF_VAR_infra_provider": `${infra}`,
}

Expand Down
6 changes: 0 additions & 6 deletions dev/preview/infrastructure/modules/gce/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,3 @@ variable "use_spot" {
default = true
description = "Flag to decide whether to use spot instances"
}

variable "with_large_vm" {
type = bool
default = false
description = "Flag to decide whether to use a larger VM"
}
4 changes: 2 additions & 2 deletions dev/preview/infrastructure/modules/gce/vm.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ resource "google_compute_instance" "default" {
# allowing us to e.g. run more e2e tests in parallel without
# running into node disk pressure.
dynamic "scratch_disk" {
for_each = var.with_large_vm == true ? [1, 2] : []
for_each = [1, 2]
content {
interface = "NVME"
}
Expand Down Expand Up @@ -100,5 +100,5 @@ locals {
ssh_authorized_keys = var.ssh_key
})

machine_type = var.with_large_vm ? "n2d-standard-32" : var.vm_type
machine_type = "n2d-standard-16"
}
6 changes: 0 additions & 6 deletions dev/preview/infrastructure/modules/harvester/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,3 @@ variable "gcp_project_dns" {
default = "gitpod-core-dev"
description = "The GCP project in which to create DNS records"
}

variable "with_large_vm" {
type = bool
default = false
description = "Flag to decide whether to use a larger VM"
}
4 changes: 2 additions & 2 deletions dev/preview/infrastructure/modules/harvester/vm.tf
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,6 @@ locals {
})
})

vm_cpu = var.with_large_vm ? 12 : 6
vm_memory = var.with_large_vm ? "24Gi" : "12Gi"
vm_cpu = 12
vm_memory = "24Gi"
}
3 changes: 0 additions & 3 deletions dev/preview/infrastructure/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
output "infra_provider" {
value = var.infra_provider
}
23 changes: 1 addition & 22 deletions dev/preview/infrastructure/preview.tf
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
module "preview_gce" {
count = var.infra_provider == "gce" ? 1 : 0
count = 1
source = "./modules/gce"

preview_name = var.preview_name
cert_issuer = var.cert_issuer
preview_namespace = kubernetes_namespace.preview_namespace.metadata[0].name
ssh_key = local.ssh_key
use_spot = var.gce_use_spot
with_large_vm = var.with_large_vm
vm_type = var.vm_type

providers = {
Expand All @@ -19,26 +18,6 @@ module "preview_gce" {
}
}

module "preview_harvester" {
count = var.infra_provider == "harvester" ? 1 : 0
source = "./modules/harvester"

preview_name = var.preview_name
cert_issuer = var.cert_issuer
preview_namespace = kubernetes_namespace.preview_namespace.metadata[0].name
ssh_key = local.ssh_key
with_large_vm = var.with_large_vm

providers = {
google = google,
acme.letsencrypt = acme.letsencrypt,
acme.zerossl = acme.zerossl,
k8s.dev = k8s.dev
k8s.harvester = k8s.harvester
harvester.harvester = harvester.harvester
}
}

module "dns" {
source = "./modules/dns"

Expand Down
12 changes: 0 additions & 12 deletions dev/preview/infrastructure/variables.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
variable "infra_provider" {
type = string
default = "harvester"
description = "the provider for the infra: [harvester, gce]"
}

variable "preview_name" {
type = string
description = "The preview environment's name"
Expand Down Expand Up @@ -55,9 +49,3 @@ variable "gce_use_spot" {
default = true
description = "Flag to decide whether to use spot instances"
}

variable "with_large_vm" {
type = bool
default = false
description = "Flag to decide whether to use a larger VM"
}
2 changes: 1 addition & 1 deletion test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ werft job run github -a with-preview=true -a with-integration-tests=webapp -f
You may want to run tests to assert whether a Gitpod installation is successfully integrated.

> Use a preview environment with a large VM to run the tests. The tests run in parallel and can consume a large amount of recources. Create one as follows:
> `TF_VAR_with_large_vm=true leeway run dev:preview`
> `leeway run dev:preview`
### Go test

Expand Down

0 comments on commit a6d6a14

Please sign in to comment.