-
Notifications
You must be signed in to change notification settings - Fork 323
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
Allow configuring Project Manager server host and port #6774
Conversation
i don't know whether this needs tests on the scala side |
8ee8af1
to
92c736a
Compare
So it seems like running two instances side-by-side by the same user should be unsupported - the Project Managers seem to want to acquire locks on the same files for compilation. So, when testing, instead a dummy HTTP server should be run on port 30535 |
@PabloBuchu what's the status of this task? |
closing until this becomes an issue again |
i've done some basic testing only - by using
|
config.server.host, | ||
config.server.port | ||
processConfig.serverHost.getOrElse(config.server.host), | ||
processConfig.serverPort.getOrElse(config.server.port) |
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.
Please add overrides in the config (instead or in addition to the cli flags)
enso/lib/scala/project-manager/src/main/resources/application.conf
Lines 35 to 36 in 59329bd
host = ${project-manager.network.interface} | |
port = 30535 |
The same way it is done for the network
enso/lib/scala/project-manager/src/main/resources/application.conf
Lines 23 to 32 in 59329bd
network { | |
interface = "127.0.0.1" | |
interface = ${?NETWORK_INTERFACE} | |
min-port = 49152 | |
min-port = ${?NETWORK_MIN_PORT} | |
max-port = 65535 | |
max-port = ${?NETWORK_MAX_PORT} | |
} |
i.e the line
interface = ${?NETWORK_INTERFACE}
defines override of the interface
value by the NETWORK_INTERFACE
environment variable.
This way you can override config by providing the necessary environment variables without the need of adding extra CLI parameters.
oh oops (edit: the changes aren't finished, and the electron app will need to switch to provide envrironment variables instead, so the latest commit does NOT work) |
14f4542
to
e350ced
Compare
so it seems like all the CLI changes were unnecessary - not a bad thing though, since it means fewer things could go wrong |
i've done basic re-testing so there shouldn't be any major problems |
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 far as I can say this is the right approach and I am looking forward to use it.
@@ -51,7 +54,7 @@ project-manager { | |||
|
|||
storage { | |||
projects-root = ${user.home}/enso | |||
projects-root=${?PROJECTS_ROOT} | |||
projects-root = ${?PROJECTS_ROOT} |
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.
I cannot claim to be an expert on Scala and its .conf
file. However I believe that the ${?SERVER_HOST}
definition reads value from environment property, if it is set.
I am surprised we need so little changes in the project-manager
code!
// eslint-disable-next-line @typescript-eslint/naming-convention | ||
SERVER_HOST: this.projectManagerHost, | ||
// eslint-disable-next-line @typescript-eslint/naming-convention | ||
SERVER_PORT: `${this.projectManagerPort}`, |
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 code prepares the SERVER_HOST
and SERVER_PORT
environment variables for the project-manager
.
const binPath = pathOrPanic(args) | ||
return await execFile(binPath, processArgs) | ||
return await execFile(binPath, processArgs, { env }) |
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.
Here the environment variables are passed to the project-manager
process.
@PabloBuchu this should be QAd (and code reviewed) at some point too btw |
just tried build and run normally and it is trowing errors @JaroslavTulach @4e6 could you do a QA of the part with the PM port? |
weird, i thought i did change the logic that decides whether to try loading enso/app/ide-desktop/lib/dashboard/src/authentication/src/dashboard/components/editor.tsx Lines 122 to 139 in a2946d2
|
pushed a commit that may fix it, unable to test due to issues with linux PM bundle |
I did the QA. It seems to work on my Linux machine
|
Pull Request Description
Important Notes
SERVER_PORT=abcd enso.AppImage
does NOT work. It would not be difficult to implement, but it probably needs discussion on how exactly it should be implemented - for example,SERVER_PORT
is quite a generic name, should the Electron app pass though something likeENSO_PM_SERVER_PORT
to the PM asSERVER_PORT
instead?In Scala, because the JS/Rust code calling it needs to know the port as well. There shouldn't be any problems with adding port scanning though, if that's desired
In Rust, because I'm not sure parsing the host and port from a string is a good idea.
QA will need a new PM (
sbt buildProjectManagerDistribution
or./run backend sbt
->buildProjectManagerDistribution
), and the path must be supplied as:-engine.project-manager-path=path/to/new/pm/here
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.
./run ide build
.