Skip to content

Commit adabc4b

Browse files
committed
11.0.0.12-r1 update
1 parent eb5f862 commit adabc4b

18 files changed

+2234
-75
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,12 @@ You can mount the following file structure at `/home/aceuser/initial-config`. Mi
218218
- A pem file called 'ca.crt' will be extracted into the directory `/home/aceuser/ace-server/ssl`
219219
- A pem file called 'tls.key' will be extracted into the directory `/home/aceuser/ace-server/ssl`
220220
- A pem file called 'tls.cert' will be extracted into the directory `/home/aceuser/ace-server/ssl`
221+
- `/home/aceuser/initial-config/bar_overrides`
222+
- For any parameters that need to be set via `mqsiapplybaroverride` include text files with extension `.properties` Eg:
223+
```script
224+
sampleFlow#MQInput.queueName=NEWC
225+
```
226+
221227

222228
## Logging
223229

ace_config_bar_overrides.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
# © Copyright IBM Corporation 2018.
4+
#
5+
# All rights reserved. This program and the accompanying materials
6+
# are made available under the terms of the Eclipse Public License v2.0
7+
# which accompanies this distribution, and is available at
8+
# http://www.eclipse.org/legal/epl-v20.html
9+
10+
if [ -z "$MQSI_VERSION" ]; then
11+
source /opt/ibm/ace-11/server/bin/mqsiprofile
12+
fi
13+
14+
if ls /home/aceuser/initial-config/bar_overrides/*.properties >/dev/null 2>&1; then
15+
for propertyFile in /home/aceuser/initial-config/bar_overrides/*.properties
16+
do
17+
mqsiapplybaroverride -b /home/aceuser/initial-config/bars/barfile.bar -p $propertyFile -r
18+
echo $propertyFile >> /home/aceuser/initial-config/bar_overrides/logs.txt
19+
done
20+
fi

ace_config_webusers.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ if [ -s $ADMINUSERSFILE ] || [ -s $OPERATORUSERSFILE ] || [ -s $EDITORUSERSFILE
2828

2929
OUTPUT=$(mqsichangefileauth -w /home/aceuser/ace-server -r admin -p all+ 2>&1)
3030
logAndExitIfError $? "${OUTPUT}"
31+
OUTPUT=$(mqsichangefileauth -w /home/aceuser/ace-server -r admin -o Data -p all+ 2>&1)
32+
logAndExitIfError $? "${OUTPUT}"
3133

3234
OUTPUT=$(mqsichangefileauth -w /home/aceuser/ace-server -r operator -p read+,write-,execute+ 2>&1)
3335
logAndExitIfError $? "${OUTPUT}"

ace_integration_server.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ if [ -s /home/aceuser/ace-server/odbc.ini ]; then
1515
export ODBCINI=/home/aceuser/ace-server/odbc.ini
1616
fi
1717

18+
# For customers running pod environment
19+
if [ -s /home/aceuser/generic/odbcinst.ini ]; then
20+
export ODBCSYSINI=/home/aceuser/generic
21+
fi
22+
23+
# For customers running ace in docker themselves
24+
if [ -s /home/aceuser/ace-server/extensions/odbcinst.ini ]; then
25+
export ODBCSYSINI=/home/aceuser/ace-server/extensions
26+
fi
27+
1828
# We need to keep the kubernetes port overrides as customers could be running ace in docker themselves
1929
# but we need to allow the ports to be overwritten in the pod environment if set by the operator
2030
if ! [[ -z "${KUBERNETES_PORT}" ]] && ! [[ -z "${SERVICE_NAME}" ]] && ! [[ -z "${MQSI_OVERRIDE_HTTP_PORT}" ]] && ! [[ -z "${MQSI_OVERRIDE_HTTPS_PORT}" ]] ; then

cmd/chkacehealthy/main.go

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,40 @@ import (
2222
"fmt"
2323
"net"
2424
"os"
25+
"time"
2526

2627
"github.com/ot4i/ace-docker/internal/command"
2728
"github.com/ot4i/ace-docker/internal/qmgr"
2829
)
2930

31+
const restartIsTimeoutInSeconds = 60
32+
3033
func main() {
3134
// Check if the integration server has started the admin REST endpoint
3235
conn, err := net.Dial("tcp", "127.0.0.1:7600")
36+
3337
if err != nil {
34-
fmt.Println(err)
35-
os.Exit(1)
38+
39+
fmt.Println("REST endpoint failed" + err.Error())
40+
41+
fileInfo, statErr := os.Stat("/tmp/integration_server_restart.timestamp")
42+
43+
if statErr != nil {
44+
fmt.Println(statErr)
45+
os.Exit(1)
46+
} else {
47+
fmt.Println("Integration server restart file found")
48+
timeNow := time.Now()
49+
timeDiff := timeNow.Sub(fileInfo.ModTime())
50+
51+
if timeDiff.Seconds() < restartIsTimeoutInSeconds {
52+
fmt.Println("Integration server is restarting")
53+
os.Exit(0)
54+
} else {
55+
fmt.Println("Integration restart time elapsed")
56+
os.Exit(1)
57+
}
58+
}
3659
}
3760
conn.Close()
3861

cmd/runaceserver/logging.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func getLogOutputFormat() string {
5050
case "json":
5151
return "ibmjson"
5252
case "basic":
53-
return "text"
53+
return "idText"
5454
default:
5555
return "ibmjson"
5656
}

cmd/runaceserver/main.go

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,16 @@ package main
1919

2020
import (
2121
"errors"
22+
"io/ioutil"
2223
"os"
2324

25+
"github.com/ot4i/ace-docker/common/designer"
2426
"github.com/ot4i/ace-docker/internal/command"
2527
"github.com/ot4i/ace-docker/internal/configuration"
28+
iscommandsapi "github.com/ot4i/ace-docker/internal/isCommandsApi"
2629
"github.com/ot4i/ace-docker/internal/metrics"
2730
"github.com/ot4i/ace-docker/internal/name"
2831
"github.com/ot4i/ace-docker/internal/qmgr"
29-
"github.com/ot4i/ace-docker/common/designer"
3032
)
3133

3234
func doMain() error {
@@ -57,6 +59,7 @@ func doMain() error {
5759
}
5860

5961
performShutdown := func() {
62+
6063
metrics.StopMetricsGathering()
6164

6265
log.Print("Stopping Integration Server")
@@ -69,9 +72,41 @@ func doMain() error {
6972

7073
checkLogs()
7174

75+
iscommandsapi.StopCommandsAPIServer()
7276
log.Print("Shutdown complete")
7377
}
7478

79+
restartIntegrationServer := func() error {
80+
err := ioutil.WriteFile("/tmp/integration_server_restart.timestamp", []byte(""), 0755)
81+
82+
if err != nil {
83+
log.Print("RestartIntegrationServer - Creating restart file failed")
84+
return err
85+
}
86+
87+
log.Print("RestartIntegrationServer - Stopping integration server")
88+
stopIntegrationServer(integrationServerProcess)
89+
log.Println("RestartIntegrationServer - Starting integration server")
90+
91+
integrationServerProcess = startIntegrationServer()
92+
err = integrationServerProcess.ReturnError
93+
94+
if integrationServerProcess.ReturnError == nil {
95+
log.Println("RestartIntegrationServer - Waiting for integration server")
96+
err = waitForIntegrationServer()
97+
}
98+
99+
if err != nil {
100+
logTermination(err)
101+
performShutdown()
102+
return err
103+
}
104+
105+
log.Println("RestartIntegrationServer - Integration server is ready")
106+
107+
return nil
108+
}
109+
75110
// Start signal handler
76111
signalControl := signalHandler(performShutdown)
77112

@@ -120,7 +155,7 @@ func doMain() error {
120155
return err
121156
}
122157

123-
// Note: this will do nothing if there are no crs set in the environment
158+
// Note: this will do nothing if there are no crs set in the environment
124159
err = configuration.SetupConfigurationsFiles(log, "/home/aceuser")
125160
if err != nil {
126161
logTermination(err)
@@ -150,7 +185,7 @@ func doMain() error {
150185
performShutdown()
151186
return err
152187
}
153-
188+
154189
log.Println("Starting integration server")
155190
integrationServerProcess = startIntegrationServer()
156191
if integrationServerProcess.ReturnError != nil {
@@ -174,6 +209,15 @@ func doMain() error {
174209
log.Println("Metrics are disabled")
175210
}
176211

212+
log.Println("Starting integration server commands API server")
213+
err = iscommandsapi.StartCommandsAPIServer(log, 7980, restartIntegrationServer)
214+
215+
if err != nil {
216+
log.Println("Failed to start isapi server " + err.Error())
217+
} else {
218+
log.Println("Integration API started")
219+
}
220+
177221
// Start reaping zombies from now on.
178222
// Start this here, so that we don't reap any sub-processes created
179223
// by this process (e.g. for crtmqm or strmqm)

common/designer/flow_validation.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ var IsFlowValid = func(log logger.LoggerInterface, flow string, flowFile []byte)
173173

174174
disabledConnectors := findDisabledConnectorInFlow(flowDocument, log)
175175
if disabledConnectors != "" {
176-
log.Errorf("Flow %v contains one or more connectors, which aren't supported under the current license. Please update your license to enable this flow to run. The unsupported connectors are: %v.", flow, disabledConnectors)
176+
log.Errorf("Flow %v contains one or more connectors that aren't supported under the current license. Please update your license to enable this flow to run. The unsupported connectors are: %v.", flow, disabledConnectors)
177177
}
178178
return disabledConnectors == "", nil
179179
}

internal/configuration/configuration.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"bytes"
66
"encoding/base64"
77
"errors"
8-
"io"
98
"io/ioutil"
109
"os"
1110
"os/exec"
@@ -49,8 +48,6 @@ var (
4948
* START: FUNCTIONS CREATES EXTERNAL REQUESTS
5049
*/
5150

52-
var ioutilReadFile = ioutil.ReadFile
53-
5451
func getPodNamespace() (string, error) {
5552
if data, err := ioutilReadFile("/var/run/secrets/kubernetes.io/serviceaccount/namespace"); err == nil {
5653
if ns := strings.TrimSpace(string(data)); len(ns) > 0 {
@@ -61,9 +58,6 @@ func getPodNamespace() (string, error) {
6158
return "default", nil
6259
}
6360

64-
var osMkdirAll = os.MkdirAll
65-
var ioutilWriteFile = ioutil.WriteFile
66-
6761
func writeConfigurationFile(dir string, fileName string, contents []byte) error {
6862
makeDirErr := osMkdirAll(dir, 0740)
6963
if makeDirErr != nil {
@@ -72,9 +66,6 @@ func writeConfigurationFile(dir string, fileName string, contents []byte) error
7266
return ioutilWriteFile(dir+string(os.PathSeparator)+fileName, contents, 0740)
7367
}
7468

75-
var osOpenFile = os.OpenFile
76-
var ioCopy = io.Copy
77-
7869
func unzip(log logger.LoggerInterface, dir string, contents []byte) error {
7970
var filenames []string
8071
zipReader, err := zip.NewReader(bytes.NewReader(contents), int64(len(contents)))

internal/configuration/ioutil.go

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
package configuration
2+
3+
import (
4+
"io"
5+
"io/ioutil"
6+
"os"
7+
)
8+
9+
var ioutilReadFile = ioutil.ReadFile
10+
var osMkdirAll = os.MkdirAll
11+
var ioutilWriteFile = ioutil.WriteFile
12+
var osOpenFile = os.OpenFile
13+
var ioCopy = io.Copy
14+
var osStat = os.Stat
15+
var osIsNotExist = os.IsNotExist
16+
17+
var internalAppendFile = func(fileName string, fileContent []byte, filePerm os.FileMode) error {
18+
19+
file, err := os.OpenFile(fileName, os.O_APPEND|os.O_CREATE|os.O_WRONLY, filePerm)
20+
21+
if err != nil {
22+
return err
23+
}
24+
25+
defer file.Close()
26+
27+
_, err = file.Write(fileContent)
28+
29+
if err == nil {
30+
err = file.Sync()
31+
}
32+
33+
if err != nil {
34+
return err
35+
}
36+
37+
return nil
38+
}

0 commit comments

Comments
 (0)