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

Support typescript with pm2 #381

Closed
samreid opened this issue Oct 23, 2024 · 4 comments
Closed

Support typescript with pm2 #381

samreid opened this issue Oct 23, 2024 · 4 comments
Assignees

Comments

@samreid
Copy link
Member

samreid commented Oct 23, 2024

From phetsims/chipper#1481, https://pm2.io/docs/runtime/integration/transpilers/#typescript%5C describes how we can launch typescript scripts via pm2.

Until we upgrade, these entry points and their dependencies are stuck as *.js.
https://github.com/phetsims/aqua/blob/988b2f784fff708ba525d0e61ca183b286e3d6a5/js/config/bayes.pm2.config.js#L21-L38

@zepumph
Copy link
Member

zepumph commented Oct 31, 2024

I'm hitting this in phetsims/aqua#219. It is very easy to support this with sage run with this:

args: 'run . . .',
script: '../perennial/bin/sage',
interpreter: '/bin/bash',

The issue is that this only runs well in fork mode, it won't work for our clustered code, like ct-puppeteer-client. I learned about this here:

https://stackoverflow.com/questions/34682035/cluster-and-fork-mode-difference-in-pm2.

I'll keep investigating.

@zepumph
Copy link
Member

zepumph commented Oct 31, 2024

From this I believe that to support cluster mode, we will be required to transpile the typescript into javascript before supporting cluster mode.

zepumph added a commit to phetsims/aqua that referenced this issue Oct 31, 2024
zepumph added a commit to phetsims/aqua that referenced this issue Oct 31, 2024
@zepumph
Copy link
Member

zepumph commented Oct 31, 2024

I believe this is relatively close. I restarted all bayes processes to run with sage run, and it is working well!

@zepumph
Copy link
Member

zepumph commented Nov 4, 2024

Yes. I believe this is ready to close! Sparky and Bayes are both running tasks with sage run with a bash interpreter.

@zepumph zepumph closed this as completed Nov 4, 2024
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

No branches or pull requests

2 participants