Demo server doesn't have OWAs configured right

Looking at demo.openmrs.org, I see that (1) the Concept Dictionary OWA is not deployed, and (2) OWA in general is not configured right.

At http://demo.openmrs.org/openmrs/module/owa/manage.form I see a message saying we need to configure things.

@cintiadr, @raff, @taremwatadeo, I would expect that when you install Reference Application 2.5, the Concept Dictionary OWA is installed and works out of the box. Have we tested this generally? Is this just a (mis)configuration of the demo server?

PS- Also, for security reasons, we should ensure that if the system is configured not to allow web administration of modules (via the module.allow_web_admin runtime property), it also shouldn’t allow web administration of OWAs.

I created https://issues.openmrs.org/browse/OWA-10 about disallowing web admin for OWAs.

And I verified that things work correctly on a fresh standalone download of refapp 2.5.

We still need to configure the demo server to work right. I set one of the settings, but it’s still saying that setup is required. (Maybe the demo server needs to be restarted?)

There’s a huge chance I broke it:

So, the way I got that .sql was: mvn org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:3.6.2-SNAPSHOT:build-distro -B -Ddir=demo-server -Ddistro=rerenceapplication:2.5

I did modify ‘add_demo_data’ property to true, and started the docker containers. After all that process finished, I did take a mysql data dump. You can see the sql here (https://github.com/cintiadr/docker-openmrs/tree/master/dbdump). And as I attempt to get the resets working again, I uploaded it to current demo server.

Note that the next demo server will be based on the docker image generated by the SDK, the only changes will be the docker compose file ( I’d expect it to be just like https://github.com/cintiadr/docker-openmrs/blob/master/docker-compose.yml, changing the image name). Maybe if we can get a SDK release, it should be done in a week or two :slight_smile:

There’s a property ‘module_web_admin=true’ is always enabled on that docker image, is that the same property you are referring to?

@cintiadr, thanks for working on that!

Could you please restart the demo server to see if changes made by Darius enable OWAs?

“add_demo_data” is for the legacy UI based distros… The referencedemodata module should be used to create demo data for Reference Application. It is explained here. Let us know if those instructions are clear enough.

Yes, “module_web_admin” should be set to false for the docker image on the demo server.

The SDK release is planned for this week :slight_smile:

Ok, I did move the data to the old sql file, and restarted the server. Darius already has access to that box, just keep in mind that tomcat is shared.

That’s not configurable :confused: I will make a pull request to SDK to make it configurable from compose.

Sorry, not sure what it means. Is there any properties I can add to openmrs-server.properties or do I need that option in ‘CATALINA_OPTS’? Because that’s not configurable yet from compose as well.

As the SDK should work for older versions, was this change done from 2.4->2.5 or before?

Okay, let’s dive in. You can prepare demo data for Reference Application when you do the following:

  1. Start up the server
  2. Set the referencedemodata.createDemoPatientsOnNextStartup global property to 1000.
  3. Restart the server
  4. Once the server is started and you can log in, it means patients have been created. You can now create a dump of the db. You need to do it just once and then you can reuse the sql. No need to recreate demo patients.

Now when building a distro docker image you can include that demo dump by specifying -DdbSql=demoData.sql e.g. mvn openmrs-sdk:build-distro -DdbSql=demoData.sql -Ddir=target

The first time you start up the container using the image, it will populate the database with demoData.sql.

I’d imagine for demo.openmrs.org you would want to run every 24 hours: $ docker-compose down -v $ docker-compose up

The first command takes down containers and discards volumes (including the database). The second recreates the containers with a fresh db initialized with demoData.sql.

Oh, I see.

The ‘global property’ is something you can only set from inside the OpenMRS application, but not from a configuration file. I did that, and I managed to create a demo data with 500 patients. I assume I won’t need to redo it for every reference application release, right?

So, I created this PR, removing the old ADD_DEMO_DATA from the docker image (because it doesn’t work that way! ) and adding ‘MODULE_WEB_ADMIN’ as a docker image configuration. I can create a SDK issue and rebase the branch, but it’s usually much easier to review and add comments there instead of here :slight_smile:

Right! It should work for future releases just fine. In future releases OpenMRS server may need to apply some additional liquibase changesets on top of that dump, but it should be fast and will happen automatically.

Thanks for the PR! I’ve merged it already to make sure it is included in the coming SDK release (which I will be testing today).

By the way @cintiadr did you succeed in getting the demo server’s database being reset on a daily basis? :slight_smile:

No, but there’s this --> New demo server is ready for tests!

It’s not a lot missing to be done, so it might be done by next weekend, if nothing breaks :slight_smile:

Thanks @cintiadr for the update and great work! :smile: