Description
Issue: GPP container requires additional arguments passed to the docker run
command that are unavailable in scripts/gpp.sh.
Examples:
Thread Count - GPP is unable to support new components due to max number of threads reading as "1". The non-container GPP normally has this value as 65536.
Using docker run ... --ulimit nproc=65536 ...
fixes this issue.
Shared Memory - Docker containers default to a 64MB /dev/shm directory. The non-container GPP normally uses 50% of the RAM size, but containers should use only what is required for the expected application environment.
Using docker run ... --shm-size=<desired memory> ...
fixes this issue.
Solution:
To prevent having to add every argument that is normally accepted by the docker run command, adding an --arg argument can offer users the ability to pass arguments through to the command. For the above two examples the gpp could be run via the following command:
./gpp start mGPP --args "--ulimit nproc=65536 --shm-size=256M"
This is possible by changing the scripts/gpp.sh file with the following diff:
--- a/scripts/gpp.sh
+++ b/scripts/gpp.sh
@@ -50,6 +50,7 @@ Usage: $0 start|stop NODE_NAME (options)
[-g|--gpp GPP_NAME] GPP Device name, default is GPP_[UUID]
[-d|--domain DOMAIN_NAME] Domain Name, default is REDHAWK_DEV
[-o|--omni OMNISERVER] IP to the OmniServer (detected: ${OMNISERVER})
+ [--args <ARGS>] Additional arguments passed to 'docker run'
[-p|--print] Just print resolved settings
Examples:
@@ -106,6 +107,10 @@ while [[ $# -gt 0 ]]; do
usage
exit 0
;;
+ --args)
+ ARGUMENTS="${2:?Missing ARGUMENTS Argument}"
+ shift
+ ;;
-p|--print)
JUST_PRINT=YES
;;
@@ -127,6 +132,7 @@ fi
# Enforce defaults
GPP_NAME=${GPP_NAME:-GPP_$(uuidgen)}
DOMAIN_NAME=${DOMAIN_NAME:-REDHAWK_DEV}
+ARGUMENTS=${ARGUMENTS:-""}
if ! [ -z ${JUST_PRINT+x} ]; then
cat <<EOF
@@ -185,6 +191,7 @@ if [[ $COMMAND == "start" ]]; then
-e DOMAINNAME=${DOMAIN_NAME} \
-e OMNISERVICEIP=${OMNISERVER} \
${NETWORK_ARGS} \
+ ${ARGUMENTS} \
--name ${CONTAINER_NAME} \
${IMAGE_NAME} &> /dev/null
Similar changes could be done to all of the launch scripts to prevent future issues of this same nature.