Deploying Statistica Models

This page guides to deploy Statistica models in TIBCO ModelOps by executing the modelops-client Python script from a Windows Command Prompt.

Statistica is a Windows-based Statistical and Predictive Analytics / Data Mining software that is used to author Data science and analytic reporting workspaces (i.e. binary files with a .sdm extension). The software is commonly used to provide analytic manufacturing support through SPC and Process-Monitoring specific techniques, including GxP compliant analytic reporting for the pharmaceutical and medical device industries.

TIBCO ModelOps is a Data science model management and operationalization platform that not only serves as a file repository to version control model artifacts but also allows you to configure and deploy data channels, scoring flows, and scoring pipelines to cloud environments.

In the context of TIBCO ModelOps, Statistica workspaces with workflows containing one defined input and one defined output Statistica nodes are referred to as Statistica models. Such models can be deployed, scored, and evaluated in TIBCO ModelOps.

The modelops-client script provides five simple commands.

  1. help
  2. version
  3. display
  4. deploy
  5. delete

These commands can be called from a client machine (i.e. say a Statistica model authoring machine).

The help command can be used to learn about the other available commands and their usage.

The version, display, deploy and delete commands communicate with a running instance of TIBCO ModelOps to perform their functionality.

The following prerequisites must be installed on the machine before executing the modelops-client script from a Command Prompt.

  1. Python (version 3.6 or above)
  2. Statistica Engine (version 14.0.0.15)

Note: When you obtain third-party software or services, it is your responsibility to ensure you understand the license terms associated with such third-party software or services and comply with such terms.

Statistica Engine is available as a zip file and can be downloaded using the link provided above. Once downloaded, unzip it to start using the Statistica Engine executable (stat.exe).

Both python and stat executables must be added to the System Path variable and should be available for execution from anywhere on the Command Prompt. Meaning, using the following commands from the Command Prompt should work without any issues showing the versions of the respective programs.

python --version

  1. Python 3.8.6

stat --version

  1. Statistica Engine 14.0.0.15

Note:

  1. The deploy command supported by the modelops-client script expects Statistica Engine to be available for automatic Avro schema generation from Statistica models. Model input and output schema in Avro format are required to score models on TIBCO ModelOps server.

  2. Commands like version, delete, and display do not require this dependency and work as-is on other OS platforms outside of Windows. But the core functionality to automatically import and deploy Statistica model artifacts in TIBCO ModelOps is provided by the deploy command.

The modelops-client script has a dependency on Python requests module. Verify or automatically fulfill this requirement using the following command.

pip install requests

Note:

If pip does not work then download get-pip.py using curl.

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py

If curl is not available, download and install it from here, curl

Then running the following command should get pip installations working on your machine.

py get-pip.py

More detailed instructions on how to install pip are here, pip installation

Note: When you obtain third-party software or services, it is your responsibility to ensure you understand the license terms associated with such third-party software or services and comply with such terms.

Copy the modelops-client.py to a convenient location on the client machine and execute the following commands from that location. For example, if the script was copied directly to c drive, open the Command Prompt and change to c:\> before using the following commands.

python modelops-client.py --help

  1. usage: modelops-client.py [-h] {display,deploy,delete,version} ...
  2.  
  3. Execute Statistica models in TIBCO ModelOps.
  4. positional arguments: {display,deploy,delete,version}
  5.  
  6. display Display running data sources and sinks, environments, and currently running jobs
  7. deploy Create and deploy the required artifacts for scoring a Statistica model
  8. delete Delete a project and its contents or cancel a running job
  9. version Display TIBCO ModelOps server version
  10.  
  11. optional arguments:
  12. -h, --help show this help message and exit

python modelops-client.py version --help

  1. usage: modelops-client.py version [-h] [--address ADDRESS] [--password PASSWORD] [--verbose VERBOSE] [--user USER]
  2.  
  3. optional arguments:
  4. -h, --help show this help message and exit
  5. --address ADDRESS, -a ADDRESS
  6. TIBCO ModelOps URL (default http://localhost:2185)
  7. --password PASSWORD, -p PASSWORD
  8. Password
  9. --verbose VERBOSE, -v VERBOSE
  10. Verbose logging for diagnostic purposes
  11. --user USER, -u USER Username (default=admin)

Example:

  1. python modelops-client.py version \
  2. --address https://modelops-server.qamodelops.streamingaz.tibcocloud.com/ \
  3. --user admin

Note: There is a prompt for typing in Password. If you prefer to directly provide the password with the command, use the –password (or -p) parameter. It is advisable to type in your password at the prompt for better security.

  1. Password:
  2. Version: 1.0.0
  3. Timestamp: 2021-06-24 10:49:34 UTC
  4. Name: TIBCO ModelOps Server
  5. Git URL: https://github.com/tibco/ep-modelops.git/modelops-server
  6. Git Commit: 0226f42bbd9dafa47622603bb4771633c9d74162

python modelops-client.py display --help

  1. usage: modelops-client.py display [-h] [--address ADDRESS] [--channel CHANNEL] [--job JOB] [--password PASSWORD] [--verbose VERBOSE] [--user USER]
  2.  
  3. optional arguments:
  4. -h, --help show this help message and exit
  5. --address ADDRESS, -a ADDRESS
  6. TIBCO ModelOps URL (default=http://localhost:2185)
  7. --channel CHANNEL, -c CHANNEL
  8. Data channel name
  9. --job JOB, -j JOB Job name
  10. --password PASSWORD, -p PASSWORD
  11. Password
  12. --verbose VERBOSE, -v VERBOSE
  13. --user USER, -u USER Username (default=admin)

Example:

  1. python modelops-client.py display \
  2. --address https://modelops-server.qamodelops.streamingaz.tibcocloud.com/ \
  3. --user admin

Note: Password for the command was provided at the prompt.

  1. Password:
  2.  
  3. Available environments (4):
  4. ---------------------------
  5. Development
  6. Production
  7. Testing
  8. Data-Channels
  9.  
  10. Running jobs (8):
  11. ------------------
  12. python-source
  13. kafka-credit-rating-sink
  14. Audit-kafka-datasource
  15. audit-source
  16. iris-kafka-source
  17. race-car-kafka-source-4-pipeline-a-thon
  18. Audit-kafka-datasink
  19. race-car-kafka-sink-4-pipeline-a-thon
  20.  
  21. Data channels (8):
  22. -------------------
  23.  
  24. Name: python-source
  25. ID: kafka-datasource-8xsv7
  26. Type: SOURCE
  27. Environment: datachannels
  28.  
  29. Name: kafka-credit-rating-sink
  30. ID: kafka-datasink-jc456
  31. Type: SINK
  32. Environment: datachannels
  33.  
  34. Name: audit-source
  35. ID: kafka-datasource-96dnx
  36. Type: SOURCE
  37. Environment: datachannels
  38.  
  39. Name: Audit-kafka-datasource
  40. ID: kafka-datasource-5gbv8
  41. Type: SOURCE
  42. Environment: datachannels
  43.  
  44. Name: iris-kafka-source
  45. ID: kafka-datasource-24wcc
  46. Type: SOURCE
  47. Environment: development
  48.  
  49. Name: race-car-kafka-source-4-pipeline-a-thon
  50. ID: kafka-datasource-fhmwr
  51. Type: SOURCE
  52. Environment: production
  53.  
  54. Name: Audit-kafka-datasink
  55. ID: kafka-datasink-5hfrx
  56. Type: SINK
  57. Environment: datachannels
  58.  
  59. Name: race-car-kafka-sink-4-pipeline-a-thon
  60. ID: kafka-datasink-fmc7f
  61. Type: SINK
  62. Environment: production

Example 1 (SOURCE):

  1. python modelops-client.py display \
  2. --address https://modelops-server.qamodelops.streamingaz.tibcocloud.com/ \
  3. --user admin \
  4. --channel "kafka-credit-rating-source"

Note: Password for the command was provided at the prompt.

  1. Password:
  2.  
  3. Data channels (1):
  4. ------------------
  5. Name: kafka-credit-rating-source
  6. ID: kafka-datasource-7dw5z
  7. Type: SOURCE
  8. Environment: testing
  9. JSON schema:
  10. {
  11. "additionalProperties": false,
  12. "properties": {
  13. "Age": {
  14. "format": "double",
  15. "ordinal": 13,
  16. "type": "number"
  17. },
  18. "Amount_of_Credit": {
  19. "format": "double",
  20. "ordinal": 5,
  21. "type": "number"
  22. },
  23. "Balance_of_Current_Account": {
  24. "ordinal": 1,
  25. "type": "string"
  26. },
  27. "Credit_Rating": {
  28. "ordinal": 0,
  29. "type": "string"
  30. },
  31. "Credit_Rating_EXPECTED": {
  32. "ordinal": 18,
  33. "type": "string"
  34. },
  35. "Duration_of_Credit": {
  36. "format": "double",
  37. "ordinal": 2,
  38. "type": "number"
  39. },
  40. "Employed_by_Current_Employer_for": {
  41. "ordinal": 7,
  42. "type": "string"
  43. },
  44. "Further_running_credits": {
  45. "ordinal": 14,
  46. "type": "string"
  47. },
  48. "Gender": {
  49. "ordinal": 10,
  50. "type": "string"
  51. },
  52. "Installment_in_percent_of_Available_Income": {
  53. "ordinal": 8,
  54. "type": "string"
  55. },
  56. "Living_in_Current_Household_for": {
  57. "ordinal": 11,
  58. "type": "string"
  59. },
  60. "Marital_Status": {
  61. "ordinal": 9,
  62. "type": "string"
  63. },
  64. "Most_Valuable_Assets": {
  65. "ordinal": 12,
  66. "type": "string"
  67. },
  68. "Number_of_previous_credits_at_this_bank": {
  69. "ordinal": 16,
  70. "type": "string"
  71. },
  72. "Occupation": {
  73. "ordinal": 17,
  74. "type": "string"
  75. },
  76. "Payment_of_Previous_Credits": {
  77. "ordinal": 3,
  78. "type": "string"
  79. },
  80. "Purpose_of_Credit": {
  81. "ordinal": 4,
  82. "type": "string"
  83. },
  84. "Type_of_Apartment": {
  85. "ordinal": 15,
  86. "type": "string"
  87. },
  88. "Value_of_Savings": {
  89. "ordinal": 6,
  90. "type": "string"
  91. }
  92. },
  93. "required": [
  94. "Credit_Rating",
  95. "Balance_of_Current_Account",
  96. "Duration_of_Credit",
  97. "Payment_of_Previous_Credits",
  98. "Purpose_of_Credit",
  99. "Amount_of_Credit",
  100. "Value_of_Savings",
  101. "Employed_by_Current_Employer_for",
  102. "Installment_in_percent_of_Available_Income",
  103. "Marital_Status",
  104. "Gender",
  105. "Living_in_Current_Household_for",
  106. "Most_Valuable_Assets",
  107. "Age",
  108. "Further_running_credits",
  109. "Type_of_Apartment",
  110. "Number_of_previous_credits_at_this_bank",
  111. "Occupation",
  112. "Credit_Rating_EXPECTED"
  113. ],
  114. "title": "Credit_Rating_Challenger_Input_Schema",
  115. "type": "object"
  116. }

Example 2 (SINK)

  1. python modelops-client.py display \
  2. --address https://modelops-server.qamodelops.streamingaz.tibcocloud.com/
  3. --user admin
  4. --channel "kafka-credit-rating-sink"

Note: Password for the command was provided at the prompt.

  1. Password:
  2.  
  3. Data channels (1):
  4. ------------------
  5. Name: kafka-credit-rating-sink
  6. ID: kafka-datasink-jc456
  7. Type: SINK
  8. Environment: datachannels
  9. JSON schema:
  10. {
  11. "additionalProperties": false,
  12. "properties": {
  13. "Boosted_Classification_TreesPred": {
  14. "ordinal": 1,
  15. "type": "string"
  16. },
  17. "Boosted_Classification_TreesRes": {
  18. "ordinal": 2,
  19. "type": "string"
  20. },
  21. "Boosted_Classification_Treesbad": {
  22. "format": "double",
  23. "ordinal": 3,
  24. "type": "number"
  25. },
  26. "Boosted_Classification_Treesgood": {
  27. "format": "double",
  28. "ordinal": 4,
  29. "type": "number"
  30. },
  31. "Credit_Rating": {
  32. "ordinal": 0,
  33. "type": "string"
  34. }
  35. },
  36. "required": [
  37. "Credit_Rating",
  38. "Boosted_Classification_TreesPred",
  39. "Boosted_Classification_TreesRes",
  40. "Boosted_Classification_Treesbad",
  41. "Boosted_Classification_Treesgood"
  42. ],
  43. "title": "Credit_Rating_Challenger_Output_Schema",
  44. "type": "object"
  45. }

Example 1 (source-channel):

  1. python modelops-client.py display \
  2. --address https://modelops-server.qamodelops.streamingaz.tibcocloud.com/ \
  3. --user admin \
  4. --job "race-car-kafka-source-4-pipeline-a-thon"

Note: Password for the command was provided at the prompt.

  1. Password:
  2.  
  3. Job status:
  4. -----------
  5. race-car-kafka-source-4-pipeline-a-thon is RUNNING
  6.  
  7. Job Status response:
  8. {
  9. "@class": "com.tibco.ep.ams.model.response.JobStatusRecord",
  10. "jobIdentifier": "kafka-datasource-fhmwr",
  11. "jobName": "race-car-kafka-source-4-pipeline-a-thon",
  12. "specification": "kafka-datasource",
  13. "version": "latest",
  14. "namespace": "datachannels",
  15. "externalNamespaces": [],
  16. "durationMinutes": 0,
  17. "username": "admin",
  18. "additionalData": "{\"jobName\":\"race-car-kafka-source-4-pipeline-a-thon\",\"userName\":\"admin\",\"jobDescription\":\"Race car Kafka source channel to use for pipeline-a-thon projects.\",\"artifactRevisionId\":null,\"arti
  19. factCheckOutId\":\"4801c21a4be941d6ae4af0d023d57a5e\",\"artifactName\":\"/kafka-source-race.datachannel\",\"artifactProjectName\":\"kafka-data-channel\",\"artifactAuthor\":\"admin\",\"artifactCreatedOn\":\"2021-06-24 17:24:33.0
  20. 18 GMT\",\"artifactUpdatedOn\":\"2021-06-24 17:24:39.758 GMT\",\"deployTime\":\"Thu Jun 24 2021 12:28:36 GMT-0500\"}",
  21. "status": "RUNNING",
  22. "trace": true,
  23. "tasks": [
  24. {
  25. "@class": "com.tibco.ep.ams.model.response.TaskRecord",
  26. "taskIdentifier": "kafka-datasource-fhmwr",
  27. "status": "RUNNING",
  28. "creationTimestamp": "2021-06-24T17:28:37Z",
  29. "message": "Tasks Completed: 1 (Failed: 0, Cancelled 0), Incomplete: 2, Skipped: 0"
  30. }
  31. ]
  32. }

Example 2 (scoring-pipeline):

  1. python modelops-client.py display \
  2. --address https://modelops-server.qamodelops.streamingaz.tibcocloud.com/ \
  3. --user admin \
  4. --job "I-P-CM-C-O"

Note: Password for the command was provided at the prompt.

  1. Password:
  2.  
  3. Job status:
  4. -----------
  5. I-P-CM-C-O is RUNNING
  6.  
  7. Job Status response:
  8. {
  9. "@class": "com.tibco.ep.ams.model.response.JobStatusRecord",
  10. "jobIdentifier": "scoringpipeline-rhgq9",
  11. "jobName": "I-P-CM-C-O",
  12. "specification": "scoringpipeline",
  13. "version": "latest",
  14. "namespace": "datachannels",
  15. "externalNamespaces": [],
  16. "durationMinutes": 0,
  17. "username": "admin",
  18. "additionalData": "{\"jobName\":\"I-P-CM-C-O\",\"userName\":\"admin\",\"jobDescription\":\"\",\"artifactRevisionId\":null,\"artifactCheckOutId\":\"335e5fb39a404aac81747e0ebe104735\",\"artifactName\":\"/i-p-c-cm-o.scoringpipeline
  19. \",\"artifactProjectName\":\"Sachin\",\"artifactAuthor\":\"admin\",\"artifactCreatedOn\":\"2021-06-29 11:07:43.238 GMT\",\"artifactUpdatedOn\":\"2021-06-29 11:08:29.497 GMT\",\"deployTime\":\"Tue Jun 29 2021 16:39:35 GMT+0530\"}",
  20. "status": "RUNNING",
  21. "trace": true,
  22. "tasks": [
  23. {
  24. "@class": "com.tibco.ep.ams.model.response.TaskRecord",
  25. "taskIdentifier": "scoringpipeline-rhgq9",
  26. "status": "RUNNING",
  27. "creationTimestamp": "2021-06-29T11:09:36Z",
  28. "message": "Tasks Completed: 1 (Failed: 0, Cancelled 0), Incomplete: 2, Skipped: 0"
  29. }
  30. ]
  31. }

python modelops-client.py deploy --help

  1. usage: modelops-client.py deploy [-h] [--address ADDRESS] [--debug DEBUG] [--duration DURATION] [--environment ENVIRONMENT] [--file FILE] [--password PASSWORD] [--project PROJECT] [--save SAVE] [--source SOURCE] [--sink SINK]
  2. [--verbose VERBOSE] [--user USER]
  3.  
  4. optional arguments:
  5. -h, --help show this help message and exit
  6. --address ADDRESS, -a ADDRESS
  7. TIBCO ModelOps URL (default=http://localhost:2185)
  8. --debug DEBUG, -d DEBUG
  9. Flag to enable debug diagnostics
  10. --duration DURATION, -r DURATION
  11. Duration (minutes) to run the scoring pipeline (default=0 to run forever)
  12. --environment ENVIRONMENT, -e ENVIRONMENT
  13. Target environment. Multiple environment names must be comma separated. (default=Development)
  14. --file FILE, -f FILE Model file
  15. --password PASSWORD, -p PASSWORD
  16. Password
  17. --project PROJECT, -n PROJECT
  18. User provided project name
  19. --save SAVE, -s SAVE Flag to save or auto-delete the project in TIBCO ModelOps (default=True)
  20. --source SOURCE, -i SOURCE
  21. Source channel name
  22. --sink SINK, -o SINK Sink channel name
  23. --verbose VERBOSE, -v VERBOSE
  24. Verbose logging for diagnostic purposes
  25. --user USER, -u USER Username (default = admin)

When using the deploy command without a project name, the program creates a time-stamped project folder in TIBCO ModelOps using the provided model file name. For example, if a model file named “credit rating.sdm” was intended to be deployed to TIBCO ModelOps, the program internally creates a project name similar to credit-rating-0123456789. Note the deployment time stamp added at the end of the project name to uniquely identify it.

If a project name argument is provided then the program uses the same name and imports all created model artifacts into it.

Warning: If a project with the same name as provided by the user already exists in TIBCO ModelOps, its contents would be automatically updated during the import process.

  1. python modelops-client.py deploy \
  2. --address https://modelops-server.qamodelops.streamingaz.tibcocloud.com/ \
  3. --user admin \
  4. --environment Development \
  5. --file "C:\ModelOps\credit-rating.sdm" \
  6. --source "kafka-credit-rating-source" \
  7. --sink "kafka-credit-rating-sink" \
  8. --duration 30

Note: Password for the command was provided at the prompt.

  1. Password:
  2. Creating temporary model folders...
  3. Temp folder path: C:\Users\kgunasek\AppData\Local\Temp\STAT-modelops-client-u7lgqd6p
  4. Generating model schemas...
  5. Creating scoring flow...
  6. Creating scoring pipeline...
  7. Creating meta-data file to bind model with schemas, scoring flow and pipeline...
  8. Importing model artifacts zip file...
  9. Deleting C:\Users\kgunasek\AppData\Local\Temp\STAT-modelops-client-u7lgqd6p
  10. Deploying scoring pipeline...
  11. In approve scoring pipeline!
  12. In checkout scoring pipeline!
  13. -----------------------------------------------------------------------------------
  14. Scheduled deployment job name: credit-rating-1625192455-scoring-pipeline-1625192470
  15. -----------------------------------------------------------------------------------
  16. Deploy scoring pipeline response:
  17. {
  18. "status": 0,
  19. "startRow": 0,
  20. "endRow": 1,
  21. "totalRows": 1,
  22. "errorCode": null,
  23. "errorMessage": null,
  24. "responseMessage": null,
  25. "record": [
  26. {
  27. "@class": "com.tibco.ep.ams.model.response.JobStatusRecord",
  28. "jobIdentifier": "scoringpipeline-6pw2d",
  29. "externalNamespaces": [],
  30. "durationMinutes": 0,
  31. "status": "PENDING",
  32. "trace": false,
  33. "tasks": []
  34. }
  35. ]
  36. }

After a few seconds run the display command with the scheduled pipeline deployment job name returned by the previous deploy command. The pipeline should be in a RUNNING state.

  1. python modelops-client.py display \
  2. --address https://modelops-server.qamodelops.streamingaz.tibcocloud.com/ \
  3. --user admin \
  4. --job "credit-rating-1625192455-scoring-pipeline-1625192470"

Note: Password for the command was provided at the prompt.

  1. Password:
  2.  
  3. Job status:
  4. -----------
  5. credit-rating-1625192455-scoring-pipeline-1625192470 is RUNNING
  6.  
  7. Job Status response:
  8. {
  9. "@class": "com.tibco.ep.ams.model.response.JobStatusRecord",
  10. "jobIdentifier": "scoringpipeline-6pw2d",
  11. "jobName": "credit-rating-1625192455-scoring-pipeline-1625192470",
  12. "specification": "scoringpipeline",
  13. "version": "latest",
  14. "namespace": "development",
  15. "externalNamespaces": [],
  16. "durationMinutes": 30,
  17. "username": "admin",
  18. "additionalData": "{\"jobName\": \"credit-rating-1625192455-scoring-pipeline-1625192470\", \"userName\": \"admin\", \"jobDescription\": \"Scoring pipeline deployed using Statistica integration script.\", \"artifactRevisionId\": nul
  19. l, \"artifactCheckOutId\": \"89744a136df345e4b8ba47b0226988dd\", \"artifactName\": \"/credit-rating.scoringpipeline\", \"artifactProjectName\": \"credit-rating-1625192455\", \"artifactAuthor\": \"admin\", \"deployTime\": \"2021-07-02 0
  20. 2:21:10.409 GMT\"}",
  21. "status": "RUNNING",
  22. "trace": true,
  23. "tasks": [
  24. {
  25. "@class": "com.tibco.ep.ams.model.response.TaskRecord",
  26. "taskIdentifier": "scoringpipeline-6pw2d",
  27. "status": "RUNNING",
  28. "creationTimestamp": "2021-07-02T02:21:13Z",
  29. "message": "Tasks Completed: 1 (Failed: 0, Cancelled 0), Incomplete: 2, Skipped: 0"
  30. }
  31. ]
  32. }

In this example, we provide the project name using the –project argument.

  1. python modelops-client.py deploy \
  2. --address https://modelops-server.qamodelops.streamingaz.tibcocloud.com/ \
  3. --user admin \
  4. --environment Development \
  5. --file "C:\ModelOps\credit-rating.sdm" \
  6. --source "kafka-credit-rating-source" \
  7. --sink "kafka-credit-rating-sink" \
  8. --project "credit rating scoring test" \
  9. --duration 30

Note: Password for the command was provided at the prompt.

  1. Password:
  2. Creating temporary model folders...
  3. Temp folder path: C:\Users\kgunasek\AppData\Local\Temp\STAT-modelops-client-xmp0iol5
  4. Generating model schemas...
  5. Creating scoring flow...
  6. Creating scoring pipeline...
  7. Creating meta-data file to bind model with schemas, scoring flow and pipeline...
  8. Importing model artifacts zip file...
  9. Deleting C:\Users\kgunasek\AppData\Local\Temp\STAT-modelops-client-xmp0iol5
  10. Deploying scoring pipeline...
  11. In approve scoring pipeline!
  12. In checkout scoring pipeline!
  13. -------------------------------------------------------------------------------------
  14. Scheduled deployment job name: credit rating scoring test-scoring-pipeline-1625194110
  15. -------------------------------------------------------------------------------------
  16. Deploy scoring pipeline response:
  17. {
  18. "status": 0,
  19. "startRow": 0,
  20. "endRow": 1,
  21. "totalRows": 1,
  22. "errorCode": null,
  23. "errorMessage": null,
  24. "responseMessage": null,
  25. "record": [
  26. {
  27. "@class": "com.tibco.ep.ams.model.response.JobStatusRecord",
  28. "jobIdentifier": "scoringpipeline-fd6r7",
  29. "externalNamespaces": [],
  30. "durationMinutes": 0,
  31. "status": "PENDING",
  32. "trace": false,
  33. "tasks": []
  34. }
  35. ]
  36. }
  37.  
  38.  
  39. python modelops-client.py display \
  40. --address https://modelops-server.qamodelops.streamingaz.tibcocloud.com/ \
  41. --user admin \
  42. --job "credit rating scoring test-scoring-pipeline-625194110"

Note: Password for the command was provided at the prompt.

  1. Password:
  2.  
  3. Job status:
  4. -----------
  5. credit rating scoring test-scoring-pipeline-1625194110 is RUNNING
  6.  
  7. Job Status response:
  8. {
  9. "@class": "com.tibco.ep.ams.model.response.JobStatusRecord",
  10. "jobIdentifier": "scoringpipeline-fd6r7",
  11. "jobName": "credit rating scoring test-scoring-pipeline-1625194110",
  12. "specification": "scoringpipeline",
  13. "version": "latest",
  14. "namespace": "development",
  15. "externalNamespaces": [],
  16. "durationMinutes": 30,
  17. "username": "admin",
  18. "additionalData": "{\"jobName\": \"credit rating scoring test-scoring-pipeline-1625194110\", \"userName\": \"admin\", \"jobDescription\": \"Scoring pipeline deployed using Statistica integration script.\", \"artifactRevisionId\": n
  19. ull, \"artifactCheckOutId\": \"96e8ee02a82542818b9e570c86d59e54\", \"artifactName\": \"/credit-rating.scoringpipeline\", \"artifactProjectName\": \"credit rating scoring test\", \"artifactAuthor\": \"admin\", \"deployTime\": \"2021-07-
  20. 02 02:48:30.655 GMT\"}",
  21. "status": "RUNNING",
  22. "trace": true,
  23. "tasks": [
  24. {
  25. "@class": "com.tibco.ep.ams.model.response.TaskRecord",
  26. "taskIdentifier": "scoringpipeline-6pw2d",
  27. "status": "RUNNING",
  28. "creationTimestamp": "2021-07-02T02:48:33Z",
  29. "message": "Tasks Completed: 1 (Failed: 0, Cancelled 0), Incomplete: 2, Skipped: 0"
  30. }
  31. ]
  32. }

python modelops-client.py delete --help

  1. usage: modelops-client.py delete [-h] [--address ADDRESS] [--job JOB] [--password PASSWORD] [--project PROJECT] [--verbose VERBOSE] [--user USER]
  2.  
  3. optional arguments:
  4. -h, --help show this help message and exit
  5. --address ADDRESS, -a ADDRESS
  6. TIBCO ModelOps URL (default http://localhost:2185)
  7. --job JOB, -j JOB Running job identifier
  8. --password PASSWORD, -p PASSWORD
  9. Password
  10. --project PROJECT, -n PROJECT
  11. Project name
  12. --verbose VERBOSE, -v VERBOSE
  13. Verbose logging for diagnostic purposes
  14. --user USER, -u USER Username (default=admin)

The delete command can be used to either remove a project created on server or delete a running job that was started by you.

  1. python modelops-client.py delete \
  2. --address https://modelops-server.qamodelops.streamingaz.tibcocloud.com/ \
  3. --user admin \
  4. --project "credit rating scoring test" \
  5. --job race-car-pipleline-test3

Note: Password for the command was provided at the prompt. If a job name was not provided the program mentions that and also provides a list of running jobs to look at and consider for deletion.

  1. Password:
  2. Deleting project [credit rating scoring test] on server...
  3.  
  4. User has permissions to delete job race-car-pipleline-test3
  5. The job id is scoringpipeline-kc45d
  6.  
  7. Job status:
  8. -----------
  9. race-car-pipleline-test3 is RUNNING
  10.  
  11. Job Status response:
  12. {
  13. "@class": "com.tibco.ep.ams.model.response.JobStatusRecord",
  14. "jobIdentifier": "scoringpipeline-kc45d",
  15. "jobName": "race-car-pipleline-test3",
  16. "specification": "scoringpipeline",
  17. "version": "latest",
  18. "namespace": "development",
  19. "externalNamespaces": [],
  20. "durationMinutes": 0,
  21. "username": "admin",
  22. "additionalData": "{\"jobName\":\"race-car-pipleline-test3\",\"userName\":\"admin\",\"jobDescription\":\"\",\"artifactRevisionId\":null,\"artifactCheckOutId\":\"79ab474c09804a81a4ce4d95479a69fa\",\"artifactName\":\"/racecar.scoringpipeline\",\"artifactProjectName\":\"admin-racecar\",\"artifactAuthor\":\"admin\",\"artifactCreatedOn\":\"2021-07-02 23:21:37.188 GMT\",\"artifactUpdatedOn\":\"2021-07-02 23:22:19.252 GMT\",\"deployTime\":\"Fri Jul 02
  23. 2021 18:23:01 GMT-0500\"}",
  24. "status": "RUNNING",
  25. "trace": true,
  26. "tasks": [
  27. {
  28. "@class": "com.tibco.ep.ams.model.response.TaskRecord",
  29. "taskIdentifier": "scoringpipeline-kc45d",
  30. "status": "RUNNING",
  31. "creationTimestamp": "2021-07-02T23:23:04Z",
  32. "message": "Tasks Completed: 1 (Failed: 0, Cancelled 0), Incomplete: 2, Skipped: 0"
  33. }
  34. ]
  35. }

The immediate job status returned after deleting (i.e. canceling) the job is RUNNING. We can confirm the cancellation status of the job by running the display command after a few seconds.

  1. python modelops-client.py display \
  2. --address https://modelops-server.qamodelops.streamingaz.tibcocloud.com/ \
  3. --user admin \
  4. --job race-car-pipleline-test3

Note: Password for the command was provided at the prompt.

  1. Password:
  2.  
  3. Job status:
  4. -----------
  5. race-car-pipleline-test3 - CANCELLED
  6.  
  7. Job Status response:
  8. {
  9. "@class": "com.tibco.ep.ams.model.response.JobStatusRecord",
  10. "jobIdentifier": "scoringpipeline-kc45d",
  11. "jobName": "race-car-pipleline-test3",
  12. "specification": "scoringpipeline",
  13. "version": "latest",
  14. "namespace": "development",
  15. "externalNamespaces": [],
  16. "durationMinutes": 0,
  17. "username": "admin",
  18. "additionalData": "{\"jobName\":\"race-car-pipleline-test3\",\"userName\":\"admin\",\"jobDescription\":\"\",\"artifactRevisionId\":null,\"artifactCheckOutId\":\"79ab474c09804a81a4ce4d95479a69fa\",\"artifactName\":\"/racecar
  19. .scoringpipeline\",\"artifactProjectName\":\"admin-racecar\",\"artifactAuthor\":\"admin\",\"artifactCreatedOn\":\"2021-07-02 23:21:37.188 GMT\",\"artifactUpdatedOn\":\"2021-07-02 23:22:19.252 GMT\",\"deployTime\":\"Fri Jul 02
  20. 2021 18:23:01 GMT-0500\"}",
  21. "status": "CANCELLED",
  22. "trace": true,
  23. "tasks": [
  24. {
  25. "@class": "com.tibco.ep.ams.model.response.TaskRecord",
  26. "taskIdentifier": "scoringpipeline-kc45d",
  27. "status": "CANCELLED",
  28. "creationTimestamp": "2021-07-02T23:23:04Z",
  29. "completionTimestamp": "2021-07-06T16:15:37Z",
  30. "message": "Tasks Completed: 3 (Failed: 0, Cancelled 1), Skipped: 0"
  31. }
  32. ]
  33. }