Skip to content

Commit 10bd561

Browse files
authored
Merge pull request #85 from ot4i/11.0.0.5.1
Updates for 11.0.0.5.1 release
2 parents 66fd977 + 6bc7d8f commit 10bd561

File tree

13 files changed

+227
-39
lines changed

13 files changed

+227
-39
lines changed

.travis.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
sudo: required
2+
dist: xenial
3+
language: generic
4+
services:
5+
- docker
6+
# Make some fake binaries to spoof an ACE install for the Dockerbuild files to use.
7+
before_install:
8+
- mkdir -p deps/ace-install/server/bin/
9+
- echo -e "#!/bin/bash\nexport PATH=/opt/ibm/ace-11/server/bin/" > deps/ace-install/server/bin/mqsiprofile && chmod ugo+x deps/ace-install/server/bin/mqsiprofile
10+
- echo -e "#!/bin/bash\nexit 0" > deps/ace-install/server/bin/mqsicreateworkdir && chmod ugo+x deps/ace-install/server/bin/mqsicreateworkdir
11+
- echo -e "#!/bin/bash\ngroupadd mqbrkrs\ngroupadd mqm\nexit 0" > deps/ace-install/ace && chmod u+x deps/ace-install/ace
12+
- cd deps && tar czf ace-install.tar.gz ace-install && cd ..
13+
install:
14+
- docker build --build-arg ACE_INSTALL=ace-install.tar.gz --file ubi/Dockerfile.aceonly .

README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ You may have been provided with a fix for App Connect Enterprise by IBM Support,
3030
`tar -cvf ace-11.0.0.5_with_IT12345.tar ace-11.0.0.5`
3131
`gzip ace-11.0.0.5_with_IT12345.tar`
3232
- Place the resulting `ace-11.0.0.5_with_IT12345.tar.gz` file in the `deps` folder and when building using the `build-arg` to specify the name of the file: `--build-arg ACE_INSTALL=ace-11.0.0.5_with_IT12345.tar.gz`
33-
33+
3434
### Using App Connect Enterprise for Developers
3535

3636
Get [ACE for Developers edition](https://www.ibm.com/marketing/iwm/iwm/web/pick.do?source=swg-wmbfd). Then place it in the `deps` folder as mentioned above.
@@ -69,7 +69,7 @@ Then set the build argument `ACE_INSTALL` to the name of the ACE file placed in
6969

7070
Follow the instructions above for building an image with App Connect Enterprise Only.
7171

72-
Add the MQ Client libraries to your existing image by running `cd ubi && docker build -t ace-mqclient --build-arg BASE_IMAGE=<AceOnlyImageTag> --file Dockerfile.mqclient .`
72+
Add the MQ Client libraries to your existing image by running `docker build -t ace-mqclient --build-arg BASE_IMAGE=<AceOnlyImageTag> --file ubi/Dockerfile.mqclient .`
7373

7474
`<AceOnlyImageTag>` is the tag of the image you want to add the client libs to i.e. ace-only. You can supply a customer URL for the MQ binaries by setting the argument MQ_URL
7575

@@ -83,6 +83,7 @@ In order to use the image, it is necessary to accept the terms of the IBM App Co
8383

8484
This chart requires a SecurityContextConstraints to be bound to the target namespace prior to installation. To meet this requirement there may be cluster scoped as well as namespace scoped pre and post actions that need to occur.
8585

86+
8687
#### Running an ACE Only Integration Server
8788

8889
The predefined SecurityContextConstraints name: [`ibm-anyuid-scc`](https://ibm.biz/cpkspec-scc) has been verified for this chart when creating an ACE & MQ integration server, if your target namespace is bound to this SecurityContextConstraints resource you can proceed to install the chart.
@@ -192,7 +193,7 @@ You can mount the following file structure at `/home/aceuser/initial-config`. Mi
192193
- The truststore file that will be created for these files needs a password. You must set a truststore password using the environment variable `ACE_TRUSTSTORE_PASSWORD`
193194
- You can place multiple files, each with a different file name/alias.
194195
- `/home/aceuser/initial-config/webusers`
195-
- A text file called `admin-users.txt`. It contains a list of users to be created as admin users using the command `mqsiwebuseradmin`. These users will have READ, WRITE and EXECUTE access on the Integration Server. The file has the following format:
196+
- A text file called either `admin-users.txt` or `operator-users.txt`. It contains a list of users to be created as admin/operator users using the command `mqsiwebuseradmin`. These users will have READ, WRITE and EXECUTE access on the Integration Server. The file has the following format:
196197
```
197198
# Lines starting with a "#" are ignored
198199
# Each line should specify the <adminUser> <password>, separated by a single space
@@ -202,7 +203,7 @@ You can mount the following file structure at `/home/aceuser/initial-config`. Mi
202203
admin1 password1
203204
admin2 password2
204205
```
205-
- A text file called `viewer-users.txt`. It contains a list of users to be created as viewer users using the command `mqsiwebuseradmin`. These users will have READ access on the Integration Server. The file has the following format:
206+
- A text file called `viewer-users.txt`, `editor-users.txt`, `audit-users.txt` . It contains a list of users to be created as viewer/editor/auditor users using the command `mqsiwebuseradmin`. These users will have READ access on the Integration Server. The file has the following format:
206207
```
207208
# Lines starting with a "#" are ignored
208209
# Each line should specify the <adminUser> <password>, separated by a single space
@@ -221,6 +222,10 @@ You can mount the following file structure at `/home/aceuser/initial-config`. Mi
221222
- A json file called 'agentp.json' containing configuration information for the agent connectivity, this will be copied into the appropriate iibswitch directory
222223
- `/home/aceuser/initial-config/extensions`
223224
- A zip file called `extensions.zip` will be extracted into the directory `/home/aceuser/ace-server/extensions`. This allows you to place extra files into a directory you can then reference in, for example, the server.conf.yaml
225+
- `/home/aceuser/initial-config/ssl`
226+
- A pem file called 'ca.crt' will be extracted into the directory `/home/aceuser/ace-server/ssl`
227+
- A pem file called 'tls.key' will be extracted into the directory `/home/aceuser/ace-server/ssl`
228+
- A pem file called 'tls.cert' will be extracted into the directory `/home/aceuser/ace-server/ssl`
224229
225230
## Logging
226231

ace_config_ssl.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
11+
source ${SCRIPT_DIR}/ace_config_logging.sh
12+
13+
log "Handling SSL files"
14+
15+
mkdir /home/aceuser/ace-server/ssl/
16+
17+
if ls /home/aceuser/initial-config/ssl/* >/dev/null 2>&1; then
18+
for sslfile in `ls /home/aceuser/initial-config/ssl/*`; do
19+
if [ -s "${sslfile}" ]; then
20+
cp "${sslfile}" /home/aceuser/ace-server/ssl/.
21+
fi
22+
done
23+
fi
24+
25+
log "SSL configuration complete"

ace_config_webusers.sh

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,13 @@ source ${SCRIPT_DIR}/ace_config_logging.sh
1717
log "Handling webusers configuration"
1818

1919
ADMINUSERSFILE=/home/aceuser/initial-config/webusers/admin-users.txt
20+
OPERATORUSERSFILE=/home/aceuser/initial-config/webusers/operator-users.txt
2021
VIEWERUSERSFILE=/home/aceuser/initial-config/webusers/viewer-users.txt
22+
EDITORUSERSFILE=/home/aceuser/initial-config/webusers/editor-users.txt
23+
AUDITUSERSFILE=/home/aceuser/initial-config/webusers/audit-users.txt
2124
DASHBOARDUSERSFILE=/home/aceuser/initial-config/webusers/dashboard-users.txt
2225

23-
if [ -s $ADMINUSERSFILE ] || [ -s $VIEWERUSERSFILE ] || [ -s $DASHBOARDUSERSFILE ]; then
26+
if [ -s $ADMINUSERSFILE ] || [ -s $OPERATORUSERSFILE ] || [ -s $VIEWERUSERSFILE ] || [ -s $EDITORUSERSFILE ] || [ -s $AUDITUSERSFILE ] || [ -s $DASHBOARDUSERSFILE ]; then
2427
OUTPUT=$(mqsichangeauthmode -w /home/aceuser/ace-server -s active -m file 2>&1)
2528
logAndExitIfError $? "${OUTPUT}"
2629

@@ -47,6 +50,21 @@ if [ -s $ADMINUSERSFILE ] || [ -s $VIEWERUSERSFILE ] || [ -s $DASHBOARDUSERSFILE
4750
done
4851
fi
4952

53+
if [ -s $OPERATORUSERSFILE ]; then
54+
IFS=$'\n'
55+
for line in $(cat $OPERATORUSERSFILE | tr -d '\r'); do
56+
if [[ $line =~ ^\# ]]; then
57+
continue
58+
fi
59+
IFS=${OLDIFS}
60+
fields=($line)
61+
log "Creating admin user ${fields[0]}"
62+
63+
OUTPUT=$(mqsiwebuseradmin -w /home/aceuser/ace-server -c -u ${fields[0]} -a ${fields[1]} -r admin 2>&1)
64+
logAndExitIfError $? "${OUTPUT}"
65+
done
66+
fi
67+
5068
if [ -s $VIEWERUSERSFILE ]; then
5169
IFS=$'\n'
5270
for line in $(cat $VIEWERUSERSFILE | tr -d '\r'); do
@@ -62,6 +80,36 @@ if [ -s $ADMINUSERSFILE ] || [ -s $VIEWERUSERSFILE ] || [ -s $DASHBOARDUSERSFILE
6280
done
6381
fi
6482

83+
if [ -s $EDITORUSERSFILE ]; then
84+
IFS=$'\n'
85+
for line in $(cat $EDITORUSERSFILE | tr -d '\r'); do
86+
if [[ $line =~ ^\# ]]; then
87+
continue
88+
fi
89+
IFS=${OLDIFS}
90+
fields=($line)
91+
log "Creating viewer user ${fields[0]}"
92+
93+
OUTPUT=$(mqsiwebuseradmin -w /home/aceuser/ace-server -c -u ${fields[0]} -a ${fields[1]} -r viewer 2>&1)
94+
logAndExitIfError $? "${OUTPUT}"
95+
done
96+
fi
97+
98+
if [ -s $AUDITUSERSFILE ]; then
99+
IFS=$'\n'
100+
for line in $(cat $AUDITUSERSFILE | tr -d '\r'); do
101+
if [[ $line =~ ^\# ]]; then
102+
continue
103+
fi
104+
IFS=${OLDIFS}
105+
fields=($line)
106+
log "Creating viewer user ${fields[0]}"
107+
108+
OUTPUT=$(mqsiwebuseradmin -w /home/aceuser/ace-server -c -u ${fields[0]} -a ${fields[1]} -r viewer 2>&1)
109+
logAndExitIfError $? "${OUTPUT}"
110+
done
111+
fi
112+
65113
if [ -s $DASHBOARDUSERSFILE ]; then
66114
IFS=$'\n'
67115
for line in $(cat $DASHBOARDUSERSFILE | tr -d '\r'); do

cmd/runaceserver/integrationserver.go

Lines changed: 74 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,17 @@ func initialIntegrationServerConfig() error {
119119
}
120120
}
121121

122+
enableOpenTracing := os.Getenv("ACE_ENABLE_OPEN_TRACING")
123+
if enableOpenTracing == "true" || enableOpenTracing == "1" {
124+
enableOpenTracingError := enableOpenTracingInServerConf()
125+
if enableOpenTracingError != nil {
126+
log.Errorf("Error enabling user exits in server.conf.yaml: %v", enableOpenTracingError)
127+
return enableOpenTracingError
128+
}
129+
}
130+
131+
132+
122133
log.Printf("Initial configuration of integration server complete")
123134

124135
log.Println("Discovering override ports")
@@ -163,6 +174,36 @@ func enableMetricsInServerConf() error {
163174
return nil
164175
}
165176

177+
// enableOpenTracingInServerConf adds OpenTracing UserExits fields to the server.conf.yaml in overrides
178+
// If the file does not exist already it gets created.
179+
func enableOpenTracingInServerConf() error {
180+
181+
log.Println("Enabling OpenTracing in server.conf.yaml")
182+
183+
serverconfContent, readError := readServerConfFile()
184+
if readError != nil {
185+
if !os.IsNotExist(readError) {
186+
// Error is different from file not existing (if the file does not exist we will create it ourselves)
187+
log.Errorf("Error reading server.conf.yaml: %v", readError)
188+
return readError
189+
}
190+
}
191+
192+
serverconfYaml, manipulationError := addOpenTracingToServerConf(serverconfContent)
193+
if manipulationError != nil {
194+
return manipulationError
195+
}
196+
197+
writeError := writeServerConfFile(serverconfYaml)
198+
if writeError != nil {
199+
return writeError
200+
}
201+
202+
log.Println("OpenTracing enabled in server.conf.yaml")
203+
204+
return nil
205+
}
206+
166207
// readServerConfFile returns the content of the server.conf.yaml file in the overrides folder
167208
func readServerConfFile() ([]byte, error) {
168209
content, err := ioutil.ReadFile("/home/aceuser/ace-server/overrides/server.conf.yaml")
@@ -180,7 +221,7 @@ func writeServerConfFile(content []byte) error {
180221
return nil
181222
}
182223

183-
// addMetricsToServerConf gets the content of the server.conf.yaml and adds the metrics fileds to it
224+
// addMetricsToServerConf gets the content of the server.conf.yaml and adds the metrics fields to it
184225
// It returns the updated server.conf.yaml content
185226
func addMetricsToServerConf(serverconfContent []byte) ([]byte, error) {
186227
serverconfMap := make(map[interface{}]interface{})
@@ -233,6 +274,38 @@ func addMetricsToServerConf(serverconfContent []byte) ([]byte, error) {
233274
return serverconfYaml, nil
234275
}
235276

277+
// addOpenTracingToServerConf gets the content of the server.conf.yaml and adds the OpenTracing UserExits fields to it
278+
// It returns the updated server.conf.yaml content
279+
func addOpenTracingToServerConf(serverconfContent []byte) ([]byte, error) {
280+
serverconfMap := make(map[interface{}]interface{})
281+
unmarshallError := yaml.Unmarshal([]byte(serverconfContent), &serverconfMap)
282+
if unmarshallError != nil {
283+
log.Errorf("Error unmarshalling server.conf.yaml: %v", unmarshallError)
284+
return nil, unmarshallError
285+
}
286+
287+
if serverconfMap["UserExits"] != nil {
288+
userExits := serverconfMap["UserExits"].(map[string]string)
289+
290+
userExits["activeUserExitList"] = "ACEOpenTracingUserExit"
291+
userExits["userExitPath"] = "/opt/ACEOpenTracing"
292+
293+
} else {
294+
serverconfMap["UserExits"] = map[string]string{
295+
"activeUserExitList": "ACEOpenTracingUserExit",
296+
"userExitPath": "/opt/ACEOpenTracing",
297+
}
298+
}
299+
300+
serverconfYaml, marshallError := yaml.Marshal(&serverconfMap)
301+
if marshallError != nil {
302+
log.Errorf("Error marshalling server.conf.yaml: %v", marshallError)
303+
return nil, marshallError
304+
}
305+
306+
return serverconfYaml, nil
307+
}
308+
236309
// getConfigurationFromContentServer checks if ACE_CONTENT_SERVER_URL exists. If so then it pulls
237310
// a bar file from that URL
238311
func getConfigurationFromContentServer() error {

deps/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
*.tar.gz
22
*.tgz
3+
OpenTracing/config/*
4+
OpenTracing/library/*
5+
!OpenTracing/config/README
6+
!OpenTracing/library/README

deps/OpenTracing/config/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Any configuration files needed for the Loadable Exit Library (LEL) should be placed in this directory

deps/OpenTracing/library/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The Loadable Exit Library (LEL) file to support tracing should be placed in this directory.

sample/Dockerfile.acemq

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ COPY bars_aceonly /home/aceuser/bars
88
COPY bars_mq /home/aceuser/bars
99
RUN su - mqm -c 'ace_compile_bars.sh'
1010

11-
USER mqm
11+
USER mqm

0 commit comments

Comments
 (0)