-
Notifications
You must be signed in to change notification settings - Fork 43
Add tt commands start, stop, status, restart #3022
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HI! Thank you for the patchset.
See several comments below.
doc/reference/tt_cli/restart.rst
Outdated
Details | ||
------- | ||
|
||
The ``INSTANCE`` argument must contain the value specified when :ref:`starting the instance <tt-start>`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As for me, it sounds strange. It's the name of the running instance, and I can't think of anything else to put there other than what you specified in start
.
Maybe just INSTANCE
is the name of the running instance?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it (the nature of instance name) is obvious, I think we can just skip the Details section and rephrase intro a bit.
doc/reference/tt_cli/start.rst
Outdated
Details | ||
------- | ||
|
||
The ``INSTANCE`` argument must specify a path to the instance file: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. The name (not the path) of the instance from the instances_available
directory is specified. This can be the name of the lua
file or the name of the directory with the init.lua
file.
doc/reference/tt_cli/start.rst
Outdated
|
||
* from the ``instances_available`` path specified in the | ||
:ref:`tt configuration file <tt-config_file_app>`. | ||
* from the ``tt`` :ref:`working directory <tt-config_modes>` if ``instances_available`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now the cwd
is default instances_available
, but it looks like this will be changed. It would be better to remove this item.
doc/reference/tt_cli/start.rst
Outdated
|
||
.. code-block:: bash | ||
|
||
tt start instances/app |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not how it should work. If it works that way, it's a bug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, this does work:
p.semyonov@p-semyonov tt % ./tt check instances/app
• Result of check: syntax of file '/Users/p.semyonov/tt/instances/app.lua' is OK
p.semyonov@p-semyonov tt % ./tt start instances/app
p.semyonov@p-semyonov tt % • Starting an instance...
p.semyonov@p-semyonov tt % ./tt status instances/app
• RUNNING. PID: 267.
p.semyonov@p-semyonov tt % ./tt stop instances/app
2022/07/14 17:48:48 The Instance (PID = 267) has been terminated.
Should I file this bug?
doc/reference/tt_cli/start.rst
Outdated
|
||
.. code-block:: bash | ||
|
||
tt start app/instance1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not how it should work (only the name should be specified). If it works that way, it's a bug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, it works:
p.semyonov@p-semyonov tt % ./tt check instances/instance1
• Result of check: syntax of file '/Users/p.semyonov/tt/instances/instance1/init.lua' is OK
p.semyonov@p-semyonov tt % ./tt start instances/instance1
p.semyonov@p-semyonov tt % • Starting an instance...
p.semyonov@p-semyonov tt % ./tt status instances/instance1
• RUNNING. PID: 322.
p.semyonov@p-semyonov tt % ./tt stop instances/instance1
2022/07/14 17:51:47 The Instance (PID = 322) has been terminated.
doc/reference/tt_cli/status.rst
Outdated
Details | ||
------- | ||
|
||
The ``INSTANCE`` argument must contain the value specified when :ref:`starting the instance <tt-start>`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same as for restart
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed Details here as well.
doc/reference/tt_cli/restart.rst
Outdated
|
||
.. code-block:: bash | ||
|
||
tt stop INSTANCE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
restart
?
doc/reference/tt_cli/stop.rst
Outdated
Details | ||
------- | ||
|
||
The ``INSTANCE`` argument must contain the value specified when :ref:`starting the instance <tt-start>`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same as for restart
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Left some comments.
Examples | ||
-------- | ||
|
||
* Start the ``app.lua`` instance from the ``instances_available`` directory: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the default value for the instances_available
directory? The user might have the same question when reading this document. Consider indicating the default on the config page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now it's the current working directory but it's not the final decision, please see this comment. We decided to skip this detail so that readers don't rely on it.
Co-authored-by: Dia Patience Daur <[email protected]>
Resolves #2556