Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRAFT: removing username maap-py listJobs & submitJob #453

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions docs/source/science/GEDI/GEDI_L4A.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,6 @@
" algo_id=\"gedi-subset\",\n",
" version=\"0.6.0\",\n",
" queue=\"maap-dps-worker-32gb\",\n",
" username=username,\n",
" **inputs,\n",
")\n",
"\n",
Expand Down Expand Up @@ -970,7 +969,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python 3.12.4 64-bit",
"language": "python",
"name": "python3"
},
Expand All @@ -984,7 +983,12 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
"version": "3.12.4"
},
"vscode": {
"interpreter": {
"hash": "b0fa6594d8f4cbf19f97940f81e996739fb7646882a419484c72d19e05852a7e"
}
}
},
"nbformat": 4,
Expand Down
25 changes: 13 additions & 12 deletions docs/source/system_reference_guide/jobs_maappy.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
"\n",
"![submit_job_4.png](../_static/faq_images/submit_job_4.png)\n",
"\n",
"2. Provide the MAAP host. For normal operations, this would be `api.maap-project.org`.\n",
"\n",
"```\n",
"from maap.maap import MAAP\n",
"maap = MAAP()\n",
Expand Down Expand Up @@ -94,7 +92,7 @@
"source": [
"## Submit a Job\n",
"\n",
"Use the `submitJob` method and provide your algorithm inputs. The example below will run the `run-dps-test_ubuntu` algorithm. Be sure to put your username in the submitJob() call where indicated below.\n",
"Use the `submitJob` method and provide your algorithm inputs. The example below will run the `run-dps-test_ubuntu` algorithm. \n",
"\n",
".. note::\n",
"Experimental feature: The output data will be put into a folder named for your `algo_id` and the `identifier`. You can use the same `idenfitier` on several jobs (e.g. in a batch) to group related output data in one place. In the [View & Submit Jobs GUI](jobsui.ipynb#Submit-a-Job) this is the Job Tag field in the Submit form.\n",
Expand All @@ -103,7 +101,6 @@
"maap.submitJob(identifier=\"test-job\", \n",
" algo_id=\"run-dps-test_ubuntu\",\n",
" version=\"delay10\",\n",
" username=\"YOUR_USERNAME_HERE\",\n",
" queue=\"maap-dps-worker-8gb\",\n",
" input_file=\"https://raw.githubusercontent.com/MAAP-Project/dps-unit-test/main/README.md\")\n",
"```\n",
Expand Down Expand Up @@ -203,10 +200,10 @@
"source": [
"## List Jobs\n",
"\n",
"1. Use the `listJobs` method, specifying a username, to retrieve a list of jobs that user has submitted.\n",
"1. Use the `listJobs` method to retrieve a list of jobs that the current user (determined by the `MAAP_PGT` token environment variable) has submitted.\n",
"\n",
"```\n",
"r = maap.listJobs(\"mlucas\")\n",
"r = maap.listJobs()\n",
"print(r.text)\n",
"```\n",
"\n",
Expand All @@ -216,17 +213,16 @@
"{\"code\": 200, \"jobs\": [{\"b308b3cd-8848-4154-b682-aaf3d39734ee\": {\"resource\": \"job\", \"payload_hash\": \"0f217c35a6bdacf46b164106af9ab473\", \"job_id\": \"job-dps_tutorial_mlucas_test__main-20240626T172521.763123Z\", \"status\": \"job-completed\", \"context\": {\"tag\": \"test-new\", \"_prov\": {\"wasGeneratedBy\": \"task_id:a4761c87-dc68-4511-9a3e-e628446f1e44\", \"wasDerivedFrom\": [\"url:https://photojournal.jpl.nasa.gov/tiff/PIA00127.tif\"]}, \"container_image_name\": \"container-dps_tutorial:main\", \"outsize\": 30, \"container_specification\": {\"version\": \"main\", \"digest\": \"sha256:e539186c9e76fb923da7b3bfb6a3c700403e5302a71c3e8ba8635b7f216ab7e3\", \"id\": \"container-dps_tutorial:main\", \"url\": \"s3://s3-us-west-2.amazonaws.com/maap-dit-registry/container-dps_tutorial:main.tar.gz\"}, \"container_mappings\": {\"$HOME/.aws\": \"/home/ops/.aws\", \"$HOME/.netrc\": \"/home/ops/.netrc\", \"/tmp\": [\"/tmp\", \"rw\"]}, \"_command\": \"/app/dps_wrapper.sh '/app/dps_tutorial/gdal_wrapper/run_gdal.sh' 'output.tif' '30'\", \"localize_urls\": [{\"url\": \"https://photojournal.jpl.nasa.gov/tiff/PIA00127.tif\"}], \"output_file\": \"output.tif\", \"_disk_usage\": \"1GB\", \"container_image_url\": \"s3://s3-us-west-2.amazonaws.com/maap-dit-registry/container-dps_tutorial:main.tar.gz\", \"container_image_id\": \"sha256:e539186c9e76fb923da7b3bfb6a3c700403e5302a71c3e8ba8635b7f216ab7e3\", \"job_specification\": {\"post\": [\"hysds.triage.triage\"], \"resource\": \"jobspec\", \"container\": \"container-dps_tutorial:main\", \"soft_time_limit\": 86400, \"time_limit\": 86400, \"recommended-queues\": [\"maap-dps-worker-8gb\"], \"job-version\": \"main\", \"command\": \"/app/dps_wrapper.sh '/app/dps_tutorial/gdal_wrapper/run_gdal.sh'\", \"params\": [{\"destination\": \"localize\", \"name\": \"input_file\", \"value\": \"https://photojournal.jpl.nasa.gov/tiff/PIA00127.tif\"}, {\"destination\": \"positional\", \"name\": \"output_file\", \"value\": \"output.tif\"}...\n",
"```\n",
"\n",
"Users may provide optional query parameters to filter the list on desired fields. The following example will return a list of jobs submitted by user `mlucas` \n",
"that all ran the `job-dps_tutorial_mlucas:main` algorithm:\n",
"Users may provide optional query parameters to filter the list on desired fields. The following example will return a list of jobs submitted by the current user that all ran the `job-dps_tutorial_mlucas:main` algorithm:\n",
"\n",
"```\n",
"r = maap.listJobs(\"mlucas\", algo_id=\"job-dps_tutorial_mlucas\", version=\"main\")\n",
"r = maap.listJobs(algo_id=\"job-dps_tutorial_mlucas\", version=\"main\")\n",
"```\n",
"\n",
"Users may also request just the list of jobs id's and their corresponding tags rather than full job details. This is controlled using the `get_job_details` option. By default `get_job_details` is set to `True`, but if set to `False` will return a compact list, as shown in this example:\n",
"\n",
"```\n",
"r = maap.listJobs(\"mlucas\", algo_id=\"job-dps_tutorial_mlucas\", version=\"main\", get_job_details=False)\n",
"r = maap.listJobs(algo_id=\"job-dps_tutorial_mlucas\", version=\"main\", get_job_details=False)\n",
"print(r.text)\n",
"```\n",
"\n",
Expand Down Expand Up @@ -254,7 +250,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -268,7 +264,12 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.1"
"version": "3.10.10"
},
"vscode": {
"interpreter": {
"hash": "b0fa6594d8f4cbf19f97940f81e996739fb7646882a419484c72d19e05852a7e"
}
}
},
"nbformat": 4,
Expand Down
9 changes: 7 additions & 2 deletions docs/source/system_reference_guide/jobsui.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3.12.4 64-bit",
"language": "python",
"name": "python3"
},
Expand All @@ -159,7 +159,12 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.1"
"version": "3.12.4"
},
"vscode": {
"interpreter": {
"hash": "b0fa6594d8f4cbf19f97940f81e996739fb7646882a419484c72d19e05852a7e"
}
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
{
"cell_type": "code",
"execution_count": 126,
"execution_count": 1,
"id": "ea7bcf9f",
"metadata": {
"tags": []
Expand All @@ -33,30 +33,7 @@
},
{
"cell_type": "code",
"execution_count": 127,
"id": "be655aaf-644c-4041-8d04-e1237a50a7f4",
"metadata": {
"tags": []
},
"outputs": [
{
"data": {
"text/plain": [
"'api.maap-project.org'"
]
},
"execution_count": 127,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"maap._MAAP_HOST"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"id": "5c541eee",
"metadata": {
"tags": []
Expand Down Expand Up @@ -290,7 +267,6 @@
" identifier=IDENTIFIER,\n",
" algo_id=ALGO_ID,\n",
" version=ALGO_VERSION,\n",
" username=USER, # username needs to be the same as whoever created the workspace\n",
" queue=WORKER_TYPE,\n",
" **in_params_dict\n",
" )\n",
Expand Down Expand Up @@ -345,7 +321,12 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
"version": "3.10.10"
},
"vscode": {
"interpreter": {
"hash": "b0fa6594d8f4cbf19f97940f81e996739fb7646882a419484c72d19e05852a7e"
}
}
},
"nbformat": 4,
Expand Down