From b592ecb3275bb131c2f4fdf2882e811eaa0ec653 Mon Sep 17 00:00:00 2001 From: Alexandre Fayolle Date: Fri, 26 Nov 2021 15:28:32 +0100 Subject: [PATCH 1/2] [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. From 597f6b0eb8857ca045f938963c02cd0cf61df467 Mon Sep 17 00:00:00 2001 From: Alexandre Fayolle Date: Fri, 26 Nov 2021 15:36:45 +0100 Subject: [PATCH 2/2] [FIX] debian package dependencies not available the Debian package dependencies where only installed during the initialization phase, not the deployement -> install them at that point. closes: #23 --- src/runboat/kubefiles/runboat-clone-and-install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/runboat/kubefiles/runboat-clone-and-install.sh b/src/runboat/kubefiles/runboat-clone-and-install.sh index d8fda37..80f1911 100755 --- a/src/runboat/kubefiles/runboat-clone-and-install.sh +++ b/src/runboat/kubefiles/runboat-clone-and-install.sh @@ -5,12 +5,12 @@ set -ex # If it exists, copy the previously initialized venv. if [ -f /mnt/data/initialized ] ; then - #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) + # Install 'deb' external dependencies of all Odoo addons found in path. + DEBIAN_FRONTEND=noninteractive apt-get install -qq --no-install-recommends $(oca_list_external_dependencies deb) exit 0 fi + DEBIAN_FRONTEND=noninteractive apt-get -yqq install rsync # Remove addons dir, in case we are reinitializing after a previously