Skip to content

Commit

Permalink
VAST Data CSI Plugin - v2.4.2
Browse files Browse the repository at this point in the history
  (from 74a71a94d91f1725866056334015f84201bcf23e)
  • Loading branch information
koreno committed Sep 23, 2024
1 parent 7443350 commit 268bab1
Show file tree
Hide file tree
Showing 10 changed files with 95 additions and 19 deletions.
28 changes: 17 additions & 11 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion charts/vastcosi/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion charts/vastcsi/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 10 additions & 1 deletion packaging/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
48 changes: 48 additions & 0 deletions packaging/push_multi_arch.sh
Original file line number Diff line number Diff line change
@@ -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"
10 changes: 8 additions & 2 deletions vast_csi/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down Expand Up @@ -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,
Expand All @@ -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"]))
Expand Down
2 changes: 1 addition & 1 deletion vast_csi/vms_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2.4.1
v2.4.2

0 comments on commit 268bab1

Please sign in to comment.