Commit 3f2fe87c authored by Adam Reese's avatar Adam Reese

Merge pull request #291 from adamreese/helm-merge

feat(*) merge Helm and Deployment Manager
parents c3ee2030 5f39a8f6
expandybird/pkg/*
expandybird/expansion/*.pyc
resourcifier/pkg/*
resourcifier/bin/*
manager/pkg/*
*.pyc
.project
vendor/*
/bin
/vendor/*
/rootfs/manager/bin/manager
/rootfs/manager/bin/kubectl
/rootfs/resourcifier/bin/resourcifier
/rootfs/resourcifier/bin/kubectl
/rootfs/expandybird/bin/expandybird
/rootfs/expandybird/opt/expansion
sudo: true
env:
- GO15VENDOREXPERIMENT=1 GLIDE_VERSION="0.9.1"
language: go
go:
- 1.4
install:
- sudo pip install -r expandybird/requirements.txt
- 1.6
script:
- make setup-gotools test
- make bootstrap test
branches:
only:
- master
- /^v?(?:[0-9]+\.){2}[0-9]+.*$/
install:
- wget "https://github.com/Masterminds/glide/releases/download/$GLIDE_VERSION/glide-$GLIDE_VERSION-linux-amd64.tar.gz"
- mkdir -p $HOME/bin
- tar -vxz -C $HOME/bin --strip=1 -f glide-$GLIDE_VERSION-linux-amd64.tar.gz
- export PATH="$HOME/bin:$PATH" GLIDE_HOME="$HOME/.glide"
- sudo pip install -r expansion/requirements.txt
......@@ -12,41 +12,80 @@
# See the License for the specific language governing permissions and
# limitations under the License.
include include.mk
SUBDIRS := expandybird/. resourcifier/. manager/.
TARGETS := all build test push container clean
SUBDIRS_TARGETS := \
$(foreach t,$(TARGETS),$(addsuffix $t,$(SUBDIRS)))
ifndef GOPATH
$(error No GOPATH set)
endif
GO_DEPS := github.com/kubernetes/deployment-manager/util/... github.com/kubernetes/deployment-manager/version/... github.com/kubernetes/deployment-manager/expandybird/... github.com/kubernetes/deployment-manager/resourcifier/... github.com/kubernetes/deployment-manager/manager/... github.com/kubernetes/deployment-manager/dm/...
include include.mk
.PHONY : all build test clean $(TARGETS) $(SUBDIRS_TARGETS) .project .docker
GO_DIRS ?= $(shell glide nv -x )
GO_PKGS ?= $(shell glide nv)
.PHONY: build
build:
go get -v $(GO_DEPS)
go install -v $(GO_DEPS)
@scripts/build-go.sh
.PHONY: build-cross
build-cross:
@BUILD_CROSS=1 scripts/build-go.sh
.PHONY: all
all: build
.PHONY: clean
clean:
go clean -v $(GO_DEPS)
go clean -v $(GO_PKGS)
rm -rf bin
test: build
go test -v $(GO_DEPS)
.PHONY: test
test: build test-style test-unit
.PHONY: push
push: container
.PHONY: container
container: .project .docker
.PHONY: test-unit
test-unit:
@echo Running tests...
go test -v $(GO_PKGS)
.PHONY: .test-style
test-style: lint vet
@if [[ -z $(shell gofmt -e -l -s $(GO_DIRS) | wc -l) ]]; then \
echo "gofmt check failed:"; gofmt -e -d -s $(GO_DIRS); exit 1; \
fi
.PHONY: lint
lint:
@echo Running golint...
@for i in $(GO_PKGS); do \
golint $$i; \
done
@echo -----------------
.PHONY: vet
vet:
@echo Running go vet...
@for i in $(GO_DIRS); do \
go tool vet $$i; \
done
@echo -----------------
.PHONY: bootstrap
bootstrap:
@echo Installing deps
go get -u github.com/golang/lint/golint
go get -u golang.org/x/tools/cmd/vet
go get -u github.com/mitchellh/gox
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
$(TARGETS) : % : $(addsuffix %,$(SUBDIRS))
$(SUBDIRS_TARGETS) :
$(MAKE) -C $(@D) $(@F:.%=%)
......@@ -14,7 +14,7 @@
SHELL := /bin/bash
GOLANG_CROSSPLATFORMS := darwin/386 darwin/amd64 freebsd/386 freebsd/amd64 freebsd/arm linux/386 linux/amd64 linux/arm windows/386 windows/amd64
GOLANG_CROSSPLATFORMS="darwin/386 darwin/amd64 freebsd/386 freebsd/amd64 freebsd/arm linux/386 linux/amd64 linux/arm windows/386 windows/amd64"
all: build binary
......@@ -22,15 +22,13 @@ build:
docker build -t dm .
binary:
- docker stop dm
- docker rm dm
docker run --name dm dm
for platform in ${GOLANG_CROSSPLATFORMS}; do \
for platform in $$GOLANG_CROSSPLATFORMS; do \
echo $$platform; \
docker cp dm:/go/src/dm/dm-$${platform%/*}-$${platform##*/} .; \
done
clean:
- docker rm dm
- docker rmi dm
rm -f dm-*
docker rm dm
docker rmi dm
rm dm-*
......@@ -19,8 +19,8 @@ package main
import (
"github.com/ghodss/yaml"
"github.com/kubernetes/deployment-manager/common"
"github.com/kubernetes/deployment-manager/util"
"github.com/kubernetes/deployment-manager/pkg/common"
"github.com/kubernetes/deployment-manager/pkg/util"
"archive/tar"
"bytes"
......@@ -272,7 +272,7 @@ func callService(path, method, action string, reader io.ReadCloser) {
var URL *url.URL
URL, err := url.Parse(*service)
if err != nil {
panic(fmt.Errorf("cannot parse url (%s): %s\n", *service, err))
panic(fmt.Errorf("cannot parse url (%s): %s\n", path, err))
}
URL.Path = strings.TrimRight(URL.Path, "/") + "/" + strings.TrimLeft(path, "/")
......
// Package cmd contains the executables for Deployment Manager.
package cmd
......@@ -19,6 +19,7 @@ include ../include.mk
DOCKER_REGISTRY := gcr.io
PREFIX := $(DOCKER_REGISTRY)/$(PROJECT)
IMAGE := expandybird
TAG := latest
ROOT_DIR := $(abspath ./..)
DIR = $(ROOT_DIR)
......
......@@ -24,7 +24,7 @@ import (
"os/exec"
"github.com/ghodss/yaml"
"github.com/kubernetes/deployment-manager/common"
"github.com/kubernetes/deployment-manager/pkg/common"
)
// Expander abstracts interactions with the expander and deployer services.
......
......@@ -26,8 +26,8 @@ import (
"strings"
"testing"
"github.com/kubernetes/deployment-manager/common"
"github.com/kubernetes/deployment-manager/util"
"github.com/kubernetes/deployment-manager/pkg/common"
"github.com/kubernetes/deployment-manager/pkg/util"
)
var importFileNames = []string{
......@@ -37,7 +37,7 @@ var importFileNames = []string{
var validFileName = "../test/ValidContent.yaml"
var outputFileName = "../test/ExpectedOutput.yaml"
var archiveFileName = "../test/TestArchive.tar"
var expanderName = "../expansion/expansion.py"
var expanderName = "../../../expansion/expansion.py"
type ExpanderTestCase struct {
Description string
......
......@@ -6,7 +6,7 @@ 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.
......@@ -17,9 +17,9 @@ limitations under the License.
package main
import (
"github.com/kubernetes/deployment-manager/expandybird/expander"
"github.com/kubernetes/deployment-manager/expandybird/service"
"github.com/kubernetes/deployment-manager/version"
"github.com/kubernetes/deployment-manager/cmd/expandybird/expander"
"github.com/kubernetes/deployment-manager/cmd/expandybird/service"
"github.com/kubernetes/deployment-manager/pkg/version"
"flag"
"fmt"
......@@ -33,7 +33,7 @@ import (
var port = flag.Int("port", 8080, "Port to listen on")
// path to expansion binary
var expansionBinary = flag.String("expansion_binary", "../expansion/expansion.py",
var expansionBinary = flag.String("expansion_binary", "../../../expansion/expansion.py",
"The path to the expansion binary that will be used to expand the template.")
func main() {
......
......@@ -17,9 +17,9 @@ limitations under the License.
package service
import (
"github.com/kubernetes/deployment-manager/common"
"github.com/kubernetes/deployment-manager/expandybird/expander"
"github.com/kubernetes/deployment-manager/util"
"github.com/kubernetes/deployment-manager/cmd/expandybird/expander"
"github.com/kubernetes/deployment-manager/pkg/common"
"github.com/kubernetes/deployment-manager/pkg/util"
"errors"
"fmt"
......@@ -86,7 +86,7 @@ func NewExpansionHandler(backend expander.Expander) restful.RouteFunction {
}
util.LogHandlerExit("expandybird", http.StatusOK, "OK", resp.ResponseWriter)
message := fmt.Sprintf("\nConfig:\n%s\nLayout:\n%s\n", response.Config, response.Layout)
message := fmt.Sprintf("\nConfig:\n%s\nLayout:\n%s\n", response.Config, response.Layout)
util.LogHandlerText("expandybird", message)
resp.WriteEntity(response)
}
......
......@@ -26,9 +26,9 @@ import (
"reflect"
"testing"
"github.com/kubernetes/deployment-manager/common"
"github.com/kubernetes/deployment-manager/expandybird/expander"
"github.com/kubernetes/deployment-manager/util"
"github.com/kubernetes/deployment-manager/cmd/expandybird/expander"
"github.com/kubernetes/deployment-manager/pkg/common"
"github.com/kubernetes/deployment-manager/pkg/util"
restful "github.com/emicklei/go-restful"
)
......@@ -112,7 +112,7 @@ var ServiceWrapperTestCases = []ServiceWrapperTestCase{
}
func TestServiceWrapper(t *testing.T) {
backend := expander.NewExpander("../expansion/expansion.py")
backend := expander.NewExpander("../../../expansion/expansion.py")
wrapper := NewService(NewExpansionHandler(backend))
container := restful.NewContainer()
container.ServeMux = http.NewServeMux()
......
......@@ -51,7 +51,7 @@ config:
spec:
containers:
- env: []
image: gcr.io/dm-k8s-prod/expandybird
image: gcr.io/dm-k8s-testing/expandybird
name: expandybird
ports:
- containerPort: 8080
......@@ -63,7 +63,7 @@ layout:
properties:
container_port: 8080
external_service: true
image: gcr.io/dm-k8s-prod/expandybird
image: gcr.io/dm-k8s-testing/expandybird
labels:
app: expandybird
replicas: 3
......
......@@ -19,4 +19,4 @@ resources:
properties:
service_port: 8080
target_port: 8080
image: gcr.io/dm-k8s-prod/expandybird
image: gcr.io/dm-k8s-testing/expandybird
......@@ -19,4 +19,4 @@ resources:
properties:
service_port: 8080
target_port: 8080
invalidproperty: gcr.io/dm-k8s-prod/expandybird
invalidproperty: gcr.io/dm-k8s-testing/expandybird
......@@ -19,4 +19,4 @@ resources:
properties:
service_port: 8080
target_port: 8080
image: gcr.io/dm-k8s-prod/expandybird
image: gcr.io/dm-k8s-testing/expandybird
......@@ -18,4 +18,4 @@ resources:
properties:
service_port: 8080
target_port: 8080
image: gcr.io/dm-k8s-prod/expandybird
image: gcr.io/dm-k8s-testing/expandybird
......@@ -18,4 +18,4 @@ resources:
properties:
service_port: 8080
target_port: 8080
image: gcr.io/dm-k8s-prod/expandybird
image: gcr.io/dm-k8s-testing/expandybird
......@@ -18,4 +18,4 @@ resources:
properties:
service_port: 8080
target_port: 8080
image: gcr.io/dm-k8s-prod/expandybird
image: gcr.io/dm-k8s-testing/expandybird
......@@ -22,6 +22,6 @@ resources:
container_port: 8080
external_service: true
replicas: 3
image: gcr.io/dm-k8s-prod/expandybird
image: gcr.io/dm-k8s-testing/expandybird
labels:
app: expandybird
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
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