gpt4 book ai didi

.net - Azure 批处理池下的relativemountpath

转载 作者:行者123 更新时间:2023-12-02 23:17:30 26 4
gpt4 key购买 nike

我需要为RelativeMountPath提供什么值才能使用Windows计算节点将文件共享装载到批处理池?

https://learn.microsoft.com/en-us/dotnet/api/microsoft.azure.management.batchai.models.azurefilesharereference.relativemountpath?view=azure-dotnet

根据文档,它说“将安装文件系统的计算节点上的相对路径

目前,当它向池中添加节点时,我收到“MountConfigurationException:不正确的调用或权限”错误。

我尝试使用 powershell 和 C# 代码。在这两种情况下,它都不起作用。下面是C#代码

private static void CreateBatchPool(BatchClient batchClient, CloudServiceConfiguration cloudServiceConfiguration)
{
CloudPool pool = batchClient.PoolOperations.CreatePool(
poolId: PoolId,
targetDedicatedComputeNodes: PoolNodeCount,
virtualMachineSize: PoolVMSize,
targetLowPriorityComputeNodes: 0,
cloudServiceConfiguration: cloudServiceConfiguration);
pool.MaxTasksPerComputeNode = 8;
pool.ApplicationPackageReferences = CreateAppPackageReferences();
pool.TaskSchedulingPolicy = new TaskSchedulingPolicy(ComputeNodeFillType.Pack);
pool.MountConfiguration = new List<MountConfiguration>();
pool.MountConfiguration.Add(new MountConfiguration(CreateFileShareConfiguration(batchClient)));

pool.Commit();
}

private static AzureFileShareConfiguration CreateFileShareConfiguration(BatchClient batchClient)
{
string url = @"https://storage.file.core.windows.net/fileshare";
AzureFileShareConfiguration fileShareConfiguration = new AzureFileShareConfiguration(StorageAccountName, url, "foo", StorageAccountKey);
return fileShareConfiguration;
}

最佳答案

请注意您使用的API是 BatchAI API 和 azure-batch还有一个单独的 API,我也会修复标签。在回复您的帖子之前我想先澄清这一点:)

为了完整起见,我将在下面提到 Azue-batch vanilla mount API 的详细信息和链接。

  • 关于 BatchAI API 我认为它与批处理普通 API 相同,其中 RelativeMountPath是可使用环境变量访问的文件夹的相对目录结构,即 AZ_BATCHAI_MOUNT_ROOT + <dir_name_supplied>举例来说:如果您提供相对挂载目录名称为 foo,那么一旦在批处理级别成功创建池,就可以通过以下方式访问挂载目录: AZ_BATCHAI_MOUNT_ROOT\foo

  • 进一步访问环境变量的详细信息如下:https://learn.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables#command-line-expansion-of-environment-variables就像在 Windows 中一样,您可以通过 %MY_ENV_VAR% 访问等等。

  • 此外,MountConfigurationException: Incorrect invocation or permissions表示您提供了错误的信息,导致错误配置,因此批处理返回权限错误。上面提到的文档应该可以指导。

有关单独批处理级别 API 的额外信息

Azure-Batch Vanilla mount API(注意:您没有使用此功能,但我提供此信息仅供引用)

本文档有很好的开始细节,Mount virtual file system on a pool

对于此特定 API,在 azurefile 系统的挂载中 RelativeMountPath 的上下文对于相对于标准 fsmounts 创建的目录结构可通过 AZ_BATCH_NODE_MOUNTS_DIR 在节点上访问的目录环境变量:即

Relative mount path or Source: The location of the file system mounted on the compute node, relative to standard fsmounts directory accessible on the node via AZ_BATCH_NODE_MOUNTS_DIR. The exact location varies depending on the operating system used on the node. For example, the physical location on an Ubuntu node is mapped to mnt\batch\tasks\fsmounts, and on a CentOS node it is mapped to mnt\resources\batch\tasks\fsmounts.

在 Windows 节点中,它将位于 fsmounts 的寡妇级别文件目录中的某个位置更多详细信息或环境变量在这里 https://learn.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables

这应该能够引导您走向正确的方向。谢谢!

关于.net - Azure 批处理池下的relativemountpath,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59692400/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com