Skip to content

Commit

Permalink
Merge pull request volcano-sh#6 from volcano-sh/codes/refactor_contro…
Browse files Browse the repository at this point in the history
…llers
  • Loading branch information
TommyLike authored Mar 15, 2019
2 parents 00e22f6 + a2c9bb9 commit b6e970a
Show file tree
Hide file tree
Showing 362 changed files with 31,254 additions and 1,786 deletions.
138 changes: 122 additions & 16 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,127 @@
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, build with `go test -c`
*.test
# OSX leaves these everywhere on SMB shares
._*

# OSX trash
.DS_Store

# Eclipse files
.classpath
.project
.settings/**

# Output of the go coverage tool, specifically when used with LiteIDE
*.out
# Files generated by JetBrains IDEs, e.g. IntelliJ IDEA
.idea/
*.iml

# editor and IDE paraphernalia
.idea
# Vscode files
.vscode
*.swp
*.swo

# This is where the result of the go build goes
/output*/
/_output*/
/_output

# Emacs save files
*~
\#*\#
.\#*

# Vim-related files
[._]*.s[a-w][a-z]
[._]s[a-w][a-z]
*.un~
Session.vim
.netrwhist

# cscope-related files
cscope.*

# Go test binaries
*.test
/hack/.test-cmd-auth

# JUnit test output from ginkgo e2e tests
/junit*.xml

# Mercurial files
**/.hg
**/.hg*

# Vagrant
.vagrant
network_closure.sh

# Local cluster env variables
/cluster/env.sh

# Compiled binaries in third_party
/third_party/pkg

# Also ignore etcd installed by hack/install-etcd.sh
/third_party/etcd*
/default.etcd

# User cluster configs
.kubeconfig

.tags*

# Version file for dockerized build
.dockerized-kube-version-defs

# Web UI
/www/master/node_modules/
/www/master/npm-debug.log
/www/master/shared/config/development.json

# Karma output
/www/test_out

# precommit temporary directories created by ./hack/verify-generated-docs.sh and ./hack/lib/util.sh
/_tmp/
/doc_tmp/

# Test artifacts produced by Jenkins jobs
/_artifacts/

# Go dependencies installed on Jenkins
/_gopath/

# Config directories created by gcloud and gsutil on Jenkins
/.config/gcloud*/
/.gsutil/

# CoreOS stuff
/cluster/libvirt-coreos/coreos_*.img

# Juju Stuff
/cluster/juju/charms/*
/cluster/juju/bundles/local.yaml

# Downloaded Kubernetes binary release
/kubernetes/

# direnv .envrc files
.envrc

# Downloaded kubernetes binary release tar ball
kubernetes.tar.gz

# generated files in any directory
# TODO(thockin): uncomment this when we stop committing the generated files.
#zz_generated.*
#zz_generated.openapi.go

# make-related metadata
/.make/
# Just in time generated data in the source, should never be commited
/test/e2e/generated/bindata.go

# This file used by some vendor repos (e.g. github.com/go-openapi/...) to store secret variables and should not be ignored
!\.drone\.sec

/bazel-*
*.pyc

_output
# e2e log files
/hack/*.log
65 changes: 57 additions & 8 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 17 additions & 1 deletion Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,21 @@
# go-tests = true
# unused-packages = true

required = [
"k8s.io/code-generator/cmd/client-gen",
"k8s.io/code-generator/cmd/informer-gen",
"k8s.io/code-generator/cmd/lister-gen",
"k8s.io/code-generator/cmd/deepcopy-gen",
"k8s.io/code-generator/cmd/defaulter-gen",
]

[[constraint]]
branch = "master"
name = "github.com/golang/glog"

[[constraint]]
name = "github.com/kubernetes-sigs/kube-batch"
version = "0.4.0"
version = "0.4.1"

[[constraint]]
name = "github.com/onsi/ginkgo"
Expand Down Expand Up @@ -76,6 +84,14 @@
name = "k8s.io/apiextensions-apiserver"
version = "kubernetes-1.13.2"

[[constraint]]
name = "k8s.io/code-generator"
version = "kubernetes-1.13.2"

[prune]
go-tests = true
unused-packages = true

[[prune.project]]
name = "k8s.io/code-generator"
unused-packages = false
37 changes: 32 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
BIN_DIR=_output/bin
IMAGE=volcano
TAG = 1.0

all: controllers scheduler cli
all: controllers scheduler cli admission

init:
mkdir -p ${BIN_DIR}
Expand All @@ -14,13 +16,38 @@ scheduler:
cli:
go build -o ${BIN_DIR}/vkctl ./cmd/cli

admission:
go build -o ${BIN_DIR}/vk-admission ./cmd/admission

release:
CGO_ENABLED=0 go build -o ${BIN_DIR}/rel/vk-controllers ./cmd/controllers
CGO_ENABLED=0 go build -o ${BIN_DIR}/rel/vk-scheduler ./cmd/scheduler
CGO_ENABLED=0 go build -o ${BIN_DIR}/rel/vk-admission ./cmd/admission

docker: release
for name in controllers scheduler admission; do\
cp ${BIN_DIR}/rel/vk-$$name ./installer/dockerfile/$$name/; \
docker build --no-cache -t $(IMAGE)-$$name:$(TAG) ./installer/dockerfile/$$name; \
rm installer/dockerfile/$$name/vk-$$name; \
done

generate-code:
go build -o ${BIN_DIR}/deepcopy-gen ./cmd/deepcopy-gen/
${BIN_DIR}/deepcopy-gen -i ./pkg/apis/batch/v1alpha1/ -O zz_generated.deepcopy
${BIN_DIR}/deepcopy-gen -i ./pkg/apis/bus/v1alpha1/ -O zz_generated.deepcopy
./hack/update-gencode.sh

e2e-test: all
e2e-test:
./hack/run-e2e.sh

unit-test:
go list ./... | grep -v e2e | xargs go test -v

e2e-test-kind:
./hack/run-e2e-kind.sh

clean:
rm -rf _output/
rm -f *.log

verify: generate-code
hack/verify-gofmt.sh
hack/verify-golint.sh
hack/verify-gencode.sh
Loading

0 comments on commit b6e970a

Please sign in to comment.