Skip to content

STAND-126: Improve Windows Compatibility and Safe Data Directory Reuse for Standalone 3.x#84

Merged
dkayiwa merged 16 commits intoopenmrs:openmrs-emr3from
Muta-Jonathan:STAND-126
Jul 30, 2025
Merged

STAND-126: Improve Windows Compatibility and Safe Data Directory Reuse for Standalone 3.x#84
dkayiwa merged 16 commits intoopenmrs:openmrs-emr3from
Muta-Jonathan:STAND-126

Conversation

@Muta-Jonathan
Copy link
Copy Markdown
Member

@Muta-Jonathan Muta-Jonathan commented Jul 30, 2025

See https://openmrs.atlassian.net/browse/STAND-126

Description

This PR improves Windows support for the OpenMRS Standalone launcher by addressing issues related to MariaDB startup and file system behavior, particularly around data directory handling and platform-specific constraints.

It addresses On Windows, MariaDB startup fails with:
ERROR : Data directory ... is not empty. Only new or empty existing directories are accepted for --datadir

ScreenShots on Windows

Screenshot 2025-07-31 003213
Screenshot 2025-07-31 003226
Screenshot 2025-07-31 005153
Screenshot 2025-07-31 005230

@Muta-Jonathan
Copy link
Copy Markdown
Member Author

@dkayiwa still trying this on windows gonna update to draft after the CI Tests but at now its not ready for review

@Muta-Jonathan
Copy link
Copy Markdown
Member Author

cc @dkayiwa @wikumChamith
However noticed on switching to runtime sql runs... this will require me to refresh the search index and also on windows the load time is really long about 6 - 10mins

@Muta-Jonathan
Copy link
Copy Markdown
Member Author

Its now ready for review

@dkayiwa
Copy link
Copy Markdown
Member

dkayiwa commented Jul 30, 2025

When building, does this allow me to specify the exact version of O3 that i would like to build the standalone for?

@Muta-Jonathan
Copy link
Copy Markdown
Member Author

When building, does this allow me to specify the exact version of O3 that i would like to build the standalone for?

let me check it out in a minute

@dkayiwa
Copy link
Copy Markdown
Member

dkayiwa commented Jul 30, 2025

Can we also remove the version duplication?

@Muta-Jonathan
Copy link
Copy Markdown
Member Author

oh yes @dkayiwa
using -Drefapp.version=3.4.0 for ref-App version and -Dopenmrs.version=2.7.4 for openmrs core version
Also to Note
You can specify one like mvn package -Drefapp.version=3.4.0 or mvn install -Drefapp.version=3.4.0 or mvn package -Dopenmrs.version=2.7.4 but the suggested version has to be published in artifact org.openmrs.distro:referenceapplication-distro

<configuration>
	<rules>
		<requireProperty>
			<property>refapp.version</property>
			<message>refapp.version property is missing. This should be
				something like 3.4, 3.5 Add
				-Drefapp.version=3.4.1-SNAPSHOT</message>
		</requireProperty>
		<requireProperty>
			<property>openmrs.version</property>
			<message>openmrs.version property is missing. This should be
				something like 2.7.4, 2.8.0 Add
				-Dopenmrs.version=2.7.4</message>
		</requireProperty>
	</rules>
	<fail>true</fail>
</configuration>

@Muta-Jonathan
Copy link
Copy Markdown
Member Author

Can we also remove the version duplication?

Oh yes let me take it to the Industry standard

@dkayiwa
Copy link
Copy Markdown
Member

dkayiwa commented Jul 30, 2025

By the way, do we have a CI pipeline to build the standalone and output it as an artifact?

@dkayiwa
Copy link
Copy Markdown
Member

dkayiwa commented Jul 30, 2025

I notice the running the O3 standalone for the first time takes a lot of time. Can't we have this happen during the build such that we publish a standalone zip that is already initialised?

@Muta-Jonathan
Copy link
Copy Markdown
Member Author

I notice the running the O3 standalone for the first time takes a lot of time. Can't we have this happen during the build such that we publish a standalone zip that is already initialised?

The problem with this is mariadb generates machine-specific metadata, including the mysql system database which defines users, permissions, and hostname bindings. hence work only on the built machine and cannot work on another machine no matter the os more had discussed here https://talk.openmrs.org/t/gsoc-2025-replacing-openmrs-standalone-with-a-modern-user-friendly-alternative-updates-and-discussion/46024/51?u=jonathan

@Muta-Jonathan
Copy link
Copy Markdown
Member Author

By the way, do we have a CI pipeline to build the standalone and output it as an artifact?

Am not aware of this maybe @Ruhanga has an idea on this but at the moment i dont think so

@Muta-Jonathan
Copy link
Copy Markdown
Member Author

New look in industry Standard

Screenshot from 2025-07-31 01-48-48

@dkayiwa
Copy link
Copy Markdown
Member

dkayiwa commented Jul 30, 2025

Would it work with an sql dump that we just load?

@Muta-Jonathan
Copy link
Copy Markdown
Member Author

Would it work with an sql dump that we just load?

Oh yes and i think currently we are doing this and thats why the load time is longer in my guess

@dkayiwa
Copy link
Copy Markdown
Member

dkayiwa commented Jul 30, 2025

Can't we use an already initialised database to create the sql dump?

@Muta-Jonathan
Copy link
Copy Markdown
Member Author

Can't we use an already initialised database to create the sql dump?

I think this can work probably this means to use a zipped sql demo to load it at runtime as demo (with patient data)
However how about the Starter Implementation Option? since for it has no patient data

@dkayiwa
Copy link
Copy Markdown
Member

dkayiwa commented Jul 30, 2025

However how about the Starter Implementation Option? since for it has no patient data

A separate sql dump for it?

@Muta-Jonathan
Copy link
Copy Markdown
Member Author

Can't we use an already initialised database to create the sql dump?

So this means I spin up an sdk 3.x version and from it extract the demo dump which also creates the openmrs schema by default.
And by this we dont need to load the core-data, schema in pom steps and also in regard with the latest-up-to-date.xml if am getting it right?

@dkayiwa
Copy link
Copy Markdown
Member

dkayiwa commented Jul 30, 2025

Tru dat, man!!!

@Muta-Jonathan
Copy link
Copy Markdown
Member Author

Oh great, Oops gonna take a nap and by morning will jump into this so we get it to work as expected 😊 ....Good night @dkayiwa this as been really helpful hope this approach reduces the load time for our users experience

@dkayiwa
Copy link
Copy Markdown
Member

dkayiwa commented Jul 30, 2025

Sure. In the meantime, i will merge this because it works. Then you will improve it with that. 😊

@dkayiwa dkayiwa merged commit d82489d into openmrs:openmrs-emr3 Jul 30, 2025
3 checks passed
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

Successfully merging this pull request may close these issues.

2 participants