Skip to content

Commit

Permalink
Support displaying log files
Browse files Browse the repository at this point in the history
  • Loading branch information
TommyLike committed Apr 2, 2019
1 parent be49d98 commit 1218d20
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,4 @@ kubernetes.tar.gz
*.pyc

# e2e log files
/hack/*.log
*.log
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,8 @@ jobs:
- make cli
- make docker
- make e2e-test-kind
after_failure:
# Echo logs and upload
- test -f volcano-admission.log && echo "******<<admission logs>>******" && cat volcano-admission.log
- test -f volcano-controller.log && echo "******<<controller logs>>******" && cat volcano-controller.log
- test -f volcano-scheduler.log && echo "******<<scheduler logs>>******" && cat volcano-scheduler.log
12 changes: 12 additions & 0 deletions hack/run-e2e-kind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ function uninstall-volcano {
helm delete integration --purge --kubeconfig ${KUBECONFIG}
}

function generate-log {
echo "Generating volcano log files"
kubectl logs -lapp=volcano-admission -n kube-system > volcano-admission.log
kubectl logs -lapp=volcano-controller -n kube-system > volcano-controller.log
kubectl logs -lapp=volcano-scheduler -n kube-system > volcano-scheduler.log
}

# clean up
function cleanup {
uninstall-volcano
Expand Down Expand Up @@ -118,3 +125,8 @@ install-volcano
# Run e2e test
cd ${VK_ROOT}
KUBECONFIG=${KUBECONFIG} go test ./test/e2e -v -timeout 30m

if [[ $? != 0 ]]; then
generate-log
exit 1
fi
13 changes: 5 additions & 8 deletions installer/chart/volcano/templates/admission.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,18 @@ apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: admission
admission: "true"
app: volcano-admission
name: {{ .Release.Name }}-admission
namespace: {{ .Release.Namespace }}
spec:
replicas: 1
selector:
matchLabels:
app: admission
admission: "true"
app: volcano-admission
template:
metadata:
labels:
app: admission
admission: "true"
app: volcano-admission
spec:
serviceAccount: {{ .Release.Name }}-admission
{{ if .Values.basic.image_pull_secret }}
Expand Down Expand Up @@ -90,7 +87,7 @@ apiVersion: v1
kind: Service
metadata:
labels:
test: admission
app: volcano-admission
name: {{ .Release.Name }}-admission-service
namespace: {{ .Release.Namespace }}
spec:
Expand All @@ -99,5 +96,5 @@ spec:
protocol: TCP
targetPort: 443
selector:
admission: "true"
app: volcano-admission
sessionAffinity: None
6 changes: 4 additions & 2 deletions installer/chart/volcano/templates/controllers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,17 @@ apiVersion: apps/v1
metadata:
name: {{ .Release.Name }}-controllers
namespace: {{ .Release.Namespace }}
labels:
app: volcano-controller
spec:
replicas: 1
selector:
matchLabels:
vk-controllers: test
app: volcano-controller
template:
metadata:
labels:
vk-controllers: test
app: volcano-controller
spec:
serviceAccount: {{ .Release.Name }}-controllers
{{ if .Values.basic.image_pull_secret }}
Expand Down
6 changes: 4 additions & 2 deletions installer/chart/volcano/templates/scheduler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,17 @@ apiVersion: apps/v1
metadata:
name: {{ .Release.Name }}-scheduler
namespace: {{ .Release.Namespace }}
labels:
app: volcano-scheduler
spec:
replicas: 1
selector:
matchLabels:
vk-scheduler: test
app: volcano-scheduler
template:
metadata:
labels:
vk-scheduler: test
app: volcano-scheduler
spec:
serviceAccount: {{ .Release.Name }}-scheduler
containers:
Expand Down
2 changes: 1 addition & 1 deletion pkg/controllers/job/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ func (jc *jobCache) DeletePod(pod *v1.Pod) error {
}

func (jc *jobCache) Run(stopCh <-chan struct{}) {
wait.Until(jc.processCleanupJob, 0, stopCh)
wait.Until(jc.worker, 0, stopCh)
}

func (jc jobCache) TaskCompleted(jobKey, taskName string) bool {
Expand Down

0 comments on commit 1218d20

Please sign in to comment.