|
18 | 18 | }, |
19 | 19 | { |
20 | 20 | "cell_type": "code", |
21 | | - "execution_count": 13, |
| 21 | + "execution_count": 9, |
22 | 22 | "id": "839fa332-70a6-4818-a190-18c9ca109c28", |
23 | 23 | "metadata": {}, |
24 | 24 | "outputs": [ |
|
79 | 79 | "Building wheels for collected packages: dapi\n", |
80 | 80 | " Building editable for dapi (pyproject.toml) ... \u001b[?25ldone\n", |
81 | 81 | "\u001b[?25h Created wheel for dapi: filename=dapi-1.0.0-py3-none-any.whl size=3825 sha256=f9fd4761dd2e940e7cd0f96795280478e27aacfbc14275ffb57c0ee44f9b129c\n", |
82 | | - " Stored in directory: /private/var/folders/w8/xz590jyd7r36zmxcspgzj3z40000gn/T/pip-ephem-wheel-cache-qfmkjb13/wheels/98/df/91/ed70fe2dca11c3c6e5b6e8e6eef18c373a119d095037f892a3\n", |
| 82 | + " Stored in directory: /private/var/folders/w8/xz590jyd7r36zmxcspgzj3z40000gn/T/pip-ephem-wheel-cache-tph3acf9/wheels/98/df/91/ed70fe2dca11c3c6e5b6e8e6eef18c373a119d095037f892a3\n", |
83 | 83 | "Successfully built dapi\n", |
84 | 84 | "Installing collected packages: dapi\n", |
85 | 85 | "Successfully installed dapi-1.0.0\n", |
|
96 | 96 | }, |
97 | 97 | { |
98 | 98 | "cell_type": "code", |
99 | | - "execution_count": 1, |
| 99 | + "execution_count": 5, |
100 | 100 | "id": "35fca324-ee48-41c8-84a1-78ad7b03aae8", |
101 | 101 | "metadata": {}, |
102 | | - "outputs": [ |
103 | | - { |
104 | | - "name": "stderr", |
105 | | - "output_type": "stream", |
106 | | - "text": [ |
107 | | - "/Users/krishna/Library/Caches/pypoetry/virtualenvs/dapi-ptztLUqK-py3.13/lib/python3.13/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n", |
108 | | - " from .autonotebook import tqdm as notebook_tqdm\n" |
109 | | - ] |
110 | | - } |
111 | | - ], |
| 102 | + "outputs": [], |
112 | 103 | "source": [ |
113 | 104 | "import os\n", |
114 | 105 | "\n", |
|
120 | 111 | " AppDiscoveryError,\n", |
121 | 112 | " FileOperationError,\n", |
122 | 113 | " JobSubmissionError,\n", |
| 114 | + " SystemInfoError,\n", |
123 | 115 | " JobMonitorError,\n", |
124 | 116 | " # Optionally import status constants if you want to check against them explicitly\n", |
125 | 117 | " STATUS_TIMEOUT,\n", |
|
785 | 777 | "\n", |
786 | 778 | "print(f\"App Description: {app_details}\")" |
787 | 779 | ] |
| 780 | + }, |
| 781 | + { |
| 782 | + "cell_type": "code", |
| 783 | + "execution_count": 6, |
| 784 | + "id": "9aaef98a", |
| 785 | + "metadata": {}, |
| 786 | + "outputs": [ |
| 787 | + { |
| 788 | + "name": "stdout", |
| 789 | + "output_type": "stream", |
| 790 | + "text": [ |
| 791 | + "\n", |
| 792 | + "--- System Queue Information ---\n", |
| 793 | + "\n", |
| 794 | + "Fetching queue information for system 'frontera'...\n", |
| 795 | + "Found 10 batch logical queues for system 'frontera':\n", |
| 796 | + " - Name: flex (HPC Queue: flex, Max Jobs: -1, Max User Jobs: N/A, Max Mins: 2880, Max Nodes: 128)\n", |
| 797 | + " - Name: development (HPC Queue: development, Max Jobs: -1, Max User Jobs: N/A, Max Mins: 120, Max Nodes: 40)\n", |
| 798 | + " - Name: normal (HPC Queue: normal, Max Jobs: -1, Max User Jobs: N/A, Max Mins: 2880, Max Nodes: 512)\n", |
| 799 | + " - Name: large (HPC Queue: large, Max Jobs: -1, Max User Jobs: N/A, Max Mins: 2880, Max Nodes: 2048)\n", |
| 800 | + " - Name: debug (HPC Queue: debug, Max Jobs: -1, Max User Jobs: N/A, Max Mins: 2880, Max Nodes: 8368)\n", |
| 801 | + " - Name: rtx (HPC Queue: rtx, Max Jobs: -1, Max User Jobs: N/A, Max Mins: 2880, Max Nodes: 22)\n", |
| 802 | + " - Name: rtx-dev (HPC Queue: rtx-dev, Max Jobs: -1, Max User Jobs: N/A, Max Mins: 120, Max Nodes: 2)\n", |
| 803 | + " - Name: nvdimm (HPC Queue: nvdimm, Max Jobs: -1, Max User Jobs: N/A, Max Mins: 120, Max Nodes: 4)\n", |
| 804 | + " - Name: small (HPC Queue: small, Max Jobs: -1, Max User Jobs: N/A, Max Mins: 2880, Max Nodes: 2)\n", |
| 805 | + " - Name: grace (HPC Queue: grace, Max Jobs: -1, Max User Jobs: N/A, Max Mins: 7200, Max Nodes: 30)\n", |
| 806 | + "\n", |
| 807 | + "Does 'development' queue exist on Frontera? True\n", |
| 808 | + "\n", |
| 809 | + "Fetching queue information for system 'non-existent-system'...\n", |
| 810 | + "Error getting system info: Failed to retrieve queues for system 'non-existent-system': message: SYSAPI_NOT_FOUND Record not found. jwtTenant: designsafe jwtUser: kks32 OboTenant: designsafe OboUser: kks32 System: non-existent-system\n", |
| 811 | + "-----------------------------\n" |
| 812 | + ] |
| 813 | + } |
| 814 | + ], |
| 815 | + "source": [ |
| 816 | + "# --- Example: List Queues for Frontera ---\n", |
| 817 | + "try:\n", |
| 818 | + " print(\"\\n--- System Queue Information ---\")\n", |
| 819 | + " frontera_queues = ds.systems.list_queues(\"frontera\")\n", |
| 820 | + " # You can now inspect the 'frontera_queues' list\n", |
| 821 | + " # Example: Find if 'development' queue exists\n", |
| 822 | + " dev_queue_exists = any(q.name == 'development' for q in frontera_queues)\n", |
| 823 | + " print(f\"Does 'development' queue exist on Frontera? {dev_queue_exists}\")\n", |
| 824 | + "\n", |
| 825 | + " # Example: List queues for a non-existent system\n", |
| 826 | + " ds.systems.list_queues(\"non-existent-system\") # This would raise SystemInfoError\n", |
| 827 | + "\n", |
| 828 | + "except SystemInfoError as e:\n", |
| 829 | + " print(f\"Error getting system info: {e}\")\n", |
| 830 | + "except Exception as e:\n", |
| 831 | + " print(f\"An unexpected error occurred: {e}\")\n", |
| 832 | + "print(\"-----------------------------\")" |
| 833 | + ] |
| 834 | + }, |
| 835 | + { |
| 836 | + "cell_type": "markdown", |
| 837 | + "id": "c3fb073a", |
| 838 | + "metadata": {}, |
| 839 | + "source": [ |
| 840 | + "## Verify TAPIS paths" |
| 841 | + ] |
| 842 | + }, |
| 843 | + { |
| 844 | + "cell_type": "code", |
| 845 | + "execution_count": 6, |
| 846 | + "id": "e074a3c3", |
| 847 | + "metadata": {}, |
| 848 | + "outputs": [ |
| 849 | + { |
| 850 | + "name": "stdout", |
| 851 | + "output_type": "stream", |
| 852 | + "text": [ |
| 853 | + "\n", |
| 854 | + "Translating and verifying path: /MyData/mpm-benchmarks/2d/uniaxial_stress/\n", |
| 855 | + "Translated '/MyData/mpm-benchmarks/2d/uniaxial_stress/' to 'tapis://designsafe.storage.default/kks32/mpm-benchmarks/2d/uniaxial_stress/' using t.username\n", |
| 856 | + "Verifying existence of translated path: tapis://designsafe.storage.default/kks32/mpm-benchmarks/2d/uniaxial_stress/\n", |
| 857 | + "Checking system 'designsafe.storage.default' for path 'kks32/mpm-benchmarks/2d/uniaxial_stress/'...\n", |
| 858 | + "Verification successful: Path exists.\n", |
| 859 | + "Input Directory Tapis URI (verified): tapis://designsafe.storage.default/kks32/mpm-benchmarks/2d/uniaxial_stress/\n", |
| 860 | + "\n", |
| 861 | + "Translating and verifying non-existent path: /MyData/this/path/does/not/exist/\n", |
| 862 | + "Translated '/MyData/this/path/does/not/exist/' to 'tapis://designsafe.storage.default/kks32/this/path/does/not/exist/' using t.username\n", |
| 863 | + "Verifying existence of translated path: tapis://designsafe.storage.default/kks32/this/path/does/not/exist/\n", |
| 864 | + "Checking system 'designsafe.storage.default' for path 'kks32/this/path/does/not/exist/'...\n", |
| 865 | + "Error during path translation/verification: Verification error for path 'kks32/this/path/does/not/exist/' on system 'designsafe.storage.default': message: FILES_CLIENT_SSH_NOT_FOUND Path not found. OboTenant: designsafe OboUser: kks32 System: designsafe.storage.default EffectiveUser: kks32 Host: cloud.data.tacc.utexas.edu RootDir: /data/designsafe/mydata Path: kks32/this/path/does/not/exist\n" |
| 866 | + ] |
| 867 | + }, |
| 868 | + { |
| 869 | + "ename": "SystemExit", |
| 870 | + "evalue": "Stopping notebook due to path verification error.", |
| 871 | + "output_type": "error", |
| 872 | + "traceback": [ |
| 873 | + "An exception has occurred, use %tb to see the full traceback.\n", |
| 874 | + "\u001b[0;31mSystemExit\u001b[0m\u001b[0;31m:\u001b[0m Stopping notebook due to path verification error.\n" |
| 875 | + ] |
| 876 | + }, |
| 877 | + { |
| 878 | + "name": "stderr", |
| 879 | + "output_type": "stream", |
| 880 | + "text": [ |
| 881 | + "/Users/krishna/Library/Caches/pypoetry/virtualenvs/dapi-ptztLUqK-py3.13/lib/python3.13/site-packages/IPython/core/interactiveshell.py:3585: UserWarning: To exit: use 'exit', 'quit', or Ctrl-D.\n", |
| 882 | + " warn(\"To exit: use 'exit', 'quit', or Ctrl-D.\", stacklevel=1)\n" |
| 883 | + ] |
| 884 | + } |
| 885 | + ], |
| 886 | + "source": [ |
| 887 | + "# --- Translate Path with Verification ---\n", |
| 888 | + "ds_path: str = \"/MyData/mpm-benchmarks/2d/uniaxial_stress/\"\n", |
| 889 | + "ds_path_nonexistent: str = \"/MyData/this/path/does/not/exist/\"\n", |
| 890 | + "\n", |
| 891 | + "try:\n", |
| 892 | + " # Translate and verify the existing path\n", |
| 893 | + " print(f\"\\nTranslating and verifying path: {ds_path}\")\n", |
| 894 | + " input_uri = ds.files.translate_path_to_uri(ds_path, verify_exists=True)\n", |
| 895 | + " print(f\"Input Directory Tapis URI (verified): {input_uri}\")\n", |
| 896 | + "\n", |
| 897 | + " # Example: Try translating a non-existent path with verification (will raise error)\n", |
| 898 | + " print(f\"\\nTranslating and verifying non-existent path: {ds_path_nonexistent}\")\n", |
| 899 | + " input_uri_bad = ds.files.translate_path_to_uri(ds_path_nonexistent, verify_exists=True)\n", |
| 900 | + " print(f\"This line should not be reached.\")\n", |
| 901 | + "\n", |
| 902 | + "except FileOperationError as e:\n", |
| 903 | + " print(f\"Error during path translation/verification: {e}\")\n", |
| 904 | + " # Decide how to handle the error (e.g., stop notebook, use default, etc.)\n", |
| 905 | + " # For this example, we'll stop if verification fails.\n", |
| 906 | + " raise SystemExit(\"Stopping notebook due to path verification error.\")\n", |
| 907 | + "except Exception as e:\n", |
| 908 | + " print(f\"An unexpected error occurred during path translation: {e}\")\n", |
| 909 | + " raise SystemExit(\"Stopping notebook due to unexpected path translation error.\")\n" |
| 910 | + ] |
788 | 911 | } |
789 | 912 | ], |
790 | 913 | "metadata": { |
|
0 commit comments