diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 59eea0f..56820dd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,7 +9,7 @@ image: docker:latest variables: DOCKER_REGISTRY: ${AWS_ACCOUNT_ID}.dkr.ecr.eu-west-1.amazonaws.com IMAGE_NAME: ${AWS_ACCOUNT_ID}.dkr.ecr.eu-west-1.amazonaws.com/dev/vast-csi:${CI_PIPELINE_ID} - BASE_IMAGE_NAME: ${AWS_ACCOUNT_ID}.dkr.ecr.eu-west-1.amazonaws.com/dev/vast-csi-base:2022-12-09 + BASE_IMAGE_NAME: ${AWS_ACCOUNT_ID}.dkr.ecr.eu-west-1.amazonaws.com/dev/vast-csi-base:2024-09-10 ORION_BRANCH: comet/master @@ -60,6 +60,13 @@ build_csi: - vast-dev-builder +.common_vars: &common_vars + INSTALL_IMAGE: "prev_version" + VAST_upgrade_to: $INSTALL_IMAGE + VAST_COMET__KWARG: csi_plugin_version=${CI_PIPELINE_ID} + TRIGGER_SOURCE: "vastcsi" + + test_csi [latest]: &test_csi stage: test when: always @@ -70,10 +77,15 @@ test_csi [latest]: &test_csi branch: $ORION_BRANCH strategy: depend allow_failure: true + variables: *common_vars + + +test_csi_multicluster [latest]: + <<: *test_csi + when: manual variables: - INSTALL_IMAGE: "prev_version" - VAST_upgrade_to: $INSTALL_IMAGE - VAST_COMET_KWARG: csi_plugin_version=${CI_PIPELINE_ID} + <<: *common_vars + NUM_SYSTEMS: 2 test_csi: @@ -104,14 +116,8 @@ update_dockerhub [prod]: &update_dockerhub VERSION=$VERSION-$CI_ENVIRONMENT_NAME-$CI_PIPELINE_ID fi RELEASE_NAME=docker.io/vastdataorg/csi:${VERSION} - - docker pull ${IMAGE_NAME} - docker tag ${IMAGE_NAME} ${RELEASE_NAME} - - echo "Pushing: ${IMAGE_NAME} --> ${RELEASE_NAME}" docker login -u ${DOCKER_USER} -p ${DOCKER_PASSWORD} $DOCKER_HUB - docker push ${RELEASE_NAME} - echo "pushed ${RELEASE_NAME}" + /bin/sh -x packaging/push_multi_arch.sh ${BASE_IMAGE_NAME} ${RELEASE_NAME} after_script: - docker logout $DOCKER_HUB diff --git a/CHANGELOG.md b/CHANGELOG.md index 5211ad5..35cec33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## Version 2.4.2 +* Support for ARM architecture (VCSI-191) +* Bug Fix - do not expect VMS credentials in a non-ephemeral mounting flow (VCSI-196) + ## Version 2.4.1 * Support for multiple Vast Clusters via using StorageClass secrets (VCSI-140) * Set a timeout on requests to VMS, to prevent worker threads hanging (VCSI-183) diff --git a/README.md b/README.md index 515bc90..9722566 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,7 @@ # VAST Data CSI Driver -The source-code in this repository is for informational purposes only. It is not meant to be compiled or used directly. +The source-code in this repository is for informational purposes only. It is not meant to be used directly. If you wish to use our driver with your VAST storage system, please refer to our [official documentation](https://support.vastdata.com/s/topic/0TOV40000000TwTOAU/vast-csi-driver-23-administrators-guide). + +Avoid opening issues in this within this project. +If you need support, please use VAST's Customer Support channels - https://support.vastdata.com diff --git a/charts/vastcosi/values.yaml b/charts/vastcosi/values.yaml index 11844b2..35309e1 100644 --- a/charts/vastcosi/values.yaml +++ b/charts/vastcosi/values.yaml @@ -62,7 +62,7 @@ truncateVolumeName: 64 image: csiVastPlugin: repository: vastdataorg/csi - tag: v2.4.1 + tag: v2.4.2 # the version of the Vast COSI driver imagePullPolicy: IfNotPresent objectstorageProvisioner: repository: gcr.io/k8s-staging-sig-storage/objectstorage-sidecar/objectstorage-sidecar diff --git a/charts/vastcsi/values.yaml b/charts/vastcsi/values.yaml index 0c70ad0..e271758 100644 --- a/charts/vastcsi/values.yaml +++ b/charts/vastcsi/values.yaml @@ -180,7 +180,7 @@ snapshotClasses: {} image: csiVastPlugin: repository: vastdataorg/csi - tag: v2.4.1 # the version of the Vast CSI driver + tag: v2.4.2 # the version of the Vast CSI driver imagePullPolicy: IfNotPresent csiAttacher: repository: registry.k8s.io/sig-storage/csi-attacher diff --git a/packaging/Dockerfile b/packaging/Dockerfile index 15d15dd..2919c67 100644 --- a/packaging/Dockerfile +++ b/packaging/Dockerfile @@ -4,7 +4,16 @@ FROM $BASE_IMAGE_NAME COPY packaging/files files RUN pip install --no-cache-dir -r files/requirements.txt && rm -rf files -RUN cd /usr/libexec/gcc/x86_64-alpine-linux-musl/*/ && rm -fv cc1 cc1obj cc1plus lto1 +# Dynamically find the GCC directory and remove GCC files +RUN set -ex; \ + gcc_dir=$(find /usr/libexec/gcc -mindepth 1 -maxdepth 1 -type d | grep -E "gcc/.*-alpine-linux-musl"); \ + if [ -n "$gcc_dir" ]; then \ + echo "Found GCC directory: $gcc_dir"; \ + cd "$gcc_dir" && rm -fv cc1 cc1obj cc1plus lto1; \ + else \ + echo "No suitable GCC directory found."; \ + fi + COPY vast_csi vast_csi COPY charts charts diff --git a/packaging/push_multi_arch.sh b/packaging/push_multi_arch.sh new file mode 100755 index 0000000..0e7da13 --- /dev/null +++ b/packaging/push_multi_arch.sh @@ -0,0 +1,48 @@ +#!/bin/sh + +set -e + +log() { echo -e "\033[93m$(date $DATE_PARAM) >> $@\033[0m" 1>&2; } + +# Check if the base image name is specified +if [ -z "$1" ]; then + log "Base image name is not specified." && exit 1 +fi + +# Check if the tag is specified +if [ -z "$2" ]; then + log "Tag is not specified." && exit 1 +fi + +BASE_IMAGE_NAME=$1 +IMAGE_TAG=$2 +VERSION=$(cat version.txt) +if [ -z "$CI_COMMIT_SHA" ]; then + CI_COMMIT_SHA=$(git rev-parse HEAD) +fi + +# Define target platforms +PLATFORMS="linux/amd64,linux/arm64" + +# Create or use an existing Buildx builder instance +if ! docker buildx inspect builder > /dev/null 2>&1; then + log "Creating a new Buildx builder instance." + docker buildx create --name builder --use +else + log "Using existing Buildx builder instance." +fi + +# Build and push the Docker image +docker buildx build \ + --platform $PLATFORMS \ + -t $IMAGE_TAG \ + --build-arg=GIT_COMMIT=$CI_COMMIT_SHA \ + --build-arg=VERSION=$VERSION \ + --build-arg=CI_PIPELINE_ID=${CI_PIPELINE_ID:-local} \ + --build-arg=BASE_IMAGE_NAME=$BASE_IMAGE_NAME \ + -f packaging/Dockerfile \ + --push \ + . + +# Log build completion +log "Build and push completed for image: $IMAGE_TAG for platforms: $PLATFORMS" diff --git a/vast_csi/server.py b/vast_csi/server.py index 39aeb3a..f629e40 100644 --- a/vast_csi/server.py +++ b/vast_csi/server.py @@ -405,7 +405,7 @@ def _delete_data_from_storage(self, vms_session, path, tenant_id): vms_session.delete_folder(path, tenant_id) return # Successfully deleted. Prevent using local mounting except OperationNotSupported as exc: - logger.debug(f"Trash API not available {exc}") + logger.info(f"Trash API not available {exc}") CONF.avoid_trash_api.reset() logger.info(f"Use local mounting to delete {path}") @@ -693,9 +693,9 @@ def NodeGetCapabilities(self): def NodePublishVolume( self, - vms_session, volume_id, target_path, + vms_session=None, volume_capability=None, publish_context=None, readonly=False, @@ -708,6 +708,12 @@ def NodePublishVolume( ): from .quantity import parse_quantity + if not vms_session: + raise Abort( + FAILED_PRECONDITION, + "Ephemeral Volume provisioning requires " + "configuring a global VMS credentials secret or nodePublishSecretRef secret reference." + ) eph_volume_name_fmt = volume_context.get("eph_volume_name_fmt", CONF.name_fmt) if "size" in volume_context: required_bytes = int(parse_quantity(volume_context["size"])) diff --git a/vast_csi/vms_session.py b/vast_csi/vms_session.py index 4e34911..12c97fb 100644 --- a/vast_csi/vms_session.py +++ b/vast_csi/vms_session.py @@ -250,7 +250,7 @@ def delete_folder(self, path: str, tenant_id: int): self.delete("/folders/delete_folder/", data={"path": path, "tenant_id": tenant_id}) except ApiError as e: if "no such directory" in e.render(): - logger.debug(f"Remote directory might have been removed earlier. ({e})") + logger.info(f"Remote directory might have been removed earlier. ({e})") elif "trash folder disabled" in e.render(): raise CannotUseTrashAPI(reason="Trash Folder Access is disabled (see Settings/Cluster/Features in VMS)") else: diff --git a/version.txt b/version.txt index a372120..3dfbe33 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -v2.4.1 +v2.4.2