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

cli: support loading initial datasets in cockroach demo #28383

Merged
merged 1 commit into from
Aug 8, 2018

Conversation

danhhz
Copy link
Contributor

@danhhz danhhz commented Aug 8, 2018

Any registered workloads are automatically added as subcommands.
cockroach demo demo keeps the old behavior, but cockroach demo startrek will load the startrek dataset into the startrek database
and alter the connection it starts to start in that database.

$ ./cockroach demo startrek
#
# Welcome to the CockroachDB demo database!
#
# You are connected to a temporary, in-memory CockroachDB
# instance. Your changes will not be saved!
#
# Web UI: http://127.0.0.1:63932
#
# Server version: CockroachDB CCL v2.1.0-alpha.20180702-1271-g3fe24ce-dirty (x86_64-apple-darwin17.7.0, built 2018/08/08 16:30:52, go1.10) (same version as client)
# Cluster ID: 7d0a580b-ecb2-4f5a-ae0f-bae298dbaf9b
#
# Enter \? for a brief introduction.
#
root@127.0.0.1:63931/startrek> select * from episodes limit 1;
+----+--------+-----+--------------+----------+
| id | season | num |    title     | stardate |
+----+--------+-----+--------------+----------+
|  1 |      1 |   1 | The Man Trap |   1531.1 |
+----+--------+-----+--------------+----------+
(1 row)

Still TODO is faster loading than Setup for large workloads, like tpcc.

Release note (cli change): cockroach demo now supports starting with
one of various datasets loaded

@danhhz danhhz requested a review from jordanlewis August 8, 2018 16:41
@danhhz danhhz requested a review from a team as a code owner August 8, 2018 16:41
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@jordanlewis
Copy link
Member

Nice idea! LGTM. I notice you didn't change / add any help texts (I think) - if you don't mind, it would be good to extend the help text to explain that subcommands mean load a given workload.

Any registered workloads are automatically added as subcommands.
`cockroach demo` demo keeps the old behavior, but `cockroach demo
startrek` will load the startrek dataset into the `startrek` database
and alter the connection it starts to start in that database.

    $ ./cockroach demo startrek
    #
    # Welcome to the CockroachDB demo database!
    #
    # You are connected to a temporary, in-memory CockroachDB
    # instance. Your changes will not be saved!
    #
    # Web UI: http://127.0.0.1:63932
    #
    # Server version: CockroachDB CCL v2.1.0-alpha.20180702-1271-g3fe24ce-dirty (x86_64-apple-darwin17.7.0, built 2018/08/08 16:30:52, go1.10) (same version as client)
    # Cluster ID: 7d0a580b-ecb2-4f5a-ae0f-bae298dbaf9b
    #
    # Enter \? for a brief introduction.
    #
    root@127.0.0.1:63931/startrek> select * from episodes limit 1;
    +----+--------+-----+--------------+----------+
    | id | season | num |    title     | stardate |
    +----+--------+-----+--------------+----------+
    |  1 |      1 |   1 | The Man Trap |   1531.1 |
    +----+--------+-----+--------------+----------+
    (1 row)

Still TODO is faster loading than Setup for large workloads, like tpcc.

Release note (cli change): `cockroach demo` now supports starting with
one of various datasets loaded
@danhhz
Copy link
Contributor Author

danhhz commented Aug 8, 2018

Whoops, slipped my mind. Done!

@danhhz
Copy link
Contributor Author

danhhz commented Aug 8, 2018

Thanks for the review!

Test failure is a flake fixed by #28329, which I don't have in my branch.

bors r=jordanlewis

craig bot pushed a commit that referenced this pull request Aug 8, 2018
28383: cli: support loading initial datasets in `cockroach demo` r=jordanlewis a=danhhz

Any registered workloads are automatically added as subcommands.
`cockroach demo` demo keeps the old behavior, but `cockroach demo
startrek` will load the startrek dataset into the `startrek` database
and alter the connection it starts to start in that database.

    $ ./cockroach demo startrek
    #
    # Welcome to the CockroachDB demo database!
    #
    # You are connected to a temporary, in-memory CockroachDB
    # instance. Your changes will not be saved!
    #
    # Web UI: http://127.0.0.1:63932
    #
    # Server version: CockroachDB CCL v2.1.0-alpha.20180702-1271-g3fe24ce-dirty (x86_64-apple-darwin17.7.0, built 2018/08/08 16:30:52, go1.10) (same version as client)
    # Cluster ID: 7d0a580b-ecb2-4f5a-ae0f-bae298dbaf9b
    #
    # Enter \? for a brief introduction.
    #
    root@127.0.0.1:63931/startrek> select * from episodes limit 1;
    +----+--------+-----+--------------+----------+
    | id | season | num |    title     | stardate |
    +----+--------+-----+--------------+----------+
    |  1 |      1 |   1 | The Man Trap |   1531.1 |
    +----+--------+-----+--------------+----------+
    (1 row)

Still TODO is faster loading than Setup for large workloads, like tpcc.

Release note (cli change): `cockroach demo` now supports starting with
one of various datasets loaded

Co-authored-by: Daniel Harrison <daniel.harrison@gmail.com>
@craig
Copy link
Contributor

craig bot commented Aug 8, 2018

Build succeeded

@craig craig bot merged commit 6a8d341 into cockroachdb:master Aug 8, 2018
@danhhz danhhz deleted the demo_dataset branch August 8, 2018 18:01
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