Github workflows fail to run modules on port 8084

When running the e2e tests, we used to start all the esm modules in parallel. When running using yarn, it uses ports 8081-8086 for those esm modules. However, in Ubuntu 22.04 (ubuntu-latest) runner, port 8084 is used by a service called mono in default. Therefore the esm-patient-lists app fails to run on port 8084.

image

issue : [O3-1994] Github workflows fail to run modules on port 8084 - OpenMRS Issues

As a temporary solution, we can include a step to stop the mono service which runs on 8084 before starting the dev server. But what will be the best solution for this?

3 Likes

Hello @chiran, If starting the dev server on some different ports will not cause any issue then we can also change the ports when running yarn start command by specifying a specific port to use using --port in the yarn start command. Further improving the solution we can also check if the series of ports which we are trying to access are free or not and based on that we can modify the command for starting the dev by specifying different ports.

cc: @piumal1999 @jayasanka @anjisvj

1 Like

The yarn start ''packages/esm-*-app" command is currently configured to use a number of consecutive ports (starting from 8081) depending on the number of esm-modules. As we discussed in the last meeting, the best solution would be configuring it to skip the busy ports while assigning the consecutive ports for esm-modules.

This is also good as a temporary solution. But still, we didn’t encounter problems with any other ports except port 8084. So I think it would be better to free the port before running the dev server, instead of hardcoding the port in the yarn start command. (as a temporary solution)

@jayasanka @ibacher what do you think? To summarize, In the GitHub action workflows, the esm-patient-list-app fails to start since port 8084 is already occupied by a service in ubuntu-latest runner in default. Due to that, we can’t run the related e2e tests. So we thought to free the port before running the dev server in github workflow.

Why not just set the base port to, e.g., 8180?

1 Like

Yeah. That will solve the problem for every repository with a single fix. Otherwise we’ll have to free the port in each workflow in every repository. But we need to check whether that range of ports are not occupied in ubuntu-runner by default. @chiran can you please look into that?

@ibacher, then we will have to update all the related documentations where we have mentioned about the base port (8080). Is that ok?

1 Like

I was just thinking that we run the e2e tests with yarn start --sources <whatever> --port 8180. No code or doc changes (except, I guess, to the configuration for Playwright).

2 Likes

Oh I thought we are going to change the default port in esm-core.

Yeah, we can do this. It would be better.

1 Like

Thank you @piumal1999 @ibacher for the guidance.

So as a solution to this,

I set the workflow started (base) port to port 8180 and

we run the dev server with yarn start --sources --port 8180.

Special thanks to @piumal1999 for the step-by-step guidance on the issue.

pr link is here

1 Like