Skip to content
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

Docker support for module development environment #12

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

corneliouzbett
Copy link
Member

Initial docker support for the module development environment.
The goal is to be able to develop OpenMRS modules using a docker environment, with zero installations but just docker installed.

  • Prepare the environment by downloading the required modules specified in the module.properties file.
  • Add .env file with declared configurations.

@corneliouzbett
Copy link
Member Author

corneliouzbett commented Jul 13, 2022

@rkorytkowski check out this.

Also, we need to disable the requirement to specify the war.openmrs in the properties file, maybe also name and version. I want to have module.properties with only module versions.

Copy link
Member

@rkorytkowski rkorytkowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's looking better now. A few more adjustments are needed. Please see my comments.

docker-compose.yml Outdated Show resolved Hide resolved
README.md Outdated
OPENMRS_DB_REPLICAS=1

# OMOD file name
OMOD_TARGET="queue-1.0.0-SNAPSHOT.omod"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't you just commit .env in the repo instead of creating it on the fly?

README.md Outdated
Prepare the docker development environment by executing the following command;

```bash
sh prepare-docker-env.sh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally we don't have an additional step to prepare docker env and just have docker run, which prepares what is needed and builds.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the additional step is mainly for downloading the other required modules for this module to run. I suppose we could add to the entry point script for the dev image. How can I make sure we are not redownloading the same modules every time we run the Image?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would make it so that deploy_module.sh simply checks if a directory with modules exists. If it does then it does not re-downloads. If one needs to apply changes then the script could accept a parameter e.g. '-r' or '--refresh'. It's simple and it does not force to remember to run a different script.

test: [ "CMD", "curl", "-f", "http://localhost:8080/openmrs" ]
timeout: 5s
volumes:
- ${PWD}/omod/target/${OMOD_TARGET}:/root/.OpenMRS/modules/${OMOD_TARGET}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to have just one volume e.g. ${PWD}:/openmrs/module/ and modify https://github.com/openmrs/openmrs-core/blob/master/startup.sh to do whatever is needed or better add deploy_module.sh in the openmrs-core dev image. We want to make it as simple as possible with no extra scripts to include in modules.

@rkorytkowski
Copy link
Member

@corneliouzbett please let me know if anything needs clarification.

@corneliouzbett
Copy link
Member Author

corneliouzbett commented Oct 6, 2022

@corneliouzbett please let me know if anything needs clarification.

Yes, I'd need clarification with the openmrs-core:dev image;

  • Initial test DB schema or leave to liquibase
  • Modifying startup.sh script

Perhaps we could have a short session, let me know when you have free slot.

@rkorytkowski
Copy link
Member

Initial test DB schema will be added to core so don't worry about that.

startup.sh needs to be modified in a way that supports module development. Basically scripts you added in this pull request need to be included in core. It is in startup.sh or deploy_module.sh as I suggested. It is to avoid having to add any scripts to individual modules rather have a script at hand to be used for any module.

If you need further clarifications I'm available today in the next 4 hours or tomorrow in the same timeslot. Just ping me on slack.

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.

None yet

2 participants