Use the status function to check the status of the operations performed by the library and file management methods of UserEnv.
- File installation, when installed asynchronously.
Applicable for the files with size greater than 10 MB.
- Install, uninstall or update of the libraries in user environment.
Optional Argument
- claim_ids
- Specifies the unique identifiers of the asynchronous process started by the UserEnv management methods.
This function returns pandas DataFrame.
Example Prerequisite
Create remote user environment for the following examples.
>>> env = create_env('test_env', 'python_3.7.9', 'Test environment')
User environment test_env created.
Example 1: Check the status of an asynchronous installation of a file
This function installs the file 'large_file' asynchronously with 'large_file' found in temp folder and check the latest status of installation.
Running this example creates a file 'large_file' with size # approximately 41MB in the temp folder
>>> import tempfile, os
>>> def create_large_file(): file_name = os.path.join(tempfile.gettempdir(),"large_file") with open(file_name, 'xb') as fp: fp.seek((1024 * 1024 * 41) - 1) fp.write(b'\0')
>>> claim_id = env.install_file('large_file')
File installation is initiated. Check the status using status() with the claim id 53e44892-1952-45eb-b828-6635c0447b59.
>>> env.status(claim_id)
Claim Id File/Libs Method Name Stage Timestamp Additional Details 0 53e44892-1952-45eb-b828-6635c0447b59 TeradataToolsAndUtilitiesBase__ubuntu_x8664.17.10.19.00.tar.gz install_file Endpoint Generated 2022-07-27T18:20:34Z None 1 53e44892-1952-45eb-b828-6635c0447b59 TeradataToolsAndUtilitiesBase__ubuntu_x8664.17.10.19.00.tar.gz install_file File Uploaded 2022-07-27T18:20:35Z None 2 53e44892-1952-45eb-b828-6635c0447b59 TeradataToolsAndUtilitiesBase__ubuntu_x8664.17.10.19.00.tar.gz install_file File Installed 2022-07-27T18:20:38Z None
Example 2: Check the status of an asynchronous installation of a library
This example installs the library 'teradataml' asynchronously and check the status of installation.
>>> claim_id = env.install_lib('teradataml')
Request to install libraries initiated successfully in the remote user environment test_env. Check the status using status() with the claim id '349615e2-9257-4a70-8304-ac76f50712f8'.
>>> env.status(claim_id)
Claim Id File/Libs Method Name Stage Timestamp Additional Details 0 349615e2-9257-4a70-8304-ac76f50712f8 teradataml install_lib Started 2022-07-13T10:37:40Z None 1 349615e2-9257-4a70-8304-ac76f50712f8 teradataml install_lib Finished 2022-07-13T10:39:29Z None
Example 3: Check the status of an asynchronous update of a library
This example updates the library 'teradataml' to 17.10.0.0 asynchronously and check the status of installation.
>>> claim_id = env.update_lib('teradataml==17.10.0.0')
Request to update libraries initiated successfully in the remote user environment test_env. Check the status using status() with the claim id '29d06296-7444-4851-adef-ca1f921b1dd6'.
>>> env.status(claim_id)
Claim Id File/Libs Method Name Stage Timestamp Additional Details 0 29d06296-7444-4851-adef-ca1f921b1dd6 teradataml==17.10.0.0 update_lib Started 2022-07-13T10:47:39Z None 1 29d06296-7444-4851-adef-ca1f921b1dd6 teradataml==17.10.0.0 update_lib Finished 2022-07-13T10:49:52Z None
Example 4: Check the status of all asynchronous processes
This example uninstalls the library 'teradataml' and check the complete status of all asynchronous processes.
>>> claim_id = env.uninstall_lib('teradataml')
Request to uninstall libraries initiated successfully in the remote user environment test_env. Check the status using status() with the claim id '5cd3b3f7-f3b8-4bfd-8abe-7c811a6728db'.
>>> env.status()
Claim Id File/Libs Method Name Stage Timestamp Additional Details 0 53e44892-1952-45eb-b828-6635c0447b59 TeradataToolsAndUtilitiesBase__ubuntu_x8664.17.10.19.00.tar.gz install_file Endpoint Generated 2022-07-27T18:20:34Z None 1 53e44892-1952-45eb-b828-6635c0447b59 TeradataToolsAndUtilitiesBase__ubuntu_x8664.17.10.19.00.tar.gz install_file File Uploaded 2022-07-27T18:20:35Z None 2 53e44892-1952-45eb-b828-6635c0447b59 TeradataToolsAndUtilitiesBase__ubuntu_x8664.17.10.19.00.tar.gz install_file File Installed 2022-07-27T18:20:38Z None 3 29d06296-7444-4851-adef-ca1f921b1dd6 teradataml==17.10.0.0 update_lib Started 2022-07-13T10:47:39Z None 4 29d06296-7444-4851-adef-ca1f921b1dd6 teradataml==17.10.0.0 update_lib Finished 2022-07-13T10:49:52Z None 5 349615e2-9257-4a70-8304-ac76f50712f8 teradataml install_lib Started 2022-07-13T10:37:40Z None 6 349615e2-9257-4a70-8304-ac76f50712f8 teradataml install_lib Finished 2022-07-13T10:39:29Z None 7 5cd3b3f7-f3b8-4bfd-8abe-7c811a6728db teradataml uninstall_lib Started 2022-07-13T10:37:40Z None 8 5cd3b3f7-f3b8-4bfd-8abe-7c811a6728db teradataml uninstall_lib Finished 2022-07-13T10:39:29Z None
Example 5: Uninstall lib from conda environment and check the complete status of all the asynchronous processes
- Create conda environment.
>>> testenv_conda = create_env('testenv_conda', 'python_3.8', 'Test conda environment', conda_env=True)
Conda environment creation initiated User environment 'testenv_conda' created.
- View existing libraries installed.
>>> testenv_conda.libs
name version 0 _libgcc_mutex 0.1 1 _openmp_mutex 5.1 2 ca-certificates 2023.12.12 3 ld_impl_linux-64 2.38 4 libffi 3.4.4 5 libgcc-ng 11.2.0 6 libgomp 11.2.0 7 libstdcxx-ng 11.2.0 8 ncurses 6.4 9 openssl 3.0.12 10 pip 23.3.1 11 python 3.9.18 12 readline 8.2 13 setuptools 68.2.2 14 sqlite 3.41.2 15 tk 8.6.12 16 tzdata 2023d 17 wheel 0.41.2 18 xz 5.4.5 19 zlib 1.2.13
- Install additional Python libraries.
>>> testenv_conda.install_lib(['numpy','nltk>=3.3'])
Claim Id File/Libs/Model Method Name Stage Timestamp Additional Details 0 4e3d5cde-20fd-490f-981d-82fda578b2fd numpy, nltk>=3.3 install_lib Started 2024-01-31T17:56:15Z 1 4e3d5cde-20fd-490f-981d-82fda578b2fd numpy, nltk>=3.3 install_lib Finished 2024-01-31T17:57:24Z
- Check the status.
>>> conda_env.status()
Claim Id File/Libs/Model Method Name Stage Timestamp Additional Details 0 4e3d5cde-20fd-490f-981d-82fda578b2fd numpy, nltk>=3.3 install_lib Started 2024-01-31T17:56:15Z 1 4e3d5cde-20fd-490f-981d-82fda578b2fd numpy, nltk>=3.3 install_lib Finished 2024-01-31T17:57:24Z