In this article, let us see how we can add a custom CBAs to a deployed MDM docker container from the host machine using scripts.Custom docker-compose file for MDM
In this sample, we have an MDM container that has been configured to use a remote database and WMQ. A docker image has been created from this container, by committing and pushing this container into the local docker registry. The image is then used in a custom docker-compose file.
The mdm-custom.yml is a docker-compose file that has a container corresponding to the custom image mdmosfp10:v2 Note that the commands demonstrated can also be used with the containers provided with the mdm-deployed.yaml file.Bringing up the docker-compose yml file
We have to bring up the containers in the docker compose file by using the docker-compose up command.Scripts to add CBAs to MDM operational server
Meanwhile let us have a look into the scripts that will help us in adding custom CBAs. Download addCBA.zip
and extract the files to a folder. This compressed file has four files namely addCBA.py, addCBA.sh README.md and mdm_container_addCBA.sh
In the sample above, we noticed two CBAs that will be added as extension to MDM EBA.Check Application Server Status
Before executing the script to add the custom CBA to the EBA, we need to ensure that the WebSphere Application Server in the docker container is running. This can be checked by viewing the logs corresponding to the container. An alternative is to login to the container and execute ./serverStatus.sh from $WAS_PROFILE_DIR/bin
We can then execute the shell script mdm_container_addCBA.sh On the host machine with has the MDM docker container, the scripts mdm_container_addCBA.sh, addCBA.sh and addCBA.py have to be placed in the same folder. Any custom CBAs that have to be deployed also have to be placed in the same folder. The script mdm_container_addCBA.sh that has to be executed takes in two parameters, the MDM Instance Id and the WAS admin password. In case you are using the mdm_container from mdm-deployed.yaml, the MDM Instance Id is E001 and the WAS admin password is mdmadmin.
The script copies the CBAs to $WAS_PROFILE_HOME/CustomCBA in the container and copies the files addCBA.sh and addCBA.py to $WAS_PROFILE_DIR/bin. It then executes addCBA.sh at $WAS_PROFILE_DIR/binIn case you provided a different container name corresponding the MDM image, you can pass in the container name as the third parameter. Check the extensions in WAS Admin Console
You can confirm whether the CBA is added and whether it is added as an Extension to the CBA from the WAS Admin Console. The WAS Admin Console is accessible at port 9043 of the host machine.
This container can then be committed and pushed to a docker registry for use in other environments including container orchestration platforms like Kubernetes and OpenShift.