Skip to content

Commit

Permalink
GA v1.2.0 merge develop to master branch (#85)
Browse files Browse the repository at this point in the history
GA v1.2.0
  • Loading branch information
oriyarde committed Jun 30, 2020
1 parent 61343fa commit 0d417f0
Show file tree
Hide file tree
Showing 33 changed files with 6,094 additions and 160 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ deploy/examples/
# Temporary Build Files
build/_output
build/_test
.idea/
# Created by https://www.gitignore.io/api/go,vim,emacs,visualstudiocode
### Emacs ###
# -*- mode: gitignore; -*-
Expand Down Expand Up @@ -78,3 +79,4 @@ tags
.vscode/*
.history
# End of https://www.gitignore.io/api/go,vim,emacs,visualstudiocode
/vendor/pkg/
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
build:
CGO_ENABLED=1 GOOS=linux go build -o build/_output/bin/ibm-block-csi-operator -gcflags all=-trimpath=${GOPATH} -asmflags all=-trimpath=${GOPATH} -mod=vendor cmd/manager/main.go

.PHONY: courier
courier:
operator-courier --verbose verify deploy/olm-catalog/ibm-block-csi-operator-community
operator-courier --verbose verify deploy/olm-catalog/ibm-block-csi-operator

.PHONY: test
test: update
# for go 1.13+, set GOFLAGS to enable vendor mod for ginkgo
Expand All @@ -29,7 +34,6 @@ test: update
update:
hack/update-all.sh


.PHONY: list
list:
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$'
Expand Down
10 changes: 5 additions & 5 deletions NOTICES
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This file details additional third party software license agreements
and third party notices and information that are required
to be reproduced for the following programs:

Operator for IBM Block Storage CSI Driver version 1.1.0
Operator for IBM Block Storage CSI Driver version 1.2.0



Expand Down Expand Up @@ -1040,7 +1040,7 @@ Version 7

===========================================================================
END OF TERMS AND CONDITIONS FOR SEPARATELY LICENSED CODE for Operator for
IBM Block Storage CSI Driver version 1.1.0
IBM Block Storage CSI Driver version 1.2.0
===========================================================================


Expand All @@ -1051,7 +1051,7 @@ IBM Block Storage CSI Driver version 1.1.0

GNU GPL and / or LGPL Source Code for:

Operator for IBM Block Storage CSI Driver Version 1.1.0 Third Party
Operator for IBM Block Storage CSI Driver Version 1.2.0 Third Party
Licenses and Notices

===========================================================================
Expand All @@ -1070,7 +1070,7 @@ under the GNU Lesser General Public License 3.0.
Prometheus version 1.8.2

Source code to any of the above-listed packages distributed with
Operator for IBM Block Storage CSI Driver Version 1.1.0 Third Party
Operator for IBM Block Storage CSI Driver Version 1.2.0 Third Party
Licenses and Notices is available at the website below, when a URL is
provided, or by sending a request to the following address or email:

Expand Down Expand Up @@ -4996,7 +4996,7 @@ END OF thrift NOTICES AND INFORMATION

===========================================================================
END OF NOTICES AND INFORMATION FOR Operator for IBM Block
Storage CSI Driver Version 1.1.0 Third Party Licenses and
Storage CSI Driver Version 1.2.0 Third Party Licenses and
Notices
===========================================================================

24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ The Container Storage Interface (CSI) Driver for IBM block storage systems enabl
This is the official operator to deploy and manage IBM block storage CSI driver.

Supported container platforms:
- OpenShift v4.2
- OpenShift v4.3
- Kubernetes v1.14
- OpenShift v4.4
- Kubernetes v1.16
- Kubernetes v1.17

Supported IBM storage systems:
- IBM FlashSystem 9100
Expand Down Expand Up @@ -211,7 +211,7 @@ $ kubectl -n <namespace> apply -f csi.ibm.com_v1_ibmblockcsi_cr.yaml
```bash
$ kubectl get all -n <namespace> -l csi
NAME READY STATUS RESTARTS AGE
pod/ibm-block-csi-controller-0 4/4 Running 0 9m36s
pod/ibm-block-csi-controller-0 5/5 Running 0 9m36s
pod/ibm-block-csi-node-jvmvh 3/3 Running 0 9m36s
pod/ibm-block-csi-node-tsppw 3/3 Running 0 9m36s

Expand Down Expand Up @@ -265,7 +265,7 @@ kubectl create secret generic <NAME> --from-literal=username=<USER> --fromlitera

#### 2. Create storage classes

Create a storage class `storageclass-gold.yaml` file as follows, with the relevant capabilities, pool and, array secret.
Create a storage class `demo-storageclass-gold-pvc.yaml` file as follows, with the relevant capabilities, pool and, array secret.

Use the `SpaceEfficiency` parameters for each storage system. These values are not case sensitive:
* IBM FlashSystem A9000 and A9000R
Expand All @@ -286,22 +286,22 @@ metadata:
name: gold
provisioner: block.csi.ibm.com
parameters:
#SpaceEfficiency: <VALUE> # Optional: Values applicable for Spectrum Virtualize Family are: thin, compressed, or deduplicated
pool: <VALUE_POOL_NAME> # DS8000 Family paramater is VALUE_POOL_ID
SpaceEfficiency: <VALUE> # Optional: Values applicable for Spectrum Virtualize Family are: thin, compressed, or deduplicated
pool: <POOL_NAME> # DS8000 Family paramater is pool ID
csi.storage.k8s.io/provisioner-secret-name: <VALUE_ARRAY_SECRET>
csi.storage.k8s.io/provisioner-secret-namespace: <VALUE_ARRAY_SECRET_NAMESPACE>
csi.storage.k8s.io/controller-publish-secret-name: <VALUE_ARRAY_SECRET>
csi.storage.k8s.io/controller-publish-secret-namespace: <VALUE_ARRAY_SECRET_NAMESPACE>
csi.storage.k8s.io/provisioner-secret-name: <ARRAY_SECRET>
csi.storage.k8s.io/provisioner-secret-namespace: <ARRAY_SECRET_NAMESPACE>
csi.storage.k8s.io/controller-publish-secret-name: <ARRAY_SECRET>
csi.storage.k8s.io/controller-publish-secret-namespace: <ARRAY_SECRET_NAMESPACE>
csi.storage.k8s.io/fstype: xfs # Optional: Values ext4/xfs. The default is ext4.
csi.storage.k8s.io/fstype: xfs # Optional: Values ext4/xfs. The default is ext4.
volume_name_prefix: <prefix_name> # Optional: DS8000 Family maximum prefix length is 5 characters. Maximum prefix length for other systems is 20 characters.
```

#### 3. Apply the storage class:

```bash
$ kubectl apply -f storageclass-gold.yaml
$ kubectl apply -f demo-storageclass-gold-pvc.yaml
storageclass.storage.k8s.io/gold created
```

Expand Down
4 changes: 2 additions & 2 deletions build/Dockerfile.operator
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ RUN CGO_ENABLED=1 GOOS=linux go build \
github.com/IBM/ibm-block-csi-operator/cmd/manager


FROM registry.access.redhat.com/ubi7/ubi-minimal:7.7-138
FROM registry.access.redhat.com/ubi7/ubi-minimal:7.8-237
MAINTAINER IBM Storage

ARG VERSION=1.1.0
ARG VERSION=1.2.0
ARG BUILD_NUMBER=0

###Required Labels
Expand Down
22 changes: 22 additions & 0 deletions build/ci/Dockerfile.courier
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright IBM Corporation 2020.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http:https://www.apache.org/licenses/LICENSE-2.0

# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

FROM python:3

WORKDIR /usr/src/app

RUN pip3 install operator-courier

COPY . .
CMD ["make", "courier"]
7 changes: 6 additions & 1 deletion build/ci/jenkins_pipeline_build
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pipeline {
agent {
label 'docker-engine'
label "${env.AGENT_LABEL}"
}
stages {
stage ('Run unit tests') {
Expand All @@ -9,6 +9,11 @@ pipeline {
sh './build/ci/run_unittests.sh'
}
}
stage ('Run OLM verifications') {
steps {
sh './build/ci/run_olm_verification.sh'
}
}
stage ('Build and push images') {
steps {
sh './build/ci/build_push_image.sh build/_output/reports/images_url'
Expand Down
80 changes: 80 additions & 0 deletions build/ci/multiarch/helper_to_push_csi_images_and_manifests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
#!/bin/bash -ex

# ----------------------------------------------------------------
# This script is for internal use in CI
# The script push all csi images from internal registry to external registry.
# Images for amd64, ppc64le and s390x for each csi image : operator, controller and node.
# It also creates and pushes relevant manifests per architecture into the external repository.
# The script validates the whole process. If something gets wrong the script will fail with error.
# Pre-requisites:
# 1. Run docker login to the external registry in advance.
# 2. The internal images should exist in advance.
# 3. The external images should NOT exist (the script will create them).
# 4. Helper scripts should be accessible: ./helper_to_push_docker_image.sh and ./helper_to_push_docker_manifest.sh
# 5. Scripts input comes from environment variables
# ----------------------------------------------------------------

function push_arch_images_and_create_manifest_for_app() {
# This function push <app> arch images(X, P and Z) from internal registry to external registry and then create manifest for them on the external registry.
# Function arguments :
# <app name>
# <in_app_image_AMD64> <out_app_image_AMD64>
# <in_app_image_PPC64LE> <out_app_image_PPC64LE>
# <in_app_image_S390X> <out_app_image_S390X>
# <out_app_image_MULTIARCH>
# <tag_LATEST>

app_name="$1"
in_app_image_AMD64="$2"
out_app_image_AMD64="$3"
in_app_image_PPC64LE="$4"
out_app_image_PPC64LE="$5"
in_app_image_S390X="$6"
out_app_image_S390X="$7"
out_app_image_MULTIARCH="$8"
tag_LATEST="$9"

echo ""
echo "Start to push $app_name images and manifest..."
$HELPER_PUSH_IMAGE $in_app_image_AMD64 $out_app_image_AMD64 $tag_LATEST
$HELPER_PUSH_IMAGE $in_app_image_PPC64LE $out_app_image_PPC64LE $tag_LATEST
$HELPER_PUSH_IMAGE $in_app_image_S390X $out_app_image_S390X $tag_LATEST
$HELPER_PUSH_MANIFEST $out_app_image_MULTIARCH $out_app_image_AMD64 $out_app_image_PPC64LE $out_app_image_S390X
if [ -n "$tag_LATEST" ]; then
latest_external_image=$(echo $out_app_image_MULTIARCH | sed "s|^\(.*/.*:\)\(.*\)$|\1$tag_LATEST|") # replace tag with $tag_LATEST
$HELPER_PUSH_MANIFEST $latest_external_image $out_app_image_AMD64 $out_app_image_PPC64LE $out_app_image_S390X no
fi
}

operator_envs="in_OPERATOR_IMAGE_AMD64 out_OPERATOR_IMAGE_AMD64 in_OPERATOR_IMAGE_PPC64LE out_OPERATOR_IMAGE_PPC64LE in_OPERATOR_IMAGE_S390X out_OPERATOR_IMAGE_S390X out_OPERATOR_IMAGE_MULTIARCH"
controller_envs="in_CONTROLLER_IMAGE_AMD64 out_CONTROLLER_IMAGE_AMD64 in_CONTROLLER_IMAGE_PPC64LE out_CONTROLLER_IMAGE_PPC64LE in_CONTROLLER_IMAGE_S390X out_CONTROLLER_IMAGE_S390X out_CONTROLLER_IMAGE_MULTIARCH"
node_envs="in_NODE_IMAGE_AMD64 out_NODE_IMAGE_AMD64 in_NODE_IMAGE_PPC64LE out_NODE_IMAGE_PPC64LE in_NODE_IMAGE_S390X out_NODE_IMAGE_S390X out_NODE_IMAGE_MULTIARCH"

HELPER_PUSH_IMAGE=./helper_to_push_docker_image.sh
HELPER_PUSH_MANIFEST=./helper_to_push_docker_manifest.sh

date
# Validations
[ -f $HELPER_PUSH_IMAGE -a -f $HELPER_PUSH_MANIFEST ] && : || exit 1
for expected_env in $operator_envs $controller_envs $node_envs; do
[ -z "$(printenv $expected_env)" ] && {
echo "Error: expected env [$expected_env] does not exist. Please set it first."
exit 1
} || :
echo "$expected_env=$(printenv $expected_env)"
done

echo "TAG_LATEST=$TAG_LATEST"

push_arch_images_and_create_manifest_for_app "operator" $in_OPERATOR_IMAGE_AMD64 $out_OPERATOR_IMAGE_AMD64 $in_OPERATOR_IMAGE_PPC64LE $out_OPERATOR_IMAGE_PPC64LE $in_OPERATOR_IMAGE_S390X $out_OPERATOR_IMAGE_S390X $out_OPERATOR_IMAGE_MULTIARCH $TAG_LATEST
push_arch_images_and_create_manifest_for_app "controller" $in_CONTROLLER_IMAGE_AMD64 $out_CONTROLLER_IMAGE_AMD64 $in_CONTROLLER_IMAGE_PPC64LE $out_CONTROLLER_IMAGE_PPC64LE $in_CONTROLLER_IMAGE_S390X $out_CONTROLLER_IMAGE_S390X $out_CONTROLLER_IMAGE_MULTIARCH $TAG_LATEST
push_arch_images_and_create_manifest_for_app "node" $in_NODE_IMAGE_AMD64 $out_NODE_IMAGE_AMD64 $in_NODE_IMAGE_PPC64LE $out_NODE_IMAGE_PPC64LE $in_NODE_IMAGE_S390X $out_NODE_IMAGE_S390X $out_NODE_IMAGE_MULTIARCH $TAG_LATEST

date
echo "######################################"
echo "Finish to push successfully all images"
echo "######################################"

echo $out_OPERATOR_IMAGE_MULTIARCH
echo $out_CONTROLLER_IMAGE_MULTIARCH
echo $out_NODE_IMAGE_MULTIARCH
75 changes: 75 additions & 0 deletions build/ci/multiarch/helper_to_push_docker_image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#!/bin/bash -xe

# This script is for internal use in CI
# Assume docker login to the external registry was done in advance.

function usage()
{
echo $0 [internal-image-path] [external-image-path] [latest-tag-optional]
exit 1
}

[ $# -eq 2 -o $# -eq 3 ] || { usage; }

internal_image=$1
external_image=$2
latest="$3"

# if also latest, then define latest_external_image (replace the external tag with the $latest wanted tag)
if [ -n "$latest" ]; then
latest_external_image=`echo $external_image | sed "s|^\(.*/.*:\)\(.*\)$|\1$latest|"`
latest_str_msg=" And latest tag image [$latest_external_image]"
fi

echo "Preparing to push internal_image --> external_image:"
echo " internal_image=[$internal_image]"
echo " external_image=[$external_image]"
[ -n "$latest" ] && echo " latest_image =[$latest_external_image]"


echo "1. Validate no external_image exists yet before pushing it." # Note: no need to test latest tag since it already exists
docker pull $external_image && { echo "Error : the $external_image exists in remote. Cannot overwrite it."; exit 1; } || { echo "$external_image is not exist on the remote."; }
echo ""


echo "2. Validate internal_image does not exist yet on local."
docker images $internal_image
docker rmi $internal_image && { echo "Remove the internal_image image to pull it again"; } || { echo "internal_image does not exist on local. Continue."; }
echo ""


echo "3. Pull internal_image to local"
docker pull $internal_image
echo ""


echo "4. Tag internal_image to external_image (and latest=[$latest_external_image]) and remove the internal_image"
docker tag $internal_image $external_image
[ -n "$latest_external_image" ] && docker tag $internal_image $latest_external_image
docker rmi $internal_image
docker push $external_image
[ -n "$latest_external_image" ] && docker push $latest_external_image
echo ""


echo "5. Test pushed image by delete the local and pull it back"
docker rmi $external_image
docker pull $external_image
docker rmi $external_image


if [ -n "$latest_external_image" ]; then
echo "6. Test pushed [latest] image by delete the local and pull it back"
docker rmi $latest_external_image
docker pull $latest_external_image
docker rmi $latest_external_image
fi

set +x
echo ""
echo "Succeeded to push internal_image --> external_image"
echo " internal_image=[$internal_image]"
echo " external_image=[$external_image]"
[ -n "$latest" ] && echo " latest_image =[$latest_external_image]"
set -x

Loading

0 comments on commit 0d417f0

Please sign in to comment.