Notification test
-----------------
-The four steps bellow describe basic testing procedure of the notification
+Steps bellow describe basic testing procedure of the notification
system by creating a fake job record in the LB server, registering
a notification on any state change of this job, and forcing the job state
change.
client here. It uses mentioned client API calls to manipulate with
registrations.
+LB server supporting notifications is running on skurut68-2.cesnet.cz:9100,
+local-logger used for sending of events (there's no need to run it on the same
+host) on skurut68-2.cesnet.cz:9002.
1) Register a job
- export EDG_WL_LOG_DESTINATION=HOSTNAME:9002
- ./glite-lb-job_reg -m HOSTNAME:9000 -s UserInterface
+ examples/glite-lb-job_reg -m skurut68-2.cesnet.cz:9100 -s UserInterface
- -> returns JOBID - used in the next steps
- This creates a new job with status submitted.
+ -> returns jobid and sequence code used in next steps
+EDG_JOBID="https://skurut68-2.cesnet.cz:9100/D1qbFGwvXLnd927JOcja1Q"
+EDG_WL_SEQUENCE="UI=000002:NS=0000000000:WM=000000:BH=0000000000:JSS=000000:LM=000000:LRMS=000000:APP=000000:LBS=000000"
-2) Register notification
- export EDG_WL_NOTIF_SERVER=HOSTNAME:9000
- ./glite-lb-notify test JOBID
+2) Create notification for this jobid
-3) Change status of your job
- export EDG_WL_LOG_DESTINATION=HOSTNAME:9002
- ./glite-lb-running.sh -j JOBID
+ GLITE_WMS_NOTIF_SERVER=skurut68-2.cesnet.cz:9100 bin/glite-lb-notify
+new -j https://skurut68-2.cesnet.cz:9100/D1qbFGwvXLnd927JOcja1Q
+ -> returns notification id
+ notification ID: https://skurut68-2.cesnet.cz:9100/NOTIF:tOsgB19Wz-M884anZufyUw
+
+3) Start process waiting for notifications on job state change
+
+ GLITE_WMS_NOTIF_SERVER=skurut68-2.cesnet.cz:9100 bin/glite-lb-notify
+receive -i 120 https://skurut68-2.cesnet.cz:9100/NOTIF:tOsgB19Wz-M884anZufyUw
+
+4) Change status of your job
+
+4a)
+ - using glite-lb-logevent (sequence code passed from glite-lb-job_reg
+ and between glite-lb-logevent calls
+
+ GLITE_WMS_LOG_DESTINATION=skurut68-2.cesnet.cz:9002 bin/glite-lb-logevent \
+ -j https://skurut68-2.cesnet.cz:9100/D1qbFGwvXLnd927JOcja1Q \
+ -e Running -s LogMonitor --node hokus \
+ -c "UI=000002:NS=0000000000:WM=000000:BH=0000000000:JSS=000000:LM=000000:LRMS=000000:APP=000000:LBS=000000"
+
+ -> returns seq. code for later usage:
+ UI=000002:NS=0000000000:WM=000000:BH=0000000000:JSS=000000:LM=000002:LRMS=000000:APP=000000:LBS=000000
+
+
+ GLITE_WMS_LOG_DESTINATION=skurut68-2.cesnet.cz:9002 bin/glite-lb-logevent \
+ -j https://skurut68-2.cesnet.cz:9100/D1qbFGwvXLnd927JOcja1Q \
+ -e Done -s LogMonitor --status_code=OK --reason="hotovo" --exit_code=0 \
+ -c "UI=000002:NS=0000000000:WM=000000:BH=0000000000:JSS=000000:LM=000002:LRMS=000000:APP=000000:LBS=000000"
+
+ -> returns
+ UI=000002:NS=0000000000:WM=000000:BH=0000000000:JSS=000000:LM=000004:LRMS=000000:APP=000000:LBS=000000
+
+4b)
+ - using examples/glite-lb-running.sh (sends corresponding set of events):
+
+ GLITE_WMS_LOG_DESTINATION=skurut68-2.cesnet.cz:9002 \
+ examples/glite-lb-running.sh \
+ -j https://skurut68-2.cesnet.cz:9100/D1qbFGwvXLnd927JOcja1Q
+
+5) Watch incomming notifications.
-4) Watch incomming notifications.
You should receive several notification, each correspondig
- with job status change.
+ with job status change:
+
+https://skurut68-2.cesnet.cz:9100/D1qbFGwvXLnd927JOcja1Q Running /DC=cz/DC=cesnet-ca/O=Masaryk University/CN=Miroslav Ruda
+https://skurut68-2.cesnet.cz:9100/D1qbFGwvXLnd927JOcja1Q Done /DC=cz/DC=cesnet-ca/O=Masaryk University/CN=Miroslav Ruda
When you let notification client running several minutes without any incomming notification, it will finish and remove your registration from the server automatically.
\LB server and port to contact is specified with GLITE\_WMS\_NOTIF\_SERVER
environment variable.
+\TODO{ruda, what's supported in \LBold, what in \LBnew}
+
\verb'glite-lb-notify' support these actions:
\begin{tabularx}{\textwidth}{lX}
\subsubsection{Example: Registration and waiting for simple notification}
\label{e:notify}
-The two steps bellow describe basic testing procedure of the notification
+Following steps describe basic testing procedure of the notification
system by registering a notification on any state change of this job
and waiting for notification.
-Register notification:
+Register notification for given jobid:
\begin{verbatim}
- export EDG_WL_NOTIF_SERVER=HOSTNAME:9000
- ./glite-lb-notify new JOBID
+ GLITE_WMS_NOTIF_SERVER=skurut68-2.cesnet.cz:9100 bin/glite-lb-notify new \
+ -j https://skurut68-2.cesnet.cz:9100/D1qbFGwvXLnd927JOcja1Q
+
+ returns:
+ notification ID: https://skurut68-2.cesnet.cz:9100/NOTIF:tOsgB19Wz-M884anZufyUw
\end{verbatim}
-Wait for notification:
+
+Wait for notification (with timeout 120 seconds):
\begin{verbatim}
- TODO
+ GLITE_WMS_NOTIF_SERVER=skurut68-2.cesnet.cz:9100 bin/glite-lb-notify receive \
+ -i 120 https://skurut68-2.cesnet.cz:9100/NOTIF:tOsgB19Wz-M884anZufyUw
\end{verbatim}
+Destroy notification:
+\begin{verbatim}
+ GLITE_WMS_NOTIF_SERVER=skurut68-2.cesnet.cz:9100 bin/glite-lb-notify destroy \
+\end{verbatim}
+
+\TODO{ruda, end of notification, set validity for two hours}
+
When you let notification client running several minutes without any incomming notification, it will finish and remove your registration from the server automatically.
\subsubsection{Example: Waiting for notifications on all user's jobs}