diff --git a/.travis.yml b/.travis.yml index ce84ed8..b971631 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,7 @@ # limitations under the License. # Temporarily removing dist tag as not supported by power build -#dist: xenial +# dist: xenial sudo: required language: go diff --git a/cmd/runmqserver/main.go b/cmd/runmqserver/main.go index a338346..7133ba1 100644 --- a/cmd/runmqserver/main.go +++ b/cmd/runmqserver/main.go @@ -176,11 +176,29 @@ func doMain() error { return err } + enableTraceStrmqm := os.Getenv("MQ_ENABLE_TRACE_STRMQM") + if enableTraceStrmqm == "true" || enableTraceStrmqm == "1" { + err = startMQTrace() + if err != nil { + logTermination(err) + return err + } + } + err = startQueueManager(name) if err != nil { logTermination(err) return err } + + if enableTraceStrmqm == "true" || enableTraceStrmqm == "1" { + err = endMQTrace() + if err != nil { + logTermination(err) + return err + } + } + if standby, _ := ready.IsRunningAsStandbyQM(name); !standby { err = configureQueueManager() if err != nil { diff --git a/cmd/runmqserver/qmgr.go b/cmd/runmqserver/qmgr.go index dabf753..d3faac3 100644 --- a/cmd/runmqserver/qmgr.go +++ b/cmd/runmqserver/qmgr.go @@ -199,6 +199,28 @@ func stopQueueManager(name string) error { return nil } +func startMQTrace() error { + log.Println("Starting MQ trace") + out, rc, err := command.Run("strmqtrc") + if err != nil { + log.Printf("Error %v starting trace: %v", rc, string(out)) + return err + } + log.Println("Started MQ trace") + return nil +} + +func endMQTrace() error { + log.Println("Ending MQ Trace") + out, rc, err := command.Run("endmqtrc") + if err != nil { + log.Printf("Error %v ending trace: %v", rc, string(out)) + return err + } + log.Println("Ended MQ trace") + return nil +} + func formatMQSCOutput(out string) string { // redact sensitive information out, _ = mqscredact.Redact(out) diff --git a/manifests/README.md b/manifests/README.md index bdb6ab5..8810c82 100644 --- a/manifests/README.md +++ b/manifests/README.md @@ -1,7 +1,7 @@ Fat manifests ============= -These are the fat manifests used by Docker Hub and Docker store to handle images with multiple CPU architectures. +These are the fat manifests used by Docker Hub to handle images with multiple CPU architectures. They are used in conjunction with [manifest-tool](https://github.com/estesp/manifest-tool), for example: diff --git a/manifests/dockerstore/manifest-9.1.1.yaml b/manifests/dockerstore/manifest-9.1.1.yaml deleted file mode 100644 index 9c79f70..0000000 --- a/manifests/dockerstore/manifest-9.1.1.yaml +++ /dev/null @@ -1,29 +0,0 @@ -# © Copyright IBM Corporation 2018 -# -# 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. - -image: ibmcorp/mqadvanced-server-dev:9.1.1.0 -manifests: - - image: ibmcorp/mqadvanced-server-dev:9.1.1.0-x86_64 - platform: - architecture: amd64 - os: linux - - image: ibmcorp/mqadvanced-server-dev:9.1.1.0-ppc64le - platform: - architecture: ppc64le - os: linux - - image: ibmcorp/mqadvanced-server-dev:9.1.1.0-s390x - platform: - architecture: s390x - os: linux - diff --git a/manifests/dockerstore/manifest-9.1.2-UBI.yaml b/manifests/dockerstore/manifest-9.1.2-UBI.yaml deleted file mode 100644 index b3ae29d..0000000 --- a/manifests/dockerstore/manifest-9.1.2-UBI.yaml +++ /dev/null @@ -1,28 +0,0 @@ -# © Copyright IBM Corporation 2019 -# -# 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. - -image: ibmcorp/mqadvanced-server-dev:9.1.2.0-UBI -manifests: - - image: ibmcorp/mqadvanced-server-dev:9.1.2.0-UBI-amd64 - platform: - architecture: amd64 - os: linux - - image: ibmcorp/mqadvanced-server-dev:9.1.2.0-UBI-ppc64le - platform: - architecture: ppc64le - os: linux - - image: ibmcorp/mqadvanced-server-dev:9.1.2.0-UBI-s390x - platform: - architecture: s390x - os: linux diff --git a/manifests/dockerstore/manifest-9.1.2.yaml b/manifests/dockerstore/manifest-9.1.2.yaml deleted file mode 100644 index 5fddd64..0000000 --- a/manifests/dockerstore/manifest-9.1.2.yaml +++ /dev/null @@ -1,29 +0,0 @@ -# © Copyright IBM Corporation 2018, 2019 -# -# 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. - -image: ibmcorp/mqadvanced-server-dev:9.1.2.0 -manifests: - - image: ibmcorp/mqadvanced-server-dev:9.1.2.0-x86_64 - platform: - architecture: amd64 - os: linux - - image: ibmcorp/mqadvanced-server-dev:9.1.2.0-ppc64le - platform: - architecture: ppc64le - os: linux - - image: ibmcorp/mqadvanced-server-dev:9.1.2.0-s390x - platform: - architecture: s390x - os: linux - diff --git a/manifests/dockerstore/manifest-9.1.3.yaml b/manifests/dockerstore/manifest-9.1.3.yaml deleted file mode 100644 index e59bec0..0000000 --- a/manifests/dockerstore/manifest-9.1.3.yaml +++ /dev/null @@ -1,28 +0,0 @@ -# © Copyright IBM Corporation 2019 -# -# 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. - -image: ibmcorp/mqadvanced-server-dev:9.1.3.0-r3 -manifests: - - image: ibmcorp/mqadvanced-server-dev:9.1.3.0-r3-amd64 - platform: - architecture: amd64 - os: linux - - image: ibmcorp/mqadvanced-server-dev:9.1.3.0-r3-ppc64le - platform: - architecture: ppc64le - os: linux - - image: ibmcorp/mqadvanced-server-dev:9.1.3.0-r3-s390x - platform: - architecture: s390x - os: linux diff --git a/manifests/dockerstore/manifest-9.1.4.yaml b/manifests/dockerstore/manifest-9.1.4.yaml deleted file mode 100644 index 20777cb..0000000 --- a/manifests/dockerstore/manifest-9.1.4.yaml +++ /dev/null @@ -1,28 +0,0 @@ -# © Copyright IBM Corporation 2019 -# -# 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. - -image: ibmcorp/mqadvanced-server-dev:9.1.4.0-r1 -manifests: - - image: ibmcorp/mqadvanced-server-dev:9.1.4.0-r1-amd64 - platform: - architecture: amd64 - os: linux - - image: ibmcorp/mqadvanced-server-dev:9.1.4.0-r1-ppc64le - platform: - architecture: ppc64le - os: linux - - image: ibmcorp/mqadvanced-server-dev:9.1.4.0-r1-s390x - platform: - architecture: s390x - os: linux diff --git a/manifests/dockerstore/manifest-9.1.yaml b/manifests/dockerstore/manifest-9.1.yaml deleted file mode 100644 index 2a088e9..0000000 --- a/manifests/dockerstore/manifest-9.1.yaml +++ /dev/null @@ -1,29 +0,0 @@ -# © Copyright IBM Corporation 2018 -# -# 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. - -image: ibmcorp/mqadvanced-server-dev:9.1.0.0 -manifests: - - image: ibmcorp/mqadvanced-server-dev:9.1.0.0-x86_64 - platform: - architecture: amd64 - os: linux - - image: ibmcorp/mqadvanced-server-dev:9.1.0.0-ppc64le - platform: - architecture: ppc64le - os: linux - - image: ibmcorp/mqadvanced-server-dev:9.1.0.0-s390x - platform: - architecture: s390x - os: linux - diff --git a/test/docker/docker_api_test.go b/test/docker/docker_api_test.go index b9a075d..4c48dca 100644 --- a/test/docker/docker_api_test.go +++ b/test/docker/docker_api_test.go @@ -1366,3 +1366,27 @@ func TestVersioning(t *testing.T) { } } + +func TestTraceStrmqm(t *testing.T) { + t.Parallel() + + cli, err := client.NewEnvClient() + if err != nil { + t.Fatal(err) + } + + containerConfig := container.Config{ + Env: []string{ + "LICENSE=accept", + "MQ_ENABLE_TRACE_STRMQM=1", + }, + } + id := runContainer(t, cli, &containerConfig) + defer cleanContainer(t, cli, id) + waitForReady(t, cli, id) + + rc, _ := execContainer(t, cli, id, "mqm", []string{"bash", "-c", "ls -A /var/mqm/trace | grep .TRC"}) + if rc != 0 { + t.Fatalf("No trace files found in trace directory /var/mqm/trace. RC=%d.", rc) + } +} diff --git a/travis-build-scripts/release.sh b/travis-build-scripts/release.sh index 49a567f..d6e6b65 100755 --- a/travis-build-scripts/release.sh +++ b/travis-build-scripts/release.sh @@ -60,13 +60,6 @@ function set_docker_hub { export MQ_DELIVERY_REGISTRY_CREDENTIAL=$MQ_DOCKERHUB_REGISTRY_CREDENTIAL } -function set_docker_store { - export MQ_DELIVERY_REGISTRY_HOSTNAME=ibmcorp - export MQ_DELIVERY_REGISTRY_NAMESPACE="" - export MQ_DELIVERY_REGISTRY_USER=$MQ_DOCKERHUB_REGISTRY_USER - export MQ_DELIVERY_REGISTRY_CREDENTIAL=$MQ_DOCKERHUB_REGISTRY_CREDENTIAL -} - function set_production_registry { export MQ_DELIVERY_REGISTRY_HOSTNAME=$MQ_PRODUCTION_REGISTRY export MQ_DELIVERY_REGISTRY_NAMESPACE="" @@ -92,7 +85,7 @@ elif [ "$TYPE" = "production" ]; then ARCH=ppc64le make pull-advancedserver ARCH=s390x make pull-advancedserver - # release developer images with fat manifests + # release developer image with fat manifest set_docker_hub ARCH=amd64 make push-devserver-dockerhub @@ -106,15 +99,6 @@ elif [ "$TYPE" = "production" ]; then ./manifest-tool-linux-amd64 push from-spec manifests/dockerhub/$MANIFEST_FILE ./manifest-tool-linux-amd64 push from-spec manifests/dockerhub/manifest-latest.yaml - set_docker_store - - ARCH=amd64 make push-devserver-dockerhub - ARCH=ppc64le make push-devserver-dockerhub - ARCH=s390x make push-devserver-dockerhub - - docker login --username $MQ_DOCKERHUB_REGISTRY_USER --password $MQ_DOCKERHUB_REGISTRY_CREDENTIAL - ./manifest-tool-linux-amd64 push from-spec manifests/dockerstore/$MANIFEST_FILE - # release production image set_production_registry