Configuring the UDF Deployment Workspace
Before using UDFs, you need to configure a temporary workspace required for UDF deployment.
Prerequisites
- The Aura DataFrame SDK has been installed. For details, see Obtaining and Installing the Aura DataFrame SDK.
- An AuraJobV2 endpoint has been created, and the endpoint name has been obtained. For details, see Creating an Aura Engine Endpoint.
- A LakeFormation instance has been created, where a catalog and a database are ready. For details, see Creating a LakeFormation Instance and Planning Metadata.
- A parallel file system has been created. For details, see Creating a Parallel File System.
- The parameters in os.getenv() involved in the code have been configured as environment variables.
- The Python 3.11 has been installed.
Example
import os from aura_frame.multimodal import ai_lake target_database = "test" #Connect to the AuraJobV2 endpoint. For details about the parameters, see Establishing a Connection with the AuraJobV2 Endpoint. con = ai_lake.connect( aura_endpoint=os.getenv("aura_endpoint"), # Endpoint where the AuraJobV2 endpoint is located aura_endpoint_id=os.getenv("aura_endpoint_id"), # AuraJobV2 endpoint ID aura_endpoint_name=os.getenv("aura_endpoint_name"),# AuraJobV2 endpoint name aura_workspace_id=os.getenv("aura_workspace_id"), # Workspace ID lf_catalog_name=os.getenv("lf_catalog_name"), # LakeFormation Catalog name access_key=os.getenv("access_key"), # Access Key ID (AK) secret_key=os.getenv("secret_key"), # Secret Key (SK) default_database=target_database, # LakeFormation database name use_single_cn_mode=True, # Whether to enable the single-CN mode logging_level=logging.INFO # Set the log level. ) try: con.set_function_staging_workspace( obs_directory_base=os.getenv("obs_directory_base"), # Storage path for UDFs in OBS obs_bucket_name=os.getenv("obs_bucket_name"), # OBS bucket name obs_server=os.getenv("obs_server"), # OBS endpoint access_key=os.getenv("access_key"), # Access Key ID (AK) secret_key=os.getenv("secret_key"), # Secret Key (SK) ) print("The UDF deployment workspace has been configured.") finally: con.close()
| Parameter | Description | Type | Default Value |
|---|---|---|---|
| obs_directory_base | Path for storing UDFs in the parallel file system. | str | None |
| obs_bucket_name | Name of the parallel file system. | str | None |
| obs_server | OBS access address. For details, see Endpoints and Domain Names. For endpoint information of the specific connection, see Regions and Endpoints. | str | None |
| access_key | AK/SK. For details, see AK/SK Obtaining. | str | None |
| secret_key | str | None | |
| security_token | Security token (required when a temporary AK/SK pair is used). | str | None |
Helpful Links
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot