PYTHON_PACKAGE_EXECUTOR_IMAGE_URI or PRE_BUILT_CONTAINER_IMAGE_URI:Artifact Registry 中容器映像檔的 URI,用於執行提供的 Python 套件。Vertex AI 提供各種預先安裝套件的執行器映像檔,可滿足使用者的各種用途。
PYTHON_PACKAGE_URIS:以逗號分隔的 Cloud Storage URI 清單,指定構成訓練程式及其依附元件套件的 Python 套件檔案。套件 URI 數量上限為 100 個。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-04 (世界標準時間)。"],[],[],null,["# Mount a Network File System share\n\nYou can configure your custom training jobs to mount Network File System (NFS)\nshares to the container where your code is running. This lets your jobs\naccess remote files as if they were local, enabling high throughput and\nlow latency.\n\nThis guide shows how to mount a Network File System share when running a\ncustom training job.\n\nBefore you begin\n----------------\n\n1. Create an NFS share in a\n [Virtual Private Cloud (VPC)](/vpc/docs/vpc-peering). Your share must be\n accessible without authentication.\n\n You can use a Filestore instance as your NFS share.\n If you are using [Filestore](/filestore) and plan to use VPC\n peering for Vertex AI in the next step, select **private service\n access** as the connect mode when you create an instance. For an example, see\n [Create instances](/filestore/docs/creating-instances)\n in the Filestore documentation.\n2. To connect Vertex AI with the VPC that hosts your NFS share,\n follow the instructions in [Use Private Service Connect interface for Vertex AI](/vertex-ai/docs/training/psc-i-egress) (recommended), or [Set up VPC Network Peering](/vertex-ai/docs/general/vpc-peering).\n\nNetwork File System information for custom training\n---------------------------------------------------\n\nWhen you create a custom training job that mounts an NFS share, you must\nspecify the following:\n\n- The name of the network for Vertex AI to access. The way that you\n specify the network name differs depending on the type of custom training\n job. For details, see [Perform custom training](/vertex-ai/docs/training/using-private-ip#perform-custom-training).\n\n- Your NFS configuration in the [WorkerPoolSpec field](/vertex-ai/docs/reference/rest/v1/CustomJobSpec#workerpoolspec).\n Include the following fields:\n\n For more information, see [Where to specify compute resources](/vertex-ai/docs/training/configure-compute#where_to_specify_compute_resources).\n\nExample: create a custom job using the gcloud CLI\n-------------------------------------------------\n\n1. Follow the steps in\n [Create a Python training application for a prebuilt container](/vertex-ai/docs/training/create-python-pre-built-container)\n to build a training application to run on Vertex AI.\n\n2. Create a file named `config.yaml` that describes the PSA or Private Service Connect interface config\n mount settings for your training job. Use one of the following formats:\n\n### Private Service Connect interface\n\n\n| **Preview\n| --- Private Service Connect interface**\n|\n|\n| This feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\n\u003cbr /\u003e\n\n1. To use Private Service Connect interface:\n\n pscInterfaceConfig:\n network_attachment: \u003cvar translate=\"no\"\u003eNETWORK_ATTACHMENT_NAME\u003c/var\u003e\n workerPoolSpecs:\n - machineSpec:\n machineType: \u003cvar translate=\"no\"\u003eMACHINE_TYPE\u003c/var\u003e\n replicaCount: 1\n pythonPackageSpec:\n executorImageUri: \u003cvar translate=\"no\"\u003ePYTHON_PACKAGE_EXECUTOR_IMAGE_URI\u003c/var\u003e or \u003cvar translate=\"no\"\u003ePRE_BUILT_CONTAINER_IMAGE_URI\u003c/var\u003e\n packageUris:\n - \u003cvar translate=\"no\"\u003ePYTHON_PACKAGE_URIS\u003c/var\u003e\n pythonModule: PYTHON_MODULE\n nfsMounts:\n - server: \u003cvar translate=\"no\"\u003eNFS_SERVER_IP\u003c/var\u003e\n path: \u003cvar translate=\"no\"\u003eNFS_SHARE_NAME\u003c/var\u003e\n mountPoint: LOCAL_FOLDER\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eNETWORK_ATTACHMENT_NAME\u003c/var\u003e: The name of your network attachment.\n\n - \u003cvar translate=\"no\"\u003eMACHINE_TYPE\u003c/var\u003e: The identifier of your virtual machine type.\n\n - \u003cvar translate=\"no\"\u003ePYTHON_PACKAGE_EXECUTOR_IMAGE_URI\u003c/var\u003e or \u003cvar translate=\"no\"\u003ePRE_BUILT_CONTAINER_IMAGE_URI\u003c/var\u003e:\n The URI of a container image in Artifact Registry that will run the provided\n Python package. Vertex AI provides a\n [wide range of executor images with pre-installed packages](/vertex-ai/docs/training/pre-built-containers)\n to meet users' various use cases.\n\n - \u003cvar translate=\"no\"\u003ePYTHON_PACKAGE_URIS\u003c/var\u003e: A comma-separated list of\n Cloud Storage URIs that specify the Python package files that\n make up the training program and its dependent packages. The maximum\n number of package URIs is 100.\n\n - \u003cvar translate=\"no\"\u003ePYTHON_MODULE\u003c/var\u003e: The Python module name to run after installing\n the packages.\n\n - \u003cvar translate=\"no\"\u003eNFS_SERVER_IP\u003c/var\u003e: The IP address of your NFS server.\n\n - \u003cvar translate=\"no\"\u003eNFS_SHARE_NAME\u003c/var\u003e: The NFS share path, which is an\n absolute path that begins with `/`.\n\n - \u003cvar translate=\"no\"\u003eLOCAL_FOLDER\u003c/var\u003e: The local mount point (UNIX directory name).\n\n Make sure that your network name is formatted correctly and that your NFS\n share exists in the specified network.\n2. Create your custom job and pass your `config.yaml` file to the `--config`\n parameter.\n\n gcloud ai custom-jobs create \\\n --region=\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e \\\n --display-name=\u003cvar translate=\"no\"\u003eJOB_NAME\u003c/var\u003e \\\n --config=config.yaml\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: Specify the region to create the job in.\n\n - \u003cvar translate=\"no\"\u003eJOB_NAME\u003c/var\u003e: A name for the custom job.\n\n### VPC peering\n\n1. Use VPC Peering if you want the job to use VPC Peering/PSA on the job\n or not.\n\n network: projects/\u003cvar translate=\"no\"\u003ePROJECT_NUMBER\u003c/var\u003e/global/networks/\u003cvar translate=\"no\"\u003eNETWORK_NAME\u003c/var\u003e\n workerPoolSpecs:\n - machineSpec:\n machineType: \u003cvar translate=\"no\"\u003eMACHINE_TYPE\u003c/var\u003e\n replicaCount: 1\n pythonPackageSpec:\n executorImageUri: \u003cvar translate=\"no\"\u003ePYTHON_PACKAGE_EXECUTOR_IMAGE_URI\u003cspan class=\"devsite-syntax-w\"\u003e \u003c/span\u003eor\u003cspan class=\"devsite-syntax-w\"\u003e \u003c/span\u003e\n \u003cspan class=\"devsite-syntax-w\"\u003e \u003c/span\u003ePRE_BUILT_CONTAINER_IMAGE_URI\u003c/var\u003e\n packageUris:\n - \u003cvar translate=\"no\"\u003ePYTHON_PACKAGE_URIS\u003c/var\u003e\n pythonModule: \u003cvar translate=\"no\"\u003ePYTHON_MODULE\u003c/var\u003e\n nfsMounts:\n - server: \u003cvar translate=\"no\"\u003eNFS_SERVER_IP\u003c/var\u003e\n path: \u003cvar translate=\"no\"\u003eNFS_SHARE_NAME\u003c/var\u003e\n mountPoint: \u003cvar translate=\"no\"\u003eLOCAL_FOLDER\u003c/var\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePROJECT_NUMBER\u003c/var\u003e: The project ID of your Google Cloud project.\n\n - \u003cvar translate=\"no\"\u003eNETWORK_NAME\u003c/var\u003e: The name of your private or Shared VPC.\n\n - \u003cvar translate=\"no\"\u003eMACHINE_TYPE\u003c/var\u003e: The identifier of your virtual machine type.\n\n - \u003cvar translate=\"no\"\u003ePYTHON_PACKAGE_EXECUTOR_IMAGE_URI or PRE_BUILT_CONTAINER_IMAGE_URI\u003c/var\u003e:\n The URI of a container image in Artifact Registry that will run the provided\n Python package. Vertex AI provides a\n [wide range of executor images with pre-installed packages](/vertex-ai/docs/training/pre-built-containers)\n to meet users' various use cases.\n\n - \u003cvar translate=\"no\"\u003ePYTHON_PACKAGE_URIS\u003c/var\u003e: A comma-separated list of\n Cloud Storage URIs that specify the Python package files that\n make up the training program and its dependent packages. The maximum\n number of package URIs is 100.\n\n - \u003cvar translate=\"no\"\u003ePYTHON_MODULE\u003c/var\u003e: The Python module name to run after installing\n the packages.\n\n - \u003cvar translate=\"no\"\u003eNFS_SERVER_IP\u003c/var\u003e: The IP address of your NFS server.\n\n - \u003cvar translate=\"no\"\u003eNFS_SHARE_NAME\u003c/var\u003e: The NFS share path, which is an\n absolute path that begins with `/`.\n\n - \u003cvar translate=\"no\"\u003eLOCAL_FOLDER\u003c/var\u003e: The local mount point (UNIX directory name).\n\n Make sure that your network name is formatted correctly and that your NFS\n share exists in the specified network.\n2. Create your custom job and pass your `config.yaml` file to the `--config`\n parameter.\n\n gcloud ai custom-jobs create \\\n --region=\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e \\\n --display-name=\u003cvar translate=\"no\"\u003eJOB_NAME\u003c/var\u003e \\\n --config=config.yaml\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: Specify the region to create the job in.\n\n- \u003cvar translate=\"no\"\u003eJOB_NAME\u003c/var\u003e: A name for the custom job.\n\nLimitations\n-----------\n\n- You must mount your NFS share using an IP address that is internal to your\n VPC; using public URLs isn't allowed.\n\n- Training jobs mount NFS shares without authentication, and will fail\n if a username and password are required.\n\n To secure your data, set permissions\n on your NFS share. If you are using Filestore, see\n [access control](/filestore/docs/access-control) in the Filestore\n documentation.\n- You can't run two training jobs that mount NFS shares from different\n VPC networks at the same time. This is due to the\n [network peering restriction](/vertex-ai/docs/training/using-private-ip#run_jobs_on_different_networks)."]]