-
Notifications
You must be signed in to change notification settings - Fork 993
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #344 from TommyLike/feature/release_ci
Support release volcano in Travis
- Loading branch information
Showing
7 changed files
with
298 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2019 The Volcano Authors. | ||
|
||
# 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://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. | ||
|
||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
|
||
VK_ROOT=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/.. | ||
export HELM_BIN_DIR=${VK_ROOT}/${BIN_DIR} | ||
export RELEASE_FOLDER=${VK_ROOT}/${RELEASE_DIR} | ||
|
||
export HELM_VER=${HELM_VER:-v2.13.0} | ||
export VOLCANO_IMAGE_TAG=${TAG:-"latest"} | ||
export YAML_FILENAME=volcano-${VOLCANO_IMAGE_TAG}.yaml | ||
|
||
LOCAL_OS=${OSTYPE} | ||
case $LOCAL_OS in | ||
"linux"*) | ||
LOCAL_OS='linux' | ||
;; | ||
"darwin"*) | ||
LOCAL_OS='darwin' | ||
;; | ||
*) | ||
echo "This system's OS ${LOCAL_OS} isn't recognized/supported" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
# Step1. install helm binary | ||
if [[ ! -f "${HELM_BIN_DIR}/version.helm.${HELM_VER}" ]] ; then | ||
TD=$(mktemp -d) | ||
cd "${TD}" && \ | ||
curl -Lo "${TD}/helm.tgz" "https://storage.googleapis.com/kubernetes-helm/helm-${HELM_VER}-${LOCAL_OS}-amd64.tar.gz" && \ | ||
tar xfz helm.tgz && \ | ||
mv ${LOCAL_OS}-amd64/helm "${HELM_BIN_DIR}/helm-${HELM_VER}" && \ | ||
cp "${HELM_BIN_DIR}/helm-${HELM_VER}" "${HELM_BIN_DIR}/helm" && \ | ||
chmod +x ${HELM_BIN_DIR}/helm | ||
rm -rf "${TD}" && \ | ||
touch "${HELM_BIN_DIR}/version.helm.${HELM_VER}" | ||
fi | ||
|
||
# Step2. generate yaml in folder | ||
if [[ ! -d ${RELEASE_FOLDER} ]];then | ||
mkdir ${RELEASE_FOLDER} | ||
fi | ||
|
||
DEPLOYMENT_FILE=${RELEASE_FOLDER}/${YAML_FILENAME} | ||
echo "Generating volcano yaml file into ${DEPLOYMENT_FILE}}" | ||
|
||
if [[ -f ${DEPLOYMENT_FILE} ]];then | ||
rm ${DEPLOYMENT_FILE} | ||
fi | ||
cat ${VK_ROOT}/installer/namespace.yaml > ${DEPLOYMENT_FILE} | ||
${HELM_BIN_DIR}/helm template ${VK_ROOT}/installer/helm/chart/volcano --namespace volcano-system \ | ||
--name volcano --set basic.image_tag_version=${VOLCANO_IMAGE_TAG} \ | ||
--set basic.scheduler_config_file=kube-batch-ci.conf \ | ||
-x templates/admission.yaml \ | ||
-x templates/batch_v1alpha1_job.yaml \ | ||
-x templates/bus_v1alpha1_command.yaml \ | ||
-x templates/controllers.yaml \ | ||
-x templates/scheduler.yaml \ | ||
-x templates/scheduling_v1alpha1_podgroup.yaml \ | ||
-x templates/scheduling_v1alpha1_queue.yaml \ | ||
-x templates/scheduling_v1alpha2_podgroup.yaml \ | ||
-x templates/scheduling_v1alpha2_queue.yaml \ | ||
--notes >> ${DEPLOYMENT_FILE} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2019 The Volcano Authors. | ||
|
||
# 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://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. | ||
|
||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
|
||
|
||
|
||
# The process of preparing volcano release. | ||
# 1. cp binaries into release folder | ||
# 2. cp README document into release folder | ||
# 3. cp default queue into release folder | ||
# 4. cp helm charts template into release folder and update default image tag | ||
# 5. cp license file into release folder | ||
# 6. upload docker images to volcano.sh | ||
# 7. generate zip file | ||
|
||
VK_ROOT=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/.. | ||
BINARY_FOLDER=${VK_ROOT}/${BIN_DIR}/${REL_OSARCH} | ||
RELEASE_FOLDER=${VK_ROOT}/${RELEASE_DIR} | ||
RELEASE_BINARY=${RELEASE_FOLDER}/bin | ||
QUEUE_FILE=${VK_ROOT}/installer/helm/chart/volcano/templates/default-queue.yaml | ||
README_FILE=${VK_ROOT}/installer/README.md | ||
HELM_FOLDER=${VK_ROOT}/installer/helm | ||
VOLCANO_IMAGE_TAG=${TAG:-"latest"} | ||
DOCKER_PASSWORD=${DOCKER_PASSWORD:-""} | ||
DOCKER_USERNAME=${DOCKER_USERNAME:-""} | ||
LICENSE_FILE=${VK_ROOT}/LICENSE | ||
|
||
if [[ ! -d ${RELEASE_BINARY} ]];then | ||
mkdir ${RELEASE_BINARY} | ||
fi | ||
|
||
cp -r ${BINARY_FOLDER} ${RELEASE_BINARY} | ||
|
||
cp ${README_FILE} ${RELEASE_FOLDER} | ||
|
||
cp ${QUEUE_FILE} ${RELEASE_FOLDER} | ||
|
||
cp -r ${HELM_FOLDER} ${RELEASE_FOLDER} | ||
|
||
if [[ -f ${LICENSE_FILE} ]];then | ||
cp ${LICENSE_FILE} ${RELEASE_FOLDER} | ||
fi | ||
|
||
# overwrite the tag name into values yaml | ||
sed -i "s/latest/${VOLCANO_IMAGE_TAG}/g" ${RELEASE_FOLDER}/helm/chart/volcano/values.yaml | ||
|
||
if [[ "${DOCKER_USERNAME}xxx" == "xxx" ]];then | ||
if [[ "${DOCKER_PASSWORD}xxx" == "xxx" ]];then | ||
echo "docker username or password not found, quit uploading images" | ||
exit 0 | ||
fi | ||
fi | ||
|
||
echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}" --password-stdin | ||
echo "pushing ${IMAGE_PREFIX}-controllers:${VOLCANO_IMAGE_TAG}" | ||
docker push ${IMAGE_PREFIX}-controllers:${VOLCANO_IMAGE_TAG} | ||
docker push ${IMAGE_PREFIX}-scheduler:${VOLCANO_IMAGE_TAG} | ||
docker push ${IMAGE_PREFIX}-admission:${VOLCANO_IMAGE_TAG} | ||
|
||
echo "Generate release tar files" | ||
cd ${RELEASE_FOLDER}/ | ||
tar -zcvf volcano-${VOLCANO_IMAGE_TAG}-${OSTYPE}.tar.gz * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
## Volcano | ||
|
||
Volcano is a batch system built on Kubernetes. It provides a suite of mechanisms currently missing from | ||
Kubernetes that are commonly required by many classes of batch & elastic workload including: | ||
|
||
1. machine learning/deep learning, | ||
2. bioinformatics/genomics, and | ||
3. other "big data" applications. | ||
|
||
## Prerequisites | ||
|
||
- Kubernetes 1.12+ with CRD support | ||
|
||
## Installing volcano via yaml file | ||
|
||
All-in-one yaml has been generated for quick deployment. Try command: | ||
```$xslt | ||
kubectl apply -f volcano-v0.0.x.yaml | ||
``` | ||
Check the status in namespace `volcano-system` | ||
```$xslt | ||
$kubectl get all -n volcano-system | ||
NAME READY STATUS RESTARTS AGE | ||
pod/volcano-admission-56f5465597-2pbfx 1/1 Running 0 36s | ||
pod/volcano-admission-init-pjgf2 0/1 Completed 0 36s | ||
pod/volcano-controllers-687948d9c8-zdtvw 1/1 Running 0 36s | ||
pod/volcano-scheduler-94998fc64-86hzn 1/1 Running 0 36s | ||
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE | ||
service/volcano-admission-service ClusterIP 10.103.235.185 <none> 443/TCP 36s | ||
NAME READY UP-TO-DATE AVAILABLE AGE | ||
deployment.apps/volcano-admission 1/1 1 1 36s | ||
deployment.apps/volcano-controllers 1/1 1 1 36s | ||
deployment.apps/volcano-scheduler 1/1 1 1 36s | ||
NAME DESIRED CURRENT READY AGE | ||
replicaset.apps/volcano-admission-56f5465597 1 1 1 36s | ||
replicaset.apps/volcano-controllers-687948d9c8 1 1 1 36s | ||
replicaset.apps/volcano-scheduler-94998fc64 1 1 1 36s | ||
``` | ||
Volcano scheduler utilize `queues.scheduling.incubator.k8s.io` to share resource, therefore default queue is required before usage. | ||
```$xslt | ||
kubectl apply -f default-queue.yaml | ||
``` | ||
|
||
## Installing volcano via helm charts | ||
|
||
To install the volcano with chart: | ||
|
||
```bash | ||
helm install helm/chart/volcano --namespace <namespace> --name <specified-name> | ||
|
||
e.g : | ||
helm install helm/chart/volcano --namespace volcano-trial --name volcano-trial | ||
``` | ||
|
||
This command deploys volcano in kubernetes cluster with default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation. | ||
|
||
|
||
## Uninstalling the Chart | ||
|
||
```bash | ||
$ helm delete volcano-release --purge | ||
``` | ||
|
||
## Configuration | ||
|
||
The following are the list configurable parameters of Volcano Chart and their default values. | ||
|
||
| Parameter|Description|Default Value| | ||
|----------------|-----------------|----------------------| | ||
|`basic.image_tag_version`| Docker image version Tag | `latest`| | ||
|`basic.controller_image_name`|Controller Docker Image Name|`volcanosh/vc-controllers`| | ||
|`basic.scheduler_image_name`|Scheduler Docker Image Name|`volcanosh/vc-scheduler`| | ||
|`basic.admission_image_name`|Admission Controller Image Name|`volcanosh/vc-admission`| | ||
|`basic.admission_secret_name`|Volcano Admission Secret Name|`volcano-admission-secret`| | ||
|`basic.scheduler_config_file`|Configuration File name for Scheduler|`kube-batch.conf`| | ||
|`basic.image_pull_secret`|Image Pull Secret|`""`| | ||
|`basic.image_pull_policy`|Image Pull Policy|`IfNotPresent`| | ||
|`basic.admission_app_name`|Admission Controller App Name|`volcano-admission`| | ||
|`basic.controller_app_name`|Controller App Name|`volcano-controller`| | ||
|`basic.scheduler_app_name`|Scheduler App Name|`volcano-scheduler`| | ||
|
||
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, | ||
|
||
```bash | ||
$ helm install --name volcano-release --set basic.image_pull_policy=Always volcano/volcano | ||
``` | ||
|
||
The above command set image pull policy to `Always`, so docker image will be pulled each time. | ||
|
||
|
||
Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example, | ||
|
||
```bash | ||
$ helm install --name volcano-release -f values.yaml volcano/volcano | ||
``` | ||
|
||
> **Tip**: You can use the default [values.yaml](chart/volcano/values.yaml) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Thank you for installing {{ .Chart.Name }}. | ||
|
||
Your release is named {{ .Release.Name }}. | ||
|
||
For more information on volcano, visit: | ||
https://volcano.sh/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: volcano-system |