Compiling custom stages in DataStage®
You can set up an environment to compile custom stages by using your dev cluster.
Procedure
Required:
Use your dev cluster to set up an environment to compile custom stages.
-
Log in to the container.
pod=`oc get pods | grep -i ds-px-default | grep -i px-runtime|awk '{print $1}'`
oc rsh $pod
-
Copy the makefiles. In this example, the custom operator code is in
/mnts/dev/projects/projectName/CustomStage. Replace it with the filepath of
your code.
cp -rf /opt/ibm/samples/CustomStage /src/HelloWorld/* /mnts/dev/projects/projectName/CustomStage/
cd /mnts/dev/projects/projectName/CustomStage/
-
In this directory, edit the file
FileName
to point to the new custom stage source file. For example, if the source file is customstage.C, setOP_SRC_NAME = customstage
. -
Build the operator.
$ sh ./build.sh
-
See the following
doit.sh
script for an example of how to run these commands from outside the container:# cat doit.sh pod=`oc get pods | grep -i ds-px-default | grep -i px-runtime|awk '{print $1}'` echo $pod oc exec $pod -- bash -c "cp -rf /opt/ibm/samples/CustomStage /tmp; cd /tmp/CustomStage/src/HelloWorld; sh ./build.sh" # ./doit.sh ds-px-default-ibm-datastage-px-runtime-59d6988685-ll9mb Make.LabsExamples:230: warning: overriding recipe for target 'hello.so' Make.LabsExamples:211: warning: ignoring old recipe for target 'hello.so' Make.LabsExamples:237: warning: overriding recipe for target 'clean' Make.LabsExamples:218: warning: ignoring old recipe for target 'clean' Building dynamic library hello.so g++ -g -fPIC -m64 -Wno-deprecated -mtune=generic -mcmodel=small - I/opt/ibm/PXService/Server/PXEngine/include -c hello.C -o hello_temp.o g++ -shared -m64 -Wl,-rpath,'/opt/ibm/PXService/Server/PXEngine/lib_xtra' hello_temp.o - L/opt/ibm/PXService/Server/PXEngine/lib -lorchgeneralx86_64 -lorchx86_64 - lorchmonitorx86_64 -lorchcorex86_64 -lorchsortx86_64 -ldl -o hello.so register-library hello.so [root@solo1 243]#