Skip to content

Commit

Permalink
Merge branch 'merge_repos' of github.com:IBM/ibm-spectrum-scale-csi
Browse files Browse the repository at this point in the history
  • Loading branch information
John Dunham committed Jan 20, 2020
2 parents 9d03266 + 3c032be commit 3633cad
Show file tree
Hide file tree
Showing 13 changed files with 42 additions and 121 deletions.
18 changes: 9 additions & 9 deletions .travis-pub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ env:
- LOCAL_IMAGE="csi.ibm.com/csi-scale-operator:testing"

- OPERATOR_SDK="https://github.com/operator-framework/operator-sdk/releases/download/${OP_VER}/operator-sdk-${OP_VER}-x86_64-linux-gnu"
- CSI_OP_BUILD_DIR="${TRAVIS_BUILD_DIR}/stable/ibm-spectrum-scale-csi-operator-bundle/operators/ibm-spectrum-scale-csi-operator"
- CSI_OP_BUILD_DIR="${TRAVIS_BUILD_DIR}/operator"


- OPERATOR_NAME=ibm-spectrum-scale-csi-operator
Expand Down Expand Up @@ -50,7 +50,7 @@ jobs:
script:
- pip install ansible
# Testing that the generated files match the deploy/*.yaml files, it they do not match, fail Travis
- ansible-playbook ${TRAVIS_BUILD_DIR}/ansible/generate-playbook.yaml --extra-vars "travis_testing=true"
- ansible-playbook ${TRAVIS_BUILD_DIR}/tools/ansible/generate-playbook.yaml --extra-vars "travis_testing=true"
- pip install operator-courier
- cd ${CSI_OP_BUILD_DIR}
- python hacks/package_operator.py -d ${OLM_MANIFEST} -o /tmp/operator --nozip
Expand All @@ -61,7 +61,7 @@ jobs:
script:
- sudo pip install docker
- docker version
- ${TRAVIS_BUILD_DIR}/scripts/ci/install_operator-sdk.sh
- ${TRAVIS_BUILD_DIR}/tools/scripts/ci/install_operator-sdk.sh
- cd ${CSI_OP_BUILD_DIR}
- operator-sdk version
- go version
Expand All @@ -81,8 +81,8 @@ jobs:
before_install:
- sudo pip install docker
- pip install openshift
- ${TRAVIS_BUILD_DIR}/scripts/ci/install_minikube.sh
- ${TRAVIS_BUILD_DIR}/scripts/ci/install_operator-sdk.sh
- ${TRAVIS_BUILD_DIR}/tools/scripts/ci/install_minikube.sh
- ${TRAVIS_BUILD_DIR}/tools/scripts/ci/install_operator-sdk.sh
- kubectl version
- cd ${CSI_OP_BUILD_DIR}
- eval $(minikube docker-env) # Popping this out, because I don't think the script is working.
Expand All @@ -95,13 +95,13 @@ jobs:
- python hacks/change_deploy_image.py -i ${DOCKER_REPO} --ifnotpresent
- kubectl create -f deploy/namespace.yaml
- operator-sdk scorecard --config .osdk-scorecard.yaml
- python hacks/clear_finalizers.py --restore
- python hacks/clear_finalizers.py --restore

- before_install:
- sudo pip install docker
- pip install pyyaml molecule openshift docker jmespath kubernetes-validate
- ${TRAVIS_BUILD_DIR}/scripts/ci/install_minikube.sh
- ${TRAVIS_BUILD_DIR}/scripts/ci/install_operator-sdk.sh
- ${TRAVIS_BUILD_DIR}/tools/scripts/ci/install_minikube.sh
- ${TRAVIS_BUILD_DIR}/tools/scripts/ci/install_operator-sdk.sh
- kubectl version
- cd ${CSI_OP_BUILD_DIR}
- eval $(minikube docker-env) # Popping this out, because I don't think the script is working.
Expand All @@ -114,7 +114,7 @@ jobs:
- kubectl create -f deploy/namespace.yaml
- molecule test -s test-local

#- ${TRAVIS_BUILD_DIR}/scripts/ci/fold_ouput.sh cluster.info.2 "cluster information" kubectl cluster-info dump
#- ${TRAVIS_BUILD_DIR}/tools/scripts/ci/fold_ouput.sh cluster.info.2 "cluster information" kubectl cluster-info dump
notifications:
email:
- [email protected]
95 changes: 8 additions & 87 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# <<<<<<< HEAD
services: docker
sudo: required
dist: xenial
#group: bluezone
language: go
go:
- 1.13.x
Expand All @@ -20,7 +18,7 @@ env:
- LOCAL_IMAGE="csi.ibm.com/csi-scale-operator:testing"

- OPERATOR_SDK="https://github.com/operator-framework/operator-sdk/releases/download/${OP_VER}/operator-sdk-${OP_VER}-x86_64-linux-gnu"
- CSI_OP_BUILD_DIR="${TRAVIS_BUILD_DIR}/stable/ibm-spectrum-scale-csi-operator-bundle/operators/ibm-spectrum-scale-csi-operator"
- CSI_OP_BUILD_DIR="${TRAVIS_BUILD_DIR}/operator"


- OPERATOR_NAME=ibm-spectrum-scale-csi-operator
Expand Down Expand Up @@ -52,7 +50,7 @@ jobs:
script:
- pip install ansible
# Testing that the generated files match the deploy/*.yaml files, it they do not match, fail Travis
- ansible-playbook ${TRAVIS_BUILD_DIR}/ansible/generate-playbook.yaml --extra-vars "travis_testing=true"
- ansible-playbook ${TRAVIS_BUILD_DIR}/tools/ansible/generate-playbook.yaml --extra-vars "travis_testing=true"
- pip install operator-courier
- cd ${CSI_OP_BUILD_DIR}
- python hacks/package_operator.py -d ${OLM_MANIFEST} -o /tmp/operator --nozip
Expand Down Expand Up @@ -102,7 +100,7 @@ jobs:
script:
- sudo pip install docker
- docker version
- ${TRAVIS_BUILD_DIR}/scripts/ci/install_operator-sdk.sh
- ${TRAVIS_BUILD_DIR}/tools/scripts/ci/install_operator-sdk.sh
- cd ${CSI_OP_BUILD_DIR}
- operator-sdk version
- go version
Expand All @@ -123,8 +121,8 @@ jobs:
before_install:
- sudo pip install docker
- pip install openshift
- ${TRAVIS_BUILD_DIR}/scripts/ci/install_minikube.sh
- ${TRAVIS_BUILD_DIR}/scripts/ci/install_operator-sdk.sh
- ${TRAVIS_BUILD_DIR}/tools/scripts/ci/install_minikube.sh
- ${TRAVIS_BUILD_DIR}/tools/scripts/ci/install_operator-sdk.sh
- kubectl version
- cd ${CSI_OP_BUILD_DIR}
- eval $(minikube docker-env) # Popping this out, because I don't think the script is working.
Expand All @@ -142,8 +140,8 @@ jobs:
- before_install:
- sudo pip install docker
- pip install pyyaml molecule openshift docker jmespath kubernetes-validate
- ${TRAVIS_BUILD_DIR}/scripts/ci/install_minikube.sh
- ${TRAVIS_BUILD_DIR}/scripts/ci/install_operator-sdk.sh
- ${TRAVIS_BUILD_DIR}/tools/scripts/ci/install_minikube.sh
- ${TRAVIS_BUILD_DIR}/tools/scripts/ci/install_operator-sdk.sh
- kubectl version
- cd ${CSI_OP_BUILD_DIR}
- eval $(minikube docker-env) # Popping this out, because I don't think the script is working.
Expand All @@ -156,83 +154,6 @@ jobs:
- kubectl create -f deploy/namespace.yaml
- molecule test -s test-local

#- ${TRAVIS_BUILD_DIR}/scripts/ci/fold_ouput.sh cluster.info.2 "cluster information" kubectl cluster-info dump
#- ${TRAVIS_BUILD_DIR}/tools/scripts/ci/fold_ouput.sh cluster.info.2 "cluster information" kubectl cluster-info dump
notifications:
email: false
# =======
os: linux
dist: xenial
services: docker

language: go
go:
- "1.13"

env:
global:
- REPO_OWNER=$(dirname $TRAVIS_REPO_SLUG)
- REPO_NAME=$(basename $TRAVIS_REPO_SLUG)

# Grab quay username from 'user+bot_token'
- IMAGE_REPO_OWNER=${QUAY_BOT_USERNAME%%\+*}
# Format quay image target
- IMAGE_REPO=quay.io/${IMAGE_REPO_OWNER}/${REPO_NAME}
# Add image tag
- IMAGE_TAG=$(
if [[ $TRAVIS_EVENT_TYPE == 'cron' ]];
then
echo "nightly-${TRAVIS_BUILD_ID}-`date -u +%F`";
else
echo $TRAVIS_BRANCH;
fi
)
# Add image repo and tag
- IMAGE_FQN=${IMAGE_REPO}:${IMAGE_TAG}
- IMAGE_VERSION=${IMAGE_TAG}
# Add image label to expire nightlies
- IMAGE_LABEL=$(
if [[ $TRAVIS_EVENT_TYPE == 'cron' ]];
then
echo "--label version=${IMAGE_VERSION} --label quay.expires-after=2w";
else
echo "--label version=${IMAGE_VERSION}";
fi
)

stages:
- lint
- test

jobs:
fast_finish: true
include:
# Lint with with .golangci.yml configuration
- stage: lint
before_install:
- >-
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh |
sh -s -- -b $(go env GOPATH)/bin v1.21.0 # pinned
script:
- golangci-lint run

- stage: test
env:
- GOFLAGS="-mod=vendor" #this should not be required in Go 1.14, see https://github.com/golang/go/issues/33848
before_script:
- go mod vendor
script:
- go test -v -race ./...
- docker build ${IMAGE_LABEL} --build-arg GOFLAGS=${GOFLAGS} -f Dockerfile.msb -t ${REPO_NAME} .
before_deploy:
- echo "$QUAY_BOT_PASSWORD" | docker login -u "$QUAY_BOT_USERNAME" --password-stdin quay.io
- docker tag ${REPO_NAME} ${IMAGE_FQN}
deploy:
- provider: script
script: docker push ${IMAGE_FQN}
on:
all_branches: true
condition: -n "$QUAY_BOT_USERNAME" && -n "$QUAY_BOT_PASSWORD"

notifications:
email: false
# >>>>>>> old_driver/devel
20 changes: 10 additions & 10 deletions README.operator.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ export IBM_DIR="$GOPATH/src/github.com/IBM"
# Ensure the dir is present then clone.
mkdir -p ${IBM_DIR}
cd ${IBM_DIR}
git clone https://github.com/IBM/ibm-spectrum-scale-csi-operator.git
git clone https://github.com/IBM/ibm-spectrum-scale-csi.git
```

### Development environment setup

To help configure and resolve dependencies to build the csi-operator, a ansible playbook is provided. You can run the following to invoke the playbook:

``` bash
ansible-playbook $GOPATH/src/github.com/IBM/ibm-spectrum-scale-csi-operator/ansible/dev-env-playbook.yaml
ansible-playbook $GOPATH/src/github.com/IBM/ibm-spectrum-scale-csi/tools/ansible/dev-env-playbook.yaml
```

### Building the image
Expand All @@ -42,8 +42,8 @@ To build the image the user must navigate to the operator directory (This direct

``` bash
# IBM_DIR is defined in the previous step
export OPERATOR_DIR="$IBM_DIR/ibm-spectrum-scale-csi-operator"
cd ${OPERATOR_DIR}/stable/ibm-spectrum-scale-csi-operator-bundle/operators/ibm-spectrum-scale-csi-operator
export OPERATOR_DIR="$IBM_DIR/ibm-spectrum-scale-csi/operator"
cd ${OPERATOR_DIR}

export GO111MODULE="on"
operator-sdk build csi-scale-operator
Expand Down Expand Up @@ -90,7 +90,7 @@ hacks/change_deploy_image.py -i quay.io/<your-user>/ibm-spectrum-scale-csi-opera
If you've built the image as outlined above and tagged it, you can easily run the following to deploy the operator manually, for openshift use "oc" instead of "kubectl"

``` bash
cd ${OPERATOR_DIR}/stable/ibm-spectrum-scale-csi-operator-bundle/operators/ibm-spectrum-scale-csi-operator
cd ${OPERATOR_DIR}/

kubectl apply -f deploy/namespace.yaml
kubectl apply -f deploy/service_account.yaml
Expand All @@ -115,13 +115,13 @@ At this point the operator is running and ready for use!
The following will subscribe the [quay.io](quay.io) version of the operator assuming OLM is installed.

``` bash
cd ${OPERATOR_DIR}/stable/ibm-spectrum-scale-csi-operator-bundle/operators/ibm-spectrum-scale-csi-operator
cd ${OPERATOR_DIR}/

kubectl apply -f deploy/olm-scripts/operator-source.yaml
```
> **NOTE**: Kubernetes use `kubectl` command, replace with `oc` if deploying in OpenShift.
```
cd ${OPERATOR_DIR}/stable/ibm-spectrum-scale-csi-operator-bundle/operators/ibm-spectrum-scale-csi-operator
cd ${OPERATOR_DIR}/
oc apply -f deploy/olm-scripts/operator-source-oc.yaml
```
Expand All @@ -139,12 +139,12 @@ Before starting the plugin, add any secrets to the appropriate namespace. The S
kubectl apply -f secrets.yaml -n ibm-spectrum-scale-csi-driver
```

A sample of the file is provided [deploy/crds/ibm-spectrum-scale-csi-operator-cr.yaml](stable/ibm-spectrum-scale-csi-operator-bundle/operators/ibm-spectrum-scale-csi-operator/deploy/crds/ibm-spectrum-scale-csi-operator-cr.yaml).
A sample of the file is provided [operator/deploy/crds/ibm-spectrum-scale-csi-operator-cr.yaml](operator/deploy/crds/ibm-spectrum-scale-csi-operator-cr.yaml).

Modify this file to match the properties in your environment, then:

* To start the CSI plugin, run: `kubectl apply -f deploy/crds/ibm-spectrum-scale-csi-operator-cr.yaml`
* To stop the CSI plugin, run: `kubectl delete -f deploy/crds/ibm-spectrum-scale-csi-operator-cr.yaml`
* To start the CSI plugin, run: `kubectl apply -f operator/deploy/crds/ibm-spectrum-scale-csi-operator-cr.yaml`
* To stop the CSI plugin, run: `kubectl delete -f operator/deploy/crds/ibm-spectrum-scale-csi-operator-cr.yaml`

## Uninstalling the CSI Operator

Expand Down
2 changes: 1 addition & 1 deletion driver/cmd/ibm-spectrum-scale-csi/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (

"github.com/golang/glog"

driver "github.com/IBM/ibm-spectrum-scale-csi-driver/csiplugin"
driver "github.com/IBM/ibm-spectrum-scale-csi/driver/csiplugin"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion driver/csiplugin/connectors/connectors.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package connectors

import (
"github.com/IBM/ibm-spectrum-scale-csi-driver/csiplugin/settings"
"github.com/IBM/ibm-spectrum-scale-csi/driver/csiplugin/settings"
"github.com/golang/glog"
)

Expand Down
4 changes: 2 additions & 2 deletions driver/csiplugin/connectors/rest_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import (
"strings"
"time"

"github.com/IBM/ibm-spectrum-scale-csi-driver/csiplugin/settings"
"github.com/IBM/ibm-spectrum-scale-csi-driver/csiplugin/utils"
"github.com/IBM/ibm-spectrum-scale-csi/driver/csiplugin/settings"
"github.com/IBM/ibm-spectrum-scale-csi/driver/csiplugin/utils"
"github.com/golang/glog"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
Expand Down
4 changes: 2 additions & 2 deletions driver/csiplugin/controllerserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import (
"strconv"
"strings"

"github.com/IBM/ibm-spectrum-scale-csi-driver/csiplugin/connectors"
"github.com/IBM/ibm-spectrum-scale-csi-driver/csiplugin/utils"
"github.com/IBM/ibm-spectrum-scale-csi/driver/csiplugin/connectors"
"github.com/IBM/ibm-spectrum-scale-csi/driver/csiplugin/utils"
"github.com/container-storage-interface/spec/lib/go/csi"
"github.com/golang/glog"
"golang.org/x/net/context"
Expand Down
6 changes: 3 additions & 3 deletions driver/csiplugin/gpfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import (
"path"
"strings"

"github.com/IBM/ibm-spectrum-scale-csi-driver/csiplugin/connectors"
"github.com/IBM/ibm-spectrum-scale-csi-driver/csiplugin/settings"
"github.com/IBM/ibm-spectrum-scale-csi-driver/csiplugin/utils"
"github.com/IBM/ibm-spectrum-scale-csi/driver/csiplugin/connectors"
"github.com/IBM/ibm-spectrum-scale-csi/driver/csiplugin/settings"
"github.com/IBM/ibm-spectrum-scale-csi/driver/csiplugin/utils"
"github.com/container-storage-interface/spec/lib/go/csi"
"github.com/golang/glog"
"google.golang.org/grpc/codes"
Expand Down
2 changes: 1 addition & 1 deletion driver/csiplugin/gpfs_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"strconv"
"strings"

"github.com/IBM/ibm-spectrum-scale-csi-driver/csiplugin/connectors"
"github.com/IBM/ibm-spectrum-scale-csi/driver/csiplugin/connectors"
"github.com/golang/glog"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/IBM/ibm-spectrum-scale-csi-driver
module github.com/IBM/ibm-spectrum-scale-csi

go 1.13

Expand Down
2 changes: 1 addition & 1 deletion operator/build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ COPY build/health_check.sh .
#RUN chmod 777 ./health_check.sh
COPY licenses /licenses
COPY watches.yaml ${HOME}/watches.yaml
COPY build/_output/bin/ibm-spectrum-scale-csi-operator ${OPERATOR}
COPY build/_output/bin/operator ${OPERATOR}
COPY roles/ ${HOME}/roles/


Expand Down
4 changes: 2 additions & 2 deletions tools/ansible/generate-playbook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
gather_facts: false

vars:
repo_root_dir: "{{ playbook_dir }}/../"
operator_dir: "{{ repo_root_dir }}/stable/ibm-spectrum-scale-csi-operator-bundle/operators/ibm-spectrum-scale-csi-operator"
repo_root_dir: "{{ playbook_dir }}/../../"
operator_dir: "{{ repo_root_dir }}/operator"

generated_dir: "{{ repo_root_dir }}/generated/installer"

Expand Down
2 changes: 1 addition & 1 deletion tools/scripts/ci/ci-env
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export QUAY_USERNAME="mew2057"

export OPERATOR_SDK="https://github.com/operator-framework/operator-sdk/releases/download/${OP_VER}/operator-sdk-${OP_VER}-x86_64-linux-gnu"
export
export CSI_OP_BUILD_DIR="${TRAVIS_BUILD_DIR}/stable/ibm-spectrum-scale-csi-operator-bundle/operators/ibm-spectrum-scale-csi-operator"
export CSI_OP_BUILD_DIR="${TRAVIS_BUILD_DIR}/operator"
export DOCKER_REPO="quay.io/${QUAY_USERNAME}/ibm-spectrum-scale-csi-operator:v0.9.1"

export OPERATOR_NAME=ibm-spectrum-scale-csi-operator
Expand Down

0 comments on commit 3633cad

Please sign in to comment.