-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Baremetal deploy fails on Starting serve serve process step - pm2 #5081
Comments
Looping in @cannikin |
Hi @zpeters did you add pm2 to your app's package.json or install globally? Right now it always tries to run with At some point I'd like to make it an option whether to use globally installed pm2 (by just running |
@cannikin This sounds like the right track. I will report back. Happy to help contribute to the docs or code if needed. |
@cannikin Confirming that adding the pm2 dep did solve my issue. One thing to note, i needed to manually run "yarn pm2 startup" and "yarn pm2 save" to add the systemd hooks and to have it retain the services on reboot. My thoughts would be to have the adding of the pm2 dep part of the "yarn rw deploy setup baremetal" process and have the "pm2 save" and "pm2 startup" part of the "first run" process. I saw a few different issues get created so im going to pause here and get your thoughts. Im happy to spend time documenting, submitting a patch or testing to help with the project. just let me know how you'd like time spent. |
Awesome! I actually hadn’t run those commands myself, and I agree: we should execute them on —first-run
If you wanted to take a look at the code and see about adding that option, that would be great! I was thinking of adding a config option like `pm2Install = “local”` or `”global”` (default is local for backwards compatibility) and then it would run the correct command during the restart phase.
Thanks for volunteering, I’m glad someone is as excited as I am about this feature! :)
… On Apr 8, 2022, at 5:04 PM, Zach Peters ***@***.***> wrote:
@cannikin Confirming that adding the pm2 dep did solve my issue.
One thing to note, i needed to manually run "yarn pm2 startup" and "yarn pm2 save" to add the systemd hooks and to have it retain the services on reboot.
My thoughts would be to have the adding of the pm2 dep part of the "yarn rw deploy setup baremetal" process and have the "pm2 save" and "pm2 startup" part of the "first run" process.
I saw a few different issues get created so im going to pause here and get your thoughts.
Im happy to spend time documenting, submitting a patch or testing to help with the project. just let me know how you'd like time spent.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.
|
Nearly have the first part of this complete. I am wrapping up the command to save the state. It looks like the "startup" command just spits out a sudo command to run. To avoid complication i will not try to tackle this in the setup, but rather add a note in the documentation. After i have this i'd like to tackle the local/global option we discussed |
#5139 for review |
#5139 merged - adds "save" step to baremetal and add docs for baremetal startup continuing on local/global pm2 options |
|
Sure thing! So the TOML file is parsed here: https://github.com/redwoodjs/redwood/blob/main/packages/cli/src/commands/deploy/baremetal.js#L110-L112 Then we loop through each server: https://github.com/redwoodjs/redwood/blob/main/packages/cli/src/commands/deploy/baremetal.js#L110-L112 And pick out the options needed for ssh at the top there: https://github.com/redwoodjs/redwood/blob/main/packages/cli/src/commands/deploy/baremetal.js#L110-L112 So if you add a new config option you can get it there and then modify the commands that run, like the start: https://github.com/redwoodjs/redwood/blob/main/packages/cli/src/commands/deploy/baremetal.js#L110-L112 |
This is prefect thanks! |
PRs submitting, awaiting approval |
Going to close this along with the PR, thanks again for working on it! |
I keep getting this error:
I've added pm2 to package.json, installed globally on the server. In deploy.toml, I have:
This issue is the closest I got to find the answer, please let me know what am I doing wrong (and also let me know if this isn't the right place to ask the question) |
Hello! You shouldn't need to add
We usually prefer to do help like this in the Discord! |
I am happy to do additional testing and contribute patches, etc to help solve this issue.
Main issue
yarn rw setup deploy baremetal
and made the necessary config settings (below)yarn rw deploy baremetal --firstrun
all steps succeed until i get to "Starting serve process ofr the first time". At that step i get an error that the Deploy Failed running the commandyarn pm2 start ecosystem.config.js --only serve
pm2 start ecosystem.config.js
pm2 start ecosystem.config.js
to install the initial api services. I cannot find a reference to using yarn to run the pm2 command. I suspect i am missing something in my packages config possibly?Additional thoughts
pm2 save
to make my settings persist, this would be helpful to addpm2 startup
to discuss injecting pm2 into the systems normal services so it will run on rebootRelevant configs
The text was updated successfully, but these errors were encountered: