Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix AzureBatchOperator false negative status #25844

Merged
merged 1 commit into from
Aug 26, 2022

Conversation

pankajastro
Copy link
Member

closes: #25635


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@pankajastro pankajastro changed the title Fix AzureBatchOperator false positive status Fix AzureBatchOperator false negative status Aug 24, 2022
@pankajastro pankajastro marked this pull request as ready for review August 24, 2022 11:22
@nicholashendrickx-tomtom

@pankajastro I still have issues with the exit code. I'm passing the following command line to AzureBatchOperator:

"/bin/bash -c 'exit 1'"

And even though the batch job fails on Azure, Airflow still considers the task to be exiting with code 0.
We are using apache-airflow-providers-microsoft-azure@4.3.0

@pankajastro
Copy link
Member Author

@pankajastro I still have issues with the exit code. I'm passing the following command line to AzureBatchOperator:

"/bin/bash -c 'exit 1'"

And even though the batch job fails on Azure, Airflow still considers the task to be exiting with code 0. We are using apache-airflow-providers-microsoft-azure@4.3.0

that's weird, can you please share your airflow AzureBatchOperator task?

@nicholashendrickx-tomtom

that's weird, can you please share your airflow AzureBatchOperator task?

cmd_line = "/bin/bash -c 'exit 1'"

batch_operator = AzureBatchOperator(
        task_id='batch_operator_with_inline_exit_1',
        batch_pool_id='batch_pool_test',
        batch_pool_vm_size='STANDARD_F48S_V2',
        batch_job_id='batch_job_test',
        batch_task_command_line=cmd_line,
        batch_task_id='batch_task_test',
        batch_max_retries=1,
        batch_task_resource_files=resource_files, # var defined elsewhere, irrelevant in this example
        batch_task_user_identity=user_identity, # var defined elsewhere
        target_dedicated_nodes=1,
        azure_batch_conn_id='azure_batch_default',
        vm_publisher='Canonical',
        vm_offer='0001-com-ubuntu-server-focal',
        vm_sku='20_04-lts-gen2',
        vm_node_agent_sku_id='batch.node.ubuntu 20.04',
        timeout=360,
        should_delete_job=False,
        should_delete_pool=False
    )

As said the Azure Portal shows me that the batch job failed, and exited with exit code 1

@nicholashendrickx-tomtom

Any idea how I can more easily test this? Which configuration did you use to test it @pankajastro?

@nicholashendrickx-tomtom
Copy link

nicholashendrickx-tomtom commented Oct 21, 2022

I've pushed changes in #27185

@pankajastro pankajastro deleted the fix_azure_batch_job branch March 9, 2023 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AzureBatchOperator not handling exit code correctly
4 participants