From a07c767cad9a7c32788f27d44a898c23927446df Mon Sep 17 00:00:00 2001 From: Antoni Ivanov Date: Thu, 9 Mar 2023 10:26:09 +0200 Subject: [PATCH] vdk-quickstart: remove use of global varaibles in CI The use of global variables in GitLab CI can create problems when multiple CI files are being imported, as variables are not scoped to a specific file. This can lead to unexpected variables being set, causing issues in the CI/CD pipeline. This is what is happening wiht quickstart-vdk test - https://gitlab.com/vmware-analytics/versatile-data-kit/-/jobs/3901914540 It expected that there's python installed because it's supposed to use python image but some other file overrides this image to docker and causes the test to fail. This changes quickstart-vdk to use job-level variables. In future changes I will be changing all CIs to use job-level variables or environment variables to avoid conflicts and ensure proper scoping. Or ensure that global variabels and labels are prefixed with the project or plugin name. Testing Done: this PR CI Signed-off-by: Antoni Ivanov --- projects/vdk-plugins/.plugin-common.yml | 3 ++- projects/vdk-plugins/quickstart-vdk/.plugin-ci.yml | 8 +------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/projects/vdk-plugins/.plugin-common.yml b/projects/vdk-plugins/.plugin-common.yml index 4e6f1091af..95e0f7b6f3 100644 --- a/projects/vdk-plugins/.plugin-common.yml +++ b/projects/vdk-plugins/.plugin-common.yml @@ -51,6 +51,7 @@ extends: .build-plugin .release-plugin: + image: "python:3.10" stage: release before_script: - export VDK_PATCH_VERSION=${CI_PIPELINE_ID} @@ -89,7 +90,7 @@ - echo "Build and release vdk image of plugin $PLUGIN_NAME" - cd $PLUGIN_NAME/ || exit 1 - sed -ri "s/__version__ = \"([[:digit:]]\.[[:digit:]]\.).*\"$/__version__ = \"\1${VDK_PATCH_VERSION}\"/g" setup.py - - apk add --no-cache git bash python3 + - apk add --no-cache git bash python3 py3-pip - python3 -V - python3 -m pip install -U setuptools configparser - export VDK_PACKAGE=$(python3 setup.py --name) diff --git a/projects/vdk-plugins/quickstart-vdk/.plugin-ci.yml b/projects/vdk-plugins/quickstart-vdk/.plugin-ci.yml index 81a743a29b..3986cb59a4 100644 --- a/projects/vdk-plugins/quickstart-vdk/.plugin-ci.yml +++ b/projects/vdk-plugins/quickstart-vdk/.plugin-ci.yml @@ -1,13 +1,6 @@ # Copyright 2021-2023 VMware, Inc. # SPDX-License-Identifier: Apache-2.0 -image: "python:3.7" - -variables: - DOCKER_HOST: tcp://localhost:2375 - DOCKER_DRIVER: overlay2 - DOCKER_TLS_CERTDIR: "" - # Add all quickstart-vdk dependencies locations which trigger the dependency release when changed. # In this way, quickstart-vdk will always be tested before one or more dependencies are changed, and # this is important since quickstart-vdk has unpinned dependencies and when they are upgraded, @@ -78,6 +71,7 @@ quickstart-vdk-release-candidate-base-image: extends: .release-vdk-image quickstart-vdk-release-acceptance-test: + image: "python:3.10" stage: pre_release_test before_script: - export VDK_PATCH_VERSION=${CI_PIPELINE_ID}.dev${CI_PIPELINE_IID}