Commit 0af0856e authored by Jack Greenfield's avatar Jack Greenfield

Merge pull request #556 from jackgr/change-repos

Change repo references from dm-k8s-prod to new repos and update build and push for client and server images
parents 368287ed 8636deab
...@@ -12,6 +12,12 @@ ...@@ -12,6 +12,12 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
GO_DIRS ?= $(shell glide nv -x )
GO_PKGS ?= $(shell glide nv)
ROOTFS := rootfs
CLIENT := cmd/helm
.PHONY: info .PHONY: info
info: info:
$(MAKE) -C $(ROOTFS) $@ $(MAKE) -C $(ROOTFS) $@
...@@ -21,11 +27,6 @@ ifndef GOPATH ...@@ -21,11 +27,6 @@ ifndef GOPATH
$(error No GOPATH set) $(error No GOPATH set)
endif endif
GO_DIRS ?= $(shell glide nv -x )
GO_PKGS ?= $(shell glide nv)
ROOTFS := rootfs
.PHONY: build .PHONY: build
build: gocheck build: gocheck
@scripts/build-go.sh @scripts/build-go.sh
...@@ -55,8 +56,16 @@ quicktest: test-style ...@@ -55,8 +56,16 @@ quicktest: test-style
go test $(GO_PKGS) go test $(GO_PKGS)
.PHONY: push .PHONY: push
push: build-static push: push-server push-client
$(MAKE) -C $(ROOTFS) $@
.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 .PHONY: container
container: build-static container: build-static
......
...@@ -51,7 +51,7 @@ config: ...@@ -51,7 +51,7 @@ config:
spec: spec:
containers: containers:
- env: [] - env: []
image: gcr.io/dm-k8s-prod/expandybird image: gcr.io/kubernetes-helm/expandybird
name: expandybird name: expandybird
ports: ports:
- containerPort: 8080 - containerPort: 8080
...@@ -63,7 +63,7 @@ layout: ...@@ -63,7 +63,7 @@ layout:
properties: properties:
container_port: 8080 container_port: 8080
external_service: true external_service: true
image: gcr.io/dm-k8s-prod/expandybird image: gcr.io/kubernetes-helm/expandybird
labels: labels:
app: expandybird app: expandybird
replicas: 3 replicas: 3
......
...@@ -19,4 +19,4 @@ resources: ...@@ -19,4 +19,4 @@ resources:
properties: properties:
service_port: 8080 service_port: 8080
target_port: 8080 target_port: 8080
image: gcr.io/dm-k8s-prod/expandybird image: gcr.io/kubernetes-helm/expandybird
...@@ -19,4 +19,4 @@ resources: ...@@ -19,4 +19,4 @@ resources:
properties: properties:
service_port: 8080 service_port: 8080
target_port: 8080 target_port: 8080
invalidproperty: gcr.io/dm-k8s-prod/expandybird invalidproperty: gcr.io/kubernetes-helm/expandybird
...@@ -19,4 +19,4 @@ resources: ...@@ -19,4 +19,4 @@ resources:
properties: properties:
service_port: 8080 service_port: 8080
target_port: 8080 target_port: 8080
image: gcr.io/dm-k8s-prod/expandybird image: gcr.io/kubernetes-helm/expandybird
...@@ -18,4 +18,4 @@ resources: ...@@ -18,4 +18,4 @@ resources:
properties: properties:
service_port: 8080 service_port: 8080
target_port: 8080 target_port: 8080
image: gcr.io/dm-k8s-prod/expandybird image: gcr.io/kubernetes-helm/expandybird
...@@ -18,4 +18,4 @@ resources: ...@@ -18,4 +18,4 @@ resources:
properties: properties:
service_port: 8080 service_port: 8080
target_port: 8080 target_port: 8080
image: gcr.io/dm-k8s-prod/expandybird image: gcr.io/kubernetes-helm/expandybird
...@@ -18,4 +18,4 @@ resources: ...@@ -18,4 +18,4 @@ resources:
properties: properties:
service_port: 8080 service_port: 8080
target_port: 8080 target_port: 8080
image: gcr.io/dm-k8s-prod/expandybird image: gcr.io/kubernetes-helm/expandybird
...@@ -22,6 +22,6 @@ resources: ...@@ -22,6 +22,6 @@ resources:
container_port: 8080 container_port: 8080
external_service: true external_service: true
replicas: 3 replicas: 3
image: gcr.io/dm-k8s-prod/expandybird image: gcr.io/kubernetes-helm/expandybird
labels: labels:
app: expandybird app: expandybird
\ No newline at end of file
#!/usr/bin/env bash
#
# Copyright 2015 The Kubernetes Authors All rights reserved. # Copyright 2015 The Kubernetes Authors All rights reserved.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
...@@ -14,30 +12,28 @@ ...@@ -14,30 +12,28 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# Run this from helm root to build and push the dm client plus SHELL := /bin/bash
# kubernetes install config into the publicly readable GCS bucket gs://get-dm.
#
# Must have EDIT permissions on the dm-k8s-prod GCP project.
set -euo pipefail
DEFAULT_TAG=v1.2
DEFAULT_BINARY=${GOPATH}/bin/dm
DEFAULT_PLATFORM=$(uname | tr '[:upper:]' '[:lower:]')
DEFAULT_ARCH=$(uname -m)
STORAGE_BUCKET=gs://get-dm GOLANG_CROSSPLATFORMS := darwin/386 darwin/amd64 freebsd/386 freebsd/amd64 freebsd/arm linux/386 linux/amd64 linux/arm windows/386 windows/amd64
ZIP=dm-${TAG:-DEFAULT_TAG}-${PLATFORM:-DEFAULT_PLATFORM}-${ARCH:-DEFAULT_ARCH}.zip
echo "Building..." ROOT_DIR := $(abspath ./../..)
make BIN_DIR := $(ROOT_DIR)/bin
echo "Zipping ${ZIP}..." DEFAULT_BUCKET := gs://get-helm
zip -j ${ZIP} ${BINARY:-DEFAULT_BINARY} install.yaml STORAGE_BUCKET ?= $(DEFAULT_BUCKET)
echo "Uploading ${ZIP} to ${STORAGE_BUCKET}..." DEFAULT_TAG := git-$(shell git rev-parse --short HEAD)
gsutil cp ${ZIP} ${STORAGE_BUCKET} TAG ?= $(DEFAULT_TAG)
rm ${ZIP}
echo "Done." 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
# 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 ## 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 `dm-k8s-prod` * be an editor or owner on the GCP project `kubernetes-helm`
* have `docker` installed and runnable in your current environment * have `docker` installed and runnable in your current environment
* have `gcloud` installed * have `gcloud` installed
* have `gsutil` installed * have `gsutil` installed
## Pushing ## 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 $ PROJECT=kubernetes-helm make push
$ export PROJECT=dm-k8s-prod
$ make push
``` ```
To push the client binaries, run the following for both Mac OS X and Linux
environments:
```
$ hack/dm-push.sh
```
...@@ -42,7 +42,7 @@ The template contains the following variables: ...@@ -42,7 +42,7 @@ The template contains the following variables:
``` ```
{% set PROPERTIES = properties or {} %} {% 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 = PROPERTIES['nfs-server'] or {} %}
{% set NFS_SERVER_IP = NFS_SERVER['ip'] or '10.0.253.247' %} {% set NFS_SERVER_IP = NFS_SERVER['ip'] or '10.0.253.247' %}
{% set NFS_SERVER_PORT = NFS_SERVER['port'] or 2049 %} {% set NFS_SERVER_PORT = NFS_SERVER['port'] or 2049 %}
......
{% set PROPERTIES = properties or {} %} {% 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 = PROPERTIES['nfs-server'] or {} %}
{% set NFS_SERVER_IP = NFS_SERVER['ip'] or '10.0.253.247' %} {% set NFS_SERVER_IP = NFS_SERVER['ip'] or '10.0.253.247' %}
{% set NFS_SERVER_PORT = NFS_SERVER['port'] or 2049 %} {% set NFS_SERVER_PORT = NFS_SERVER['port'] or 2049 %}
......
...@@ -8,7 +8,7 @@ info: ...@@ -8,7 +8,7 @@ info:
properties: properties:
project: project:
type: string type: string
default: dm-k8s-prod default: kubernetes-charts
description: Project location to load the images from. description: Project location to load the images from.
nfs-service: nfs-service:
type: object type: object
......
...@@ -13,15 +13,28 @@ ...@@ -13,15 +13,28 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # 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 set -euo pipefail
DEFAULT_TAG=v1.2 DEFAULT_TAG=git-$(git rev-parse --short HEAD)
DEFAULT_BINARY=${GOPATH}/bin/helm
DEFAULT_PLATFORM=$(uname | tr '[:upper:]' '[:lower:]') DEFAULT_PLATFORM=$(uname | tr '[:upper:]' '[:lower:]')
DEFAULT_ARCH=$(uname -m) DEFAULT_ARCH=$(uname -m)
STORAGE_URL=http://get-dm.storage.googleapis.com if [[ "${DEFAULT_ARCH}" == x86_64 ]]; then
ZIP=helm-${TAG:-${DEFAULT_TAG}}-${PLATFORM:-${DEFAULT_PLATFORM}}-${ARCH:-${DEFAULT_ARCH}}.zip 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}..." echo "Downloading ${ZIP}..."
curl -Ls "${STORAGE_URL}/${ZIP}" -O curl -Ls "${STORAGE_URL}/${ZIP}" -O
...@@ -35,14 +48,13 @@ cat <<EOF ...@@ -35,14 +48,13 @@ cat <<EOF
helm is now available in your current directory. helm is now available in your current directory.
Before using it, please install the Helm service in your Before using it, please install the Deployment Manager service in your
kubernetes cluster by running kubernetes cluster by running
$ helm server install $ ./helm server install
To get started, run: To get started, run:
$ helm help $ ./helm help
EOF EOF
...@@ -141,7 +141,7 @@ spec: ...@@ -141,7 +141,7 @@ spec:
spec: spec:
containers: containers:
- env: [] - env: []
image: {{default "gcr.io/dm-k8s-prod/expandybird:v1.2.1" .Expandybird.Image}} image: {{default "gcr.io/kubernetes-helm/expandybird:latest" .Expandybird.Image}}
name: expandybird name: expandybird
ports: ports:
- containerPort: 8080 - containerPort: 8080
...@@ -185,7 +185,7 @@ spec: ...@@ -185,7 +185,7 @@ spec:
spec: spec:
containers: containers:
- env: [] - env: []
image: {{ default "gcr.io/dm-k8s-prod/resourcifier:v1.2.1" .Resourcifier.Image }} image: {{ default "gcr.io/kubernetes-helm/resourcifier:latest" .Resourcifier.Image }}
name: resourcifier name: resourcifier
ports: ports:
- containerPort: 8080 - containerPort: 8080
...@@ -229,7 +229,7 @@ spec: ...@@ -229,7 +229,7 @@ spec:
spec: spec:
containers: containers:
- env: [] - env: []
image: {{ default "gcr.io/dm-k8s-prod/manager:v1.2.1" .Manager.Image }} image: {{ default "gcr.io/kubernetes-helm/manager:latest" .Manager.Image }}
name: manager name: manager
ports: ports:
- containerPort: 8080 - containerPort: 8080
......
...@@ -39,7 +39,7 @@ target_port: 8080 ...@@ -39,7 +39,7 @@ target_port: 8080
container_port: 8080 container_port: 8080
external_service: true external_service: true
replicas: 3 replicas: 3
image: gcr.io/dm-k8s-prod/expandybird image: gcr.io/kubernetes-helm/expandybird
labels: labels:
app: expandybird app: expandybird
` `
......
...@@ -14,10 +14,11 @@ ...@@ -14,10 +14,11 @@
# If you update this image please check the tag value before pushing. # If you update this image please check the tag value before pushing.
DOCKER_REGISTRY ?= gcr.io DEFAULT_REGISTRY := gcr.io
DOCKER_REGISTRY ?= $(DEFAULT_REGISTRY)
# Legacy support for $PROJECT DEFAULT_PROJECT := kubernetes-helm
DOCKER_PROJECT ?= $(PROJECT) DOCKER_PROJECT ?= $(DEFAULT_PROJECT)
# Support both local and remote repos, and support no project. # Support both local and remote repos, and support no project.
ifeq ($(DOCKER_PROJECT),) ifeq ($(DOCKER_PROJECT),)
......
...@@ -71,8 +71,8 @@ build_binary_cross() { ...@@ -71,8 +71,8 @@ build_binary_cross() {
echo "Building ${target}" echo "Building ${target}"
gox -verbose \ gox -verbose \
-ldflags="${LDFLAGS}" \ -ldflags="${LDFLAGS}" \
-os="linux darwin" \ -os="linux darwin freebsd windows" \
-arch="amd64 386" \ -arch="amd64 386 arm" \
-output="bin/{{.OS}}-{{.Arch}}/{{.Dir}}" \ -output="bin/{{.OS}}-{{.Arch}}/{{.Dir}}" \
"${REPO}/${target}" "${REPO}/${target}"
} }
......
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