|
31 | 31 | "id": "a4037156-e9ee-4b99-aee8-569772ae1d29",
|
32 | 32 | "metadata": {},
|
33 | 33 | "source": [
|
34 |
| - "### Imports" |
| 34 | + "## Imports" |
| 35 | + ] |
| 36 | + }, |
| 37 | + { |
| 38 | + "cell_type": "markdown", |
| 39 | + "id": "9b9dd885-56a9-4e46-889d-ca47144f7986", |
| 40 | + "metadata": { |
| 41 | + "tags": [] |
| 42 | + }, |
| 43 | + "source": [ |
| 44 | + "### See whether unity_sds_client is installed. If it is installed, this will show details of the package." |
| 45 | + ] |
| 46 | + }, |
| 47 | + { |
| 48 | + "cell_type": "code", |
| 49 | + "execution_count": null, |
| 50 | + "id": "db1492bd-600d-47f8-8bae-68c2108b1060", |
| 51 | + "metadata": {}, |
| 52 | + "outputs": [], |
| 53 | + "source": [ |
| 54 | + "pip show unity_sds_client" |
| 55 | + ] |
| 56 | + }, |
| 57 | + { |
| 58 | + "cell_type": "markdown", |
| 59 | + "id": "59276a75-1add-439d-b650-c61db81c0e94", |
| 60 | + "metadata": { |
| 61 | + "tags": [] |
| 62 | + }, |
| 63 | + "source": [ |
| 64 | + "### If unity_sds_client is NOT installed do an install. Otherwise skip this." |
| 65 | + ] |
| 66 | + }, |
| 67 | + { |
| 68 | + "cell_type": "code", |
| 69 | + "execution_count": null, |
| 70 | + "id": "7b30e677-6d0b-4544-adf8-3db6f2d395bb", |
| 71 | + "metadata": {}, |
| 72 | + "outputs": [], |
| 73 | + "source": [ |
| 74 | + "pip install unity_sds_client" |
| 75 | + ] |
| 76 | + }, |
| 77 | + { |
| 78 | + "cell_type": "markdown", |
| 79 | + "id": "27b413f7-e546-45f9-9c2f-4d670e25fec6", |
| 80 | + "metadata": {}, |
| 81 | + "source": [ |
| 82 | + "### Set up imports" |
35 | 83 | ]
|
36 | 84 | },
|
37 | 85 | {
|
|
94 | 142 | "cell_type": "markdown",
|
95 | 143 | "id": "98017416-3d3c-4225-843f-8f2fa35be36b",
|
96 | 144 | "metadata": {
|
| 145 | + "jp-MarkdownHeadingCollapsed": true, |
97 | 146 | "tags": []
|
98 | 147 | },
|
99 | 148 | "source": [
|
|
183 | 232 | "cell_type": "markdown",
|
184 | 233 | "id": "69d43073-3e99-4ea2-8021-9104b4003e84",
|
185 | 234 | "metadata": {
|
| 235 | + "jp-MarkdownHeadingCollapsed": true, |
186 | 236 | "tags": []
|
187 | 237 | },
|
188 | 238 | "source": [
|
|
314 | 364 | " print(\"Process Title: {}\".format(process.title))\n",
|
315 | 365 | " print(\"Process Abstract: {}\".format(process.abstract))\n",
|
316 | 366 | " print(\"Process Version: {}\".format(process.process_version))\n",
|
317 |
| - " print(\"\")\n", |
318 |
| - " print(process)\n", |
319 |
| - " \n", |
320 |
| - "# For example purposes, we will use the first process returned\n", |
321 |
| - "my_process = processes[0]\n", |
322 |
| - "print(\"\\n\\nSelected Process:\\n\\n{}\".format(my_process))" |
| 367 | + " print(\"\")\n" |
323 | 368 | ]
|
324 | 369 | },
|
325 | 370 | {
|
|
339 | 384 | "metadata": {},
|
340 | 385 | "outputs": [],
|
341 | 386 | "source": [
|
342 |
| - "process = process_service.get_process('l1b-cwl:develop')\n", |
343 |
| - "print(process)" |
| 387 | + "# For example purposes, we will use the a process with the id:version indicated below (taken from the list above)\n", |
| 388 | + "my_process = process_service.get_process('chirp:develop')\n", |
| 389 | + "print(my_process)" |
344 | 390 | ]
|
345 | 391 | },
|
346 | 392 | {
|
|
370 | 416 | " \"mode\": \"async\",\n",
|
371 | 417 | " \"response\": \"document\",\n",
|
372 | 418 | " \"inputs\": [\n",
|
| 419 | + " {\n", |
| 420 | + " \"id\": \"job_id\",\n", |
| 421 | + " \"data\": \"abc1234\"\n", |
| 422 | + " },\n", |
| 423 | + " {\n", |
| 424 | + " \"id\": \"input_processing_labels\",\n", |
| 425 | + " \"data\": [\"label1\", \"label2\"]\n", |
| 426 | + " },\n", |
| 427 | + " {\n", |
| 428 | + " \"id\": \"input_cmr_collection_name\",\n", |
| 429 | + " \"data\": \"C2011289787-GES_DISC\"\n", |
| 430 | + " },\n", |
| 431 | + " {\n", |
| 432 | + " \"id\": \"input_cmr_search_start_time\",\n", |
| 433 | + " \"data\": \"2016-08-22\"\n", |
| 434 | + " },\n", |
| 435 | + " {\n", |
| 436 | + " \"id\": \"input_cmr_search_stop_time\",\n", |
| 437 | + " \"data\": \"2016-09-06\"\n", |
| 438 | + " },\n", |
| 439 | + " {\n", |
| 440 | + " \"id\": \"input_cmr_edl_user\",\n", |
| 441 | + " \"data\": \"cmr_user\"\n", |
| 442 | + " },\n", |
| 443 | + " {\n", |
| 444 | + " \"id\": \"input_cmr_edl_pass\",\n", |
| 445 | + " \"data\": \"cmr_pass\"\n", |
| 446 | + " },\n", |
| 447 | + " {\n", |
| 448 | + " \"id\": \"output_collection_id\",\n", |
| 449 | + " \"data\": \"CHIRP_OUTPUT_COLLECTION\"\n", |
| 450 | + " },\n", |
| 451 | + " {\n", |
| 452 | + " \"id\": \"output_data_bucket\",\n", |
| 453 | + " \"data\": \"s3://unity-data-bucket\"\n", |
| 454 | + " },\n", |
| 455 | + " {\n", |
| 456 | + " \"id\": \"input_daac_collection_shortname\",\n", |
| 457 | + " \"data\": \"CHIRP_L1B\"\n", |
| 458 | + " },\n", |
| 459 | + " {\n", |
| 460 | + " \"id\": \"input_daac_collection_sns\",\n", |
| 461 | + " \"data\": \"arn:://SNS-arn\"\n", |
| 462 | + " }\n", |
373 | 463 | " ],\n",
|
374 | 464 | " \"outputs\": [\n",
|
375 | 465 | " {\n",
|
|
420 | 510 | " time.sleep(5)\n",
|
421 | 511 | " job_status = job.get_status()\n",
|
422 | 512 | " \n",
|
423 |
| - " # Print the job status\n", |
| 513 | + " # Print the job status once it has stopped running (i.e., succeded or failed)\n", |
424 | 514 | " print(\"\\nStatus for job \\\"{}\\\" ({}): {}\\n\".format(job.id, datetime.now().strftime(\"%H:%M:%S\"),job_status.value))\n",
|
425 | 515 | " \n",
|
426 | 516 | "except requests.exceptions.HTTPError as e:\n",
|
|
484 | 574 | "metadata": {},
|
485 | 575 | "outputs": [],
|
486 | 576 | "source": [
|
487 |
| - "print(\"{},{}\".format(my_process.id, job.id))\n", |
| 577 | + "print(\"Dismissing {}, job {}\\n\".format(my_process.id, job.id))\n", |
488 | 578 | "response = job.dismiss()\n",
|
489 | 579 | "\n",
|
490 | 580 | "print(\"Response: \", response, \"\\n\")"
|
|
507 | 597 | "metadata": {},
|
508 | 598 | "outputs": [],
|
509 | 599 | "source": [
|
510 |
| - "print(\"Jobs running for Process: \", my_process.id, \"\\n\")\n", |
| 600 | + "print(\"Jobs for Process: \", my_process.id, \"\\n\")\n", |
511 | 601 | "\n",
|
512 | 602 | "jobs = process_service.get_jobs(my_process)\n",
|
513 | 603 | "\n",
|
|
526 | 616 | ],
|
527 | 617 | "metadata": {
|
528 | 618 | "kernelspec": {
|
529 |
| - "display_name": "sounder-sips-tutorial", |
| 619 | + "display_name": "Python 3 (ipykernel)", |
530 | 620 | "language": "python",
|
531 |
| - "name": "sounder-sips-tutorial" |
| 621 | + "name": "python3" |
532 | 622 | },
|
533 | 623 | "language_info": {
|
534 | 624 | "codemirror_mode": {
|
|
540 | 630 | "name": "python",
|
541 | 631 | "nbconvert_exporter": "python",
|
542 | 632 | "pygments_lexer": "ipython3",
|
543 |
| - "version": "3.11.0" |
| 633 | + "version": "3.10.5" |
544 | 634 | }
|
545 | 635 | },
|
546 | 636 | "nbformat": 4,
|
|
0 commit comments