STAND-136: Replace Docker Compose setup steps with OpenMRS SDK in standalone build scripts#92
STAND-136: Replace Docker Compose setup steps with OpenMRS SDK in standalone build scripts#92Muta-Jonathan wants to merge 5 commits intoopenmrs:openmrs-emr3from
Conversation
…ndalone build scripts
scripts/start-docker-and-wait.sh
Outdated
| PID=$(lsof -ti:8080 || true) | ||
| if [ -n "$PID" ]; then | ||
| echo "⚠️ Port 8080 is in use by PID $PID. Stopping it..." | ||
| kill -9 $PID |
There was a problem hiding this comment.
This works if I don’t care about what’s running on port 8080. But what if I do have a process I want to keep there? Killing it blindly might stop something important. Maybe we should add a check or a prompt before killing, or even allow overriding the port instead of always freeing 8080.
Something like:
echo "Port $PORT is in use by PID $PID."
read -p "Do you want to stop this process? (y/N) " choice
There was a problem hiding this comment.
I'd prefer to use a free port within a specific range, such as 8000 to 9000.
There was a problem hiding this comment.
oh that makes sense @mherman22 .... let me update it to go as @Ruhanga suggests
|
@Muta-Jonathan have you tested this? |
yes @dkayiwa |
scripts/start-docker-and-wait.sh
Outdated
| connection.url=jdbc:mariadb://127.0.0.1:3308/openmrs-example?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull | ||
| connection.username=root | ||
| connection.password=Admin123 |
There was a problem hiding this comment.
Is there a way to detect whether a MySQL instance is running on the host machine or inside a Docker container, so the script can dynamically choose the correct connection URL—either jdbc:mariadb://127.0.0.1:* for a host-based instance, or jdbc:mariadb://<mysql-service-name>:* for a Docker-based instance?
|
@Muta-Jonathan do you know why this standalone goes all the way to over 500 mbs? |
|
@Muta-Jonathan are you also able to run this command? |
let me addess this |
@dkayiwa seems mine is about 492.4mb when zipped and around Total ≈ 705 MB unpacked and to break it downAppData: 398.7 MB (~56%)
|
Ruhanga
left a comment
There was a problem hiding this comment.
Thanks @Muta-Jonathan for your continued effort on this. It's becoming clear that we'll likely need to move away from Bamboo in the near future and so, relying on Dockerized builds may soon be obsolete, especially with the greater flexibility offered by GitHub Actions.
With this in mind, I'd suggest we consider closing this PR in favor of a GitHub Actions-based approach.
|
@Ruhanga doesn't GitHub actions offer dockerised builds? |
|
Absolutely. GitHub does support Dockerized builds, along with a variety of other build environments like Java and more. This means we're no longer limited or constrained to using the SDK solely for the sake of Dockerized builds, as is the case with Bamboo. |
does this mean we need to switch back the script to use docker compose rather than yhe sdk? |
@Muta-Jonathan this is the case already. Introducing the SDK was primarily to resolve build issues on Bamboo, due to complications with Docker-in-Docker builds. What we would need, in favour of Github actions already, is a workflow that is able to publish a standalone to SourceForge given a released distro. |
|
@Muta-Jonathan can you point me to the github actions that are handling the build now? |
Basically am meaning these Github actions on PR builds https://github.com/openmrs/openmrs-standalone/actions/runs/17127633070/job/48583108852 One thing we are missing for the one which would publish to SourceForge |
|
Can we create that such that we achieve our ultimate goal? |
sure i think @Ruhanga needs to create this workflow
Since He has the credentials |
|
@Muta-Jonathan where you able to update the database damps to contain the released Ref Apps metadata, as the current ones seem to have been generated using the pre-release distro? |
|
@dkayiwa @Ruhanga Have been looking into this and am thinking why not to go with the sdk approach instead Simply because this helps to get rid of docker requirement at build time ... been playing with docker these weeks but seems to extract demo sql but sometimes misses the table data on extraction ... that's why am suggesting this ...one downside is it takes sometime than docker build but ready to hear your suggestions |
|
@Muta-Jonathan is this still relevant? |

Issue
https://openmrs.atlassian.net/browse/STAND-136
Description
Currently, the
referenceapplication-standaloneproject relies on Docker Compose steps in the build scripts to start and initialize OpenMRS and its dependencies (e.g., MySQL). This approach introduces several drawbacks:Proposed Change
openmrs-sdk-maven-plugin) to manage setup and runtime:Benefits
Screenshots