Skip to content

Commit

Permalink
Merge branch 'master' into version-changes
Browse files Browse the repository at this point in the history
  • Loading branch information
k82cn authored May 8, 2019
2 parents 0ab66d8 + c3a5263 commit e7fa9fb
Show file tree
Hide file tree
Showing 18 changed files with 221 additions and 286 deletions.
1 change: 1 addition & 0 deletions example/integrations/tensorflow/tf-example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ spec:
minAvailable: 2
schedulerName: kube-batch
plugins:
env: []
svc: []
policies:
- event: PodEvicted
Expand Down
File renamed without changes.
58 changes: 32 additions & 26 deletions example/job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,36 @@ spec:
minAvailable: 3
schedulerName: kube-batch
policies:
- event: PodEvicted
action: RestartJob
input:
mountPath: "/myinput"
output:
mountPath: "/myoutput"
volumeClaim:
accessModes: [ "ReadWriteOnce" ]
storageClassName: "my-storage-class"
resources:
requests:
storage: 1Gi
- event: PodEvicted
action: RestartJob
plugins:
ssh: []
env: []
svc: []
maxRetry: 5
queue: default
volumes:
- mountPath: "/myinput"
- mountPath: "/myoutput"
volumeClaimName: "testvolumeclaimname"
volumeClaim:
accessModes: [ "ReadWriteOnce" ]
storageClassName: "my-storage-class"
resources:
requests:
storage: 1Gi
tasks:
- replicas: 6
name: "default-nginx"
template:
metadata:
name: web
spec:
containers:
- image: nginx
imagePullPolicy: IfNotPresent
name: nginx
resources:
requests:
cpu: "1"
restartPolicy: OnFailure
- replicas: 6
name: "default-nginx"
template:
metadata:
name: web
spec:
containers:
- image: nginx
imagePullPolicy: IfNotPresent
name: nginx
resources:
requests:
cpu: "1"
restartPolicy: OnFailure
11 changes: 0 additions & 11 deletions example/kube-batch-conf.yaml

This file was deleted.

56 changes: 0 additions & 56 deletions example/openmpi-hello.yaml

This file was deleted.

12 changes: 0 additions & 12 deletions example/role.yaml

This file was deleted.

61 changes: 0 additions & 61 deletions example/tensorflow-benchmark.yaml

This file was deleted.

12 changes: 9 additions & 3 deletions hack/run-e2e-kind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,20 @@ function install-volcano {

echo "Install volcano plugin into cluster...."
helm plugin install --kubeconfig ${KUBECONFIG} installer/chart/volcano/plugins/gen-admission-secret
helm gen-admission-secret --service integration-admission-service --namespace kube-system

#If failed to generate secret for admission service, return immediately
helm gen-admission-secret --service ${CLUSTER_NAME}-admission-service --namespace kube-system
if [[ $? != 0 ]]; then
echo "Failed to install secret for admission service, usually we need a retry."
exit 1
fi

echo "Install volcano chart"
helm install installer/chart/volcano --namespace kube-system --name integration --kubeconfig ${KUBECONFIG} --set basic.image_tag_version=${TAG}
helm install installer/chart/volcano --namespace kube-system --name ${CLUSTER_NAME} --kubeconfig ${KUBECONFIG} --set basic.image_tag_version=${TAG} --wait
}

function uninstall-volcano {
helm delete integration --purge --kubeconfig ${KUBECONFIG}
helm delete ${CLUSTER_NAME} --purge --kubeconfig ${KUBECONFIG}
}

function generate-log {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,15 @@ done
# approve and fetch the signed certificate
kubectl certificate approve ${csrName}
# verify certificate has been signed
for x in $(seq 15); do
for x in $(seq 20); do
serverCert=$(kubectl get csr ${csrName} -o jsonpath='{.status.certificate}')
if [[ ${serverCert} != '' ]]; then
break
fi
sleep 1
done
if [[ ${serverCert} == '' ]]; then
echo "ERROR: After approving csr ${csrName}, the signed certificate did not appear on the resource. Giving up after 15 attempts." >&2
echo "ERROR: After approving csr ${csrName}, the signed certificate did not appear on the resource. Giving up after 20 attempts." >&2
exit 1
fi
echo ${serverCert} | openssl base64 -d -A -out ${tmpdir}/server-cert.pem
Expand Down
64 changes: 38 additions & 26 deletions installer/chart/volcano/templates/batch_v1alpha1_job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,36 +32,27 @@ spec:
description: Specification of the desired behavior of a cron job, including
the minAvailable
properties:
input:
description: The volume mount for input of Job
properties:
volumeClaim:
description: VolumeClaim defines the PVC used by the VolumeMount.
type: object
mountPath:
description: Path within the container at which the volume should
be mounted. Must not contain ':'.
type: string
required:
- mountPath
type: object
volumes:
description: The volumes for Job
items:
properties:
volumeClaim:
description: VolumeClaim defines the PVC used by the VolumeMount.
type: object
mountPath:
description: Path within the container at which the volume should be mounted.
Must not contain ':'.
type: string
volumeClaimName:
description: The name of the volume claim.
type: object
required:
- mountPath
type: array
minAvailable:
description: The minimal available pods to run for this Job
format: int32
type: integer
output:
description: The volume mount for output of Job
properties:
volumeClaim:
description: VolumeClaim defines the PVC used by the VolumeMount.
type: object
mountPath:
description: Path within the container at which the volume should
be mounted. Must not contain ':'.
type: string
required:
- mountPath
type: object
policies:
description: Specifies the default lifecycle of tasks
items:
Expand All @@ -83,6 +74,11 @@ spec:
schedulerName:
description: SchedulerName is the default value of `tasks.template.spec.schedulerName`.
type: string
plugins:
description: Enabled task plugins when creating job.
type: object
additionalProperties:
type: array
tasks:
description: Tasks specifies the task specification of Job
items:
Expand Down Expand Up @@ -120,6 +116,13 @@ spec:
type: object
type: object
type: array
queue:
description: The name of the queue on which job should been created
type: string
maxRetry:
description: The limit for retrying submiting job, default is 3
format: int32
type: integer
type: object
status:
description: Current status of Job
Expand Down Expand Up @@ -148,6 +151,15 @@ spec:
description: Job's current version
format: int32
type: integer
retryCount:
description: The number that volcano retried to submit the job.
format: int32
type: integer
ControlledResources:
description: All of the resources that are controlled by this job.
type: object
additionalProperties:
type: string
state:
description: Current state of Job.
properties:
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/batch/v1alpha1/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ type JobEvent string
const (
CommandIssued JobEvent = "CommandIssued"
PluginError JobEvent = "PluginError"
PVCError JobEvent = "PVCError"
PodGroupError JobEvent = "PodGroupError"
)

// Event represent the phase of Job, e.g. pod-failed.
Expand Down
Loading

0 comments on commit e7fa9fb

Please sign in to comment.