Skip to content

Conversation

@adskyiproger
Copy link
Contributor

@adskyiproger adskyiproger commented Oct 15, 2025

Note

Currently, we do not run e2e tests as a check on opencrvs-countryconfig-repo PRs. Please ensure your PR doesn't break any e2e tests.

One method for doing this is to open a PR with these changes to opencrvs-farajaland as well, and see if the PR check passes there.

Description

Issue addressed: opencrvs/opencrvs-core#10672

This PR aims to actualise Tiltfile after 6 months of development.

Related PRs:

Testing

Note

Apple Silicon users need to build ARM compatible OpenCRVS Core images, see github workflow: https://github.com/opencrvs/opencrvs-core/actions/runs/18721862548
Core image tagdevelop was built with ARM support for this particular test. Docker desktop on apple silicon is able to run amd64 images, but performance is significantly degraded.
We are not building images locally, but pulling from GitHub registry, first start may take up to 30 minutes. On my machine it took 15 minutes, internet connection speed 300Mb/s

Prerequisites

Hardware:
image

Software:

  • minikube
    image

  • docker desktop
    image

Note

In this test infrastructure repository is cloned by running tilt up command
Built-in docker desktop kubernetes cluster was disabled

Steps to test

[!NOTE] Before running test steps open Tiltfile and adjust OpenCRVS core image tag, usually wrong tag will lead to errors in events container:
image

  1. Make sure minikube cluster is up:
minikube status

Example output:

minikube
type: Control Plane
host: Running
kubelet: Running
apiserver: Running
kubeconfig: Configured

Use following command to start minikube:

minikube start --cpus=8 --memory=max --ports=80:30080
  1. Navigate to countryconfig repository
(.venv) NB01NSTL012:opencrvs-countryconfig vmudryi$ pwd
/Users/vmudryi/Documents/opencrvs-repo/opencrvs-countryconfig
  1. Change branch to ocrvs-10672
(.venv) NB01NSTL012:opencrvs-countryconfig vmudryi$ git status
On branch ocrvs-10672
Your branch is up to date with 'origin/ocrvs-10672'.

nothing to commit, working tree clean
  1. Optional: remove infrastructure repository:
(.venv) NB01NSTL012:opencrvs-countryconfig vmudryi$ ls -l ../infrastructure/
(.venv) NB01NSTL012:opencrvs-repo vmudryi$ rm -rf ../infrastructure/
  1. Run tilt up
image
  1. Check url in browser: http://localhost:10350/
image 7. Verify Tiltfile was loaded: image image 8. Check logs for any errors image 9. Restart any failed jobs: image
  1. Verify all dependency pods are up and running:
kubectl get po -n opencrvs-deps-dev

Example output:

NB01NSTL012:opencrvs-countryconfig vmudryi$ kubectl get po -n opencrvs-deps-dev
NAME              READY   STATUS    RESTARTS   AGE
elasticsearch-0   1/1     Running   0          25m
influxdb-0        1/1     Running   0          25m
minio-0           1/1     Running   0          25m
mongodb-0         1/1     Running   0          25m
postgres-0        1/1     Running   0          25m
redis-0           1/1     Running   0          25m
  1. Verify all OpenCRVS pods are up and running:
kubectl get po -n opencrvs-dev

Example output:
image

Note

Use watch kubectl get po -n opencrvs-dev to get real time pods status

  1. Seed data
image 14. Go to home page: http://opencrvs.localhost (not https)

Checklist

  • I have linked the correct Github issue under "Development"
  • I have tested the changes locally, and written appropriate tests
  • I have tested beyond the happy path (e.g. edge cases, failure paths)
  • I have updated the changelog with this change (if applicable)
  • I have updated the GitHub issue status accordingly

Tiltfile Outdated
# If for some reason you don't have DockerHub account yet, please create
# you local registry
# (see: https://medium.com/@ankitkumargupta/quick-start-local-docker-registry-35107038242e)
core_images_tag = "v1.9.0-beta-6"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this something we want to hardcode? It will be old in a week

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tiltfile is a configuration file by itself, some properties like image tag can be parametrised, but some properties used for resource loading can't.

If we can't parametrise all configuration properties, we will made a confusion to people by introducing some parameters

Copy link
Contributor Author

@adskyiproger adskyiproger Oct 22, 2025

Choose a reason for hiding this comment

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

I've changed tag to develop, that tag should be more stable


# If your machine is powerful feel free to change parallel updates from default 3
# update_settings(max_parallel_updates=3)
load('../infrastructure/tilt/opencrvs.tilt', 'setup_opencrvs')
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this local path? I assume that I would not have the file in place


# If your machine is powerful feel free to change parallel updates from default 3
# update_settings(max_parallel_updates=3)
load('../infrastructure/tilt/opencrvs.tilt', 'setup_opencrvs')
Copy link
Contributor

Choose a reason for hiding this comment

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

if not os.path.exists('../infrastructure'):
    local("git clone [email protected]:opencrvs/infrastructure.git ../infrastructure")

load('../infrastructure/tilt/opencrvs.tilt', 'setup_opencrvs')

Ah, I see. As long we have it somewhere written down that these repos need to live side by side.

Other way would be to introduce INFRA_REPOSITORY_PATH to allow ay config.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wish to parametrise repository path, but tiltfile has limitations:

# ✅ Correct - string literal
load('../infrastructure/tilt/opencrvs.tilt', 'setup_opencrvs')

# ❌ Wrong - variable
lib_path = '../infrastructure/tilt/opencrvs.tilt'
load(lib_path, 'setup_opencrvs')

load doesn't support variables. In next iteration I will try to publish opencrvs.tilt as external module

@adskyiproger adskyiproger merged commit 8bea946 into develop Oct 23, 2025
2 checks passed
@adskyiproger adskyiproger deleted the ocrvs-10672 branch October 23, 2025 08:08
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.

3 participants