From b592ecb3275bb131c2f4fdf2882e811eaa0ec653 Mon Sep 17 00:00:00 2001 From: Alexandre Fayolle Date: Fri, 26 Nov 2021 15:28:32 +0100 Subject: [PATCH] [IMP] speed up start of container we rsync the virtual env of odoo to a volume at the end of the init phase. Rather than rsync'ing back, mount the volume on top of the odoo venv from the base docker image. --- src/runboat/kubefiles/deployment.yaml | 3 +++ src/runboat/kubefiles/runboat-clone-and-install.sh | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/runboat/kubefiles/deployment.yaml b/src/runboat/kubefiles/deployment.yaml index cdd4ce0..2057d50 100644 --- a/src/runboat/kubefiles/deployment.yaml +++ b/src/runboat/kubefiles/deployment.yaml @@ -26,6 +26,9 @@ spec: mountPath: /runboat - name: data mountPath: /mnt/data + - name: data + mountPath: /opt/odoo-venv + subPath: odoo-venv envFrom: - secretRef: name: odoosecretenv diff --git a/src/runboat/kubefiles/runboat-clone-and-install.sh b/src/runboat/kubefiles/runboat-clone-and-install.sh index 447cdb1..d8fda37 100755 --- a/src/runboat/kubefiles/runboat-clone-and-install.sh +++ b/src/runboat/kubefiles/runboat-clone-and-install.sh @@ -2,14 +2,16 @@ set -ex -DEBIAN_FRONTEND=noninteractive apt-get -yq install rsync # If it exists, copy the previously initialized venv. if [ -f /mnt/data/initialized ] ; then - rsync -a --delete /mnt/data/odoo-venv/ /opt/odoo-venv + #rsync -a --delete /mnt/data/odoo-venv/ /opt/odoo-venv pip list + # issue#23: install debian package dependencies (hack oca_install_addons to only + # install deb) exit 0 fi +DEBIAN_FRONTEND=noninteractive apt-get -yqq install rsync # Remove addons dir, in case we are reinitializing after a previously # failed installation.