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

Show status of individual tasks #9

Merged
merged 2 commits into from
Nov 3, 2023
Merged

Show status of individual tasks #9

merged 2 commits into from
Nov 3, 2023

Conversation

nweires
Copy link
Collaborator

@nweires nweires commented Nov 1, 2023

Small update to the --list_jobs option: show the status of the tasks.

This is helpful when checking on in-progress jobs, to see how many of the batches have finished.

Sample output:

INFO:2023-11-01 19:06:53:buildstockbatch.gcp.gcp:Name: projects/buildstockbatch-dev/locations/us-central1/jobs/natalie10023-11-01-185441
INFO:2023-11-01 19:06:53:buildstockbatch.gcp.gcp:  UID: natalie10023-11-01-f66fb0dc-625f-434d0
INFO:2023-11-01 19:06:53:buildstockbatch.gcp.gcp:  Status: RUNNING
INFO:2023-11-01 19:06:53:buildstockbatch.gcp.gcp:  Task statuses: {'RUNNING': 3, 'SUCCEEDED': 2}

@nweires nweires requested a review from lathanh November 1, 2023 19:10
@@ -355,10 +355,16 @@ def list_jobs(self):
logger.info(f'Showing the first 10 existing jobs that match: {request.filter}\n')
response = client.list_jobs(request)
for job in response.jobs:
task_counts = collections.defaultdict(int)
logger.debug(job)
Copy link
Member

Choose a reason for hiding this comment

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

What does this debug line output — is it redundant with the info logs (is it needed)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It prints out the long version of the job information with lots more details (but only when the --verbose flag is set).

Copy link
Member

Choose a reason for hiding this comment

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

Is it redundant with the 'info' logging that follows? Would it make sense to not do the info logging if debug logging is enabled?

@nweires nweires merged commit 048b66a into gcp Nov 3, 2023
@nweires nweires deleted the natalie/list_jobs branch November 8, 2023 18:40
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.

2 participants