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

Serve log before termination for smoke tests #4691

Merged

Conversation

zpoint
Copy link
Collaborator

@zpoint zpoint commented Feb 11, 2025

  • output serve controller logs before termination for smoke tests

Tested (run the relevant ones):

  • Code formatting: bash format.sh
  • Any manual or new tests for this PR (please specify below)
  • All smoke tests: pytest tests/test_smoke.py
  • Relevant individual smoke tests: pytest tests/test_smoke.py::test_fill_in_the_name
  • Backward compatibility tests: conda deactivate; bash -i tests/backward_compatibility_tests.sh

@zpoint zpoint force-pushed the dev/zeping/serve_log_before_termination branch from 42cbf05 to 23670b2 Compare February 11, 2025 06:16
@zpoint zpoint requested a review from romilbhardwaj February 11, 2025 06:17
@zpoint zpoint added this to the v0.8.0 milestone Feb 11, 2025
@zpoint zpoint mentioned this pull request Feb 11, 2025
7 tasks
@zpoint
Copy link
Collaborator Author

zpoint commented Feb 11, 2025

/smoke-test --kubernetes

@zpoint zpoint requested a review from Michaelvll February 11, 2025 07:50
# "Services" section), increment a counter. Skip the first line (header) and
# print the first column (service name) for subsequent lines.
_SHOW_SERVE_STATUS = (
'sky status --refresh | awk \''
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not use sky serve status and why we use --refresh?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated with sky serve status

@zpoint zpoint requested a review from Michaelvll February 11, 2025 09:06
Comment on lines 84 to 94
_SHOW_SERVE_STATUS = (
'sky serve status | awk \''
'/^Services$/{{flag=1; next}} '
'/^$/{{flag=0}} '
'flag {{if (++count > 1) print $1}}\' | '
'while read -r service_name; do '
' echo "+ sky serve logs --controller $service_name --no-follow"; '
' sky serve logs --controller $service_name --no-follow; '
' echo "+ sky serve logs --load-balancer $service_name --no-follow"; '
' sky serve logs --load-balancer $service_name --no-follow; '
'done; ')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will show the logs for all services? What if there are multiple tests running for skyserve? Wouldn't this mess up the output of the test with outputs from other tests?

Also, would any failure of these commands cause leakage replica resources as service termination commands may not be called afterwards.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now pass the {name} to display specific services only.

The command format is cmdA; cmdB; cmdC; .... If cmdA fails, cmdB will still execute — that's how bash runs commands.

@zpoint zpoint removed this from the v0.8.0 milestone Feb 12, 2025
@zpoint zpoint requested a review from Michaelvll February 12, 2025 04:38
@zpoint
Copy link
Collaborator Author

zpoint commented Feb 15, 2025

/smoke-test --managed-jobs

@zpoint
Copy link
Collaborator Author

zpoint commented Feb 17, 2025

/smoke-test --k test_multi_tenant

@zpoint
Copy link
Collaborator Author

zpoint commented Feb 17, 2025

/smoke-test -k test_multi_tenant

1 similar comment
@zpoint
Copy link
Collaborator Author

zpoint commented Feb 17, 2025

/smoke-test -k test_multi_tenant

@zpoint
Copy link
Collaborator Author

zpoint commented Feb 17, 2025

/smoke-test --kubernetes -k test_managed_jobs_basic

@zpoint
Copy link
Collaborator Author

zpoint commented Feb 19, 2025

@romilbhardwaj Could u help review?

@@ -69,12 +69,19 @@ def _get_service_name() -> str:
_IP_REGEX = r'([0-9]{1,3}\.){3}[0-9]{1,3}'
_AWK_ALL_LINES_BELOW_REPLICAS = r'/Replicas/{flag=1; next} flag'
_SERVICE_LAUNCHING_STATUS_REGEX = 'PROVISIONING\|STARTING'

_SHOW_SERVE_STATUS = (
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a quick sky serve status before the logs commands?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zpoint zpoint requested a review from romilbhardwaj February 19, 2025 09:03
@zpoint
Copy link
Collaborator Author

zpoint commented Feb 26, 2025

@romilbhardwaj Could you help take another look?

Copy link
Collaborator

@romilbhardwaj romilbhardwaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @zpoint!

@@ -69,12 +69,21 @@ def _get_service_name() -> str:
_IP_REGEX = r'([0-9]{1,3}\.){3}[0-9]{1,3}'
_AWK_ALL_LINES_BELOW_REPLICAS = r'/Replicas/{flag=1; next} flag'
_SERVICE_LAUNCHING_STATUS_REGEX = 'PROVISIONING\|STARTING'

_SHOW_SERVE_STATUS = (
'echo "+ sky serve status {name}"; '
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these echo statements necessary? I thought the command being executed was automatically echo'd by our tests

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our tests didn’t echo the teardown command, and I think it’s better to keep the lower granularity, like the current sky serve status {name}, rather than something like echo "_AWK....1000 characters other command; {sky serve status {name}}".

@zpoint zpoint merged commit 5c12640 into skypilot-org:master Mar 4, 2025
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants