77
88before_script :
99 - export CLUSTER_NAME=cvmfs-validation-$(echo $CI_COMMIT_SHA | head -c 6)
10+ - export BASE_CLUSTER_TEMPLATE="kubernetes-1.17.2-3"
1011 - export OS_AUTH_URL="https://keystone.cern.ch/main/v3"
1112 - export OS_IDENTITY_API_VERSION="3"
1213 - export OS_USERNAME="svcbuild"
@@ -19,84 +20,88 @@ before_script:
1920
2021build :
2122 stage : build
22- image : gitlab-registry.cern.ch/cloud/ciadm
23+ image : gitlab-registry.cern.ch/cloud/ciadm:v0.3.6
2324 script :
24- - rpm --import https://mirror.go-repo.io/centos/RPM-GPG-KEY-GO-REPO
25- - curl -s https://mirror.go-repo.io/centos/go-repo.repo | tee /etc/yum.repos.d/go-repo.repo
26- - echo 'priority=1' >> /etc/yum.repos.d/go-repo.repo
27- - yum install -y gcc git golang make
28- - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN gitlab-registry.cern.ch
2925 - make
3026 - make test
3127 artifacts :
32- expire_in : ' 10 days '
28+ expire_in : ' 30 minutes '
3329 paths :
34- - _output /csi-cvmfsplugin
30+ - bin /csi-cvmfsplugin
3531 except :
3632 - qa
3733 - master
38- tags :
39- - docker-privileged
4034
41- build image :
35+ buildimg :
4236 stage : image
43- image : gitlab-registry.cern.ch/cloud/ciadm
44- script :
45- - cp _output/csi-cvmfsplugin deploy/docker
46- - yum install -y make
47- - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN gitlab-registry.cern.ch
48- - docker build -t gitlab-registry.cern.ch/cloud-infrastructure/cvmfs-csi/cvmfsplugin:$CI_COMMIT_SHA deploy/docker
49- - docker push gitlab-registry.cern.ch/cloud-infrastructure/cvmfs-csi/cvmfsplugin:$CI_COMMIT_SHA
37+ variables :
38+ TO : " ${CI_REGISTRY_IMAGE}/cvmfs-csi:${CI_COMMIT_SHORT_SHA} "
39+ CONTEXT_DIR : " ./ "
40+ DOCKER_FILE : " deployments/docker/Dockerfile "
41+ tags :
42+ - docker-image-build
43+ script : " echo "
5044 dependencies :
5145 - build
46+ only :
47+ - branches
5248 except :
5349 - master
54- - qa
55- tags :
56- - docker-privileged
5750
58- test k8s :
51+ testk8s :
5952 stage : test
60- image : gitlab-registry.cern.ch/cloud/ciadm
61- script :
62- - openstack coe cluster create $CLUSTER_NAME --cluster-template kubernetes-preview --keypair lxplus --node-count 1 --master-count 1 --flavor m2.small --labels influx_grafana_dashboard_enabled=True --labels cephfs_csi_enabled=True --labels manila_enabled=True --labels kube_tag=v1.14.1 --labels kube_csi_enabled=True --labels kube_csi_version=cern-csi-1.0-1 --labels heat_container_agent_tag=stein-dev-1 --labels cgroup_driver=cgroupfs --labels container_infra_prefix=gitlab-registry.cern.ch/cloud/atomic-system-containers/ --labels flannel_backend=vxlan --labels cvmfs_csi_version=$CI_COMMIT_SHA --labels admission_control_list=NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota,Priority --labels ingress_controller=traefik --labels manila_version=v0.3.0 --labels cvmfs_csi_enabled=True --labels cvmfs_tag=qa --labels cephfs_csi_version=cern-csi-1.0-1
63- - sleep 10
64- - STATUS=$(openstack coe cluster show $CLUSTER_NAME -c status | grep 'status ' | awk '{print $4}')
65- - while [ "$STATUS" != "CREATE_COMPLETE" ] && [ "$STATUS" != "CREATE_FAILED" ]; do STATUS=$(openstack coe cluster show $CLUSTER_NAME -c status | grep 'status ' | awk '{print $4}'); done
66- - openstack coe cluster show $CLUSTER_NAME
67- - openstack coe cluster config $CLUSTER_NAME
68- - export KUBECONFIG=config
69- - kubectl create --validate=false -f magnum-cvmfs.yaml
70- - until kubectl rollout status deployment/cvmfs; do kubectl get all; kubectl describe pvc; done
71- - POD=$(kubectl get pod | grep cvmfs | awk '{print $1}')
72- - kubectl exec $POD -c atlas cat /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/README.INSTALL
73- - kubectl exec $POD -c cms cat /cvmfs/cms.cern.ch/README
53+ image : gitlab-registry.cern.ch/cloud/ciadm:v0.3.6
54+ script : |
55+ LABELS=$(openstack coe cluster template show -f json $BASE_CLUSTER_TEMPLATE | jq --raw-output '.labels | to_entries | map("--labels \(.key)=\(.value)") | join(" ")')
56+ openstack coe cluster create $CLUSTER_NAME --cluster-template $BASE_CLUSTER_TEMPLATE --keypair lxplus --node-count 1 --master-count 1 --flavor m2.small $LABELS
57+ sleep 10
58+ STATUS=$(openstack coe cluster show $CLUSTER_NAME -c status -f value)
59+ while [ "${STATUS}" != "CREATE_COMPLETE" ] && [ "${STATUS}" != "CREATE_FAILED" ]
60+ do
61+ STATUS=$(openstack coe cluster show $CLUSTER_NAME -c status -f value)
62+ echo "Current cluster status ... $STATUS $(date)"
63+ sleep 10
64+ done
65+
66+ openstack coe cluster show $CLUSTER_NAME
67+ openstack coe cluster config $CLUSTER_NAME
68+ export KUBECONFIG=config
69+
70+ for m in $(ls test)
71+ do
72+ kubectl create --validate=false -f test/${m}
73+ done
74+ for m in $(ls test)
75+ do
76+ kubectl wait --for=condition=complete --timeout=600s -l ci=true --all-namespaces job
77+ done
7478 dependencies :
75- - build
79+ - buildimg
7680 except :
7781 - master
7882 - qa
7983
8084cleanup test clusters :
8185 stage : cleanup
82- image : gitlab-registry.cern.ch/cloud/ciadm
83- script :
84- - openstack coe cluster show ${CLUSTER_NAME}; if [ $? -eq 0 ]; then openstack coe cluster delete ${CLUSTER_NAME} || true; fi
85- - sleep 5
86- - while openstack coe cluster show ${CLUSTER_NAME}; [ $? -eq 0 ]; do sleep 3; done
86+ image : gitlab-registry.cern.ch/cloud/ciadm:v0.3.6
87+ script : |
88+ STATUS=$(openstack coe cluster show $CLUSTER_NAME -c status -f value)
89+ while true
90+ do
91+ if [ "${STATUS}" != "DELETE_IN_PROGRESS" ]
92+ then
93+ openstack coe cluster delete $CLUSTER_NAME || true
94+ fi
95+ sleep 10
96+ if STATUS=$(openstack coe cluster show $CLUSTER_NAME -c status -f value)
97+ then
98+ echo "Current cluster status ... $STATUS $(date)"
99+ else
100+ echo "done"
101+ break
102+ fi
103+ done
87104 when : always
88105 except :
89106 - master
90107 - qa
91-
92- deploy tag :
93- stage : deploy
94- image : gitlab-registry.cern.ch/cloud/ciadm
95- script :
96- - docker pull gitlab-registry.cern.ch/cloud-infrastructure/cvmfs-csi/cvmfsplugin:$CI_COMMIT_SHA
97- - docker tag gitlab-registry.cern.ch/cloud-infrastructure/cvmfs-csi/cvmfsplugin:$CI_COMMIT_SHA gitlab-registry.cern.ch/cloud-infrastructure/cvmfs-csi/cvmfsplugin:$CI_COMMIT_TAG
98- - docker push gitlab-registry.cern.ch/cloud-infrastructure/cvmfs-csi/cvmfsplugin:$CI_COMMIT_TAG
99- only :
100- - tags
101- tags :
102- - docker-privileged
0 commit comments