From 0edcff023f8649060e14609ba714105afab288ee Mon Sep 17 00:00:00 2001 From: jackgr Date: Mon, 4 Apr 2016 17:57:11 -0700 Subject: [PATCH 1/5] Change dm-k8s-prod to kubernetes-helm --- cmd/expandybird/test/ExpectedOutput.yaml | 4 ++-- cmd/expandybird/test/InvalidFileName.yaml | 2 +- cmd/expandybird/test/InvalidProperty.yaml | 2 +- cmd/expandybird/test/InvalidTypeName.yaml | 2 +- cmd/expandybird/test/MissingImports.yaml | 2 +- cmd/expandybird/test/MissingResourceName.yaml | 2 +- cmd/expandybird/test/MissingTypeName.yaml | 2 +- cmd/expandybird/test/TestArchive.tar | Bin 9728 -> 9732 bytes cmd/expandybird/test/ValidContent.yaml | 2 +- docs/pushing.md | 3 +-- hack/dm-push.sh | 2 +- pkg/client/install.go | 6 +++--- pkg/util/templateutil_test.go | 2 +- 13 files changed, 15 insertions(+), 16 deletions(-) diff --git a/cmd/expandybird/test/ExpectedOutput.yaml b/cmd/expandybird/test/ExpectedOutput.yaml index 13e510d3c..02bf868b8 100644 --- a/cmd/expandybird/test/ExpectedOutput.yaml +++ b/cmd/expandybird/test/ExpectedOutput.yaml @@ -51,7 +51,7 @@ config: spec: containers: - env: [] - image: gcr.io/dm-k8s-prod/expandybird + image: gcr.io/kubernetes-helm/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/kubernetes-helm/expandybird labels: app: expandybird replicas: 3 diff --git a/cmd/expandybird/test/InvalidFileName.yaml b/cmd/expandybird/test/InvalidFileName.yaml index fd3800466..fa29b84d2 100644 --- a/cmd/expandybird/test/InvalidFileName.yaml +++ b/cmd/expandybird/test/InvalidFileName.yaml @@ -19,4 +19,4 @@ resources: properties: service_port: 8080 target_port: 8080 - image: gcr.io/dm-k8s-prod/expandybird + image: gcr.io/kubernetes-helm/expandybird diff --git a/cmd/expandybird/test/InvalidProperty.yaml b/cmd/expandybird/test/InvalidProperty.yaml index fd3d5edeb..aab9b6341 100644 --- a/cmd/expandybird/test/InvalidProperty.yaml +++ b/cmd/expandybird/test/InvalidProperty.yaml @@ -19,4 +19,4 @@ resources: properties: service_port: 8080 target_port: 8080 - invalidproperty: gcr.io/dm-k8s-prod/expandybird + invalidproperty: gcr.io/kubernetes-helm/expandybird diff --git a/cmd/expandybird/test/InvalidTypeName.yaml b/cmd/expandybird/test/InvalidTypeName.yaml index e411c1b11..67b7050f0 100644 --- a/cmd/expandybird/test/InvalidTypeName.yaml +++ b/cmd/expandybird/test/InvalidTypeName.yaml @@ -19,4 +19,4 @@ resources: properties: service_port: 8080 target_port: 8080 - image: gcr.io/dm-k8s-prod/expandybird + image: gcr.io/kubernetes-helm/expandybird diff --git a/cmd/expandybird/test/MissingImports.yaml b/cmd/expandybird/test/MissingImports.yaml index 6a6741f8a..91c11fe33 100644 --- a/cmd/expandybird/test/MissingImports.yaml +++ b/cmd/expandybird/test/MissingImports.yaml @@ -18,4 +18,4 @@ resources: properties: service_port: 8080 target_port: 8080 - image: gcr.io/dm-k8s-prod/expandybird + image: gcr.io/kubernetes-helm/expandybird diff --git a/cmd/expandybird/test/MissingResourceName.yaml b/cmd/expandybird/test/MissingResourceName.yaml index 32215e765..00f7e7d61 100644 --- a/cmd/expandybird/test/MissingResourceName.yaml +++ b/cmd/expandybird/test/MissingResourceName.yaml @@ -18,4 +18,4 @@ resources: properties: service_port: 8080 target_port: 8080 - image: gcr.io/dm-k8s-prod/expandybird + image: gcr.io/kubernetes-helm/expandybird diff --git a/cmd/expandybird/test/MissingTypeName.yaml b/cmd/expandybird/test/MissingTypeName.yaml index f246d99f8..4a867f86c 100644 --- a/cmd/expandybird/test/MissingTypeName.yaml +++ b/cmd/expandybird/test/MissingTypeName.yaml @@ -18,4 +18,4 @@ resources: properties: service_port: 8080 target_port: 8080 - image: gcr.io/dm-k8s-prod/expandybird + image: gcr.io/kubernetes-helm/expandybird diff --git a/cmd/expandybird/test/TestArchive.tar b/cmd/expandybird/test/TestArchive.tar index 585b4418d4b8e8ddc3e76442907090b4ae1559cc..9cb986b978e50715ef04142faa80f1bf381f1f49 100644 GIT binary patch delta 28 jcmZqhY4O=`o0UJiG%2+xFSR7KST`dzCwKERRw)Glr=<%Y delta 24 fcmZqiY4F)_o0U5yS2x?DSht`kKV|bPRw)Glb>s;O diff --git a/cmd/expandybird/test/ValidContent.yaml b/cmd/expandybird/test/ValidContent.yaml index 0c342201e..5798efec3 100644 --- a/cmd/expandybird/test/ValidContent.yaml +++ b/cmd/expandybird/test/ValidContent.yaml @@ -22,6 +22,6 @@ resources: container_port: 8080 external_service: true replicas: 3 - image: gcr.io/dm-k8s-prod/expandybird + image: gcr.io/kubernetes-helm/expandybird labels: app: expandybird \ No newline at end of file diff --git a/docs/pushing.md b/docs/pushing.md index 4b139c96d..3f614fcce 100644 --- a/docs/pushing.md +++ b/docs/pushing.md @@ -6,7 +6,7 @@ This details the requirements and steps for doing a DM push. In order to build and push DM, you must: -* be an editor or owner on the GCP project `dm-k8s-prod` +* be an editor or owner on the GCP project `kubernetes-helm` * have `docker` installed and runnable in your current environment * have `gcloud` installed * have `gsutil` installed @@ -17,7 +17,6 @@ To build and push the service containers: ``` $ cd ${GOPATH}/src/github.com/kubernetes/helm -$ export PROJECT=dm-k8s-prod $ make push ``` diff --git a/hack/dm-push.sh b/hack/dm-push.sh index 3c095568d..bf894612e 100755 --- a/hack/dm-push.sh +++ b/hack/dm-push.sh @@ -17,7 +17,7 @@ # Run this from helm root to build and push the dm client plus # kubernetes install config into the publicly readable GCS bucket gs://get-dm. # -# Must have EDIT permissions on the dm-k8s-prod GCP project. +# Must have EDIT permissions on the kubernetes-helm GCP project. set -euo pipefail diff --git a/pkg/client/install.go b/pkg/client/install.go index 379dc6025..d255b686c 100644 --- a/pkg/client/install.go +++ b/pkg/client/install.go @@ -143,7 +143,7 @@ spec: spec: containers: - env: [] - image: {{default "gcr.io/dm-k8s-prod/expandybird:v1.2.1" .Expandybird.Image}} + image: {{default "gcr.io/kubernetes-helm/expandybird:v1.2.1" .Expandybird.Image}} name: expandybird ports: - containerPort: 8080 @@ -187,7 +187,7 @@ spec: spec: containers: - env: [] - image: {{ default "gcr.io/dm-k8s-prod/resourcifier:v1.2.1" .Resourcifier.Image }} + image: {{ default "gcr.io/kubernetes-helm/resourcifier:v1.2.1" .Resourcifier.Image }} name: resourcifier ports: - containerPort: 8080 @@ -231,7 +231,7 @@ spec: spec: containers: - env: [] - image: {{ default "gcr.io/dm-k8s-prod/manager:v1.2.1" .Manager.Image }} + image: {{ default "gcr.io/kubernetes-helm/manager:v1.2.1" .Manager.Image }} name: manager ports: - containerPort: 8080 diff --git a/pkg/util/templateutil_test.go b/pkg/util/templateutil_test.go index 36a99c73a..e6e66ac9f 100644 --- a/pkg/util/templateutil_test.go +++ b/pkg/util/templateutil_test.go @@ -39,7 +39,7 @@ target_port: 8080 container_port: 8080 external_service: true replicas: 3 -image: gcr.io/dm-k8s-prod/expandybird +image: gcr.io/kubernetes-helm/expandybird labels: app: expandybird ` From 74748aa276be6d8f3e8f8824d6d91c5d0179de5f Mon Sep 17 00:00:00 2001 From: jackgr Date: Mon, 4 Apr 2016 17:58:16 -0700 Subject: [PATCH 2/5] Remove .keep files in rootfs/bin directories --- rootfs/expandybird/bin/.keep | 0 rootfs/expandybird/opt/.keep | 0 rootfs/manager/bin/.keep | 0 rootfs/resourcifier/bin/.keep | 0 4 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 rootfs/expandybird/bin/.keep delete mode 100644 rootfs/expandybird/opt/.keep delete mode 100644 rootfs/manager/bin/.keep delete mode 100644 rootfs/resourcifier/bin/.keep diff --git a/rootfs/expandybird/bin/.keep b/rootfs/expandybird/bin/.keep deleted file mode 100644 index e69de29bb..000000000 diff --git a/rootfs/expandybird/opt/.keep b/rootfs/expandybird/opt/.keep deleted file mode 100644 index e69de29bb..000000000 diff --git a/rootfs/manager/bin/.keep b/rootfs/manager/bin/.keep deleted file mode 100644 index e69de29bb..000000000 diff --git a/rootfs/resourcifier/bin/.keep b/rootfs/resourcifier/bin/.keep deleted file mode 100644 index e69de29bb..000000000 From 668948f6a1bdaa8227c973932f6c41fe7c921e8b Mon Sep 17 00:00:00 2001 From: jackgr Date: Mon, 4 Apr 2016 18:00:43 -0700 Subject: [PATCH 3/5] Change dm-k8s-prod to kubernetes-charts --- examples/wordpress/README.md | 2 +- examples/wordpress/wordpress.jinja | 2 +- examples/wordpress/wordpress.jinja.schema | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/wordpress/README.md b/examples/wordpress/README.md index 177ff47c7..8c976c73e 100644 --- a/examples/wordpress/README.md +++ b/examples/wordpress/README.md @@ -42,7 +42,7 @@ The template contains the following variables: ``` {% set PROPERTIES = properties or {} %} -{% set PROJECT = PROPERTIES['project'] or 'dm-k8s-prod' %} +{% set PROJECT = PROPERTIES['project'] or 'kubernetes-charts' %} {% set NFS_SERVER = PROPERTIES['nfs-server'] or {} %} {% set NFS_SERVER_IP = NFS_SERVER['ip'] or '10.0.253.247' %} {% set NFS_SERVER_PORT = NFS_SERVER['port'] or 2049 %} diff --git a/examples/wordpress/wordpress.jinja b/examples/wordpress/wordpress.jinja index 5855b2e8c..0b84dacf4 100644 --- a/examples/wordpress/wordpress.jinja +++ b/examples/wordpress/wordpress.jinja @@ -1,5 +1,5 @@ {% set PROPERTIES = properties or {} %} -{% set PROJECT = PROPERTIES['project'] or 'dm-k8s-prod' %} +{% set PROJECT = PROPERTIES['project'] or 'kubernetes-charts' %} {% set NFS_SERVER = PROPERTIES['nfs-server'] or {} %} {% set NFS_SERVER_IP = NFS_SERVER['ip'] or '10.0.253.247' %} {% set NFS_SERVER_PORT = NFS_SERVER['port'] or 2049 %} diff --git a/examples/wordpress/wordpress.jinja.schema b/examples/wordpress/wordpress.jinja.schema index 5b4a8bc21..924ba07ba 100644 --- a/examples/wordpress/wordpress.jinja.schema +++ b/examples/wordpress/wordpress.jinja.schema @@ -8,7 +8,7 @@ info: properties: project: type: string - default: dm-k8s-prod + default: kubernetes-charts description: Project location to load the images from. nfs-service: type: object From 394bf188024df77884ed55930ac49ddf8e7fe8d8 Mon Sep 17 00:00:00 2001 From: jackgr Date: Mon, 4 Apr 2016 19:55:09 -0700 Subject: [PATCH 4/5] Update push and get-install.sh --- Makefile | 23 ++++++++++++++++------- cmd/helm/Makefile | 39 +++++++++++++++++++++++++++++++++++++++ docs/pushing.md | 21 +++++++-------------- get-install.sh | 28 ++++++++++++++++++++-------- hack/dm-push.sh | 43 ------------------------------------------- rootfs/include.mk | 7 ++++--- scripts/common.sh | 4 ++-- 7 files changed, 88 insertions(+), 77 deletions(-) create mode 100644 cmd/helm/Makefile delete mode 100755 hack/dm-push.sh diff --git a/Makefile b/Makefile index 6c023ffa5..aba820c6b 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. +GO_DIRS ?= $(shell glide nv -x ) +GO_PKGS ?= $(shell glide nv) + +ROOTFS := rootfs +CLIENT := cmd/helm + .PHONY: info info: $(MAKE) -C $(ROOTFS) $@ @@ -21,11 +27,6 @@ ifndef GOPATH $(error No GOPATH set) endif -GO_DIRS ?= $(shell glide nv -x ) -GO_PKGS ?= $(shell glide nv) - -ROOTFS := rootfs - .PHONY: build build: gocheck @scripts/build-go.sh @@ -55,8 +56,16 @@ quicktest: test-style go test $(GO_PKGS) .PHONY: push -push: build-static - $(MAKE) -C $(ROOTFS) $@ +push: push-server push-client + +.PHONY: push-server +push-server: build-static + $(MAKE) -C $(ROOTFS) push + +.PHONY: push-client +push-client: gocheck + @BUILD_TYPE=CROSS scripts/build-go.sh $(CLIENT) + $(MAKE) -C $(CLIENT) push .PHONY: container container: build-static diff --git a/cmd/helm/Makefile b/cmd/helm/Makefile new file mode 100644 index 000000000..30cfef5a5 --- /dev/null +++ b/cmd/helm/Makefile @@ -0,0 +1,39 @@ +# 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. + +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 + +ROOT_DIR := $(abspath ./../..) +BIN_DIR := $(ROOT_DIR)/bin + +DEFAULT_BUCKET := gs://get-helm +STORAGE_BUCKET ?= $(DEFAULT_BUCKET) + +DEFAULT_TAG := git-$(shell git rev-parse --short HEAD) +TAG ?= $(DEFAULT_TAG) + +all: push + +push: + for platform in ${GOLANG_CROSSPLATFORMS}; do \ + echo $$platform; \ + PLATFORM=$${platform%/*} && ARCH=$${platform##*/} && \ + BINARY=$${PLATFORM}-$${ARCH} && \ + ZIP=${TAG}-helm-$${BINARY}.zip && \ + zip -j $${ZIP} ${BIN_DIR}/$${BINARY}/helm* && \ + gsutil cp $${ZIP} ${STORAGE_BUCKET} && \ + rm $${ZIP} ; \ + done diff --git a/docs/pushing.md b/docs/pushing.md index 3f614fcce..4f5ab9bfe 100644 --- a/docs/pushing.md +++ b/docs/pushing.md @@ -1,10 +1,10 @@ -# Pushing DM +# Pushing Helm -This details the requirements and steps for doing a DM push. +This details the requirements and steps for doing a `helm` push. ## Prerequisites -In order to build and push DM, you must: +In order to build and push `helm`, you must: * be an editor or owner on the GCP project `kubernetes-helm` * have `docker` installed and runnable in your current environment @@ -13,17 +13,10 @@ In order to build and push DM, you must: ## Pushing -To build and push the service containers: +To build and push the service containers and the client binaries for all +supported platforms and architectures, checkout the branch and tag you intend to release, +and then run the following: ``` -$ cd ${GOPATH}/src/github.com/kubernetes/helm -$ make push +$ PROJECT=kubernetes-helm make push ``` - -To push the client binaries, run the following for both Mac OS X and Linux -environments: - -``` -$ hack/dm-push.sh -``` - diff --git a/get-install.sh b/get-install.sh index 84bce786d..f975840ae 100755 --- a/get-install.sh +++ b/get-install.sh @@ -13,15 +13,28 @@ # See the License for the specific language governing permissions and # limitations under the License. +# Run this from the root of your clone of the kubernetes/helm repository. +# Be sure to checkout the release you want to install before running it, +# since it will attempt to pull the version from HEAD on the current branch. + set -euo pipefail -DEFAULT_TAG=v1.2 -DEFAULT_BINARY=${GOPATH}/bin/helm +DEFAULT_TAG=git-$(git rev-parse --short HEAD) DEFAULT_PLATFORM=$(uname | tr '[:upper:]' '[:lower:]') DEFAULT_ARCH=$(uname -m) -STORAGE_URL=http://get-dm.storage.googleapis.com -ZIP=helm-${TAG:-${DEFAULT_TAG}}-${PLATFORM:-${DEFAULT_PLATFORM}}-${ARCH:-${DEFAULT_ARCH}}.zip +if [[ "${DEFAULT_ARCH}" == x86_64 ]]; then + DEFAULT_ARCH=amd64 +fi + +PLATFORM=${PLATFORM:-${DEFAULT_PLATFORM}} +ARCH=${ARCH:-${DEFAULT_ARCH}} +TAG=${TAG:-${DEFAULT_TAG}} + +BINARY=helm-${PLATFORM}-${ARCH} +ZIP=${TAG}-${BINARY}.zip + +STORAGE_URL=http://get-helm.storage.googleapis.com echo "Downloading ${ZIP}..." curl -Ls "${STORAGE_URL}/${ZIP}" -O @@ -35,14 +48,13 @@ cat < Date: Mon, 4 Apr 2016 20:04:10 -0700 Subject: [PATCH 5/5] Change server image default tag from v1.2.1 to latest --- pkg/client/install.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/client/install.go b/pkg/client/install.go index d255b686c..7fffe1487 100644 --- a/pkg/client/install.go +++ b/pkg/client/install.go @@ -143,7 +143,7 @@ spec: spec: containers: - env: [] - image: {{default "gcr.io/kubernetes-helm/expandybird:v1.2.1" .Expandybird.Image}} + image: {{default "gcr.io/kubernetes-helm/expandybird:latest" .Expandybird.Image}} name: expandybird ports: - containerPort: 8080 @@ -187,7 +187,7 @@ spec: spec: containers: - env: [] - image: {{ default "gcr.io/kubernetes-helm/resourcifier:v1.2.1" .Resourcifier.Image }} + image: {{ default "gcr.io/kubernetes-helm/resourcifier:latest" .Resourcifier.Image }} name: resourcifier ports: - containerPort: 8080 @@ -231,7 +231,7 @@ spec: spec: containers: - env: [] - image: {{ default "gcr.io/kubernetes-helm/manager:v1.2.1" .Manager.Image }} + image: {{ default "gcr.io/kubernetes-helm/manager:latest" .Manager.Image }} name: manager ports: - containerPort: 8080