diff --git a/rsconf/component/vm_devbox.py b/rsconf/component/vm_devbox.py index dd8be234..0bf6a8da 100644 --- a/rsconf/component/vm_devbox.py +++ b/rsconf/component/vm_devbox.py @@ -14,6 +14,7 @@ import rsconf.systemd _DEFAULT_VAGRANT_CPUS = 4 +_DEFAULT_VAGRANT_MEMORY = 8192 # Allowable pattern enforced by vagrant _VM_HOSTNAME_RE = "[a-z0-9][a-z0-9.-]*" _LIB_VIRT_SUB_D = "libvirt" @@ -53,6 +54,9 @@ def _create_user_instances(): z.timeout_start_min = jc[self.module_name].get("timeout_start_min", 15) z.vm_hostname = f"{self._user}.{jc[self.module_name].vm_parent_domain}" z.vagrant_cpus = jc[self.module_name].get("vagrant_cpus", _DEFAULT_VAGRANT_CPUS) + z.vagrant_memory = jc[self.module_name].get( + "vagrant_memory", _DEFAULT_VAGRANT_MEMORY + ) rsconf.systemd.unit_prepare( self, self.j2_ctx, watch_files=(z.start_f, z.stop_f) ) diff --git a/rsconf/package_data/vm_devbox/start.sh.jinja b/rsconf/package_data/vm_devbox/start.sh.jinja index 60ccb54e..5a4cf7f3 100644 --- a/rsconf/package_data/vm_devbox/start.sh.jinja +++ b/rsconf/package_data/vm_devbox/start.sh.jinja @@ -5,7 +5,7 @@ vm_devbox_create_vm() { if [[ -e Vagrantfile ]]; then return fi - curl '{{ rsconf_db.installer_url }}' | vagrant_dev_vm_devbox=1 vagrant_dev_cpus={{ this.vagrant_cpus }} bash -s vagrant-sirepo-dev '{{ this.vm_hostname}}' + curl '{{ rsconf_db.installer_url }}' | vagrant_dev_vm_devbox=1 vagrant_dev_cpus={{ this.vagrant_cpus }} vagrant_dev_memory={{ this.vagrant_memory }} bash -s vagrant-sirepo-dev '{{ this.vm_hostname}}' } vm_devbox_main() { diff --git a/tests/pkcli/build1_data/1.out/srv/host/v9.radia.run/srv/vm_devbox_user-1/start b/tests/pkcli/build1_data/1.out/srv/host/v9.radia.run/srv/vm_devbox_user-1/start index 8d814c46..3b6f65bc 100644 --- a/tests/pkcli/build1_data/1.out/srv/host/v9.radia.run/srv/vm_devbox_user-1/start +++ b/tests/pkcli/build1_data/1.out/srv/host/v9.radia.run/srv/vm_devbox_user-1/start @@ -5,7 +5,7 @@ vm_devbox_create_vm() { if [[ -e Vagrantfile ]]; then return fi - curl 'https://radia.run' | vagrant_dev_vm_devbox=1 vagrant_dev_cpus=8 bash -s vagrant-sirepo-dev 'user-1.radia.run' + curl 'https://radia.run' | vagrant_dev_vm_devbox=1 vagrant_dev_cpus=8 vagrant_dev_memory=8192 bash -s vagrant-sirepo-dev 'user-1.radia.run' } vm_devbox_main() { diff --git a/tests/pkcli/build1_data/1.out/srv/host/v9.radia.run/vm_devbox_user-1.sh b/tests/pkcli/build1_data/1.out/srv/host/v9.radia.run/vm_devbox_user-1.sh index 08a39dd7..5401e10b 100644 --- a/tests/pkcli/build1_data/1.out/srv/host/v9.radia.run/vm_devbox_user-1.sh +++ b/tests/pkcli/build1_data/1.out/srv/host/v9.radia.run/vm_devbox_user-1.sh @@ -4,7 +4,7 @@ rsconf_service_prepare 'vm_devbox_user-1' '/etc/systemd/system/vm_devbox_user-1. rsconf_install_access '700' 'vagrant' 'vagrant' rsconf_install_directory '/srv/vm_devbox_user-1' rsconf_install_access '500' 'vagrant' 'vagrant' -rsconf_install_file '/srv/vm_devbox_user-1/start' '65860ba541b7c09caf1613945d6e46a4' +rsconf_install_file '/srv/vm_devbox_user-1/start' '8978e325d8f77026b863c6cb2617f65e' rsconf_install_file '/srv/vm_devbox_user-1/stop' '94f5e7855deadc753f54580dfad70217' rsconf_install_access '444' 'root' 'root' rsconf_install_file '/etc/systemd/system/vm_devbox_user-1.service' '95beabb09a3e8a9977002d11ae4e47cd'