azure-cli-extensions icon indicating copy to clipboard operation
azure-cli-extensions copied to clipboard

Add log streaming for container app jobs

Open lihaMSFT opened this issue 10 months ago • 11 comments


This checklist is used to make sure that common guidelines for a pull request are followed.

Related command

  • az containerapp job logs show
  • az containerapp job replica

General Guidelines

  • [ ] Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • [x] Have you run python scripts/ci/test_index.py -q locally? (pip install wheel==0.30.0 required)
  • [x] My extension version conforms to the Extension version schema

For new extensions:

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify src/index.json.

lihaMSFT avatar Apr 03 '24 22:04 lihaMSFT

⚠️Azure CLI Extensions Breaking Change Test
⚠️containerapp
rule cmd_name rule_message suggest_message
⚠️ 1011 - SubgroupAdd containerapp job logs sub group containerapp job logs added
⚠️ 1011 - SubgroupAdd containerapp job replica sub group containerapp job replica added

Hi @lihaMSFT, Please write the description of changes which can be perceived by customers into HISTORY.rst. If you want to release a new extension version, please update the version in setup.py as well.

Thank you for your contribution! We will review the pull request and get back to you soon.

yonzhan avatar Apr 03 '24 22:04 yonzhan

:warning: Release Suggestions

Module: containerapp

  • Update VERSION to 1.0.0b1 in src/containerapp/setup.py

Notes

  • Stable/preview tag is inherited from last release. If needed, please add stable/preview label to modify it.
  • Major/minor/patch/pre increment of version number is calculated by pull request code changes automatically. If needed, please add major/minor/patch/pre label to adjust it.
  • For more info about extension versioning, please refer to Extension version schema

github-actions[bot] avatar Apr 08 '24 02:04 github-actions[bot]

Not sure why integration tests are failing. Didn't change these in this PR.

lihaMSFT avatar Apr 18 '24 23:04 lihaMSFT

Not sure why integration tests are failing. Didn't change these in this PR.

The other test failed due to their related api-version update. Need to rerun them with --live to update the recording files.

except CannotOverwriteExistingCassetteException as ex:
>           raise AssertionError(ex)
E           AssertionError: Can't overwrite existing cassette ('/mnt/vss/_work/1/s/src/containerapp/azext_containerapp/tests/latest/recordings/test_containerapp_addon_binding_e2e.yaml') in your current record mode ('once').
E           No match for the request (<Request (DELETE) [https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/client.env_rg_francecentral/providers/Microsoft.App/containerapps/containerapp000002/providers/Microsoft.ServiceLinker/linkers/postgres_binding?api-version=2023-04-01-preview>](https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/client.env_rg_francecentral/providers/Microsoft.App/containerapps/containerapp000002/providers/Microsoft.ServiceLinker/linkers/postgres_binding?api-version=2023-04-01-preview%3E)) was found.
E           Found 1 similar requests with 1 different matcher(s) :
E           
E           1 - (<Request (DELETE) [https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/client.env_rg_francecentral/providers/Microsoft.App/containerapps/containerapp000002/providers/Microsoft.ServiceLinker/linkers/postgres_binding?api-version=2022-11-01-preview>).](https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/client.env_rg_francecentral/providers/Microsoft.App/containerapps/containerapp000002/providers/Microsoft.ServiceLinker/linkers/postgres_binding?api-version=2022-11-01-preview%3E).)
E           Matchers succeeded : ['method', 'scheme', 'host', 'port', 'path']
E           Matchers failed :
E           _custom_request_query_matcher - assertion failure :
E           None


Greedygre avatar Apr 19 '24 00:04 Greedygre

Not sure why integration tests are failing. Didn't change these in this PR.

The other test failed due to their related api-version update. Need to rerun them with --live to update the recording files.

except CannotOverwriteExistingCassetteException as ex:
>           raise AssertionError(ex)
E           AssertionError: Can't overwrite existing cassette ('/mnt/vss/_work/1/s/src/containerapp/azext_containerapp/tests/latest/recordings/test_containerapp_addon_binding_e2e.yaml') in your current record mode ('once').
E           No match for the request (<Request (DELETE) [https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/client.env_rg_francecentral/providers/Microsoft.App/containerapps/containerapp000002/providers/Microsoft.ServiceLinker/linkers/postgres_binding?api-version=2023-04-01-preview>](https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/client.env_rg_francecentral/providers/Microsoft.App/containerapps/containerapp000002/providers/Microsoft.ServiceLinker/linkers/postgres_binding?api-version=2023-04-01-preview%3E)) was found.
E           Found 1 similar requests with 1 different matcher(s) :
E           
E           1 - (<Request (DELETE) [https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/client.env_rg_francecentral/providers/Microsoft.App/containerapps/containerapp000002/providers/Microsoft.ServiceLinker/linkers/postgres_binding?api-version=2022-11-01-preview>).](https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/client.env_rg_francecentral/providers/Microsoft.App/containerapps/containerapp000002/providers/Microsoft.ServiceLinker/linkers/postgres_binding?api-version=2022-11-01-preview%3E).)
E           Matchers succeeded : ['method', 'scheme', 'host', 'port', 'path']
E           Matchers failed :
E           _custom_request_query_matcher - assertion failure :
E           None

I will do that in a separate PR then.

lihaMSFT avatar Apr 19 '24 00:04 lihaMSFT

Not sure why integration tests are failing. Didn't change these in this PR.

The other test failed due to their related api-version update. Need to rerun them with --live to update the recording files.

except CannotOverwriteExistingCassetteException as ex:
>           raise AssertionError(ex)
E           AssertionError: Can't overwrite existing cassette ('/mnt/vss/_work/1/s/src/containerapp/azext_containerapp/tests/latest/recordings/test_containerapp_addon_binding_e2e.yaml') in your current record mode ('once').
E           No match for the request (<Request (DELETE) [https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/client.env_rg_francecentral/providers/Microsoft.App/containerapps/containerapp000002/providers/Microsoft.ServiceLinker/linkers/postgres_binding?api-version=2023-04-01-preview>](https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/client.env_rg_francecentral/providers/Microsoft.App/containerapps/containerapp000002/providers/Microsoft.ServiceLinker/linkers/postgres_binding?api-version=2023-04-01-preview%3E)) was found.
E           Found 1 similar requests with 1 different matcher(s) :
E           
E           1 - (<Request (DELETE) [https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/client.env_rg_francecentral/providers/Microsoft.App/containerapps/containerapp000002/providers/Microsoft.ServiceLinker/linkers/postgres_binding?api-version=2022-11-01-preview>).](https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/client.env_rg_francecentral/providers/Microsoft.App/containerapps/containerapp000002/providers/Microsoft.ServiceLinker/linkers/postgres_binding?api-version=2022-11-01-preview%3E).)
E           Matchers succeeded : ['method', 'scheme', 'host', 'port', 'path']
E           Matchers failed :
E           _custom_request_query_matcher - assertion failure :
E           None

I will do that in a separate PR then.

Hi @lihaMSFT I am going to upgrade the api-version to 2024-02-02-preview early this week, you can wait for this and rerun your new tests.

Greedygre avatar Apr 22 '24 02:04 Greedygre

Hi @lihaMSFT Can you send a message to me in the teams?

Greedygre avatar May 14 '24 00:05 Greedygre

Please follow the review process and resolve the conflict.

Greedygre avatar May 14 '24 11:05 Greedygre

About CI failed: There are 5 tests failed, I have help to fix 4 of them with PR due to az containerapp job update polling logic fix in azure-cli. The rest one test_containerappjob_logstream, please rerun it with --live, and update the recording file.

FAILED src/containerapp/azext_containerapp/tests/latest/test_containerappjob_crud.py::ContainerAppJobsCRUDOperationsTest::test_containerapp_manualjob_crudoperations_e2e
FAILED src/containerapp/azext_containerapp/tests/latest/test_containerappjob_event_triggered_crud.py::ContainerAppJobsCRUDOperationsTest::test_containerapp_eventjob_crudoperations_e2e
FAILED src/containerapp/azext_containerapp/tests/latest/test_containerappjob_executions.py::ContainerAppJobsExecutionsTest::test_containerappjob_logstream
FAILED src/containerapp/azext_containerapp/tests/latest/test_containerappjob_with_yaml.py::ContainerAppJobsExecutionsLocationNotInStageTest::test_containerappjob_create_with_yaml
FAILED src/containerapp/azext_containerapp/tests/latest/test_containerappjob_with_yaml.py::ContainerAppJobsExecutionsLocationNotInStageTest::test_containerappjob_eventtriggered_create_with_yaml

Greedygre avatar May 29 '24 03:05 Greedygre

@Greedygre the tests are passing now.

lihaMSFT avatar May 29 '24 20:05 lihaMSFT

@Greedygre the tests are passing now.

Please resolve the conflict. Or you can assign the right to my account Greedygre, I can help to resolve small conflict in history.rst

Greedygre avatar May 31 '24 05:05 Greedygre

Please fix conflicting files.

yonzhan avatar May 31 '24 06:05 yonzhan

Hi @lihaMSFT

I recommend you only update your test's yaml file test_containerappjob_logstream after update azure-cli dev branch to latest code then rerun it with --live. About other 4 tests you can use command git checkout main src/containerapp/azext_containerapp/tests/latest/recordings/test_containerapp_eventjob_crudoperations_e2e.yaml to checkout to the main branch.

Please assign permission for your repo to my account Greedygre, so that I can handle small conflict.

Greedygre avatar Jun 03 '24 08:06 Greedygre