From 90a562257c8bd11c94df05e68c76069390355471 Mon Sep 17 00:00:00 2001 From: Kevin Minehart <5140827+kminehart@users.noreply.github.com> Date: Fri, 25 Oct 2024 08:53:52 -0500 Subject: [PATCH] =?UTF-8?q?[v11.3.x]=20CI:=20Remove=20drone=20steps=20for?= =?UTF-8?q?=20building=20windows=20because=20its=20done=20in=20grafana-?= =?UTF-8?q?=E2=80=A6=20(#95413)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CI: Remove drone steps for building windows because it's done in grafana-… (#95373) Remove drone steps for building windows because it's done in grafana-build now (cherry picked from commit 67b3848fd997b8c6e3923ddc63e0e8d68d0a6747) --- .drone.star | 5 - .drone.yml | 161 +----------------------------- scripts/drone/events/release.star | 1 - scripts/drone/rgm.star | 10 -- scripts/drone/windows.star | 149 --------------------------- 5 files changed, 1 insertion(+), 325 deletions(-) delete mode 100644 scripts/drone/windows.star diff --git a/.drone.star b/.drone.star index 14575d5693d..f633ee08e85 100644 --- a/.drone.star +++ b/.drone.star @@ -27,10 +27,6 @@ load( "rgm", ) load("scripts/drone/vault.star", "secrets") -load( - "scripts/drone/windows.star", - "windows_manual_pipeline", -) def main(_ctx): return ( @@ -44,6 +40,5 @@ def main(_ctx): rgm() + integration_test_pipelines() + cronjobs() + - [windows_manual_pipeline()] + secrets() ) diff --git a/.drone.yml b/.drone.yml index 7954c89dbd1..b9f6d8665da 100644 --- a/.drone.yml +++ b/.drone.yml @@ -4338,89 +4338,6 @@ image_pull_secrets: - gcr - gar kind: pipeline -name: prerelease-windows-msi -node: - type: no-parallel -platform: - arch: amd64 - os: linux -services: [] -steps: -- commands: - - curl -L0 https://nssm.cc/release/nssm-2.24.zip -o nssm-2.24.zip - image: byrnedo/alpine-curl:0.1.8 - name: downlad-nssm -- commands: - - mkdir wix3 && cd wix3 - - curl -L0 https://github.com/wixtoolset/wix3/releases/download/wix3141rtm/wix314-binaries.zip - -o wix3.zip - - unzip wix3.zip - image: byrnedo/alpine-curl:0.1.8 - name: download-wix3 -- commands: - - printenv GCP_KEY | base64 -d > /tmp/key.json - - gcloud auth activate-service-account --key-file=/tmp/key.json - - bash -c 'gcloud storage cp gs://grafana-prerelease/artifacts/downloads/$${DRONE_TAG}/oss/release/grafana-$${DRONE_TAG:1}.windows-amd64.zip - grafana.zip' - environment: - GCP_KEY: - from_secret: gcp_key_base64 - image: google/cloud-sdk:431.0.0 - name: download-zip -- commands: - - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.1.1/grabpl - - chmod +x bin/grabpl - image: byrnedo/alpine-curl:0.1.8 - name: grabpl -- commands: - - export WINEPATH=$(winepath ./wix3) - - ./bin/grabpl windows-installer --target grafana.zip --edition oss - depends_on: - - downlad-nssm - - download-wix3 - - grabpl - - download-zip - entrypoint: - - /bin/bash - image: scottyhardy/docker-wine:stable-9.0 - name: build-msi -- commands: - - printenv GCP_KEY | base64 -d > /tmp/key.json - - gcloud auth activate-service-account --key-file=/tmp/key.json - - bash -c 'gcloud storage cp *.msi gs://grafana-prerelease/artifacts/downloads/$${DRONE_TAG}/oss/release' - - bash -c 'gcloud storage cp *.msi.sha256 gs://grafana-prerelease/artifacts/downloads/$${DRONE_TAG}/oss/release' - depends_on: - - build-msi - environment: - GCP_KEY: - from_secret: gcp_key_base64 - image: google/cloud-sdk:431.0.0 - name: upload-msi-installer -trigger: - event: - exclude: - - promote - ref: - exclude: - - refs/tags/*-cloud* - include: - - refs/tags/v* -type: docker -volumes: -- host: - path: /var/run/docker.sock - name: docker ---- -clone: - retries: 3 -depends_on: -- prerelease-windows-msi -- rgm-tag-prerelease -image_pull_secrets: -- gcr -- gar -kind: pipeline name: rgm-tag-verify-prerelease-assets node: type: no-parallel @@ -5662,82 +5579,6 @@ volumes: - name: config temp: {} --- -clone: - retries: 3 -depends_on: [] -image_pull_secrets: -- gcr -- gar -kind: pipeline -name: windows-pipeline-manual -node: - type: no-parallel -platform: - arch: amd64 - os: linux -services: [] -steps: -- commands: - - curl -L0 https://nssm.cc/release/nssm-2.24.zip -o nssm-2.24.zip - image: byrnedo/alpine-curl:0.1.8 - name: downlad-nssm -- commands: - - mkdir wix3 && cd wix3 - - curl -L0 https://github.com/wixtoolset/wix3/releases/download/wix3141rtm/wix314-binaries.zip - -o wix3.zip - - unzip wix3.zip - image: byrnedo/alpine-curl:0.1.8 - name: download-wix3 -- commands: - - printenv GCP_KEY | base64 -d > /tmp/key.json - - gcloud auth activate-service-account --key-file=/tmp/key.json - - bash -c 'gcloud storage cp gs://grafana-prerelease/artifacts/downloads/$${DRONE_TAG}/oss/release/grafana-$${DRONE_TAG:1}.windows-amd64.zip - grafana.zip' - environment: - GCP_KEY: - from_secret: gcp_key_base64 - image: google/cloud-sdk:431.0.0 - name: download-zip -- commands: - - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.1.1/grabpl - - chmod +x bin/grabpl - image: byrnedo/alpine-curl:0.1.8 - name: grabpl -- commands: - - export WINEPATH=$(winepath ./wix3) - - ./bin/grabpl windows-installer --target grafana.zip --edition oss - depends_on: - - downlad-nssm - - download-wix3 - - grabpl - - download-zip - entrypoint: - - /bin/bash - image: scottyhardy/docker-wine:stable-9.0 - name: build-msi -- commands: - - printenv GCP_KEY | base64 -d > /tmp/key.json - - gcloud auth activate-service-account --key-file=/tmp/key.json - - bash -c 'gcloud storage cp *.msi gs://grafana-prerelease/artifacts/downloads/$${DRONE_TAG}/oss/release' - - bash -c 'gcloud storage cp *.msi.sha256 gs://grafana-prerelease/artifacts/downloads/$${DRONE_TAG}/oss/release' - depends_on: - - build-msi - environment: - GCP_KEY: - from_secret: gcp_key_base64 - image: google/cloud-sdk:431.0.0 - name: upload-msi-installer -trigger: - event: - - promote - target: build-msi -type: docker -volumes: -- host: - path: /var/run/docker.sock - name: docker ---- get: name: credentials.json path: infra/data/ci/grafana-release-eng/grafanauploads @@ -5937,6 +5778,6 @@ kind: secret name: gcr_credentials --- kind: signature -hmac: a8084d907b286e710ed331c4c09a23f16c1afed5c428a9a1b99da3ad05ab3a3f +hmac: 53143f19d4dd87f1a7b76cb3226c353084f85ee7b832d259ca8d318b13d1ed37 ... diff --git a/scripts/drone/events/release.star b/scripts/drone/events/release.star index 22819a28ec8..0bb72430fe2 100644 --- a/scripts/drone/events/release.star +++ b/scripts/drone/events/release.star @@ -310,7 +310,6 @@ def verify_release_pipeline( trigger = {}, depends_on = [ "release-build-e2e-publish", - "release-windows", ]): """ Runs a script that 'gsutil stat's every artifact that should have been produced by the pre-release process. diff --git a/scripts/drone/rgm.star b/scripts/drone/rgm.star index 85e956d57a8..21e981b48b5 100644 --- a/scripts/drone/rgm.star +++ b/scripts/drone/rgm.star @@ -45,10 +45,6 @@ load( "rgm_github_token", "rgm_storybook_destination", ) -load( - "scripts/drone/windows.star", - "windows_pipeline_release", -) docs_paths = { "exclude": [ @@ -289,20 +285,14 @@ def rgm_nightly_pipeline(): def rgm_tag_pipeline(): build = rgm_tag() - # the Windows step requires an uploaded .zip file to base its compilation on - windows = windows_pipeline_release(trigger = tag_trigger, depends_on = [ - build["name"], - ]) return [ build, whats_new_checker_pipeline(tag_trigger), - windows, verify_release_pipeline( trigger = tag_trigger, name = "rgm-tag-verify-prerelease-assets", bucket = "grafana-prerelease", depends_on = [ - windows["name"], build["name"], ], ), diff --git a/scripts/drone/windows.star b/scripts/drone/windows.star deleted file mode 100644 index 2c0943b9dc2..00000000000 --- a/scripts/drone/windows.star +++ /dev/null @@ -1,149 +0,0 @@ -""" -This module is a library of Drone steps that exclusively run on windows machines. -""" - -load( - "scripts/drone/steps/lib.star", - "download_grabpl_step", -) -load( - "scripts/drone/utils/images.star", - "images", -) -load( - "scripts/drone/utils/utils.star", - "pipeline", -) -load( - "scripts/drone/vault.star", - "from_secret", - "rgm_gcp_key_base64", -) - -def download_nssm_step(): - return { - "name": "downlad-nssm", - "image": images["curl"], - "commands": [ - # We don't need to extract nssm-2.24 because the wix / build process extracts it. It just needs to be in - # PWD and be named `nssm-2.24`. - "curl -L0 https://nssm.cc/release/nssm-2.24.zip -o nssm-2.24.zip", - ], - } - -def download_wix_step(): - return { - "name": "download-wix3", - "image": images["curl"], - "commands": [ - "mkdir wix3 && cd wix3", - "curl -L0 https://github.com/wixtoolset/wix3/releases/download/wix3141rtm/wix314-binaries.zip -o wix3.zip", - "unzip wix3.zip", - ], - } - -def download_zip_step(target = ""): - path = "{}/grafana-$${{DRONE_TAG:1}}.windows-amd64.zip".format(target) - return { - "name": "download-zip", - "image": images["cloudsdk"], - "commands": [ - "printenv GCP_KEY | base64 -d > /tmp/key.json", - "gcloud auth activate-service-account --key-file=/tmp/key.json", - "bash -c 'gcloud storage cp {} grafana.zip'".format(path), - ], - "environment": { - "GCP_KEY": from_secret(rgm_gcp_key_base64), - }, - } - -def windows_msi_pipeline(target = "", name = "", trigger = {}, depends_on = [], environment = {}): - """windows_msi_pipeline is a pipeline which creates an MSI from a .zip file. - - Args: - target: GCS path (with gs:// scheme) to the oflder containing the zip file - name: Name of the pipeline, should be unique. - trigger: The conditions which trigger the pipeline - depends_on: dependencies (strings) - environment: map of environment variables - Returns: - Drone step. - """ - nssm = download_nssm_step() - wix = download_wix_step() - grabpl = download_grabpl_step() - zip = download_zip_step(target = target) - build = build_msi_step( - depends_on = [ - nssm["name"], - wix["name"], - grabpl["name"], - zip["name"], - ], - ) - upload = upload_msi_step( - depends_on = [ - build["name"], - ], - target = target, - ) - - return pipeline( - name = name, - steps = [ - nssm, - wix, - zip, - grabpl, - build, - upload, - ], - trigger = trigger, - depends_on = depends_on, - environment = environment, - ) - -def windows_pipeline_release(name = "prerelease-windows-msi", depends_on = [], trigger = {}, environment = {}): - target = "gs://grafana-prerelease/artifacts/downloads/$${DRONE_TAG}/oss/release" - return windows_msi_pipeline(name = name, target = target, depends_on = depends_on, trigger = trigger, environment = environment) - -def windows_pipeline_main(depends_on = [], trigger = {}, environment = {}): - target = "gs://grafana-downloads/oss/main" - return windows_msi_pipeline(name = "main-windows-msi", target = target, depends_on = depends_on, trigger = trigger, environment = environment) - -def upload_msi_step(depends_on = [], target = ""): - return { - "name": "upload-msi-installer", - "image": images["cloudsdk"], - "commands": [ - "printenv GCP_KEY | base64 -d > /tmp/key.json", - "gcloud auth activate-service-account --key-file=/tmp/key.json", - "bash -c 'gcloud storage cp *.msi {}'".format(target), - "bash -c 'gcloud storage cp *.msi.sha256 {}'".format(target), - ], - "depends_on": depends_on, - "environment": { - "GCP_KEY": from_secret(rgm_gcp_key_base64), - }, - } - -def build_msi_step(depends_on = []): - return { - "name": "build-msi", - "image": images["wine"], - "entrypoint": ["/bin/bash"], - "commands": [ - "export WINEPATH=$(winepath ./wix3)", - "./bin/grabpl windows-installer --target grafana.zip --edition oss", - ], - "depends_on": depends_on, - } - -def windows_manual_pipeline(): - return windows_pipeline_release( - name = "windows-pipeline-manual", - trigger = { - "event": ["promote"], - "target": "build-msi", - }, - )