【问题标题】:Azure Batch and Determine the Path of the Downloaded EXE on the Compute Node in c#Azure Batch并在c#中确定计算节点上下载的EXE的路径
【发布时间】:2020-04-30 12:03:05
【问题描述】:

我正在使用 Azure Batch。我正在编写一个将文件上传到 Azure 存储帐户的 c# 应用程序。然后代码创建一个池和任务 - 除了一件事之外,这一切都很好。该任务有一个命令行,该命令行在池中的每个节点 (VM) 上执行,以在每个节点上运行 c# 应用程序。该应用程序已成功下载到节点,但我认为我的 exe 路径在代码中是错误的..

const string appPackageId = "ffmpeg";
const string appPackageVersion = "6.0";

...

string taskCommandLine = String.Format("cmd /c {0}\\ffmpeg\\bin\\{1}.exe -i {2} {3}", appPath, appPackageId, inputMediaFile, outputMediaFile);


// Create a cloud task (with the task ID and command line) and add it to the task list
CloudTask task = new CloudTask(taskId, taskCommandLine);
task.ResourceFiles = new List<ResourceFile> { inputFiles[i] };

...

如何将 taskCommandLine 设置为 VM 上 exe 的正确路径?

我知道在 VM 上创建了文件夹,但我不确定 exe 和支持文件下载到哪里...? (必须有某种文件/文件夹结构)

问候 伊恩

【问题讨论】:

    标签: c# azure azure-batch


    【解决方案1】:

    我设法登录到一个节点 (VM) 并查看我的 exe 的完整文件路径。

    代码修复是...

    const string appPackageId = "ffmpeg";
    const string appPackageVersion = "6.0";
    ...
    string taskCommandLine = String.Format("cmd /c {0}\\ffmpeg\\bin\\{1}.exe -i {2} {3}", appPath, appPackageId, inputMediaFile, outputMediaFile);
    

    上面调用的是应用程序的默认版本。

    谢谢 伊恩

    【讨论】:

    • 嗨,Ian,您可以将自己的答案标记为正确答案 :-)
    猜你喜欢
    • 2022-08-17
    • 1970-01-01
    • 1970-01-01
    • 2017-10-09
    • 1970-01-01
    • 1970-01-01
    • 2012-05-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多