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

Run command timelimit #924

Closed
dima-stefantsov opened this issue Dec 13, 2016 · 9 comments
Closed

Run command timelimit #924

dima-stefantsov opened this issue Dec 13, 2016 · 9 comments
Labels

Comments

@dima-stefantsov
Copy link

Q A
Issue Type Bug
Deployer Version ^3.3
Local Machine OS Windows 10
Remote Machine OS Ubuntu Server 16

Description

Run command has a fixed time limit of 1 hour.

Steps to reproduce

  1. Run a command that takes longer than 1 hour.
  2. It will silently die, without any exceptions or errors, deploy script will continue like nothing happened.

Expected outcome

Allow me to override timelimit, or make run command have no timelimit by default.
http://4.stefantsov.com/s/?2016.12.13_19.17.04_bp73y2t4.png

@antonmedv
Copy link
Member

Ok, i think we can add option for support that case.

@antonmedv
Copy link
Member

Done in #1092

@dima-stefantsov
Copy link
Author

That was a huge bait. While v3.3 fails at running for more than an hour, v.5 doesn't work at all, after all days spent trying to make it function. It's inner API became more restrictive, it requires external tools (rsync?), external configs (.ssh/config?), it's harder to invoke (dep task --roles rolename instead of just dep task stagename), and it still doesn't work.

I see your general direction is moving from PHP code to 'native' workflow, but it's 'native' just for unix.

Using a simple tool must be easy. Using v3.3 was easy. After several days of trying, v5 still doesn't work for me. That's sad.

@antonmedv
Copy link
Member

antonmedv commented Apr 14, 2017

@dima-stefantsov v5 is still in beta. It may don't work. instead of crying how bad it became you can better offer solution how to make it better. I put a lot of work in v5 and i think it's best app i've ever created.

@barryvdh
Copy link
Contributor

Agreed, you can just keep using v3 forever if you like it better, or fork it and keep maintaining that. I do like that deployer 5 is going in a more 'native' solution regarding SSH etc.
Keep up the good work @antonmedv :)

@dima-stefantsov
Copy link
Author

That I have noticed. It looks like you have improved very much as a programmer: namespaces, smart native solutions. But deployer has lost what it was good for: it's user-simplicity.

For those, who like I would continue to use dep v3.3, to fix current issue you have to edit https://github.com/deployphp/deployer/blob/3.x/src/Server/Remote/PhpSecLib.php#L49 and write there huge positive value of seconds, for example 172800 would be 2 days.

Since you are going that way, you might as well enable real time run() output in v3.3. For that you'd had to edit vendor/phpseclib/phpseclib/phpseclib/Net/SSH2.php http://4.stefantsov.com/s/2017.04.14_11.40.01_xqpcp2g3.png and vendor/deployer/deployer/src/functions.php http://4.stefantsov.com/s/2017.04.14_11.40.43_p2h7e8tu.png

And while we are at it, set useful default runLocally value http://4.stefantsov.com/s/2017.04.14_11.42.53_0bq6tvbx.png

@dima-stefantsov
Copy link
Author

@barryvdh that 'native' way is huge paradigm change for deployer. It was good because it was using just universal PHP libs. It worked good on Windows. Now it doesn't.

Now user can't specify login password. Now user can't specify passphrase. Now user have to go further ways to invoke dep commands (stages now are singular), etc.

That is an improvement for some use cases, but for my case it's a huge step back.

@dima-stefantsov
Copy link
Author

instead of crying how bad it became you can better offer solution how to make it better.

Last time I said what could be better, you answered I should fork it and reminded me deployer is provided as is. Every hardship I encountered is my feedback on what can be done better:

  1. don't break api. There is no need to change server() to host().
  2. don't silently break api! Functions like identityFile() are now taking different parameters, but has same name.
  3. don't make it harder to use. You are using ...$string syntax now instead of [] syntax, this way interpreter fails on comma in the end; in arrays it doesn't. And it doesn't die if it takes array! It just silently works, but like no values was set. It made me fail to use --roles for a long time.
  4. don't make it harder to use! After few days, I'm still unable to connect to my server. Looks like now deployer wants me to use .ssh/config file. I want to specify everything in code, a monster with a lot of configs - that's ansible. Simplicity - is why deployer was better.
  5. have better documentation. It took me a day to find there is a file https://github.com/deployphp/deployer/blob/master/UPGRADE.md , it took me another day to find https://github.com/deployphp/docs , who knows how many more good learning places are there, which I don't know about. Are you sure I'm unique, and all your other users know everything? Ok, v5 is beta, but after I update to v4, I'm lost same way. My deploy.php stops working the same. I'm totally lost. "This thing got broken". Error messages I was getting had no hints "here, Dima, you are using old api, just update your code according to $link".
  6. do the bug fixing. This issue reports a problem, reports a place in code where to fix it. Just go there and change 3600 to 99999999. Done. But you have "fixed" it in v5beta. How much have this helped me? Negative help, wasted few full days just to start version controlling and editing vendor.
  7. an idea for better default. Defaulting runLocally to suddenly die in 1 minute is weird. Have it =null by default, if developer wants to set timeout, he will specify it. That would be consistent with how run() will work after fix.
  8. be consistent. I have no idea how, but I was able to use dep ssh on v5. It asked for password, and let me in. But dep deploy always fails on first step. "This is completely broken".
  9. be consistent, please. You may have rose as developer, and the following is exclusively my personal(professional) opinion, but good code = simple code. If you really are about to make "best app i've ever created", it ought to be simpler, easier to use, understand, read and edit code. Judging by my painful experience with (v4 and) v5, this is totally not the case. This is just my opinion, everyone may understand the art of programming different.

@antonmedv
Copy link
Member

don't break api. There is no need to change server() to host().

Disagree. Deployer uses semver, so it doesn't break api in minor/patch releases. Read more about it here: http://semver.org/
While BC in major releases allows to move forward.

don't silently break api! Functions like identityFile() are now taking different parameters, but has same name.

Same here.

don't make it harder to use. You are using ...$string syntax now instead of [] syntax, this way interpreter fails on comma in the end; in arrays it doesn't. And it doesn't die if it takes array! It just silently works, but like no values was set. It made me fail to use --roles for a long time.

Maybe allowing array here will make deployer easy to use.

don't make it harder to use! After few days, I'm still unable to connect to my server. Looks like now deployer wants me to use .ssh/config file. I want to specify everything in code, a monster with a lot of configs - that's ansible. Simplicity - is why deployer was better.

Use still can define everything inside one deploy.php file. New Deployer v5 only omits passwords and passphrases as it doesn't supported by OpenSSH and it's bad to have passowords in repo anywhere. (you can use tools like sshpass, But I do not recommend).

have better documentation. It took me a day to find there is a file https://github.com/deployphp/deployer/blob/master/UPGRADE.md , it took me another day to find https://github.com/deployphp/docs , who knows how many more good learning places are there, which I don't know about. Are you sure I'm unique, and all your other users know everything? Ok, v5 is beta, but after I update to v4, I'm lost same way. My deploy.php stops working the same. I'm totally lost. "This thing got broken". Error messages I was getting had no hints "here, Dima, you are using old api, just update your code according to $link".

Better docs is my next goal at the project. I already started to write a lot of it. But finding UPGRADE.md file in root on project must be simple enough for dev people.

do the bug fixing. This issue reports a problem, reports a place in code where to fix it. Just go there and change 3600 to 99999999. Done. But you have "fixed" it in v5beta. How much have this helped me? Negative help, wasted few full days just to start version controlling and editing vendor.

Thank you for telling me what I need to do. But I prefer to decide what I should do first and what is best for the project myself.

an idea for better default. Defaulting runLocally to suddenly die in 1 minute is weird. Have it =null by default, if developer wants to set timeout, he will specify it. That would be consistent with how run() will work after fix.

Deployer 5.x now has 300s as default. I think this is good, because it will show what some task take a lot of time and dev should explicitly set it to unlimited, but maybe unlimited by default is better (stuff for research and improvement).

be consistent. I have no idea how, but I was able to use dep ssh on v5. It asked for password, and let me in. But dep deploy always fails on first step. "This is completely broken".

I will.

be consistent, please. You may have rose as developer, and the following is exclusively my personal(professional) opinion, but good code = simple code. If you really are about to make "best app i've ever created", it ought to be simpler, easier to use, understand, read and edit code. Judging by my painful experience with (v4 and) v5, this is totally not the case. This is just my opinion, everyone may understand the art of programming different.

One more time: I think Deployer 5.x is much better then previous version. It may contain bugs, it is still in beta. But the approach and features offered by the new version are much better. They allow for greater flexibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants