# My Fellowship Journey: Bett Kipchumba

**URL:** <https://talk.openmrs.org/t/my-fellowship-journey-bett-kipchumba/36880>\
**Category:** Uncategorized\
**Created:** [June 13, 2022, 8:00pm UTC](https://talk.openmrs.org/t/my-fellowship-journey-bett-kipchumba/36880 "2022-06-13T20:00:19Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![corneliouzbett](https://talk.openmrs.org/user_avatar/talk.openmrs.org/corneliouzbett/32/15464_2.png) [@corneliouzbett](https://talk.openmrs.org/u/corneliouzbett)\
**Post date:** [June 13, 2022, 8:00pm UTC](https://talk.openmrs.org/t/my-fellowship-journey-bett-kipchumba/36880/1 "2022-06-13T20:00:19Z")

</div>

Hi there 👋🏾

I’m Kipchumba C. Bett, but people call me “Bett” from Eldoret, Kenya. I work as a Software Engineer at AMPATH Kenya. I’d enjoy music, riding my bike, and reading.

On and off, I’ve been a member of this community for some time now. You may have seen my work because I’ve contributed to a number of projects. [FHIR support](https://github.com/openmrs/openmrs-module-fhir2) for openmrs, [service delivery queues](https://github.com/openmrs/openmrs-module-queue) backend, and [cohorts](https://github.com/openmrs/openmrs-module-cohort) are a few examples.

A number of personal circumstances have kept me from embarking on this adventure for some time now. Finally, I’m excited and eager to get started on the fellowship program and concentrate on honing my software engineering skills. In the coming months, I’ll learn more about the community’s ongoing projects and challenges/community priority issues and help come up with solutions. I will also provide mentorship and help review some PRs.

To begin, I’ll be focusing on;

- Utilizing docker to build and develop openmrs modules.
- Add support to build and develop using docker to the rest of openmrs modules(at least actively maintained ones).
- Refactor `openmrs-module-basicexample` (example module provided by openmrs SDK) to include docker development support
- Backport Rafal’s changes [here](https://github.com/openmrs/openmrs-core/pull/4094/commits/a617d3a079f24755f28bc8d1eff2299a82a98620) to openmrs core maintained branches i.e. 2.5.x, 2.4.x, 2.3.x, …

I’m hoping that with @raff assistance and guidance, I’ll be able to complete the tasks listed above and more especially improve the developer experience.

Lastly, a big thank you to @jennifer for her help and guidance in getting me up and running. Thanks also to @jdick @grace @burke @ibacher @dkayiwa, as well as everyone else we’ve talked to along the way.

~ Bett

---

<div class="post-metadata">

**Author:** ![grace](https://talk.openmrs.org/user_avatar/talk.openmrs.org/grace/32/16942_2.png) [@grace](https://talk.openmrs.org/u/grace)\
**Post date:** [June 13, 2022, 9:49pm UTC](https://talk.openmrs.org/t/my-fellowship-journey-bett-kipchumba/36880/2 "2022-06-13T21:49:58Z")

</div>

Welcome to the fellowship program Bett!! It’s going to be a pleasure to follow your journey in this thread. It’s _so_ good that you’re helping to move OpenMRS containerization forward. Dockerization of OMRS is something I heard interest in from many org representatives across East Africa recently. CC/FYI @rubailly

---

<div class="post-metadata">

**Author:** ![gcliff](https://talk.openmrs.org/user_avatar/talk.openmrs.org/gcliff/32/8783_2.png) [@gcliff](https://talk.openmrs.org/u/gcliff)\
**Post date:** [June 15, 2022, 4:19pm UTC](https://talk.openmrs.org/t/my-fellowship-journey-bett-kipchumba/36880/3 "2022-06-15T16:19:58Z")

</div>

Welcome to the fellowship and good to see you @corneliouzbett

---

<div class="post-metadata">

**Author:** ![jwnasambu](https://talk.openmrs.org/user_avatar/talk.openmrs.org/jwnasambu/32/13543_2.png) [@jwnasambu](https://talk.openmrs.org/u/jwnasambu)\
**Post date:** [June 15, 2022, 4:37pm UTC](https://talk.openmrs.org/t/my-fellowship-journey-bett-kipchumba/36880/4 "2022-06-15T16:37:42Z")

</div>

@corneliouzbett I wish you the best in your fellowship journey. Am grateful for having your back during my journey.

---

<div class="post-metadata">

**Author:** ![grace](https://talk.openmrs.org/user_avatar/talk.openmrs.org/grace/32/16942_2.png) [@grace](https://talk.openmrs.org/u/grace)\
**Post date:** [July 22, 2022, 2:21pm UTC](https://talk.openmrs.org/t/my-fellowship-journey-bett-kipchumba/36880/5 "2022-07-22T14:21:08Z")

</div>

> [@corneliouzbett](#):
>
> To begin, I’ll be focusing on;
> 
> - Utilizing docker to build and develop openmrs modules.
> - Add support to build and develop using docker to the rest of openmrs modules(at least actively maintained ones).
> - Refactor `openmrs-module-basicexample` (example module provided by openmrs SDK) to include docker development support
> - Backport Rafal’s changes [here](https://github.com/openmrs/openmrs-core/pull/4094/commits/a617d3a079f24755f28bc8d1eff2299a82a98620) to openmrs core maintained branches i.e. 2.5.x, 2.4.x, 2.3.x, …

Hi @corneliouzbett! How are things going for you lately? How are you finding the work on these areas?

---

<div class="post-metadata">

**Author:** ![corneliouzbett](https://talk.openmrs.org/user_avatar/talk.openmrs.org/corneliouzbett/32/15464_2.png) [@corneliouzbett](https://talk.openmrs.org/u/corneliouzbett)\
**Post date:** [July 25, 2022, 6:29am UTC](https://talk.openmrs.org/t/my-fellowship-journey-bett-kipchumba/36880/6 "2022-07-25T06:29:01Z")

</div>

Hi @grace 👋🏾  
It is going on well though slowly. I’m waiting for a review from @raff for this [PR](https://github.com/openmrs/openmrs-module-queue/pull/12), once it’s done, I will be able to apply the same to the rest of the modules.

---

<div class="post-metadata">

**Author:** ![corneliouzbett](https://talk.openmrs.org/user_avatar/talk.openmrs.org/corneliouzbett/32/15464_2.png) [@corneliouzbett](https://talk.openmrs.org/u/corneliouzbett)\
**Post date:** [October 27, 2022, 9:09am UTC](https://talk.openmrs.org/t/my-fellowship-journey-bett-kipchumba/36880/7 "2022-10-27T09:09:01Z")

</div>

For the recent weeks, I’ve been looking into docker and containerization technology. As a concept it refers to the process of packaging up everything needed to run an application, including runtime dependencies, configuration files, and settings then running the application in a pre-prepared isolated environment.

Docker is a containerization technology that enables for the rapid and easy creation of containers. It runs on Windows, Linux, and MacOS. It is used in both development and production. The intention is harness this technology to better our backend development experience. For my case module development.

**Docker support for OpenMRS module development**

> Note: This is still a work in progress. Feedback is highly appreciated

**Pre-requisites**

- Docker - (No maven installation needed)

OpenMRS releases two variants of [`openmrs-core`](https://hub.docker.com/r/openmrs/openmrs-core/tags) docker images: `nightly` and `dev`. I’m going to focus on the `dev` image, which is used for development. It contains dev dependencies such as maven and a configured OpenMRS SDK necessary for development purposes only.

Below is a `docker-compose.yml` template file;

```auto
version: "3.8"

services:
  db:
    image: mariadb:10.3
    command: "mysqld --character-set-server=utf8 --collation-server=utf8_general_ci"
    environment:
      MYSQL_DATABASE: ${OPENMRS_DB_NAME:-openmrs}
      MYSQL_USER: ${OPENMRS_DB_USER:-openmrs}
      MYSQL_PASSWORD: ${OPENMRS_DB_PASSWORD:-openmrs}
      MYSQL_ROOT_PASSWORD: ${OPENMRS_DB_ROOT_PASSWORD:-openmrs}
    deploy:
      replicas: '${OPENMRS_DB_REPLICAS:-1}'
      restart_policy:
        max_attempts: 3
    volumes:
      - db-data:/var/lib/mysql

  openmrs-core:
    image: openmrs-core:dev
    ports:
      - "8080:8080"
      - "8000:8000"
    restart: "no"
    environment:
      OMRS_CONFIG_MODULE_WEB_ADMIN: "true"
      OMRS_CONFIG_AUTO_UPDATE_DATABASE: "true"
      OMRS_CONFIG_CREATE_TABLES: "true"
      OMRS_CONFIG_CONNECTION_SERVER: ${OPENMRS_DB_SERVER:-db}
      OMRS_CONFIG_CONNECTION_DATABASE: ${OPENMRS_DB_NAME:-openmrs}
      OMRS_CONFIG_CONNECTION_USERNAME: ${OPENMRS_DB_USER:-openmrs}
      OMRS_CONFIG_CONNECTION_PASSWORD: ${OPENMRS_DB_PASSWORD:-openmrs}
      OMRS_REFRESH_MODULES: ${OMRS_REFRESH_MODULES:-false}
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8080/openmrs"]
      timeout: 5s
    volumes:
      - ${PWD}:/openmrs/module/source
      # mount local m2 repository
      - ~/.m2:/root/.m2
volumes:
  db-data:

```

With changes from this [PR](https://github.com/openmrs/openmrs-core/pull/4169)(will be available in the next release of `dev` image), you only a compose file at the root of your module repository to start developing using docker. Moreover, extra configuration file is needed for a module that depend on other modules in order to run/start e.g `queue module` or `emrapi module`. That file would be `module.properties`(same as disto.properties used by SDK) - specifies the required modules to be download and looks like;

```auto
version=0.0.1-DEV
war.openmrs=2.6.0-SNAPSHOT
name=Queue module development
omod.webservices.rest=2.36.0

```

This leverages the OpenMRS-SDK to download modules specified in the properties. However, we need to modify OpenMRS-SDK to make `name`, `version`, `war.openmrs` optional or add a flag or something along those lines…

I would advise to mount local `m2` repo for faster builds.

Any additional module to `module.properties` or force re-download modules needs a restart and first please set `OMRS_REFRESH_MODULES` to `true`

**Build**

Build module sources using the `openmrs-dev` docker image.

```auto
docker run --rm -w="/module" -v ~/.m2:/root/.m2 -v ${PWD}:/module openmrs/openmrs-core:dev mvn clean install -DskipTests

```

**Module development**

To start the OpenMRS development server, execute the command;

```bash
docker-compose up -d

```

Restart the container to deploy changes;

```auto
docker-compose restart

```

Under the hood `docker-compose restart` will build the current module, re-deploy and restart the OpenMRS development server

Access the container/server logs;

```auto
docker-compose logs -f --tail=1000

```

**Connecting to an existing database**

To use an existing database, first set the `OPENMRS_DB_REPLICAS` env variable to `0`, then provide the following database connection properties in the `.env` file:

```bash
OPENMRS_DB_SERVER=host.docker.internal // The database host
OPENMRS_DB_NAME=openmrs
OPENMRS_DB_USER=openmrs
OPENMRS_DB_PASSWORD=openmrs

```

Thoughts? Improvements?

[@Platform\_Team](https://talk.openmrs.org/groups/platform_team) [@dev5](https://talk.openmrs.org/groups/dev5) [@dev4](https://talk.openmrs.org/groups/dev4)[@dev3](https://talk.openmrs.org/groups/dev3) [@dev2](https://talk.openmrs.org/groups/dev2) [@dev1](https://talk.openmrs.org/groups/dev1)

Would you be interested to try out? Let me know 🙂

---

<div class="post-metadata">

**Author:** ![herbert24](https://talk.openmrs.org/user_avatar/talk.openmrs.org/herbert24/32/8178_2.png) [@herbert24](https://talk.openmrs.org/u/herbert24)\
**Post date:** [October 27, 2022, 3:25pm UTC](https://talk.openmrs.org/t/my-fellowship-journey-bett-kipchumba/36880/8 "2022-10-27T15:25:01Z")

</div>

thanks @corneliouzbett, we do use the docker tech already at UW,will look through your pr at the weekend to suggest any areas of improvement/thoughts
