【问题标题】:How to retrieve stdout / stderr.txt files from Azure Batch compute nodes using python SDK?如何使用 python SDK 从 Azure Batch 计算节点检索 stdout / stderr.txt 文件?
【发布时间】:2017-11-08 21:44:21
【问题描述】:

Batch 的 .NET 文档包含一种从池中的节点检索文件的方法:link python SDK 中的相应类没有任何方法。任务失败时返回 stderr.txt 文件的最佳方式是什么?

【问题讨论】:

    标签: python azure azure-batch


    【解决方案1】:

    我认为你可以通过使用 python batch_client 来做到这一点,我在这里找到了一个实现:https://github.com/Azure/azure-sdk-for-python/blob/master/doc/batch.rst

    # Download task output
    with open('task_output.txt', 'w') as file_output:
            output = batch_client.file.get_from_task(
                    'python_test_job',
                    'python_task_1',
                    'stdout.txt'
            )
            for data in output:
                    file_output.write(data)
    

    【讨论】:

    • git 链接不起作用。你能发布你的完整实现吗
    猜你喜欢
    • 2022-08-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-14
    • 2020-08-20
    • 2020-10-08
    • 1970-01-01
    相关资源
    最近更新 更多