I'm trying to build a system where I could supply some parameters in a Order and other parameters in Job Chains. The idea is to run commands on different servers, but I'd like to be able to change the credentials and server addresses easily, and I don't want to give them in each order.
It seems that the parameters that are entered in Job Chains are only used if I launch the job from Job chain menu in JOC. If I launch the Order which runs the same Job Chain, only the Order's parameters are sent to the job. Is this correct, and is there any way to start a Order with parameters, and also have the parameters from Job Chains added when they are started?
I tried putting the data I'd like in Job Chains into scheduler_global_vars.xml, but the variables don't seem to be available to the shell scripts. I also tried putting the parameters directly to scheduler.xml, but that didn't help either.
I'm testing the parameters with this kind of code.
echo "Parameter server_hostname = \"$SCHEDULER_PARAM_SERVER_HOSTNAME\""
Any hints would be greatly appreciated.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
assuming that you refer to the "configuration monitor" feature as suggested with the article How to define and reference Job Chain Node parameters you should consider to add the class sos.scheduler.managed.configuration.ConfigurationOrderMonitor as a pre- and postprocessing monitor to each job of your job chain. My assumption is that this monitor assignment currently is missing in your configuration.
As usually there is more than one way how to do it, I suggest to consider a simple alternative:
See How to store job and order parameters in external files: the article explains how to store parameters in separate files that are assigned to a job or order via the <params><include> element which is available by the respective "Include" tab in JOE.
This allows you to include the same external parameter file(s) to a number of jobs or orders.
Parameters from jobs and orders are merged for job execution with higher precedence to order parameters. Therefore you could organize parameters in ascending precedence like this:
create an external file for parameters that are available to all jobs of a job chain.
add specific parameters to individual jobs that would overwrite parameters with the same name from the external file.
create an external file for parameters that are available to all orders of your job chain.
add specific parameters for individual orders that would overwrite parameters with the same name from the external file.
Concerning usage of parameters please keep in mind that
the prefix SCHEDULER_PARAM_ has to be added when using parameters that are exposed as environment variables. When setting parameters or when using parameters by scripting with the API then no prefex has to be used.
Hi! Thanks for all your replies. They have been really helpful. Unfortunately I bumped again into this problem. I have the ConfigurationOrderMonitor in place, and my other parameters are working fine. However - the job chain node parameters still don't work. I have one parameter as a job chain node parameter as described in this document: https://kb.sos-berlin.com/display/PKB/How+to+define+and+reference+Job+Chain+Node+parameters
When I run the job chain order, the parameter in the job just stays empty. The job is a SSH job if it has any relevance. I'm also including some parameters from a file, but the beef is that I have two very similar tasks I need done, so I'd like to just have one job and change the critical parameter in the job chain node.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm trying to build a system where I could supply some parameters in a Order and other parameters in Job Chains. The idea is to run commands on different servers, but I'd like to be able to change the credentials and server addresses easily, and I don't want to give them in each order.
It seems that the parameters that are entered in Job Chains are only used if I launch the job from Job chain menu in JOC. If I launch the Order which runs the same Job Chain, only the Order's parameters are sent to the job. Is this correct, and is there any way to start a Order with parameters, and also have the parameters from Job Chains added when they are started?
I tried putting the data I'd like in Job Chains into scheduler_global_vars.xml, but the variables don't seem to be available to the shell scripts. I also tried putting the parameters directly to scheduler.xml, but that didn't help either.
I'm testing the parameters with this kind of code.
echo "Parameter server_hostname = \"$SCHEDULER_PARAM_SERVER_HOSTNAME\""
Any hints would be greatly appreciated.
Hi Naranek,
assuming that you refer to the "configuration monitor" feature as suggested with the article How to define and reference Job Chain Node parameters you should consider to add the class sos.scheduler.managed.configuration.ConfigurationOrderMonitor as a pre- and postprocessing monitor to each job of your job chain. My assumption is that this monitor assignment currently is missing in your configuration.
As usually there is more than one way how to do it, I suggest to consider a simple alternative:
Concerning usage of parameters please keep in mind that
Best regards
Andreas
Hi! Thanks for all your replies. They have been really helpful. Unfortunately I bumped again into this problem. I have the ConfigurationOrderMonitor in place, and my other parameters are working fine. However - the job chain node parameters still don't work. I have one parameter as a job chain node parameter as described in this document: https://kb.sos-berlin.com/display/PKB/How+to+define+and+reference+Job+Chain+Node+parameters
When I run the job chain order, the parameter in the job just stays empty. The job is a SSH job if it has any relevance. I'm also including some parameters from a file, but the beef is that I have two very similar tasks I need done, so I'd like to just have one job and change the critical parameter in the job chain node.
Please provide your configuration files.