Use the snapshot() function to take the snapshot of the user environment.
This function stores the snapshot of the user environment in a JSON file, which can be used as input to recreate the exact same user environment by passing the snapshot file to create_env.
Optional Argument
- dir
- Specifies the directory path to store the snapshot file.
Example
- Create a Python environment with name"env_1" in Vantage.
>>> env = create_env("env_1")... User environment 'env_1' created.
- Install the file mapper.py in the 'env_1' environment.
>>> import os, teradataml
>>> file_path = os.path.join(os.path.dirname(teradataml.__file__), "data", "scripts", "mapper.py")
>>> env.install_file(file_path = file_path)
File 'mapper.py' installed successfully in the remote user environment 'env_1'. True
- Install 'numpy' Python library.
>>> env.install_lib('numpy')fa72b8ec-429e-4a63-a6d1-598869a57bc3 Claim Id File/Libs/Model Method Name Stage Timestamp Additional Details 0 fa72b8ec-429e-4a63-a6d1-598869a57bc3 numpy install_lib Started 2023-11-28T17:06:18Z 1 fa72b8ec-429e-4a63-a6d1-598869a57bc3 numpy install_lib Finished 2023-11-28T17:06:39Z - Take a snapshot of 'env_1'.
>>> env.snapshot()
Snapshot for environment "env_1" is stored at "...:\\...\\...\\snapshot_env_1_python_3.10.5_1700740261.2757893.json"