Skip to content

Commit

Permalink
Merge pull request #605 from k82cn/rename_bins
Browse files Browse the repository at this point in the history
Rename binaries.
  • Loading branch information
volcano-sh-bot authored Dec 20, 2019
2 parents 072ae08 + 61cfd22 commit 8d82937
Show file tree
Hide file tree
Showing 22 changed files with 52 additions and 44 deletions.
18 changes: 9 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ include Makefile.def

.EXPORT_ALL_VARIABLES:

all: vc-scheduler vc-controllers vc-admission vcctl
all: vc-scheduler vc-controller-manager vc-webhook-manager vcctl

init:
mkdir -p ${BIN_DIR}
Expand All @@ -32,31 +32,31 @@ init:
vc-scheduler: init
go build -ldflags ${LD_FLAGS} -o=${BIN_DIR}/vc-scheduler ./cmd/scheduler

vc-controllers: init
go build -ldflags ${LD_FLAGS} -o=${BIN_DIR}/vc-controllers ./cmd/controllers
vc-controller-manager: init
go build -ldflags ${LD_FLAGS} -o=${BIN_DIR}/vc-controller-manager ./cmd/controller-manager

vc-admission: init
go build -ldflags ${LD_FLAGS} -o=${BIN_DIR}/vc-admission ./cmd/admission
vc-webhook-manager: init
go build -ldflags ${LD_FLAGS} -o=${BIN_DIR}/vc-webhook-manager ./cmd/webhook-manager

vcctl: init
go build -ldflags ${LD_FLAGS} -o=${BIN_DIR}/vcctl ./cmd/cli

image_bins: init
go get github.com/mitchellh/gox
CGO_ENABLED=0 gox -osarch=${REL_OSARCH} -ldflags ${LD_FLAGS} -output ${BIN_DIR}/${REL_OSARCH}/vcctl ./cmd/cli
for name in controllers scheduler admission; do\
for name in controller-manager scheduler webhook-manager; do\
CGO_ENABLED=0 gox -osarch=${REL_OSARCH} -ldflags ${LD_FLAGS} -output ${BIN_DIR}/${REL_OSARCH}/vc-$$name ./cmd/$$name; \
done

images: image_bins
for name in controllers scheduler admission; do\
for name in controller-manager scheduler webhook-manager; do\
cp ${BIN_DIR}/${REL_OSARCH}/vc-$$name ./installer/dockerfile/$$name/; \
docker build --no-cache -t $(IMAGE_PREFIX)-$$name:$(TAG) ./installer/dockerfile/$$name; \
rm installer/dockerfile/$$name/vc-$$name; \
done

admission-base-image:
docker build --no-cache -t $(IMAGE_PREFIX)-admission-base:$(TAG) ./installer/dockerfile/admission/ -f ./installer/dockerfile/admission/Dockerfile.base;
webhook-manager-base-image:
docker build --no-cache -t $(IMAGE_PREFIX)-webhook-manager-base:$(TAG) ./installer/dockerfile/webhook-manager/ -f ./installer/dockerfile/webhook-manager/Dockerfile.base;

generate-code:
./hack/update-gencode.sh
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func (s *ServerOption) AddFlags(fs *pflag.FlagSet) {
fs.StringVar(&s.Master, "master", s.Master, "The address of the Kubernetes API server (overrides any value in kubeconfig)")
fs.StringVar(&s.Kubeconfig, "kubeconfig", s.Kubeconfig, "Path to kubeconfig file with authorization and master location information.")
fs.BoolVar(&s.EnableLeaderElection, "leader-elect", s.EnableLeaderElection, "Start a leader election client and gain leadership before "+
"executing the main loop. Enable this when running replicated vc-controllers for high availability.")
"executing the main loop. Enable this when running replicated vc-controller-manager for high availability.")
fs.StringVar(&s.LockObjectNamespace, "lock-object-namespace", s.LockObjectNamespace, "Define the namespace of the lock object.")
fs.Float32Var(&s.KubeAPIQPS, "kube-api-qps", defaultQPS, "QPS to use while talking with kubernetes apiserver")
fs.IntVar(&s.KubeAPIBurst, "kube-api-burst", defaultBurst, "Burst to use while talking with kubernetes apiserver")
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import (
"k8s.io/client-go/tools/leaderelection/resourcelock"
"k8s.io/client-go/tools/record"

"volcano.sh/volcano/cmd/controllers/app/options"
"volcano.sh/volcano/cmd/controller-manager/app/options"
"volcano.sh/volcano/pkg/apis/helpers"
vcclientset "volcano.sh/volcano/pkg/client/clientset/versioned"
"volcano.sh/volcano/pkg/controllers/garbagecollector"
Expand Down Expand Up @@ -100,7 +100,7 @@ func Run(opt *options.ServerOption) error {
// Prepare event clients.
broadcaster := record.NewBroadcaster()
broadcaster.StartRecordingToSink(&corev1.EventSinkImpl{Interface: leaderElectionClient.CoreV1().Events(opt.LockObjectNamespace)})
eventRecorder := broadcaster.NewRecorder(scheme.Scheme, v1.EventSource{Component: "vc-controllers"})
eventRecorder := broadcaster.NewRecorder(scheme.Scheme, v1.EventSource{Component: "vc-controller-manager"})

hostname, err := os.Hostname()
if err != nil {
Expand All @@ -111,7 +111,7 @@ func Run(opt *options.ServerOption) error {

rl, err := resourcelock.New(resourcelock.ConfigMapsResourceLock,
opt.LockObjectNamespace,
"vc-controllers",
"vc-controller-manager",
leaderElectionClient.CoreV1(),
resourcelock.ResourceLockConfig{
Identity: id,
Expand Down
4 changes: 2 additions & 2 deletions cmd/controllers/main.go → cmd/controller-manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import (
"k8s.io/apiserver/pkg/util/flag"
"k8s.io/klog"

"volcano.sh/volcano/cmd/controllers/app"
"volcano.sh/volcano/cmd/controllers/app/options"
"volcano.sh/volcano/cmd/controller-manager/app"
"volcano.sh/volcano/cmd/controller-manager/app/options"
"volcano.sh/volcano/pkg/version"
)

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"k8s.io/client-go/tools/clientcmd"
"k8s.io/klog"

"volcano.sh/volcano/cmd/admission/app/options"
"volcano.sh/volcano/cmd/webhook-manager/app/options"
"volcano.sh/volcano/pkg/admission/router"
"volcano.sh/volcano/pkg/version"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"k8s.io/client-go/rest"
"k8s.io/klog"

"volcano.sh/volcano/cmd/admission/app/options"
"volcano.sh/volcano/cmd/webhook-manager/app/options"
"volcano.sh/volcano/pkg/admission/router"
"volcano.sh/volcano/pkg/client/clientset/versioned"
)
Expand Down
4 changes: 2 additions & 2 deletions cmd/admission/main.go → cmd/webhook-manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import (
"k8s.io/apiserver/pkg/util/flag"
"k8s.io/klog"

"volcano.sh/volcano/cmd/admission/app"
"volcano.sh/volcano/cmd/admission/app/options"
"volcano.sh/volcano/cmd/webhook-manager/app"
"volcano.sh/volcano/cmd/webhook-manager/app/options"

_ "volcano.sh/volcano/pkg/admission/jobs/mutate"
_ "volcano.sh/volcano/pkg/admission/jobs/validate"
Expand Down
6 changes: 3 additions & 3 deletions docs/development/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ make images

## Building a specific docker image

If you want to make a local change and test some component, say `vc-controllers`, you
If you want to make a local change and test some component, say `vc-controller-manager`, you
could do:

Under volcano.sh/volcano repo
Expand All @@ -73,10 +73,10 @@ export HUB=docker.io/yourrepo
export TAG=citadel
```

Make some local change of the code, then build `vc-controllers`
Make some local change of the code, then build `vc-controller-manager`

```bash
make image.vc-controllers
make image.vc-controller-manager
```

## Building the Volcano manifests
Expand Down
4 changes: 2 additions & 2 deletions hack/lib/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ function kind-up-cluster {
kind create cluster ${CLUSTER_CONTEXT} ${KIND_OPT}

echo "Loading docker images into kind cluster"
kind load docker-image ${IMAGE_PREFIX}-controllers:${TAG} ${CLUSTER_CONTEXT}
kind load docker-image ${IMAGE_PREFIX}-controller-manager:${TAG} ${CLUSTER_CONTEXT}
kind load docker-image ${IMAGE_PREFIX}-scheduler:${TAG} ${CLUSTER_CONTEXT}
kind load docker-image ${IMAGE_PREFIX}-admission:${TAG} ${CLUSTER_CONTEXT}
kind load docker-image ${IMAGE_PREFIX}-webhook-manager:${TAG} ${CLUSTER_CONTEXT}
}


Expand Down
10 changes: 5 additions & 5 deletions hack/local-up-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,10 @@ function start_apiserver {
}

function start_controller_manager {
nohup ${VC_HOME}/_output/bin/vc-controllers \
nohup ${VC_HOME}/_output/bin/vc-controller-manager \
--v=3 \
--logtostderr=false \
--log-file=${VC_HOME}/volcano/logs/vc-controllers.log \
--log-file=${VC_HOME}/volcano/logs/vc-controller-manager.log \
--scheduler-name=default-scheduler \
--kubeconfig=${VC_HOME}/volcano/config/controller-manager.config &

Expand Down Expand Up @@ -190,10 +190,10 @@ function start_volcano_scheduler {
}

function start_volcano_admission {
nohup ${VC_HOME}/_output/bin/vc-admission \
nohup ${VC_HOME}/_output/bin/vc-webhook-manager \
-v 3 \
--logtostderr=false \
--log-file=${VC_HOME}/volcano/logs/vc-admission.log \
--log-file=${VC_HOME}/volcano/logs/vc-webhook-manager.log \
--ca-cert-file ${CERT_DIR}/root.pem \
--scheduler-name=default-scheduler \
--kubeconfig ${VC_HOME}/volcano/config/admin.config \
Expand All @@ -203,7 +203,7 @@ function start_volcano_admission {
}

function cleanup_cluster {
killall -9 etcd kube-apiserver kube-controller-manager kubelet vc-controllers vc-scheduler vc-admission
killall -9 etcd kube-apiserver kube-controller-manager kubelet vc-controller-manager vc-scheduler vc-webhook-manager
rm -rf ${VC_HOME}/volcano

# Waiting for TIME_WAIT
Expand Down
10 changes: 9 additions & 1 deletion hack/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,18 @@ if [[ "${DOCKER_USERNAME}xxx" == "xxx" ]];then
fi

echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}" --password-stdin
echo "pushing ${IMAGE_PREFIX}-controllers:${VOLCANO_IMAGE_TAG}"
echo "pushing ${IMAGE_PREFIX}-controller-manager:${VOLCANO_IMAGE_TAG}"
docker tag ${IMAGE_PREFIX}-controller-manager:${VOLCANO_IMAGE_TAG} ${IMAGE_PREFIX}-controllers:${VOLCANO_IMAGE_TAG}
docker push ${IMAGE_PREFIX}-controllers:${VOLCANO_IMAGE_TAG}
docker push ${IMAGE_PREFIX}-controller-manager:${VOLCANO_IMAGE_TAG}

echo "pushing ${IMAGE_PREFIX}-scheduler:${VOLCANO_IMAGE_TAG}"
docker push ${IMAGE_PREFIX}-scheduler:${VOLCANO_IMAGE_TAG}

echo "pushing ${IMAGE_PREFIX}-webhook-manager:${VOLCANO_IMAGE_TAG}"
docker tag ${IMAGE_PREFIX}-webhook-manager:${VOLCANO_IMAGE_TAG} ${IMAGE_PREFIX}-admission:${VOLCANO_IMAGE_TAG}
docker push ${IMAGE_PREFIX}-admission:${VOLCANO_IMAGE_TAG}
docker push ${IMAGE_PREFIX}-webhook-manager:${VOLCANO_IMAGE_TAG}

echo "Generate release tar files"
cd ${RELEASE_FOLDER}/
Expand Down
4 changes: 2 additions & 2 deletions installer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ The following are the list configurable parameters of Volcano Chart and their de
| 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.controller_image_name`|Controller Docker Image Name|`volcanosh/vc-controller-manager`|
|`basic.scheduler_image_name`|Scheduler Docker Image Name|`volcanosh/vc-scheduler`|
|`basic.admission_image_name`|Admission Controller Image Name|`volcanosh/vc-admission`|
|`basic.admission_image_name`|Admission Controller Image Name|`volcanosh/vc-webhook-manager`|
|`basic.admission_secret_name`|Volcano Admission Secret Name|`volcano-admission-secret`|
|`basic.scheduler_config_file`|Configuration File name for Scheduler|`config/volcano-scheduler.conf`|
|`basic.image_pull_secret`|Image Pull Secret|`""`|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@

FROM alpine:latest

ADD vc-controllers /vc-controllers
ENTRYPOINT ["/vc-controllers"]
ADD vc-controller-manager /vc-controller-manager
ENTRYPOINT ["/vc-controller-manager"]
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

# The base image is created via `Dockerfile.base`, the base image is cached
# since the required packages change very rarely.
FROM volcanosh/vk-admission-base:latest
FROM volcanosh/vc-webhook-manager-base:1.3.1

ADD vc-admission /vc-admission
ADD vc-webhook-manager /vc-webhook-manager
ADD gen-admission-secret.sh /gen-admission-secret.sh
ENTRYPOINT ["/vc-admission"]
ENTRYPOINT ["/vc-webhook-manager"]
4 changes: 2 additions & 2 deletions installer/helm/chart/volcano/values.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
basic:
image_tag_version: "latest"
controller_image_name: "volcanosh/vc-controllers"
controller_image_name: "volcanosh/vc-controller-manager"
scheduler_image_name: "volcanosh/vc-scheduler"
admission_image_name: "volcanosh/vc-admission"
admission_image_name: "volcanosh/vc-webhook-manager"
admission_secret_name: "volcano-admission-secret"
scheduler_config_file: "config/volcano-scheduler.conf"
image_pull_secret: ""
6 changes: 3 additions & 3 deletions installer/volcano-development.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ spec:
- --port=443
- -v=4
- 2>&1
image: volcanosh/vc-admission:latest
image: volcanosh/vc-webhook-manager:latest
imagePullPolicy: IfNotPresent
name: admission
volumeMounts:
Expand Down Expand Up @@ -266,7 +266,7 @@ spec:
restartPolicy: Never
containers:
- name: main
image: volcanosh/vc-admission:latest
image: volcanosh/vc-webhook-manager:latest
imagePullPolicy: IfNotPresent
command: ["./gen-admission-secret.sh", "--service", "volcano-admission-service", "--namespace",
"volcano-system", "--secret", "volcano-admission-secret"]
Expand Down Expand Up @@ -364,7 +364,7 @@ spec:

containers:
- name: volcano-controllers
image: volcanosh/vc-controllers:latest
image: volcanosh/vc-controller-manager:latest
args:
- --alsologtostderr
- -v=4
Expand Down
2 changes: 1 addition & 1 deletion pkg/controllers/job/job_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func NewJobController(
eventBroadcaster := record.NewBroadcaster()
eventBroadcaster.StartLogging(klog.Infof)
eventBroadcaster.StartRecordingToSink(&corev1.EventSinkImpl{Interface: kubeClient.CoreV1().Events("")})
recorder := eventBroadcaster.NewRecorder(vcscheme.Scheme, v1.EventSource{Component: "vc-controllers"})
recorder := eventBroadcaster.NewRecorder(vcscheme.Scheme, v1.EventSource{Component: "vc-controller-manager"})

cc := &Controller{
kubeClient: kubeClient,
Expand Down
2 changes: 1 addition & 1 deletion pkg/controllers/queue/queue_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func NewQueueController(

podGroups: make(map[string]map[string]struct{}),

recorder: eventBroadcaster.NewRecorder(versionedscheme.Scheme, v1.EventSource{Component: "vc-controllers"}),
recorder: eventBroadcaster.NewRecorder(versionedscheme.Scheme, v1.EventSource{Component: "vc-controller-manager"}),
}

queueInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
Expand Down

0 comments on commit 8d82937

Please sign in to comment.