Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
charts
cmd
downloads
pkg
test
vendor
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ services:
- docker

before_install:
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
- sudo apt-get update
- sudo apt-get -y install docker-ce
- curl https://glide.sh/get | sh
- curl -LO https://github.com/golang/dep/releases/download/v0.3.0/dep-linux-amd64.zip
- unzip dep-linux-amd64.zip
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Change log

## 9.0.4 (2017-11-01)
* Updated to MQ version 9.0.4.0
* Updated to Go version 9
* Removed packages `curl`, `ca-certificates`, and their dependencies, which were only used at build time
* Improved logging
* Helm charts now work on Kubernetes V1.6
* Production Helm chart now includes a default image repository and tag
* Updated to use multi-stage Docker build, so that Go code is built inside a container

## 9.0.3 (2017-10-17)
* Initial version
50 changes: 0 additions & 50 deletions Dockerfile-devserver

This file was deleted.

35 changes: 23 additions & 12 deletions Dockerfile-server
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,41 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# Build stage to build Go code
FROM golang:1.9 as builder
WORKDIR /go/src/github.com/ibm-messaging/mq-container/
COPY cmd/ ./cmd
COPY pkg/ ./pkg
COPY vendor/ ./vendor
RUN go build ./cmd/runmqserver/
RUN go build ./cmd/chkmqready/
RUN go build ./cmd/chkmqhealthy/

# Build stage to run Go unit tests
FROM golang:1.9 as tester
COPY pkg/ ./pkg
RUN cd pkg/name && go test
RUN cd pkg/linux/capabilities && go test

# Main build stage, to build MQ image
FROM ubuntu:16.04

ARG IBM_PRODUCT_ID
ARG IBM_PRODUCT_NAME
ARG IBM_PRODUCT_VERSION

# The URL to download the MQ installer from in tar.gz format
# This assumes an archive containing the MQ Debian (.deb) install packages
ARG MQ_URL

# The MQ packages to install
ARG MQ_PACKAGES="ibmmq-server ibmmq-java ibmmq-jre ibmmq-gskit ibmmq-msg-.* ibmmq-samples ibmmq-ams"

LABEL "ProductID"=$IBM_PRODUCT_ID \
"ProductName"=$IBM_PRODUCT_NAME \
"ProductVersion"=$IBM_PRODUCT_VERSION

COPY install-mq.sh /usr/local/bin/

# Install MQ. To avoid a "text file busy" error here, we sleep before installing.
RUN chmod u+x /usr/local/bin/install-mq.sh \
# To avoid a "text file busy" error here we sleep before installing.
&& sleep 1 && install-mq.sh
&& sleep 1 \
&& install-mq.sh

COPY build/runmqserver /usr/local/bin/
COPY build/chkmq* /usr/local/bin/
COPY --from=builder /go/src/github.com/ibm-messaging/mq-container/runmqserver /usr/local/bin/
COPY --from=builder /go/src/github.com/ibm-messaging/mq-container/chkmq* /usr/local/bin/
COPY NOTICES.txt /opt/mqm/licenses/notices-container.txt

RUN chmod +x /usr/local/bin/runmqserver \
Expand Down
72 changes: 35 additions & 37 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@
# limitations under the License.

BUILD_SERVER_CONTAINER=build-server
# Set architecture for Go code. Don't set GOOS globally, so that tests can be run locally
export GOARCH ?= amd64
# Don't set GOOS globally, so that tests can be run locally
DOCKER_TAG_ARCH ?= x86_64
# By default, all Docker client commands are run inside a Docker container.
# This means that newer features of the client can be used, even with an older daemon.
DOCKER ?= docker run --tty --interactive --rm --volume /var/run/docker.sock:/var/run/docker.sock --volume "$(CURDIR)":/var/src --workdir /var/src docker:stable docker
DOCKER_TAG ?= latest-$(DOCKER_TAG_ARCH)
DOCKER_REPO_DEVSERVER ?= mq-devserver
DOCKER_REPO_ADVANCEDSERVER ?= mq-advancedserver
Expand Down Expand Up @@ -60,43 +63,28 @@ deps:
cd test/docker && dep ensure -vendor-only
cd test/kubernetes && dep ensure -vendor-only

build/runmqserver:
mkdir -p build
cd build; GOOS=linux go build ../cmd/runmqserver/

build/chkmqready:
mkdir -p build
cd build; GOOS=linux go build ../cmd/chkmqready/

build/chkmqhealthy:
mkdir -p build
cd build; GOOS=linux go build ../cmd/chkmqhealthy/

.PHONY: build
build: build/runmqserver build/chkmqready build/chkmqhealthy

.PHONY: build-cov
build-cov:
mkdir -p build
cd build; go test -c -covermode=count ../cmd/runmqserver

.PHONY: test-advancedserver
test-advancedserver: build
test-advancedserver:
cd pkg/name && go test
cd test/docker && TEST_IMAGE=$(DOCKER_FULL_ADVANCEDSERVER) go test $(TEST_OPTS_DOCKER)

.PHONY: test-devserver
test-devserver: build
test-devserver:
$(info $(SPACER)$(shell printf $(TITLE)"Test $(DOCKER_FULL_DEVSERVER)"$(END)))
cd pkg/name && go test
cd test/docker && TEST_IMAGE=$(DOCKER_FULL_DEVSERVER) go test

.PHONY: test-kubernetes-devserver
test-kubernetes-devserver: build
test-kubernetes-devserver:
$(call test-kubernetes,$(DOCKER_REPO_DEVSERVER),$(DOCKER_TAG),"../../charts/ibm-mqadvanced-server-dev")

.PHONY: test-kubernetes-advancedserver
test-kubernetes-advancedserver: build
test-kubernetes-advancedserver:
$(call test-kubernetes,$(DOCKER_REPO_ADVANCEDSERVER),$(DOCKER_TAG),"../../charts/ibm-mqadvanced-server-prod")

define test-kubernetes
Expand All @@ -106,9 +94,9 @@ endef

define docker-build-mq
# Create a temporary network to use for the build
docker network create build
$(DOCKER) network create build
# Start a web server to host the MQ downloadable (tar.gz) file
docker run \
$(DOCKER) run \
--rm \
--name $(BUILD_SERVER_CONTAINER) \
--network build \
Expand All @@ -117,48 +105,58 @@ define docker-build-mq
--detach \
nginx:alpine
# Build the new image
docker build \
$(DOCKER) build \
--pull \
--tag $1 \
--file $2 \
--network build \
--build-arg MQ_URL=http://build:80/$3 \
--build-arg IBM_PRODUCT_ID=$4 \
--build-arg IBM_PRODUCT_NAME=$5 \
--build-arg IBM_PRODUCT_VERSION=$6 \
--label IBM_PRODUCT_ID=$4 \
--label IBM_PRODUCT_NAME=$5 \
--label IBM_PRODUCT_VERSION=$6 \
.
# Stop the web server (will also remove the container)
docker kill $(BUILD_SERVER_CONTAINER)
$(DOCKER) kill $(BUILD_SERVER_CONTAINER)
# Delete the temporary network
docker network rm build
$(DOCKER) network rm build
endef

.PHONY: build-advancedserver
build-advancedserver: build downloads/CNJR7ML.tar.gz
# .PHONY: build-advancedserver-903
# build-advancedserver-903: build downloads/CNJR7ML.tar.gz
# $(info $(SPACER)$(shell printf $(TITLE)"Build $(DOCKER_FULL_ADVANCEDSERVER)"$(END)))
# $(call docker-build-mq,$(DOCKER_FULL_ADVANCEDSERVER),Dockerfile-server,CNJR7ML.tar.gz,"4486e8c4cc9146fd9b3ce1f14a2dfc5b","IBM MQ Advanced","9.0.3")
# $(DOCKER) tag $(DOCKER_FULL_ADVANCEDSERVER) $(DOCKER_REPO_ADVANCEDSERVER):9.0.3-$(DOCKER_TAG_ARCH)

.PHONY: build-advancedserver-904
build-advancedserver-904: downloads/CNLE4ML.tar.gz
$(info $(SPACER)$(shell printf $(TITLE)"Build $(DOCKER_FULL_ADVANCEDSERVER)"$(END)))
$(call docker-build-mq,$(DOCKER_FULL_ADVANCEDSERVER),Dockerfile-server,CNJR7ML.tar.gz,"4486e8c4cc9146fd9b3ce1f14a2dfc5b","IBM MQ Advanced","9.0.3")
docker tag $(DOCKER_FULL_ADVANCEDSERVER) $(DOCKER_REPO_ADVANCEDSERVER):9.0.3-$(DOCKER_TAG_ARCH)
$(call docker-build-mq,$(DOCKER_FULL_ADVANCEDSERVER),Dockerfile-server,CNLE4ML.tar.gz,"4486e8c4cc9146fd9b3ce1f14a2dfc5b","IBM MQ Advanced","9.0.4")
$(DOCKER) tag $(DOCKER_FULL_ADVANCEDSERVER) $(DOCKER_REPO_ADVANCEDSERVER):9.0.4-$(DOCKER_TAG_ARCH)

.PHONY: build-advancedserver
build-advancedserver: build-advancedserver-904

.PHONY: build-devserver
build-devserver: build downloads/mqadv_dev903_ubuntu_x86-64.tar.gz
build-devserver: downloads/mqadv_dev903_ubuntu_x86-64.tar.gz
$(info $(shell printf $(TITLE)"Build $(DOCKER_FULL_DEVSERVER)"$(END)))
$(call docker-build-mq,$(DOCKER_FULL_DEVSERVER),Dockerfile-server,mqadv_dev903_ubuntu_x86-64.tar.gz,"98102d16795c4263ad9ca075190a2d4d","IBM MQ Advanced for Developers (Non-Warranted)","9.0.3")
docker tag $(DOCKER_FULL_DEVSERVER) $(DOCKER_REPO_DEVSERVER):9.0.3-$(DOCKER_TAG_ARCH)
$(DOCKER) tag $(DOCKER_FULL_DEVSERVER) $(DOCKER_REPO_DEVSERVER):9.0.3-$(DOCKER_TAG_ARCH)

# .PHONY: build-server
# build-server: build downloads/CNJR7ML.tar.gz
# $(call docker-build-mq,mq-server:latest-$(DOCKER_TAG_ARCH),Dockerfile-server,"79afd716d55b4f149a87bec52c9dc1aa","IBM MQ","9.0.3")
# docker tag mq-server:latest-$(DOCKER_TAG_ARCH) mq-server:9.0.3-$(DOCKER_TAG_ARCH)
# $(DOCKER) tag mq-server:latest-$(DOCKER_TAG_ARCH) mq-server:9.0.3-$(DOCKER_TAG_ARCH)

.PHONY: build-advancedserver-cover
build-advancedserver-cover: build-advanced-server build-cov
docker build -t mq-advancedserver:cover -f Dockerfile-server.cover .
$(DOCKER) build -t mq-advancedserver:cover -f Dockerfile-server.cover .

# .PHONY: build-web
# build-web: build downloads/CNJR7ML.tar.gz
# $(call docker-build-mq,mq-web:latest-$(DOCKER_TAG_ARCH),Dockerfile-mq-web)

.PHONY: build-explorer
build-explorer: build downloads/mqadv_dev903_ubuntu_x86-64.tar.gz
build-explorer: downloads/mqadv_dev903_ubuntu_x86-64.tar.gz
$(call docker-build-mq,mq-explorer:latest-$(DOCKER_TAG_ARCH),incubating/mq-explorer/Dockerfile-mq-explorer,mqadv_dev903_ubuntu_x86-64.tar.gz,"98102d16795c4263ad9ca075190a2d4d","IBM MQ Advanced for Developers (Non-Warranted)","9.0.3")

include formatting.mk
2 changes: 1 addition & 1 deletion charts/ibm-mqadvanced-server-dev/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
apiVersion: v1
description: IBM MQ queue manager
name: ibm-mqadvanced-server-dev
version: 1.0.1
version: 1.0.2
icon: https://developer.ibm.com/messaging/wp-content/uploads/sites/18/2017/07/IBM-MQ-Square-200.png
tillerVersion: ">=2.4.0"
2 changes: 1 addition & 1 deletion charts/ibm-mqadvanced-server-dev/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This chart deploys a single IBM MQ Advanced for Developers server (queue manager

## Prerequisites

- Kubernetes 1.7 or greater, with beta APIs enabled
- Kubernetes 1.6 or greater, with beta APIs enabled
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lowered the Kubernetes requirement?

- If persistence is enabled (see [configuration](#configuration)), then you either need to create a PersistentVolume, or specify a Storage Class if classes are defined in your cluster.

## Installing the Chart
Expand Down
2 changes: 2 additions & 0 deletions charts/ibm-mqadvanced-server-dev/templates/stateful-set.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ metadata:
spec:
serviceName: {{ .Values.service.name }}
replicas: 1
{{- if and (ge (.Capabilities.KubeVersion.Major | int) 1) (ge (.Capabilities.KubeVersion.Minor | int) 7) }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a check to make sure the Kube version has a minor of 1.7 but the above line in the readme says 1.6 now.

updateStrategy:
type: RollingUpdate
{{- end }}
template:
metadata:
labels:
Expand Down
2 changes: 1 addition & 1 deletion charts/ibm-mqadvanced-server-prod/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
apiVersion: v1
description: IBM MQ queue manager
name: ibm-mqadvanced-server-prod
version: 1.0.1
version: 1.0.2
icon: https://developer.ibm.com/messaging/wp-content/uploads/sites/18/2017/07/IBM-MQ-Square-200.png
tillerVersion: ">=2.4.0"
2 changes: 1 addition & 1 deletion charts/ibm-mqadvanced-server-prod/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This chart deploys a single IBM MQ Advanced server (queue manager) into an IBM C

## Prerequisites

- Kubernetes 1.7 or greater, with beta APIs enabled
- Kubernetes 1.6 or greater, with beta APIs enabled
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

- If persistence is enabled (see [configuration](#configuration)), then you either need to create a PersistentVolume, or specify a Storage Class if classes are defined in your cluster.

## Installing the Chart
Expand Down
2 changes: 2 additions & 0 deletions charts/ibm-mqadvanced-server-prod/templates/stateful-set.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ metadata:
spec:
serviceName: {{ .Values.service.name }}
replicas: 1
{{- if and (ge (.Capabilities.KubeVersion.Major | int) 1) (ge (.Capabilities.KubeVersion.Minor | int) 7) }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

updateStrategy:
type: RollingUpdate
{{- end }}
template:
metadata:
labels:
Expand Down
4 changes: 2 additions & 2 deletions charts/ibm-mqadvanced-server-prod/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ license: "not accepted"

image:
# repository is the container repository to use, which must contain IBM MQ Advanced
repository:
repository: ibm-mqadvanced-server
# tag is the tag to use for the container repository
tag:
tag: 9.0.4.0-x86_64
# pullSecret is the secret to use when pulling the image from a private registry
pullSecret:
# pullPolicy is either IfNotPresent or Always (https://kubernetes.io/docs/concepts/containers/images/)
Expand Down
Loading