Skip to content

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

Merged
merged 11 commits into from
Jul 20, 2022
Merged

Add tt commands start, stop, status, restart #3022

merged 11 commits into from
Jul 20, 2022

Conversation

p7nov
Copy link
Contributor

@p7nov p7nov commented Jul 12, 2022

Resolves #2556

@p7nov p7nov marked this pull request as draft July 12, 2022 10:04
@github-actions github-actions bot temporarily deployed to branch-gh-2556-tt-start July 12, 2022 10:06 Inactive
@github-actions github-actions bot temporarily deployed to branch-gh-2556-tt-start July 12, 2022 10:15 Inactive
@github-actions github-actions bot temporarily deployed to branch-gh-2556-tt-start July 12, 2022 10:25 Inactive
@github-actions github-actions bot temporarily deployed to branch-gh-2556-tt-start July 12, 2022 10:27 Inactive
@github-actions github-actions bot temporarily deployed to branch-gh-2556-tt-start July 12, 2022 11:30 Inactive
@github-actions github-actions bot temporarily deployed to branch-gh-2556-tt-start July 13, 2022 05:59 Inactive
Copy link

@LeonidVas LeonidVas left a 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.

Details
-------

The ``INSTANCE`` argument must contain the value specified when :ref:`starting the instance <tt-start>`.

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?

Copy link
Contributor Author

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.

Details
-------

The ``INSTANCE`` argument must specify a path to the instance file:

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.


* 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``

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.


.. code-block:: bash

tt start instances/app

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.

Copy link
Contributor Author

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?


.. code-block:: bash

tt start app/instance1

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.

Copy link
Contributor Author

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.

Details
-------

The ``INSTANCE`` argument must contain the value specified when :ref:`starting the instance <tt-start>`.

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.

Copy link
Contributor Author

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.


.. code-block:: bash

tt stop INSTANCE

Choose a reason for hiding this comment

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

restart?

Details
-------

The ``INSTANCE`` argument must contain the value specified when :ref:`starting the instance <tt-start>`.

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.

@github-actions github-actions bot temporarily deployed to branch-gh-2556-tt-start July 14, 2022 11:33 Inactive
@github-actions github-actions bot temporarily deployed to branch-gh-2556-tt-start July 14, 2022 11:34 Inactive
@github-actions github-actions bot temporarily deployed to branch-gh-2556-tt-start July 14, 2022 11:45 Inactive
@p7nov p7nov requested a review from LeonidVas July 14, 2022 11:46
@github-actions github-actions bot temporarily deployed to branch-gh-2556-tt-start July 14, 2022 11:58 Inactive
Copy link

@LeonidVas LeonidVas left a comment

Choose a reason for hiding this comment

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

LGTM

@p7nov p7nov requested a review from patiencedaur July 19, 2022 07:31
Copy link
Contributor

@patiencedaur patiencedaur left a 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:
Copy link
Contributor

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.

Copy link
Contributor Author

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]>
@github-actions github-actions bot temporarily deployed to branch-gh-2556-tt-start July 19, 2022 09:37 Inactive
@p7nov p7nov requested a review from patiencedaur July 19, 2022 09:41
@patiencedaur patiencedaur marked this pull request as ready for review July 20, 2022 08:15
@p7nov p7nov merged commit 9cbab52 into latest Jul 20, 2022
@p7nov p7nov deleted the gh-2556-tt-start branch July 20, 2022 08:24
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.

[5pt] tt start, tt stop, tt status, tt restart
3 participants