Bug 208743

Summary: resultsdbpy: Add tool to manage resultsdbpy container
Product: WebKit Reporter: Jonathan Bedard <jbedard>
Component: Tools / TestsAssignee: Jonathan Bedard <jbedard>
Status: RESOLVED FIXED    
Severity: Normal CC: aakash_jain, commit-queue, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch for landing none

Description Jonathan Bedard 2020-03-06 16:04:23 PST
Add tool to start, stop and restart the resultsdbpy Docker container.

I've found myself doing this sequence of commands enough to get annoyed by it.
Comment 1 Jonathan Bedard 2020-03-06 16:09:25 PST
Created attachment 392795 [details]
Patch
Comment 2 Aakash Jain 2020-03-06 16:20:15 PST
Comment on attachment 392795 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=392795&action=review

> Tools/ChangeLog:3
> +        resultsdbpy: Add container tool

Bug title should be little more descriptive.

> Tools/resultsdbpy/resultsdbpy/container:59
> +    start_parser = subparsers.add_parser('start', help='Start the container')

container -> 'docker container'?
Comment 3 Jonathan Bedard 2020-03-06 16:53:18 PST
Created attachment 392811 [details]
Patch
Comment 4 Aakash Jain 2020-03-06 17:47:50 PST
Comment on attachment 392811 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=392811&action=review

> Tools/resultsdbpy/resultsdbpy/container:34
> +    Docker.start()

running check required here?

> Tools/resultsdbpy/resultsdbpy/container:40
> +    if Docker.is_running():

missing not?
Comment 5 Jonathan Bedard 2020-03-06 17:51:47 PST
Comment on attachment 392811 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=392811&action=review

>> Tools/resultsdbpy/resultsdbpy/container:34
>> +    Docker.start()
> 
> running check required here?

The Docker function contains that check already.
Comment 6 Jonathan Bedard 2020-03-06 18:00:24 PST
Created attachment 392823 [details]
Patch
Comment 7 Aakash Jain 2020-03-07 10:58:18 PST
Comment on attachment 392823 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=392823&action=review

rs=me

> Tools/resultsdbpy/resultsdbpy/container:44
> +    Docker.stop()

Do we need to return 0 here?

> Tools/resultsdbpy/resultsdbpy/container:50
> +    Docker.stop_project(Docker.DEFAULT_PROJECT)

What if stop_project() fails, do we need to handle that? Does the return code of stop_project() indicate that?
Comment 8 Jonathan Bedard 2020-03-09 07:35:41 PDT
Comment on attachment 392823 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=392823&action=review

>> Tools/resultsdbpy/resultsdbpy/container:44
>> +    Docker.stop()
> 
> Do we need to return 0 here?

We should, although we don't need to (since 'None' becomes 0)

>> Tools/resultsdbpy/resultsdbpy/container:50
>> +    Docker.stop_project(Docker.DEFAULT_PROJECT)
> 
> What if stop_project() fails, do we need to handle that? Does the return code of stop_project() indicate that?

It's going to raise an exception. The output won't be pretty, but it will be correct.

Generally, these functions aren't expected to fail, so when they do, exceptions are raised.
Comment 9 Jonathan Bedard 2020-03-09 07:45:40 PDT
Created attachment 393032 [details]
Patch for landing
Comment 10 WebKit Commit Bot 2020-03-09 08:12:02 PDT
Comment on attachment 393032 [details]
Patch for landing

Clearing flags on attachment: 393032

Committed r258141: <https://trac.webkit.org/changeset/258141>
Comment 11 WebKit Commit Bot 2020-03-09 08:12:04 PDT
All reviewed patches have been landed.  Closing bug.
Comment 12 Radar WebKit Bug Importer 2020-03-09 08:13:15 PDT
<rdar://problem/60223645>