Skip to content

Commit bc29cfc

Browse files
committed
updated jobs and dockstore notebooks
1 parent 3b9b588 commit bc29cfc

File tree

2 files changed

+148
-139
lines changed

2 files changed

+148
-139
lines changed

jupyter-notebooks/tutorials/3_working_with_jobs.ipynb

Lines changed: 105 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,55 @@
3131
"id": "a4037156-e9ee-4b99-aee8-569772ae1d29",
3232
"metadata": {},
3333
"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"
3583
]
3684
},
3785
{
@@ -94,6 +142,7 @@
94142
"cell_type": "markdown",
95143
"id": "98017416-3d3c-4225-843f-8f2fa35be36b",
96144
"metadata": {
145+
"jp-MarkdownHeadingCollapsed": true,
97146
"tags": []
98147
},
99148
"source": [
@@ -183,6 +232,7 @@
183232
"cell_type": "markdown",
184233
"id": "69d43073-3e99-4ea2-8021-9104b4003e84",
185234
"metadata": {
235+
"jp-MarkdownHeadingCollapsed": true,
186236
"tags": []
187237
},
188238
"source": [
@@ -314,12 +364,7 @@
314364
" print(\"Process Title: {}\".format(process.title))\n",
315365
" print(\"Process Abstract: {}\".format(process.abstract))\n",
316366
" 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"
323368
]
324369
},
325370
{
@@ -339,8 +384,9 @@
339384
"metadata": {},
340385
"outputs": [],
341386
"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)"
344390
]
345391
},
346392
{
@@ -370,6 +416,50 @@
370416
" \"mode\": \"async\",\n",
371417
" \"response\": \"document\",\n",
372418
" \"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",
373463
" ],\n",
374464
" \"outputs\": [\n",
375465
" {\n",
@@ -420,7 +510,7 @@
420510
" time.sleep(5)\n",
421511
" job_status = job.get_status()\n",
422512
" \n",
423-
" # Print the job status\n",
513+
" # Print the job status once it has stopped running (i.e., succeded or failed)\n",
424514
" print(\"\\nStatus for job \\\"{}\\\" ({}): {}\\n\".format(job.id, datetime.now().strftime(\"%H:%M:%S\"),job_status.value))\n",
425515
" \n",
426516
"except requests.exceptions.HTTPError as e:\n",
@@ -484,7 +574,7 @@
484574
"metadata": {},
485575
"outputs": [],
486576
"source": [
487-
"print(\"{},{}\".format(my_process.id, job.id))\n",
577+
"print(\"Dismissing {}, job {}\\n\".format(my_process.id, job.id))\n",
488578
"response = job.dismiss()\n",
489579
"\n",
490580
"print(\"Response: \", response, \"\\n\")"
@@ -507,7 +597,7 @@
507597
"metadata": {},
508598
"outputs": [],
509599
"source": [
510-
"print(\"Jobs running for Process: \", my_process.id, \"\\n\")\n",
600+
"print(\"Jobs for Process: \", my_process.id, \"\\n\")\n",
511601
"\n",
512602
"jobs = process_service.get_jobs(my_process)\n",
513603
"\n",
@@ -526,9 +616,9 @@
526616
],
527617
"metadata": {
528618
"kernelspec": {
529-
"display_name": "sounder-sips-tutorial",
619+
"display_name": "Python 3 (ipykernel)",
530620
"language": "python",
531-
"name": "sounder-sips-tutorial"
621+
"name": "python3"
532622
},
533623
"language_info": {
534624
"codemirror_mode": {
@@ -540,7 +630,7 @@
540630
"name": "python",
541631
"nbconvert_exporter": "python",
542632
"pygments_lexer": "ipython3",
543-
"version": "3.11.0"
633+
"version": "3.10.5"
544634
}
545635
},
546636
"nbformat": 4,

0 commit comments

Comments
 (0)