After you have successfully installed and configured ML for IBM z/OS®, consider running the scoring services as z/OS started tasks.
About this task
You can quickly create started tasks to manage the WLP and Gunicorn Python scoring server processes by customizing the ALNSCSV and ALNSCPY sample JCL jobs.
Note:
You can globally replace:
- <core_install_dir> with the MLz Core installation directory. The default value is /usr/lpp/IBM/aln/v3r2/core.
- <ent_install_dir> with the MLz Enterprise installation directory. The default value is /usr/lpp/IBM/aln/v3r2/ent.
- <java_install_dir> with the IBM Java 17 or Java 21 installation directory.
-
<aie_install_dir> with the IBM Z Deep Neural Network Library (zDNN) installation directory.
- The default directory for z/OS V2.5 is: /usr/lpp/IBM/aie
- The default directory for z/OS V3.1 or higher is: /usr/lpp/aie
Procedure
-
Locate the following files in the $IML_INSTALL_DIR/alnsamp/started-task-samples directory on the z/OS system where your MLz runs:
ALNSCSV (sample JCL job)
ALNSCPY (sample JCL job)
- SCSVPARM-STDPARM.template (sample MVS™ data set content)
- SCPYSTRT-STDPARM.template (sample MVS data set content)
- SCPYSTOP-STDPARM.template (sample MVS data set content)
- stdenvs-STDENV.template (sample z/OS Unix text file content)
-
Copy
ALNSCSV and ALNSCPY into a data set in your PROCLIB concatenation, such as SYS1.PROCLIB, and customize them based on your system environment.
Make sure that you set IMLHOME to the $IML_HOME directory and INSTDIR to the $IML_INSTALL_DIR directory where your MLz is installed.
-
Define a new MVS data set to be used by ddname STDPARM.
-
Create member SCSVPARM for
ALNSCSV by copying the following lines from SCSVPARM-STDPARM.template:
PGM <core_install_dir>/iml-zostools/bin/bash
<core_install_dir>/bin/server.sh config <scoring-name>
where <scoring-name> is the name of the scoring server of your MLz.
-
Create member SCPYSTRT for
ALNSCPY by copying the following lines from SCPYSTRT-STDPARM.template:
PGM <core_install_dir>/iml-zostools/bin/bash
<core_install_dir>/bin/server.sh start-python <scoring-name>
where <scoring-name> is the name of your Gunicorn Python server.
-
Create member SCPYSTOP for
ALNSCPY by copying the following lines from SCPYSTOP-STDPARM.template:
PGM <core_install_dir>/iml-zostools/bin/bash
<core_install_dir>/bin/server.sh stop-python <scoring-name>
where <scoring-name> is the name of your Gunicorn Python server.
-
Create a new z/OS Unix text file
stdenvs that ddname STDENV uses.
-
Copy the following lines from stdenvs-STDENV.template:
IML_INSTALL_DIR=<core_install_dir>
IML_INSTALL_ENT_DIR=<ent_install_dir>
IML_HOME=/my/iml-home
IML_JOBNAME_PREFIX=ALN
SPARK_HOME=<core_install_dir>/spark
JAVA_HOME=<java_install_dir>
WLP_INSTALL_DIR=/usr/lpp/liberty_zos/current
AIE_INSTALL_DIR=<aie_install_dir>
PATH=<core_install_dir>/iml-zostools/bin:/bin:<java_install_dir>/bin:<core_install_dir>/spark/bin:<core_install_dir>/spark/sbin:<core_install_dir>/nodejs/bin:<ent_install_dir>/pyz/pyz-313/bin
LIBPATH=/lib:/usr/lib:/usr/lib/java_runtime:<core_install_dir>/iml-services/utils:<core_install_dir>/spark/lib:<java_install_dir>/bin/classic:<java_install_dir>/bin/j9vm:<ent_install_dir>/pyz/pyz-313/lib:<aie_install_dir>/zdnn/lib
_BPXK_AUTOCVT=ON
_BPX_BATCH_UMASK=0022
IBM_JAVA_OPTIONS=-Dfile.encoding=UTF-8 -Dibm.racfkeystore.trustchaincheck=false
_TAG_REDIR_ERR=txt
_TAG_REDIR_IN=txt
_TAG_REDIR_OUT=txt
_BPX_SHAREAS=NO
_CEE_RUNOPTS=FILETAG(AUTOCVT,AUTOTAG) POSIX(ON)
-
Set all environment variables on basis of the z/OS system environment and the MLz installation. For more information, see Configuring user ID for setting up Machine Learning for IBM z/OS Enterprise Edition.
Note:
You can use the STDENV file for all the MLz started tasks.
-
Define a RACF® profile for the new
ALNSCSV and ALNSCPY started tasks and assign <mlz_setup_userid> as the owner by issuing the following commands:
RDEFINE STARTED ALNSCSV.* STDATA(USER(<mlz_setup_userid>) GROUP(<mlz_group>))
RDEFINE STARTED ALNSCPY.* STDATA(USER(<mlz_setup_userid>) GROUP(<mlz_group>))
SETROPTS RACLIST(STARTED) REFRESH
-
Run started task
ALNSCSV to start the scoring WLP server as shown in the following example:
/S ALNSCSV,PARMS=’<server_name>’
where server_name is the name of your MLz WLP scoring server.
If necessary, you can run the ALNSCSV started task to stop the WLP server by issuing the following command:
/P ALNSCSV
The value for the PARMS parameter is case-sensitive. Make sure that you issue the command in your SDSF system command extension to retain the lower case of your input.
-
Run started task
ALNSCPY to start the Gunicorn Python scoring server as shown in the following example:
/S ALNSCPY
If necessary, you can run the ALNSCPY started task to stop the Gunicorn Python server by issuing the following command:
/S ALNSCPY,OPTION='SCPYSTOP'
The OPTION value is case-sensitive. Make sure that you issue the command in your SDSF system command extension to retain the lower case of your input.