Commit 50aa153f authored by Jack Greenfield's avatar Jack Greenfield
Browse files

Merge pull request #316 from jackgr/make-fixes

Make fixes
parents 4df02478 7100adbe
main Release add-codeql dependabot/go_modules/github.com/docker/distribution-2.8.2incompatible dependabot/go_modules/github.com/lib/pq-1.10.9 dependabot/go_modules/github.com/rubenv/sql-migrate-1.4.0 dependabot/go_modules/golang.org/x/crypto-0.9.0 dependabot/go_modules/golang.org/x/term-0.8.0 dependabot/go_modules/k8s.io/klog/v2-2.100.1 dev-v2 feat-v3/event-emitter-lua kube-update-test release-2.0 release-2.1 release-2.10 release-2.11 release-2.12 release-2.13 release-2.14 release-2.15 release-2.16 release-2.17 release-2.2 release-2.3 release-2.4 release-2.5 release-2.6 release-2.7 release-2.8 release-2.9 release-3.0 release-3.1 release-3.10 release-3.11 release-3.12 release-3.2 release-3.3 release-3.4 release-3.5 release-3.6 release-3.6.1 release-3.6.2 release-3.7 release-3.8 release-3.9 release-v3.0.0-beta.4 1.999.0 v3.12.0 v3.12.0-rc.1 v3.12.0-dev.1 v3.11.3 v3.11.2 v3.11.1 v3.11.0 v3.11.0-rc.2 v3.11.0-rc.1 v3.10.3 v3.10.2 v3.10.1 v3.10.0 v3.10.0-rc.1 v3.9.4 v3.9.3 v3.9.2 v3.9.1 v3.9.0 v3.9.0-rc.1 v3.8.2 v3.8.1 v3.8.0 v3.8.0-rc.2 v3.8.0-rc.1 v3.7.2 v3.7.1 v3.7.0 v3.7.0-rc.3 v3.7.0-rc.2 v3.7.0-rc.1 v3.6.3 v3.6.2 v3.6.1 v3.6.0 v3.6.0-rc.1 v3.5.4 v3.5.3 v3.5.2 v3.5.1 v3.5.0 v3.5.0-rc.2 v3.5.0-rc.1 v3.4.2 v3.4.1 v3.4.0 v3.4.0-rc.1 v3.3.4 v3.3.3 v3.3.2 v3.3.1 v3.3.0 v3.3.0-rc.2 v3.3.0-rc.1 v3.2.4 v3.2.3 v3.2.2 v3.2.1 v3.2.0 v3.2.0-rc.1 v3.1.3 v3.1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 v2.0.0-alpha.2 v2.0.0-alpha.1
No related merge requests found
Showing with 178 additions and 296 deletions
+178 -296
......@@ -12,21 +12,24 @@
# See the License for the specific language governing permissions and
# limitations under the License.
.PHONY: info
info:
$(MAKE) -C $(ROOTFS) $@
.PHONY: gocheck
ifndef GOPATH
$(error No GOPATH set)
$(error No GOPATH set)
endif
include include.mk
GO_DIRS ?= $(shell glide nv -x )
GO_PKGS ?= $(shell glide nv)
.PHONY: build
build:
build: gocheck
@scripts/build-go.sh
.PHONY: build-cross
build-cross:
build-cross: gocheck
@BUILD_CROSS=1 scripts/build-go.sh
.PHONY: all
......@@ -40,14 +43,18 @@ clean:
.PHONY: test
test: build test-style test-unit
ROOTFS := rootfs
.PHONY: push
push: container
push: all
$(MAKE) -C $(ROOTFS) $@
.PHONY: container
container: .project .docker
container: all
$(MAKE) -C $(ROOTFS) $@
.PHONY: test-unit
test-unit:
test-unit:
@echo Running tests...
go test -v $(GO_PKGS)
......@@ -94,12 +101,3 @@ ifndef HAS_GOX
go get -u github.com/mitchellh/gox
endif
glide install
.PHONY: .project
.project:
@if [[ -z "${PROJECT}" ]]; then echo "PROJECT variable must be set"; exit 1; fi
.PHONY: .docker
.docker:
@if [[ -z `which docker` ]] || ! docker version &> /dev/null; then echo "docker is not installed correctly"; exit 1; fi
# Copyright 2015 The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM python:2
MAINTAINER Jack Greenfield <jackgr@google.com>
RUN ln -s /usr/local/bin/python /usr/bin/python
RUN apt-get update \
&& apt-get autoremove -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# following lines copied from golang:1.6
RUN apt-get update && apt-get install -y --no-install-recommends \
g++ \
gcc \
libc6-dev \
make \
&& rm -rf /var/lib/apt/lists/*
ENV GOLANG_VERSION 1.6
ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
ENV GOLANG_DOWNLOAD_SHA256 5470eac05d273c74ff8bac7bef5bad0b5abbd1c4052efbdbc8db45332e836b0b
RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz \
&& echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - \
&& tar -C /usr/local -xzf golang.tar.gz \
&& rm golang.tar.gz
ENV GOPATH /go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
#end copied lines
COPY . "$GOPATH"/src/github.com/kubernetes/deployment-manager
WORKDIR "$GOPATH"/src/github.com/kubernetes/deployment-manager/expandybird
RUN go get -v -d .
RUN go install -v .
RUN mkdir -p /var/expandybird/expansion
WORKDIR /var/expandybird
COPY ./expandybird/expansion /var/expandybird/expansion
COPY ./expandybird/requirements.txt /var/expandybird/requirements.txt
RUN pip install --no-cache-dir -r /var/expandybird/requirements.txt
RUN cp "$GOPATH"/bin/expandybird /var/expandybird/expandybird
RUN /bin/rm -rf "$GOPATH"
EXPOSE 8080
ENTRYPOINT ["/var/expandybird/expandybird", "-expansion_binary", "/var/expandybird/expansion/expansion.py"]
# Copyright 2015 The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
include ../include.mk
.PHONY : all build push container clean .project
DOCKER_REGISTRY := gcr.io
PREFIX := $(DOCKER_REGISTRY)/$(PROJECT)
IMAGE := expandybird
ROOT_DIR := $(abspath ./..)
DIR = $(ROOT_DIR)
push: container
ifeq ($(DOCKER_REGISTRY),gcr.io)
gcloud docker push $(PREFIX)/$(IMAGE):$(TAG)
else
docker push $(PREFIX)/$(IMAGE):$(TAG)
endif
container:
docker build -t $(PREFIX)/$(IMAGE):$(TAG) -f Dockerfile $(DIR)
clean:
-docker rmi $(PREFIX)/$(IMAGE):$(TAG)
.PHONY: test
test: lint vet test-unit
# Copyright 2015 The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM golang:1.6
MAINTAINER Jack Greenfield <jackgr@google.com>
RUN apt-get update \
&& apt-get autoremove -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
WORKDIR /usr/local/bin
ENV KUBE_VERSION v1.0.5
RUN curl -fsSL -o kubectl https://storage.googleapis.com/kubernetes-release/release/$KUBE_VERSION/bin/linux/amd64/kubectl \
&& chmod +x kubectl
COPY . "$GOPATH"/src/github.com/kubernetes/deployment-manager
WORKDIR "$GOPATH"/src/github.com/kubernetes/deployment-manager/manager
RUN go-wrapper download
RUN go-wrapper install
WORKDIR /usr/local/bin
RUN cp "$GOPATH"/bin/manager /usr/local/bin
RUN /bin/rm -rf "$GOPATH"
EXPOSE 8080
ENTRYPOINT ["/usr/local/bin/manager", "--kubectl=/usr/local/bin/kubectl"]
# Copyright 2015 The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM golang:1.6
RUN apt-get update \
&& apt-get autoremove -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
WORKDIR /usr/local/bin
ENV KUBE_VERSION v1.0.5
RUN curl -fsSL -o kubectl https://storage.googleapis.com/kubernetes-release/release/$KUBE_VERSION/bin/linux/amd64/kubectl \
&& chmod +x kubectl
COPY . "$GOPATH"/src/github.com/kubernetes/deployment-manager
WORKDIR "$GOPATH"/src/github.com/kubernetes/deployment-manager/resourcifier
RUN go-wrapper download
RUN go-wrapper install
WORKDIR /usr/local/bin
RUN cp "$GOPATH"/bin/resourcifier /usr/local/bin
RUN /bin/rm -rf "$GOPATH"
EXPOSE 8080
ENTRYPOINT ["/usr/local/bin/resourcifier", "--kubectl=/usr/local/bin/kubectl"]
.PHONY: info
info:
@echo "Build tag: ${TAG}"
@echo "Registry: ${DOCKER_REGISTRY}"
@echo "Project: ${PROJECT}"
@echo "Image: ${IMAGE}"
TAG ?= $(shell echo `date +"%s"`_`date +"%N"`)
\ No newline at end of file
......@@ -12,29 +12,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.
include ../include.mk
SUBDIRS := expandybird/. resourcifier/. manager/.
TARGETS := info push container
.PHONY : all build push container clean .project
SUBDIRS_TARGETS := \
$(foreach t,$(TARGETS),$(addsuffix $t,$(SUBDIRS)))
DOCKER_REGISTRY := gcr.io
PREFIX := $(DOCKER_REGISTRY)/$(PROJECT)
IMAGE := manager
.PHONY : $(TARGETS) $(SUBDIRS_TARGETS)
ROOT_DIR := $(abspath ./..)
DIR = $(ROOT_DIR)
$(TARGETS) : % : $(addsuffix %,$(SUBDIRS))
push: container
ifeq ($(DOCKER_REGISTRY),gcr.io)
gcloud docker push $(PREFIX)/$(IMAGE):$(TAG)
else
docker push $(PREFIX)/$(IMAGE):$(TAG)
endif
container:
docker build -t $(PREFIX)/$(IMAGE):$(TAG) -f Dockerfile $(DIR)
clean:
-docker rmi $(PREFIX)/$(IMAGE):$(TAG)
.PHONY: test
test: lint vet test-unit
$(SUBDIRS_TARGETS) :
$(MAKE) -C $(@D) $(@F:.%=%)
......@@ -12,27 +12,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
DOCKER_REGISTRY := gcr.io
PREFIX := $(DOCKER_REGISTRY)/$(PROJECT)
IMAGE ?= expandybird
TAG ?= git-$(shell git rev-parse --short HEAD)
FULL_IMAGE := $(PREFIX)/$(IMAGE)
.PHONY: container
container: binary expansion
docker build -t $(FULL_IMAGE):latest -f Dockerfile .
docker tag $(FULL_IMAGE):latest $(FULL_IMAGE):$(TAG)
include ../include.mk
.PHONY: push
push: container
ifeq ($(DOCKER_REGISTRY),gcr.io)
gcloud docker push $(PREFIX)/$(IMAGE):$(TAG)
else
docker push $(PREFIX)/$(IMAGE):$(TAG)
endif
.PHONY: extras
extras: expansion
.PHONY: expansion
expansion:
cp -R ../../expansion ./opt
binary:
cp ../../bin/linux-amd64/expandybird ./bin
......@@ -14,29 +14,56 @@
# If you update this image please check the tag value before pushing.
include ../include.mk
DOCKER_REGISTRY ?= gcr.io
PREFIX := $(DOCKER_REGISTRY)/$(PROJECT)
FULL_IMAGE := $(PREFIX)/$(IMAGE)
.PHONY : all build push container clean
TAG ?= git-$(shell git rev-parse --short HEAD)
DOCKER_REGISTRY := gcr.io
PREFIX := $(DOCKER_REGISTRY)/$(PROJECT)
IMAGE := resourcifier
DEFAULT_PLATFORM := $(shell uname | tr '[:upper:]' '[:lower:]')
PLATFORM ?= $(DEFAULT_PLATFORM)
DEFAULT_ARCH := $(shell uname -m)
ARCH ?= $(DEFAULT_ARCH)
ROOT_DIR := $(abspath ./..)
DIR = $(ROOT_DIR)
.PHONY: info
info:
@echo "Build tag: ${TAG}"
@echo "Registry: ${DOCKER_REGISTRY}"
@echo "Project: ${PROJECT}"
@echo "Image: ${IMAGE}"
@echo "Platform: ${PLATFORM}"
@echo "Arch: ${ARCH}"
.PHONY : .project
.PHONY: push
push: container
ifeq ($(DOCKER_REGISTRY),gcr.io)
gcloud docker push $(PREFIX)/$(IMAGE):$(TAG)
gcloud docker push $(FULL_IMAGE):$(TAG)
else
docker push $(PREFIX)/$(IMAGE):$(TAG)
docker push $(FULL_IMAGE):$(TAG)
endif
container:
docker build -t $(PREFIX)/$(IMAGE):$(TAG) -f Dockerfile $(DIR)
.PHONY: container
container: .project .docker binary extras
docker build -t $(FULL_IMAGE):latest -f Dockerfile .
docker tag -f $(FULL_IMAGE):latest $(FULL_IMAGE):$(TAG)
.project:
@if [[ -z "${PROJECT}" ]]; then echo "PROJECT variable must be set"; exit 1; fi
.docker:
@if [[ -z `which docker` ]] || ! docker version &> /dev/null; then echo "docker is not installed correctly"; exit 1; fi
clean:
-docker rmi $(PREFIX)/$(IMAGE):$(TAG)
CROSS_IMAGE := $(PLATFORM)-$(ARCH)/$(IMAGE)/$(IMAGE)
.PHONY: test
test: lint vet test-unit
.PHONY: binary
binary:
@if [[ -z $(CROSS_IMAGE) ]]; then \
echo cp ../../bin/$(CROSS_IMAGE) ./bin ; \
cp ../../bin/$(CROSS_IMAGE) ./bin ; \
else \
echo cp ../../bin/$(IMAGE) ./bin ; \
cp ../../bin/$(IMAGE) ./bin ; \
fi
......@@ -12,30 +12,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.
DOCKER_REGISTRY := gcr.io
PREFIX := $(DOCKER_REGISTRY)/$(PROJECT)
IMAGE ?= manager
TAG ?= git-$(shell git rev-parse --short HEAD)
FULL_IMAGE := $(PREFIX)/$(IMAGE)
KUBE_VERSION ?= v1.1.7
.PHONY: container
container: binary kubectl
docker build -t $(FULL_IMAGE):latest -f Dockerfile .
docker tag $(FULL_IMAGE):latest $(FULL_IMAGE):$(TAG)
.PHONY: push
push: container
ifeq ($(DOCKER_REGISTRY),gcr.io)
gcloud docker push $(PREFIX)/$(IMAGE):$(TAG)
else
docker push $(PREFIX)/$(IMAGE):$(TAG)
endif
include ../include.mk
binary:
cp ../../bin/linux-amd64/manager ./bin
.PHONY: extras
extras: kubectl
.PHONY: kubectl
kubectl:
curl -fsSL -o bin/kubectl https://storage.googleapis.com/kubernetes-release/release/${KUBE_VERSION}/bin/linux/amd64/kubectl
chmod +x bin/kubectl
......@@ -12,30 +12,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.
DOCKER_REGISTRY := gcr.io
PREFIX := $(DOCKER_REGISTRY)/$(PROJECT)
IMAGE ?= resourcifier
TAG ?= git-$(shell git rev-parse --short HEAD)
FULL_IMAGE := $(PREFIX)/$(IMAGE)
KUBE_VERSION ?= v1.1.7
.PHONY: container
container: binary kubectl
docker build -t $(FULL_IMAGE):latest -f Dockerfile .
docker tag $(FULL_IMAGE):latest $(FULL_IMAGE):$(TAG)
.PHONY: push
push: container
ifeq ($(DOCKER_REGISTRY),gcr.io)
gcloud docker push $(PREFIX)/$(IMAGE):$(TAG)
else
docker push $(PREFIX)/$(IMAGE):$(TAG)
endif
include ../include.mk
binary:
cp ../../bin/linux-amd64/resourcifier ./bin
.PHONY: extras
extras: kubectl
.PHONY: kubectl
kubectl:
curl -fsSL -o bin/kubectl https://storage.googleapis.com/kubernetes-release/release/${KUBE_VERSION}/bin/linux/amd64/kubectl
chmod +x bin/kubectl
#!/bin/bash
LOGDIR=log
if [[ ! -d $LOGDIR ]]; then
mkdir $LOGDIR
fi
KUBECTL=`which kubectl`
if [[ -z $KUBECTL ]] ; then
echo Cannot find kubectl
exit 1
fi
echo "Starting resourcifier..."
RESOURCIFIER=bin/resourcifier
if [[ -z $RESOURCIFIER ]] ; then
echo Cannot find resourcifier
exit 1
fi
pkill -f $RESOURCIFIER
nohup $RESOURCIFIER > $LOGDIR/resourcifier.log 2>&1 --kubectl=$KUBECTL --port=8082 &
echo
echo "Starting expandybird..."
EXPANDYBIRD=bin/expandybird
if [[ -z $EXPANDYBIRD ]] ; then
echo Cannot find expandybird
exit 1
fi
pkill -f $EXPANDYBIRD
nohup $EXPANDYBIRD > $LOGDIR/expandybird.log 2>&1 --port=8081 --expansion_binary=expansion/expansion.py &
echo
echo "Starting deployment manager..."
MANAGER=bin/manager
if [[ -z $MANAGER ]] ; then
echo Cannot find manager
exit 1
fi
pkill -f $MANAGER
nohup $MANAGER > $LOGDIR/manager.log 2>&1 --port=8080 --kubectl=$KUBECTL --expanderURL=http://localhost:8081 --deployerURL=http://localhost:8082 &
echo
echo "Starting kubectl proxy..."
pkill -f "$KUBECTL proxy"
nohup $KUBECTL proxy --port=8001 &
sleep 1s
echo
echo "Done."
#!/bin/bash
echo "Stopping resourcifier..."
RESOURCIFIER=bin/resourcifier
if [[ ! -z $RESOURCIFIER ]] ; then
pkill -f $RESOURCIFIER
fi
echo
echo "Stopping expandybird..."
EXPANDYBIRD=bin/expandybird
if [[ ! -z $EXPANDYBIRD ]] ; then
pkill -f $EXPANDYBIRD
fi
echo
echo "Stopping deployment manager..."
MANAGER=bin/manager
if [[ ! -z $MANAGER ]] ; then
pkill -f $MANAGER
fi
echo
echo "Done."
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment