Skip to content

Commit 9273387

Browse files
authored
12.0.2.0-r2 update (#172)
1 parent 6f581ce commit 9273387

35 files changed

+882
-1092
lines changed

README-MQ.md

Lines changed: 0 additions & 248 deletions
This file was deleted.

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ You can build an image containing one of the following combinations:
1010
- IBM App Connect Enterprise for Developers
1111
- IBM App Connect Enterprise for Developers with IBM MQ Client
1212

13-
For information of building images with IBM MQ Advanced please refer to [IBM App Connect Enterprise for Developers with IBM MQ Advanced for Developers](README-MQ.md)
14-
1513
The IBM App Connect operator now supports a single image which includes both the ACE server runtime as well as an MQ client. This readme will describe how you can build an equivalent image.
1614

1715
Pre-built developer and production edition image can be found on IBM Container Registry - [Obtaining the IBM App Connect Enterprise server image from the IBM Cloud Container Registry](https://www.ibm.com/support/knowledgecenter/en/SSTTDS_11.0.0/com.ibm.ace.icp.doc/certc_install_obtaininstallationimageser.html)

build-rhel.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ mqImage=$4
99
if [ -z "$aceInstall" ]
1010
then
1111
echo "Building temporary container with default ACE install parameters"
12-
docker build --build-arg -t ace/builder:11.0.0.4 . -f ./rhel/Dockerfile.build
12+
docker build --no-cache --build-arg -t ace/builder:11.0.0.4 . -f ./rhel/Dockerfile.build
1313
else
1414
echo "Building temporary container with ACE install $buildType"
15-
docker build --build-arg ACE_INSTALL=$aceInstall -t ace/builder:11.0.0.4 . -f ./rhel/Dockerfile.build
15+
docker build --no-cache --build-arg ACE_INSTALL=$aceInstall -t ace/builder:11.0.0.4 . -f ./rhel/Dockerfile.build
1616
fi
1717

1818
docker create --name builder ace/builder:11.0.0.4
@@ -30,19 +30,19 @@ sed -i "s%^FROM .*%FROM $mqImage%" ./rhel/Dockerfile.acemqrhel
3030
case $buildType in
3131
"ace-dev-only")
3232
echo "Building ACE only for development"
33-
docker build -t $buildTag -f ./rhel/Dockerfile.acerhel .
33+
docker build --no-cache -t $buildTag -f ./rhel/Dockerfile.acerhel .
3434
;;
3535
"ace-only")
3636
echo "Building ACE only for production"
37-
docker build -t $buildTag -f ./rhel/Dockerfile.acerhel .
37+
docker build --no-cache -t $buildTag -f ./rhel/Dockerfile.acerhel .
3838
;;
3939
"ace-mq")
4040
echo "Building ACE with MQ for production"
41-
docker build -t $buildTag --build-arg BASE_IMAGE=$mqImage -f ./rhel/Dockerfile.acemqrhel .
41+
docker build --no-cache -t $buildTag --build-arg BASE_IMAGE=$mqImage -f ./rhel/Dockerfile.acemqrhel .
4242
;;
4343
"ace-dev-mq-dev")
4444
echo "Building ACE with MQ for production"
45-
docker build -t $buildTag --build-arg BASE_IMAGE=$mqImage -f ./rhel/Dockerfile.acemqrhel .
45+
docker build --no-cache -t $buildTag --build-arg BASE_IMAGE=$mqImage -f ./rhel/Dockerfile.acemqrhel .
4646
;;
4747
*) echo "Invalid option"
4848
;;

cmd/chkacehealthy/main.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,13 @@ limitations under the License.
1515
*/
1616

1717
// chkacelively checks that ACE is still runing, by checking if the admin REST endpoint port is available.
18-
// Additionally, if MQ is enabled, it also runs the MQ liveness probe chkmqhealthy.
1918
package main
2019

2120
import (
2221
"fmt"
2322
"net"
2423
"os"
2524
"time"
26-
27-
"github.com/ot4i/ace-docker/internal/command"
28-
"github.com/ot4i/ace-docker/internal/qmgr"
2925
)
3026

3127
const restartIsTimeoutInSeconds = 60
@@ -62,13 +58,4 @@ func main() {
6258
}
6359
conn.Close()
6460

65-
// Run MQ's liveness check chkmqhealthy, if enabled
66-
if qmgr.UseQueueManager() {
67-
out, rc, err := command.RunAsUser("mqm", "chkmqhealthy")
68-
if rc != 0 || err != nil {
69-
fmt.Println(out)
70-
fmt.Println(err)
71-
os.Exit(1)
72-
}
73-
}
7461
}

cmd/chkaceready/chkaceready_rbc

-2.7 MB
Binary file not shown.

cmd/chkaceready/main.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,12 @@ limitations under the License.
1515
*/
1616

1717
// chkaceready checks that ACE is ready for work, by checking if the admin REST endpoint port is available.
18-
// Additionally, if MQ is enabled, it also runs the MQ readiness probe chkmqready.
1918
package main
2019

2120
import (
2221
"fmt"
2322
"net"
2423
"os"
25-
26-
"github.com/ot4i/ace-docker/internal/command"
27-
"github.com/ot4i/ace-docker/internal/qmgr"
2824
)
2925

3026
func main() {
@@ -36,13 +32,4 @@ func main() {
3632
}
3733
conn.Close()
3834

39-
// Run MQ's readiness check chkmqready, if enabled
40-
if qmgr.UseQueueManager() {
41-
out, rc, err := command.RunAsUser("mqm", "chkmqready")
42-
if rc != 0 || err != nil {
43-
fmt.Println(out)
44-
fmt.Println(err)
45-
os.Exit(1)
46-
}
47-
}
4835
}

cmd/runaceserver/integrationserver.go

Lines changed: 33 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ import (
4141
"github.com/ot4i/ace-docker/internal/command"
4242
"github.com/ot4i/ace-docker/internal/configuration"
4343
"github.com/ot4i/ace-docker/internal/name"
44-
"github.com/ot4i/ace-docker/internal/qmgr"
4544
"github.com/ot4i/ace-docker/internal/webadmin"
4645
"gopkg.in/yaml.v2"
4746

@@ -66,24 +65,6 @@ var yamlMarshal = yaml.Marshal
6665
var writeServerConfFile = writeServerConfFileLocal
6766
var getConfigurationFromContentServer = getConfigurationFromContentServerLocal
6867

69-
// createSystemQueues creates the default MQ service queues used by the Integration Server
70-
func createSystemQueues() error {
71-
log.Println("Creating system queues")
72-
name, err := name.GetQueueManagerName()
73-
if err != nil {
74-
log.Errorf("Error getting queue manager name: %v", err)
75-
return err
76-
}
77-
78-
out, _, err := command.Run("bash", "/opt/ibm/ace-12/server/sample/wmq/iib_createqueues.sh", name, "mqbrkrs")
79-
if err != nil {
80-
log.Errorf("Error creating system queues: %v", string(out))
81-
return err
82-
}
83-
log.Println("Created system queues")
84-
return nil
85-
}
86-
8768
// initialIntegrationServerConfig walks through the /home/aceuser/initial-config directory
8869
// looking for directories (each containing some config data), then runs a shell script
8970
// called ace_config_{directory-name}.sh to process that data.
@@ -127,41 +108,32 @@ func initialIntegrationServerConfig() error {
127108
for _, file := range fileList {
128109
if file.IsDir() && file.Name() != "mqsc" && file.Name() != "workdir_overrides" {
129110
log.Printf("Processing configuration in folder %v", file.Name())
130-
if qmgr.UseQueueManager() {
131-
out, _, err := command.RunAsUser("mqm", "ace_config_"+file.Name()+".sh")
111+
if file.Name() == "webusers" {
112+
log.Println("Configuring server.conf.yaml overrides - Webadmin")
113+
updateServerConf := createSHAServerConfYaml()
114+
if updateServerConf != nil {
115+
log.Errorf("Error setting webadmin SHA server.conf.yaml: %v", updateServerConf)
116+
return updateServerConf
117+
}
118+
log.Println("Configuring WebAdmin Users")
119+
err := ConfigureWebAdminUsers(log)
120+
if err != nil {
121+
log.Errorf("Error configuring the WebAdmin users : %v", err)
122+
return err
123+
}
124+
}
125+
if file.Name() != "webusers" {
126+
cmd := exec.Command("ace_config_" + file.Name() + ".sh")
127+
out, _, err := command.RunCmd(cmd)
132128
if err != nil {
133129
log.LogDirect(out)
134130
log.Errorf("Error processing configuration in folder %v: %v", file.Name(), err)
135131
return err
136132
}
137133
log.LogDirect(out)
138-
} else {
139-
if file.Name() == "webusers" {
140-
log.Println("Configuring server.conf.yaml overrides - Webadmin")
141-
updateServerConf := createSHAServerConfYaml()
142-
if updateServerConf != nil {
143-
log.Errorf("Error setting webadmin SHA server.conf.yaml: %v", updateServerConf)
144-
return updateServerConf
145-
}
146-
log.Println("Configuring WebAdmin Users")
147-
err := ConfigureWebAdminUsers(log)
148-
if err != nil {
149-
log.Errorf("Error configuring the WebAdmin users : %v", err)
150-
return err
151-
}
152-
}
153-
if file.Name() != "webusers" {
154-
cmd := exec.Command("ace_config_" + file.Name() + ".sh")
155-
out, _, err := command.RunCmd(cmd)
156-
if err != nil {
157-
log.LogDirect(out)
158-
log.Errorf("Error processing configuration in folder %v: %v", file.Name(), err)
159-
return err
160-
}
161-
log.LogDirect(out)
162-
}
163134
}
164135
}
136+
165137
}
166138

167139
enableMetrics := os.Getenv("ACE_ENABLE_METRICS")
@@ -465,13 +437,13 @@ func addOpenTracingToServerConf(serverconfContent []byte) ([]byte, error) {
465437
}
466438

467439
if serverconfMap["UserExits"] != nil {
468-
userExits := serverconfMap["UserExits"].(map[string]string)
440+
userExits := serverconfMap["UserExits"].(map[interface{}]interface{})
469441

470442
userExits["activeUserExitList"] = "ACEOpenTracingUserExit"
471443
userExits["userExitPath"] = "/opt/ACEOpenTracing"
472444

473445
} else {
474-
serverconfMap["UserExits"] = map[string]string{
446+
serverconfMap["UserExits"] = map[interface{}]interface{} {
475447
"activeUserExitList": "ACEOpenTracingUserExit",
476448
"userExitPath": "/opt/ACEOpenTracing",
477449
}
@@ -723,18 +695,6 @@ func startIntegrationServer() command.BackgroundCmd {
723695
defaultAppName = serverName
724696
}
725697

726-
if qmgr.UseQueueManager() {
727-
qmgrName, err := name.GetQueueManagerName()
728-
if err != nil {
729-
log.Printf("Error getting queue manager name: %v", err)
730-
returnErr := command.BackgroundCmd{}
731-
returnErr.ReturnCode = -1
732-
returnErr.ReturnError = err
733-
return returnErr
734-
}
735-
return command.RunAsUserBackground("mqm", "ace_integration_server.sh", log, "-w", "/home/aceuser/ace-server", "--name", serverName, "--mq-queue-manager-name", qmgrName, "--log-output-format", logOutputFormat, "--console-log", "--default-application-name", defaultAppName)
736-
}
737-
738698
thisUser, err := user.Current()
739699
if err != nil {
740700
log.Errorf("Error finding this user: %v", err)
@@ -749,26 +709,15 @@ func startIntegrationServer() command.BackgroundCmd {
749709

750710
func waitForIntegrationServer() error {
751711
for {
752-
if qmgr.UseQueueManager() {
753-
_, rc, err := command.RunAsUser("mqm", "chkaceready")
754-
if rc != 0 || err != nil {
755-
log.Printf("Integration server not ready yet")
756-
}
757-
if rc == 0 {
758-
break
759-
}
760-
time.Sleep(5 * time.Second)
761-
} else {
762-
cmd := exec.Command("chkaceready")
763-
_, rc, err := command.RunCmd(cmd)
764-
if rc != 0 || err != nil {
765-
log.Printf("Integration server not ready yet")
766-
}
767-
if rc == 0 {
768-
break
769-
}
770-
time.Sleep(5 * time.Second)
712+
cmd := exec.Command("chkaceready")
713+
_, rc, err := command.RunCmd(cmd)
714+
if rc != 0 || err != nil {
715+
log.Printf("Integration server not ready yet")
716+
}
717+
if rc == 0 {
718+
break
771719
}
720+
time.Sleep(5 * time.Second)
772721
}
773722
return nil
774723
}
@@ -781,33 +730,14 @@ func stopIntegrationServer(integrationServerProcess command.BackgroundCmd) {
781730
}
782731

783732
func createWorkDir() error {
784-
log.Printf("Checking if work dir is already initialized")
785-
f, err := os.Open("/home/aceuser/ace-server")
733+
log.Printf("Attempting to initialise /home/aceuser/ace-server")
734+
cmd := exec.Command("/opt/ibm/ace-12/server/bin/mqsicreateworkdir", "/home/aceuser/ace-server")
735+
_, _, err := command.RunCmd(cmd)
786736
if err != nil {
787-
log.Printf("Error reading /home/aceuser/ace-server")
737+
log.Printf("Error initializing work dir")
788738
return err
789739
}
790-
791-
log.Printf("Checking for contents in the work dir")
792-
_, err = f.Readdirnames(1)
793-
if err != nil {
794-
log.Printf("Work dir is not yet initialized - initializing now in /home/aceuser/ace-server")
795-
796-
if qmgr.UseQueueManager() {
797-
_, _, err := command.RunAsUser("mqm", "/opt/ibm/ace-12/server/bin/mqsicreateworkdir", "/home/aceuser/ace-server")
798-
if err != nil {
799-
log.Printf("Error reading initializing work dir")
800-
return err
801-
}
802-
} else {
803-
cmd := exec.Command("/opt/ibm/ace-12/server/bin/mqsicreateworkdir", "/home/aceuser/ace-server")
804-
_, _, err := command.RunCmd(cmd)
805-
if err != nil {
806-
log.Printf("Error reading initializing work dir")
807-
return err
808-
}
809-
}
810-
}
740+
811741
log.Printf("Work dir initialization complete")
812742
return nil
813743
}

cmd/runaceserver/integrationserver_internal_test.go

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,4 +1102,46 @@ iipaBg==
11021102
os.Remove(certificateLocation)
11031103
os.Remove(keystoreLocation)
11041104

1105+
}
1106+
1107+
1108+
1109+
var yamlOpenTracingTests = []struct {
1110+
in string
1111+
out string
1112+
}{
1113+
{ // User's blank yaml
1114+
``,
1115+
`UserExits:
1116+
activeUserExitList: ACEOpenTracingUserExit
1117+
userExitPath: /opt/ACEOpenTracing
1118+
`},
1119+
{ // Do not alter as values provided
1120+
`UserExits:
1121+
activeUserExitList: ACEOpenTracingUserExit
1122+
userExitPath: /opt/ACEOpenTracing`,
1123+
`UserExits:
1124+
activeUserExitList: ACEOpenTracingUserExit
1125+
userExitPath: /opt/ACEOpenTracing
1126+
`},
1127+
{ // Check all values
1128+
`UserExits:
1129+
userExitPath: /opt/ACEOpenTracing`,
1130+
`UserExits:
1131+
activeUserExitList: ACEOpenTracingUserExit
1132+
userExitPath: /opt/ACEOpenTracing
1133+
`},
1134+
}
1135+
1136+
func TestAddOpenTracingToServerConf(t *testing.T) {
1137+
for _, table := range yamlOpenTracingTests {
1138+
out, err := addOpenTracingToServerConf([]byte(table.in))
1139+
if err != nil {
1140+
t.Error(err)
1141+
}
1142+
stringOut := string(out)
1143+
if stringOut != table.out {
1144+
t.Errorf("addOpenTracingToServerConf expected \n%v, got \n%v", table.out, stringOut)
1145+
}
1146+
}
11051147
}

0 commit comments

Comments
 (0)