kestra-io / plugin-azure

Apache License 2.0
3 stars 5 forks source link

Azure Task Runner does not work #117

Closed wrussell1999 closed 3 months ago

wrussell1999 commented 3 months ago

Expected Behavior

When executing the example flow, it just throws the same error. Configuration should be correct.

Actual Behaviour

image

kestra-1    | 2024-07-11 17:17:09,195 INFO  WorkerThread f.a.5.2T2tIsCkTWpLzZrCu1GwxM Job 'companyteam-azure-batch-runner-scrape-environment-info-a6leh' created on pool 'azure_batch_task_runner'
kestra-1    | 2024-07-11 17:17:09,293 ERROR WorkerThread f.a.5.2T2tIsCkTWpLzZrCu1GwxM com.microsoft.azure.batch.CreateTasksErrorException: At least one task failed to be added.
kestra-1    | io.kestra.core.models.tasks.runners.TaskException: com.microsoft.azure.batch.CreateTasksErrorException: At least one task failed to be added.
kestra-1    |   at io.kestra.plugin.azure.runner.Batch.run(Batch.java:261)
kestra-1    |   at io.kestra.plugin.scripts.exec.scripts.runners.CommandsWrapper.run(CommandsWrapper.java:159)
kestra-1    |   at io.kestra.plugin.scripts.python.Commands.run(Commands.java:281)
kestra-1    |   at io.kestra.plugin.scripts.python.Commands.run(Commands.java:19)
kestra-1    |   at io.kestra.core.runners.WorkerTaskThread.doRun(WorkerTaskThread.java:77)
kestra-1    |   at io.kestra.core.runners.AbstractWorkerThread.run(AbstractWorkerThread.java:56)
kestra-1    | 2024-07-11 17:17:09,298 INFO  worker_14    f.a.scrape_environment_info [namespace: company.team] [flow: azure_batch_runner] [task: scrape_environment_info] [execution: 550AlV7hmVkIn8VVN59HCP] [taskrun: 2T2tIsCkTWpLzZrCu1GwxM] Type Commands with state FAILED completed in 00:00:00.918
kestra-1    | 2024-07-11 17:17:09,468 INFO  jdbc-queue-Execution_0 flow.azure_batch_runner [namespace: company.team] [flow: azure_batch_runner] [execution: 550AlV7hmVkIn8VVN59HCP] Flow completed with state FAILED in 00:00:01.994

No logs from Azure.

Steps To Reproduce

No response

Environment Information

Example flow

id: azure_batch_runner
namespace: company.team

variables:
  poolId: "azure_batch_task_runner"
  containerName: "kestra-demo-container"

tasks:
  - id: scrape_environment_info
    type: io.kestra.plugin.scripts.python.Commands
    containerImage: ghcr.io/kestra-io/pydata:latest
    taskRunner:
      type: io.kestra.plugin.azure.runner.Batch
      account: "account"
      accessKey: "access key"
      endpoint: "url"
      poolId: "{{ vars.poolId }}"
      blobStorage:
        containerName: "kestra-demo-container"
        connectionString: "string"
    commands:
      - python main.py
    namespaceFiles:
      enabled: true
    outputFiles:
      - "environment_info.json"
    inputFiles:
      main.py: |
        import platform
        import socket
        import sys
        import json
        from kestra import Kestra

        print("Hello from Azure Batch and kestra!")

        def print_environment_info():
            print(f"Host's network name: {platform.node()}")
            print(f"Python version: {platform.python_version()}")
            print(f"Platform information (instance type): {platform.platform()}")
            print(f"OS/Arch: {sys.platform}/{platform.machine()}")

            env_info = {
                "host": platform.node(),
                "platform": platform.platform(),
                "OS": sys.platform,
                "python_version": platform.python_version(),
            }
            Kestra.outputs(env_info)

            filename = 'environment_info.json'
            with open(filename, 'w') as json_file:
                json.dump(env_info, json_file, indent=4)

        if __name__ == '__main__':
          print_environment_info()
brian-mulier-p commented 3 months ago

fixed by https://github.com/kestra-io/plugin-azure/commit/5be6e5c58a949da4ea8ccc88e0de83cf881f49b9