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

Fix #549: Allow configuration of vagrant memory. #551

Merged
merged 1 commit into from
Feb 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions rsconf/component/vm_devbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
)
Expand Down
2 changes: 1 addition & 1 deletion rsconf/package_data/vm_devbox/start.sh.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down