Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use common CSM baseimage #271

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Dockerfile.podman
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
ARG GOIMAGE
ARG BASEIMAGE

# Stage to build the driver
FROM $GOIMAGE as builder
RUN mkdir -p /go/src
Expand All @@ -14,7 +16,7 @@ RUN go run core/semver/semver.go -f mk

# Dockerfile to build Unity CSI Driver
# Fetching the base ubi micro image with the require packges committed using buildah
FROM localhost/csiunity-ubimicro as driver
FROM $BASEIMAGE as driver

COPY --from=builder /go/src/csi-unity/bin/csi-unity /
COPY csi-unity/scripts/run.sh /
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,19 @@ download-csm-common:
# Generates the docker container (but does not push)
podman-build: download-csm-common go-build
$(eval include csm-common.mk)
sh build.sh --baseubi $(DEFAULT_BASEIMAGE) --goimage $(DEFAULT_GOIMAGE)
sh build.sh --baseimage $(CSM_BASEIMAGE) --goimage $(DEFAULT_GOIMAGE)

podman-push: download-csm-common go-build
$(eval include csm-common.mk)
sh build.sh --baseubi $(DEFAULT_BASEIMAGE) --goimage $(DEFAULT_GOIMAGE) --push
sh build.sh --baseimage $(CSM_BASEIMAGE) --goimage $(DEFAULT_GOIMAGE) --push

podman-build-no-cache: download-csm-common go-build
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the go-build still needed since the build is being done in the Docker image build?

$(eval include csm-common.mk)
sh build.sh --baseubi $(DEFAULT_BASEIMAGE) --goimage $(DEFAULT_GOIMAGE) --no-cache
sh build.sh --baseimage $(CSM_BASEIMAGE) --goimage $(DEFAULT_GOIMAGE) --no-cache

podman-no-cachepush: download-csm-common go-build
$(eval include csm-common.mk)
sh build.sh --baseubi $(DEFAULT_BASEIMAGE) --goimage $(DEFAULT_GOIMAGE) --push --no-cache
sh build.sh --baseimage $(CSM_BASEIMAGE) --goimage $(DEFAULT_GOIMAGE) --push --no-cache

#
# Docker-related tasks
Expand Down
11 changes: 4 additions & 7 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,8 @@ function git_version {


function build_image {
echo ${BASE_UBI_IMAGE}
echo ${DEFAULT_GOIMAGE}
bash build_ubi_micro.sh ${BASE_UBI_IMAGE}
echo $BUILDCMD build ${NOCACHE} -t ${IMAGE_NAME}:${IMAGE_TAG} .
(cd .. && $BUILDCMD build ${NOCACHE} -t ${IMAGE_NAME}:${IMAGE_TAG} --build-arg GOIMAGE=$DEFAULT_GOIMAGE --build-arg GOPROXY=$GOPROXY -f csi-unity/Dockerfile.podman . --format=docker)
echo $BUILDCMD build ${NOCACHE} -t ${IMAGE_NAME}:${IMAGE_TAG} GOIMAGE=$DEFAULT_GOIMAGE BASEIMAGE=$CSM_BASEIMAGE .
(cd .. && $BUILDCMD build --pull ${NOCACHE} -t ${IMAGE_NAME}:${IMAGE_TAG} --build-arg GOIMAGE=$DEFAULT_GOIMAGE --build-arg BASEIMAGE=$CSM_BASEIMAGE --build-arg GOPROXY=$GOPROXY -f csi-unity/Dockerfile.podman . --format=docker)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we get rid of this file altogether? Seems that it may have been part of some legacy build/test framework. Why not push things back into the Makefile?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. New cert-csi VolumeIO run also passed

echo $BUILDCMD tag ${IMAGE_NAME}:${IMAGE_TAG} ${IMAGE_REPO}/${IMAGE_REPO_NAMESPACE}/${IMAGE_NAME}:${IMAGE_TAG}
$BUILDCMD tag ${IMAGE_NAME}:${IMAGE_TAG} ${IMAGE_REPO}/${IMAGE_REPO_NAMESPACE}/${IMAGE_NAME}:${IMAGE_TAG}
}
Expand All @@ -56,9 +53,9 @@ NOCACHE=
# Read options
for param in $*; do
case $param in
"--baseubi")
"--baseimage")
shift
BASE_UBI_IMAGE=$1
CSM_BASEIMAGE=$1
shift
;;
"--goimage")
Expand Down
7 changes: 0 additions & 7 deletions build_ubi_micro.sh

This file was deleted.

12 changes: 6 additions & 6 deletions samples/storageclass/unity-fc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ provisioner: csi-unity.dellemc.com
reclaimPolicy: Delete
# allowVolumeExpansion - Attribute to allow volume expansion
# Allowed values:
# "true" - Volume can be resized
# "false" - Volume cannot be resized
# "true" - Volume can be resized
# "false" - Volume cannot be resized
# Optional: true
# Default value: "true"
allowVolumeExpansion: true
Expand Down Expand Up @@ -56,27 +56,27 @@ parameters:
# Optional: false
# Examples: "APM000000001", "APM000000002"
arrayId: <ARRAY_ID>
#storagePool - Defines storage pool. The value should be picked from the column labeled "CLI ID" of Pools in the Unisphere GUI.
# storagePool - Defines storage pool. The value should be picked from the column labeled "CLI ID" of Pools in the Unisphere GUI.
# Allowed values: String
# Default value: None
# Optional: false
# Examples: pool_0
storagePool: <STORAGE_POOL>
#thinProvisioned- Defines Boolean to choose value of thinProvisioned while creating a new volume
# thinProvisioned- Defines Boolean to choose value of thinProvisioned while creating a new volume
# Allowed values:
# "true" - for thin provision
# "false" - for thick provision
# Optional: true
# Default value: false
thinProvisioned: "true"
#isDataReductionEnabled - Defines Boolean to choose value of is DataReductionEnabled while creating a new volume
# isDataReductionEnabled - Defines Boolean to choose value of is DataReductionEnabled while creating a new volume
# Allowed values:
# "true" - Enables data reduction for all-flash storage pool.
# "false" - Disables data reduction.
# Optional: true
# Default value: false
isDataReductionEnabled: "true"
#TieringPolicy - Tiering policy to be used during provisioning
# TieringPolicy - Tiering policy to be used during provisioning
# Requires FAST VP license.
# Allowed values: String
# Optional: true
Expand Down
12 changes: 6 additions & 6 deletions samples/storageclass/unity-iscsi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ provisioner: csi-unity.dellemc.com
reclaimPolicy: Delete
# allowVolumeExpansion - Attribute to allow volume expansion
# Allowed values:
# "true" - Volume can be resized
# "false" - Volume cannot be resized
# "true" - Volume can be resized
# "false" - Volume cannot be resized
# Default value: "true"
# Optional: true
allowVolumeExpansion: true
Expand Down Expand Up @@ -56,27 +56,27 @@ parameters:
# Optional: false
# Examples: "APM000000001", "APM000000002"
arrayId: <ARRAY_ID>
#storagePool - Defines storage pool. The value should be picked from the column labeled "CLI ID" of Pools in the Unisphere GUI.
# storagePool - Defines storage pool. The value should be picked from the column labeled "CLI ID" of Pools in the Unisphere GUI.
# Allowed values: String
# Default value: None
# Optional: false
# Examples: pool_0
storagePool: <STORAGE_POOL>
#thinProvisioned- Defines Boolean to choose value of thinProvisioned while creating a new volume
# thinProvisioned- Defines Boolean to choose value of thinProvisioned while creating a new volume
# Allowed values:
# "true" - for thin provision
# "false" - for thick provision
# Default value: false
# Optional: true
thinProvisioned: "true"
#isDataReductionEnabled - Defines Boolean to choose value of is DataReductionEnabled while creating a new volume
# isDataReductionEnabled - Defines Boolean to choose value of is DataReductionEnabled while creating a new volume
# Allowed values:
# "true" - Enables data reduction for all-flash storage pool.
# "false" - Disables data reduction.
# Optional: true
# Default value: false
isDataReductionEnabled: "true"
#TieringPolicy - Tiering policy to be used during provisioning
# TieringPolicy - Tiering policy to be used during provisioning
# Requires FAST VP license.
# Allowed values: String
# Optional: true
Expand Down
8 changes: 4 additions & 4 deletions samples/storageclass/unity-nfs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
reclaimPolicy: Delete
# allowVolumeExpansion - Attribute to allow volume expansion
# Allowed values:
# "true" - Volume can be resized

Check warning on line 27 in samples/storageclass/unity-nfs.yaml

View workflow job for this annotation

GitHub Actions / Golang Validation / Yaml Lint

27:5 [comments-indentation] comment not indented like content
# "false" - Volume cannot be resized
# Default value: "true"
# Optional: true
Expand Down Expand Up @@ -53,27 +53,27 @@
# Default value: None
# Examples: "APM000000001", "APM000000002"
arrayId: <ARRAY_ID>
#storagePool - Defines storage pool. The value should be picked from the column labeled "CLI ID" of Pools in the Unisphere GUI.
# storagePool - Defines storage pool. The value should be picked from the column labeled "CLI ID" of Pools in the Unisphere GUI.
# Allowed values: String
# Default value: None
# Optional: false
# Examples: pool_0
storagePool: <STORAGE_POOL>
#thinProvisioned- Defines Boolean to choose value of thinProvisioned while creating a new volume
# thinProvisioned- Defines Boolean to choose value of thinProvisioned while creating a new volume
# Allowed values:
# "true" - for thin provision
# "false" - for thick provision
# Default value: false
# Optional: true
thinProvisioned: "true"
#isDataReductionEnabled - Defines Boolean to choose value of is DataReductionEnabled while creating a new volume
# isDataReductionEnabled - Defines Boolean to choose value of is DataReductionEnabled while creating a new volume
# Allowed values:
# "true" - Enables data reduction for all-flash storage pool.
# "false" - Disables data reduction.
# Optional: true
# Default value: false
isDataReductionEnabled: "true"
#TieringPolicy - Tiering policy to be used during provisioning
# TieringPolicy - Tiering policy to be used during provisioning
# Requires FAST VP license.
# Allowed values: String
# Optional: true
Expand Down
6 changes: 3 additions & 3 deletions samples/storageclass/unity-plain.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@ allowVolumeExpansion: true
volumeBindingMode: Immediate
parameters:
protocol: iSCSI
# arrayId - Serial Id of the array that will be used for provisioning.
# arrayId - Serial Id of the array that will be used for provisioning.
# Allowed values: String
# Default value: None
# Optional: false
# Examples: "APM000000001", "APM000000002"
arrayId: <ARRAY_ID>
#storagePool - Define Storage pool CLI Id of the storage array.
# storagePool - Define Storage pool CLI Id of the storage array.
# Allowed values: String
# Default value: None
# Optional: false
# Examples: pool_0
storagePool: <STORAGE_POOL>
thinProvisioned: "true"
isDataReductionEnabled: "true"
#tieringPolicy - Define Tiering policy that is to be used for provisioning
# tieringPolicy - Define Tiering policy that is to be used for provisioning
# Allowed values: integer
# Default value: None
# Optional: false
Expand Down
Loading