I am experiencing some odd behaviors when executing a script in a k8s/Argo workflow step.
To start with, where I start the Metamap Tagger servers (see code snippet below), instead of waiting till each has completed before executing the next command, they all just fire off immediately (my kludgey solution was to put a /bin/bash/sleep 120
command between each).
The other oddity is that if I run a script from within a script that sets a bunch of environment variables (in this case source set_uima.sh
does this), the environment variable are not set accordingly. I have tested this outside of the k8 workflow and it all works as desired.
Is there something about k8 that makes this script not run the same in a non-TTY session (k8) as it does from a TTY session (from my local workstation)?
#!/bin/bash
export DATA_DIRECTORY=/data
export METAMAP_OUT=$DATA_DIRECTORY/metamap_out
export SAMPLE_FILE=$DATA_DIRECTORY/nlptab_manifest.txt
export DATA_IN=$DATA_DIRECTORY/in
export METAMAP_HOME=/usr/share/public_mm # /usr/share/public_mm
export JAVA_TOOL_OPTIONS=‘-Xms2G -Xmx6G -XX:MinHeapFreeRatio=25 -XX:+UseG1GC’
##### Start Metamap Tagger Servers #####
skrmedpostctl start
wsdserverctl start
mmserver &
##### Run UIMA against Metamap taggers #####
source ./setup_uima.sh