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

azure-cli v2.69.0 does not work with a stable release of azure-batch #30814

Open
ShermanCAA opened this issue Feb 12, 2025 · 4 comments
Open
Assignees
Labels
Customer Usage customer-reported Issues that are reported by GitHub users external to the Azure organization. Service Attention This issue is responsible by Azure service team.
Milestone

Comments

@ShermanCAA
Copy link

ShermanCAA commented Feb 12, 2025

Describe the bug

The latest release of azure-cli v2.69.0 depends on a pre-release version of azure-batch

'azure-batch~=15.0.0b1',
, which breaks software that relies on the latest stable version of azure-batch v14.2.0

The class signature has changed significantly from BatchServiceClient to BatchClient

Related command

Using the python SDK:

  1. Install latest version of azure-batch from PyPI (https://pypi.org/project/azure-batch/)
  2. Install latest version of azure-cli from PyPI (https://pypi.org/project/azure-cli/)
  3. from azure.batch import BatchServiceClient

Errors

ImportError: cannot import name 'BatchServiceClient' from 'azure.batch'...

Issue script & Debug output

ImportError while importing test module '/home/vsts/work/1/s/Pipelines/RestartPools/tests/test_restart_pools.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/opt/hostedtoolcache/Python/3.10.16/x64/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
Pipelines/RestartPools/tests/test_restart_pools.py:11: in <module>
    import restart_pools as p
Pipelines/RestartPools/activities/python/restart_pools.py:35: in <module>
    import common.batch.pool as p
common/common/batch/pool.py:6: in <module>
    from azure.batch import BatchServiceClient
E   ImportError: cannot import name 'BatchServiceClient' from 'azure.batch' (/opt/hostedtoolcache/Python/3.10.16/x64/lib/python3.10/site-packages/azure/batch/__init__.py)

Expected behavior

No discrepancy between latest stable versions of azure-batch and azure-cli

Environment Summary

azure-cli: 2.69.0
azure-batch: 14.2.0
Python: 3.10.16
OS: Ubuntu-22.04

Additional context

Related issue: Azure/azure-sdk-for-python#39676

@ShermanCAA ShermanCAA added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Feb 12, 2025
@yonzhan
Copy link
Collaborator

yonzhan commented Feb 12, 2025

Thank you for opening this issue, we will look into it.

@microsoft-github-policy-service microsoft-github-policy-service bot added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label Feb 12, 2025
@yonzhan yonzhan added the Service Attention This issue is responsible by Azure service team. label Feb 12, 2025
@yonzhan yonzhan added this to the Backlog milestone Feb 12, 2025
@evelyn-ys
Copy link
Member

@ShermanCAA The Batch SDK has been upgraded from track1 to track2. If you have any other scripts calling batch SDK, pls use separate environment, pls don't rely on the batch SDK that CLI depends on.

@evelyn-ys evelyn-ys added Customer Usage and removed bug This issue requires a change to an existing behavior in the product in order to be resolved. labels Feb 13, 2025
@ShermanCAA
Copy link
Author

ShermanCAA commented Feb 13, 2025

@evelyn-ys What do I do when I have software that needs to run with both azure-cli & azure-batch under the same environment?
What do track1 & track2 mean?
Will either azure-batch release a new stable version (EDIT: perhaps to track2?) that is compatible with azure-cli, or will azure-cli be backwards compatible with azure-batch's current stable release?

@evelyn-ys
Copy link
Member

@ShermanCAA I'd like to defer the question to batch team @wiboris

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Customer Usage customer-reported Issues that are reported by GitHub users external to the Azure organization. Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

3 participants