Skip to content

Modernize the Vagrant dev environment and add libvirt support - #6955

Open
millerdev wants to merge 17 commits into
masterfrom
dm/vagrant
Open

Modernize the Vagrant dev environment and add libvirt support#6955
millerdev wants to merge 17 commits into
masterfrom
dm/vagrant

Conversation

@millerdev

Copy link
Copy Markdown
Contributor

This restores the Vagrant-based dev environment to a working, easier-to-maintain state. It replaces the outdated Ubuntu box, fixes the permission, service-limit, and dependency-install errors that broke provisioning, and adds support for contributors who use libvirt instead of VirtualBox.

Default service versions (Elasticsearch, CouchDB, HAProxy) are brought up to date. Control-node provisioning has been reworked to bind-mount the repo rather than symlink it, which resolves several errors seen when initializing commcare-cloud inside the VM. Fixes a handful of other smaller, including minor cleanup of a filebeat_inputs setting that was duplicated identically across environment files.

deploy-stack on Vagrant VMs is now possible end-to-end without errors.

🐡 Review by commit.

Environments Affected

  • development: primary target of this branch; box, provisioning, and env-var changes are Vagrant-specific.
  • All environments: couchdb_version default now matches what production, staging, eu, india already set explicitly (3.5.0), so no behavior change there. haproxy_version default changes from 1.8 to 2.4 (upgrade long ago via changelog 0071).

millerdev added 17 commits July 23, 2026 14:56
The script runs as root
- Sync UID:GID of vagrant user with host system to allow write access
  for files like environments/development/.generated.yml
- Reliable "real" file paths.
- A second .git bind mount avoids error when git has wrong branch.
  Also avoids init.sh commit hook error.
  Prevents git operations in VM from messing with host git state.
- Set UV_PROJECT_ENVIRONMENT to avoid conflict with host venv.
Change logs have long since directed operators to upgrade, so the old
default is obsolete.
Change logs have long since directed operators to upgrade, so the old
default is obsolete.
Disable ecryptfs environment because ES and Kafka fail to start:

ecryptfs can't mmap shared libraries with exec permission, so JNA
fails to load its native library out of /opt/data, which then makes
ES's seccomp/system-call-filter bootstrap check fail and abort startup

[WARN ][o.e.b.Natives] [es0] unable to load JNA native support library, native methods will be disabled.
java.lang.UnsatisfiedLinkError: /opt/data/elasticsearch-6.8.23/tmp/jna8792826677444915978.tmp:
/opt/data/elasticsearch-6.8.23/tmp/jna8792826677444915978.tmp: failed to map segment from shared object
...
[INFO ][o.e.e.NodeEnvironment] [es0] using [1] data paths, mounts [[/opt/data (/opt/data)]], ..., types [ecryptfs]
DefaultLimitNPROC

[ERROR][o.e.b.Bootstrap] [es0] node validation exception
[1] bootstrap checks failed
[1]: max number of threads [2369] for user [elasticsearch] is too low, increase to at least [4096]
TASK [Format system data disk] *****************************************
fatal: [192.168.33.16]: FAILED! =>
       {"changed": false, "msg": "Device /dev/xvdbb1 not found."}
The development environment did not have it, and all other envs had
matching configurations. Environments that override it will not
be affected.

Fixes deploy-stack error:

TASK [dimagi.commcare_logstash.filebeat : Copy Filebeat configuration.] ********************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ansible.errors.AnsibleUndefinedVariable: 'filebeat_inputs' is undefined
fatal: [192.168.33.17]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'filebeat_inputs' is undefined"}
@millerdev

Copy link
Copy Markdown
Contributor Author

Note: auto-merge enabled so it doesn't get stale while I'm offline for a bit.

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.

1 participant