Skip to content

Commit 61ca88c

Browse files
committed
Initial checkin of source code.
Signed-off-by: Diana Arroyo <[email protected]>
1 parent 23a2a63 commit 61ca88c

File tree

6,393 files changed

+1643780
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

6,393 files changed

+1643780
-0
lines changed

.gitignore

+125
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
# OSX leaves these everywhere on SMB shares
2+
._*
3+
4+
# OSX trash
5+
.DS_Store
6+
7+
# Eclipse files
8+
.classpath
9+
.project
10+
.settings/**
11+
12+
# Files generated by JetBrains IDEs, e.g. IntelliJ IDEA
13+
.idea/
14+
*.iml
15+
16+
# Vscode files
17+
.vscode
18+
19+
# This is where the result of the go build goes
20+
/output*/
21+
/_output*/
22+
/_output
23+
24+
# Emacs save files
25+
*~
26+
\#*\#
27+
.\#*
28+
29+
# Vim-related files
30+
[._]*.s[a-w][a-z]
31+
[._]s[a-w][a-z]
32+
*.un~
33+
Session.vim
34+
.netrwhist
35+
36+
# cscope-related files
37+
cscope.*
38+
39+
# Go test binaries
40+
*.test
41+
/hack/.test-cmd-auth
42+
43+
# JUnit test output from ginkgo e2e tests
44+
/junit*.xml
45+
46+
# Mercurial files
47+
**/.hg
48+
**/.hg*
49+
50+
# Vagrant
51+
.vagrant
52+
network_closure.sh
53+
54+
# Local cluster env variables
55+
/cluster/env.sh
56+
57+
# Compiled binaries in third_party
58+
/third_party/pkg
59+
60+
# Also ignore etcd installed by hack/install-etcd.sh
61+
/third_party/etcd*
62+
/default.etcd
63+
64+
# User cluster configs
65+
.kubeconfig
66+
67+
.tags*
68+
69+
# Version file for dockerized build
70+
.dockerized-kube-version-defs
71+
72+
# Web UI
73+
/www/master/node_modules/
74+
/www/master/npm-debug.log
75+
/www/master/shared/config/development.json
76+
77+
# Karma output
78+
/www/test_out
79+
80+
# precommit temporary directories created by ./hack/verify-generated-docs.sh and ./hack/lib/util.sh
81+
/_tmp/
82+
/doc_tmp/
83+
84+
# Test artifacts produced by Jenkins jobs
85+
/_artifacts/
86+
87+
# Go dependencies installed on Jenkins
88+
/_gopath/
89+
90+
# Config directories created by gcloud and gsutil on Jenkins
91+
/.config/gcloud*/
92+
/.gsutil/
93+
94+
# CoreOS stuff
95+
/cluster/libvirt-coreos/coreos_*.img
96+
97+
# Juju Stuff
98+
/cluster/juju/charms/*
99+
/cluster/juju/bundles/local.yaml
100+
101+
# Downloaded Kubernetes binary release
102+
/kubernetes/
103+
104+
# direnv .envrc files
105+
.envrc
106+
107+
# Downloaded kubernetes binary release tar ball
108+
kubernetes.tar.gz
109+
110+
# generated files in any directory
111+
# TODO(thockin): uncomment this when we stop committing the generated files.
112+
#zz_generated.*
113+
#zz_generated.openapi.go
114+
115+
# make-related metadata
116+
/.make/
117+
# Just in time generated data in the source, should never be commited
118+
/test/e2e/generated/bindata.go
119+
120+
# This file used by some vendor repos (e.g. github.com/go-openapi/...) to store secret variables and should not be ignored
121+
!\.drone\.sec
122+
123+
/bazel-*
124+
*.pyc
125+

Makefile

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
BIN_DIR=_output/bin
2+
RELEASE_VER=v0.2
3+
CONTRIB_VENDOR_GOPATH=${HOME}/tmp/contrib/DLaaS
4+
CURRENT_DIR=$(shell pwd)
5+
CONTRIB_VENDOR_GOPATH_SRC_TARGET=${CURRENT_DIR}/vendor
6+
SYM_LINK_EXISTS=$(shell [ -e ${CONTRIB_VENDOR_GOPATH}/src ] && echo 1 || echo 0 )
7+
ORIG_GOPATH=${GOPATH}
8+
9+
kar-controller: init
10+
CGO_ENABLED=0 GOARCH=amd64 go build -o ${BIN_DIR}/kar-controllers ./cmd/kar-controllers/
11+
12+
verify: generate-code
13+
# hack/verify-gofmt.sh
14+
# hack/verify-golint.sh
15+
# hack/verify-gencode.sh
16+
17+
init:
18+
mkdir -p ${BIN_DIR}
19+
20+
generate-code: set_gopath_to_generate_code
21+
GOPATH=${ORIG_GOPATH} go build -o ${BIN_DIR}/deepcopy-gen ./cmd/deepcopy-gen/
22+
GOPATH=${CONTRIB_VENDOR_GOPATH}:${GOPATH} ${BIN_DIR}/deepcopy-gen -i ./pkg/apis/controller/v1alpha1/ -O zz_generated.deepcopy -o ../../../../..
23+
24+
images: kube-batch
25+
cp ./_output/bin/kube-batch ./deployment/images/
26+
GOPATH=${ORIG_GOPATH} docker build ./deployment/images -t kubesigs/kube-batch:${RELEASE_VER}
27+
rm -f ./deployment/images/kube-batch
28+
29+
run-test:
30+
# hack/make-rules/test.sh $(WHAT) $(TESTS)
31+
32+
e2e:
33+
# kube-controller
34+
# hack/run-e2e.sh
35+
36+
coverage:
37+
# KUBE_COVER=y hack/make-rules/test.sh $(WHAT) $(TESTS)
38+
39+
clean:
40+
rm -rf _output/
41+
rm -f kar-controllers
42+
43+
set_gopath_to_generate_code: set_gopath_to_generate_code_clean
44+
$(info Make a temporary path to hold the creation of a symbolic link for contrib vendor directory)
45+
mkdir -p ${CONTRIB_VENDOR_GOPATH}
46+
$(info Set symbolic link inside the path of the CONTRIB_VENDOR_GOPATH variable to link to vender directory in contrib)
47+
cd ${CONTRIB_VENDOR_GOPATH} && ln -s ${CONTRIB_VENDOR_GOPATH_SRC_TARGET} src
48+
49+
50+
set_gopath_to_generate_code_clean:
51+
$(info Removing symbolic link to vender directory in contrib)
52+
$(shell if [ "${SYM_LINK_EXISTS}" = "1" ]; then cd ${CONTRIB_VENDOR_GOPATH}; rm src; fi;)

OWNERS

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
approvers:
2+
- animeshsingh
3+
- dmatch01
4+
- scostache
5+
reviewers:
6+
- animeshsingh
7+
- dmatch01
8+
- scostache

README_orig.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Customized Enhanced QueueJob Controller Contribution
2+
==
3+
4+
This directory is used to manage contribution for an enhanced queuejob controller from vendors.
5+
6+
# Extended Queuejob Controller
7+
8+
The extended queuejob controller `xqueuejob-controller` is a controler to manage batch jobs in Kubernetes, providing mechanisms for applications which would like to run batch jobs leveraging Kubernetes.
9+
10+
Refer to [deployment](deployment/deployment.md) on how to deploy `xqueuejob-controller` as in Kubernetes.
11+
12+
Refer to [tutorial](doc/usage/tutorial.md) on how to use `kube-batch` to run batch job in Kubernetes
13+
14+
## Overall Architecture
15+
16+
![xqueuejob-controler](doc/images/xqueuejob-controller.png)
17+
18+
19+
### Code of conduct
20+
21+
Participation in the Kubernetes community is governed by the [Kubernetes Code of Conduct](code-of-conduct.md).

cluster/lib/logging.sh

+171
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
#!/bin/bash
2+
3+
# Copyright 2014 The Kubernetes Authors.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
# Controls verbosity of the script output and logging.
18+
KUBE_VERBOSE="${KUBE_VERBOSE:-5}"
19+
20+
# Handler for when we exit automatically on an error.
21+
# Borrowed from https://gist.github.com/ahendrix/7030300
22+
kube::log::errexit() {
23+
local err="${PIPESTATUS[@]}"
24+
25+
# If the shell we are in doesn't have errexit set (common in subshells) then
26+
# don't dump stacks.
27+
set +o | grep -qe "-o errexit" || return
28+
29+
set +o xtrace
30+
local code="${1:-1}"
31+
# Print out the stack trace described by $function_stack
32+
if [ ${#FUNCNAME[@]} -gt 2 ]
33+
then
34+
kube::log::error "Call tree:"
35+
for ((i=1;i<${#FUNCNAME[@]}-1;i++))
36+
do
37+
kube::log::error " $i: ${BASH_SOURCE[$i+1]}:${BASH_LINENO[$i]} ${FUNCNAME[$i]}(...)"
38+
done
39+
fi
40+
kube::log::error_exit "Error in ${BASH_SOURCE[1]}:${BASH_LINENO[0]}. '${BASH_COMMAND}' exited with status $err" "${1:-1}" 1
41+
}
42+
43+
kube::log::install_errexit() {
44+
# trap ERR to provide an error handler whenever a command exits nonzero this
45+
# is a more verbose version of set -o errexit
46+
trap 'kube::log::errexit' ERR
47+
48+
# setting errtrace allows our ERR trap handler to be propagated to functions,
49+
# expansions and subshells
50+
set -o errtrace
51+
}
52+
53+
# Print out the stack trace
54+
#
55+
# Args:
56+
# $1 The number of stack frames to skip when printing.
57+
kube::log::stack() {
58+
local stack_skip=${1:-0}
59+
stack_skip=$((stack_skip + 1))
60+
if [[ ${#FUNCNAME[@]} -gt $stack_skip ]]; then
61+
echo "Call stack:" >&2
62+
local i
63+
for ((i=1 ; i <= ${#FUNCNAME[@]} - $stack_skip ; i++))
64+
do
65+
local frame_no=$((i - 1 + stack_skip))
66+
local source_file=${BASH_SOURCE[$frame_no]}
67+
local source_lineno=${BASH_LINENO[$((frame_no - 1))]}
68+
local funcname=${FUNCNAME[$frame_no]}
69+
echo " $i: ${source_file}:${source_lineno} ${funcname}(...)" >&2
70+
done
71+
fi
72+
}
73+
74+
# Log an error and exit.
75+
# Args:
76+
# $1 Message to log with the error
77+
# $2 The error code to return
78+
# $3 The number of stack frames to skip when printing.
79+
kube::log::error_exit() {
80+
local message="${1:-}"
81+
local code="${2:-1}"
82+
local stack_skip="${3:-0}"
83+
stack_skip=$((stack_skip + 1))
84+
85+
if [[ ${KUBE_VERBOSE} -ge 4 ]]; then
86+
local source_file=${BASH_SOURCE[$stack_skip]}
87+
local source_line=${BASH_LINENO[$((stack_skip - 1))]}
88+
echo "!!! Error in ${source_file}:${source_line}" >&2
89+
[[ -z ${1-} ]] || {
90+
echo " ${1}" >&2
91+
}
92+
93+
kube::log::stack $stack_skip
94+
95+
echo "Exiting with status ${code}" >&2
96+
fi
97+
98+
exit "${code}"
99+
}
100+
101+
# Log an error but keep going. Don't dump the stack or exit.
102+
kube::log::error() {
103+
timestamp=$(date +"[%m%d %H:%M:%S]")
104+
echo "!!! $timestamp ${1-}" >&2
105+
shift
106+
for message; do
107+
echo " $message" >&2
108+
done
109+
}
110+
111+
# Print an usage message to stderr. The arguments are printed directly.
112+
kube::log::usage() {
113+
echo >&2
114+
local message
115+
for message; do
116+
echo "$message" >&2
117+
done
118+
echo >&2
119+
}
120+
121+
kube::log::usage_from_stdin() {
122+
local messages=()
123+
while read -r line; do
124+
messages+=("$line")
125+
done
126+
127+
kube::log::usage "${messages[@]}"
128+
}
129+
130+
# Print out some info that isn't a top level status line
131+
kube::log::info() {
132+
local V="${V:-0}"
133+
if [[ $KUBE_VERBOSE < $V ]]; then
134+
return
135+
fi
136+
137+
for message; do
138+
echo "$message"
139+
done
140+
}
141+
142+
# Just like kube::log::info, but no \n, so you can make a progress bar
143+
kube::log::progress() {
144+
for message; do
145+
echo -e -n "$message"
146+
done
147+
}
148+
149+
kube::log::info_from_stdin() {
150+
local messages=()
151+
while read -r line; do
152+
messages+=("$line")
153+
done
154+
155+
kube::log::info "${messages[@]}"
156+
}
157+
158+
# Print a status line. Formatted to show up in a stream of output.
159+
kube::log::status() {
160+
local V="${V:-0}"
161+
if [[ $KUBE_VERBOSE < $V ]]; then
162+
return
163+
fi
164+
165+
timestamp=$(date +"[%m%d %H:%M:%S]")
166+
echo "+++ $timestamp $1"
167+
shift
168+
for message; do
169+
echo " $message"
170+
done
171+
}

0 commit comments

Comments
 (0)