Skip to content

Commit c6e03ae

Browse files
authored
Merge pull request #626 from Tecnativa/add-18.0
[ADD] Odoo 18.0
2 parents 533f140 + 583898e commit c6e03ae

File tree

4 files changed

+275
-7
lines changed

4 files changed

+275
-7
lines changed

.github/workflows/ci.yaml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,14 @@ jobs:
3535
fail-fast: false
3636
matrix:
3737
# Test modern Odoo versions with latest Postgres version
38-
odoo_version: ["17.0"]
39-
pg_version: ["15"]
38+
odoo_version: ["18.0"]
39+
pg_version: ["16"]
4040
python_version: ["3.10"]
4141
include:
4242
# Older odoo versions don't support latest postgres and Python versions
43+
- odoo_version: "17.0"
44+
pg_version: "15"
45+
python_version: "3.10"
4346
- odoo_version: "16.0"
4447
pg_version: "14"
4548
python_version: "3.10"
@@ -56,6 +59,8 @@ jobs:
5659
# Other variables to configure tests and execution environment
5760
DOCKER_BUILDKIT: 1
5861
PG_VERSIONS: ${{ matrix.pg_version }}
62+
ODOO_MINOR: ${{ matrix.odoo_version }}
63+
DOCKER_TAG: ${{ matrix.odoo_version }}
5964
steps:
6065
# Prepare
6166
- uses: actions/checkout@v4
@@ -80,10 +85,12 @@ jobs:
8085
fail-fast: false
8186
matrix:
8287
# Test modern Odoo versions with latest Postgres version
83-
odoo_version: ["17.0"]
88+
odoo_version: ["18.0"]
8489
platforms: ["linux/amd64,linux/arm64"]
8590
include:
8691
# Older odoo versions don't support latest postgres and Python versions
92+
- odoo_version: "17.0"
93+
platforms: "linux/amd64,linux/arm64"
8794
- odoo_version: "16.0"
8895
platforms: "linux/amd64,linux/arm64"
8996
- odoo_version: "15.0"
@@ -94,7 +101,7 @@ jobs:
94101
platforms: "linux/amd64"
95102
env:
96103
# Indicates what's the equivalent to tecnativa/doodba:latest image
97-
LATEST_RELEASE: "17.0"
104+
LATEST_RELEASE: "18.0"
98105
# Define the docker hub repository location and github container registry host
99106
DOCKER_REPO: tecnativa/doodba
100107
GHCR_HOST: ghcr.io

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
"[dockerfile]": {
1313
"editor.formatOnSave": false
1414
},
15-
"python.analysis.extraPaths": ["./lib", "./tests"]
15+
"python.analysis.extraPaths": ["./lib", "./tests"],
16+
"python.languageServer": "None"
1617
}

18.0.Dockerfile

Lines changed: 260 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,260 @@
1+
FROM python:3.10-slim-bookworm AS base
2+
3+
EXPOSE 8069 8072
4+
5+
ARG TARGETARCH
6+
ARG GEOIP_UPDATER_VERSION=6.0.0
7+
ARG WKHTMLTOPDF_VERSION=0.12.6.1
8+
ARG WKHTMLTOPDF_AMD64_CHECKSUM='98ba0d157b50d36f23bd0dedf4c0aa28c7b0c50fcdcdc54aa5b6bbba81a3941d'
9+
ARG WKHTMLTOPDF_ARM64_CHECKSUM="b6606157b27c13e044d0abbe670301f88de4e1782afca4f9c06a5817f3e03a9c"
10+
ARG WKHTMLTOPDF_URL="https://github.com/wkhtmltopdf/packaging/releases/download/${WKHTMLTOPDF_VERSION}-3/wkhtmltox_${WKHTMLTOPDF_VERSION}-3.bookworm_${TARGETARCH}.deb"
11+
ARG LAST_SYSTEM_UID=499
12+
ARG LAST_SYSTEM_GID=499
13+
ARG FIRST_UID=500
14+
ARG FIRST_GID=500
15+
ENV DB_FILTER=.* \
16+
DEPTH_DEFAULT=1 \
17+
DEPTH_MERGE=100 \
18+
EMAIL=https://hub.docker.com/r/tecnativa/odoo \
19+
GEOIP_ACCOUNT_ID="" \
20+
GEOIP_LICENSE_KEY="" \
21+
GIT_AUTHOR_NAME=docker-odoo \
22+
INITIAL_LANG="" \
23+
LC_ALL=C.UTF-8 \
24+
LIST_DB=false \
25+
NODE_PATH=/usr/local/lib/node_modules:/usr/lib/node_modules \
26+
OPENERP_SERVER=/opt/odoo/auto/odoo.conf \
27+
PATH="/home/odoo/.local/bin:$PATH" \
28+
PIP_NO_CACHE_DIR=0 \
29+
DEBUGPY_ARGS="--listen 0.0.0.0:6899 --wait-for-client" \
30+
DEBUGPY_ENABLE=0 \
31+
PUDB_RDB_HOST=0.0.0.0 \
32+
PUDB_RDB_PORT=6899 \
33+
PYTHONOPTIMIZE="" \
34+
UNACCENT=true \
35+
WAIT_DB=true \
36+
WDB_NO_BROWSER_AUTO_OPEN=True \
37+
WDB_SOCKET_SERVER=wdb \
38+
WDB_WEB_PORT=1984 \
39+
WDB_WEB_SERVER=localhost
40+
41+
# Other requirements and recommendations
42+
# See https://github.com/$ODOO_SOURCE/blob/$ODOO_VERSION/debian/control
43+
RUN echo "LAST_SYSTEM_UID=$LAST_SYSTEM_UID\nLAST_SYSTEM_GID=$LAST_SYSTEM_GID\nFIRST_UID=$FIRST_UID\nFIRST_GID=$FIRST_GID" >> /etc/adduser.conf \
44+
&& echo "SYS_UID_MAX $LAST_SYSTEM_UID\nSYS_GID_MAX $LAST_SYSTEM_GID" >> /etc/login.defs \
45+
&& sed -i -E "s/^UID_MIN\s+[0-9]+.*/UID_MIN $FIRST_UID/;s/^GID_MIN\s+[0-9]+.*/GID_MIN $FIRST_GID/" /etc/login.defs \
46+
&& useradd --system -u $LAST_SYSTEM_UID -s /usr/sbin/nologin -d / systemd-network \
47+
&& apt-get -qq update \
48+
&& apt-get install -yqq --no-install-recommends \
49+
curl \
50+
&& if [ "$TARGETARCH" = "arm64" ]; then \
51+
WKHTMLTOPDF_CHECKSUM=$WKHTMLTOPDF_ARM64_CHECKSUM; \
52+
elif [ "$TARGETARCH" = "amd64" ]; then \
53+
WKHTMLTOPDF_CHECKSUM=$WKHTMLTOPDF_AMD64_CHECKSUM; \
54+
else \
55+
echo "Unsupported architecture: $TARGETARCH" >&2; \
56+
exit 1; \
57+
fi \
58+
&& curl -SLo wkhtmltox.deb ${WKHTMLTOPDF_URL} \
59+
&& echo "Downloading wkhtmltopdf from: ${WKHTMLTOPDF_URL}" \
60+
&& echo "Expected wkhtmltox checksum: ${WKHTMLTOPDF_CHECKSUM}" \
61+
&& echo "Computed wkhtmltox checksum: $(sha256sum wkhtmltox.deb | awk '{ print $1 }')" \
62+
&& echo "${WKHTMLTOPDF_CHECKSUM} wkhtmltox.deb" | sha256sum -c - \
63+
&& apt-get install -yqq --no-install-recommends \
64+
./wkhtmltox.deb \
65+
chromium \
66+
ffmpeg \
67+
fonts-liberation2 \
68+
gettext \
69+
git \
70+
gnupg2 \
71+
locales-all \
72+
nano \
73+
npm \
74+
openssh-client \
75+
telnet \
76+
vim
77+
RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ bookworm-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \
78+
&& curl -SL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
79+
&& apt-get update \
80+
&& curl --silent -L --output geoipupdate_${GEOIP_UPDATER_VERSION}_linux_${TARGETARCH}.deb https://github.com/maxmind/geoipupdate/releases/download/v${GEOIP_UPDATER_VERSION}/geoipupdate_${GEOIP_UPDATER_VERSION}_linux_${TARGETARCH}.deb \
81+
&& dpkg -i geoipupdate_${GEOIP_UPDATER_VERSION}_linux_${TARGETARCH}.deb \
82+
&& rm geoipupdate_${GEOIP_UPDATER_VERSION}_linux_${TARGETARCH}.deb \
83+
&& apt-get autopurge -yqq \
84+
&& rm -Rf wkhtmltox.deb /var/lib/apt/lists/* /tmp/* \
85+
&& sync
86+
87+
WORKDIR /opt/odoo
88+
COPY bin/* /usr/local/bin/
89+
COPY lib/doodbalib /usr/local/lib/python3.10/site-packages/doodbalib
90+
COPY build.d common/build.d
91+
COPY conf.d common/conf.d
92+
COPY entrypoint.d common/entrypoint.d
93+
RUN mkdir -p auto/addons auto/geoip custom/src/private \
94+
&& ln /usr/local/bin/direxec common/entrypoint \
95+
&& ln /usr/local/bin/direxec common/build \
96+
&& chmod -R a+rx common/entrypoint* common/build* /usr/local/bin \
97+
&& chmod -R a+rX /usr/local/lib/python3.10/site-packages/doodbalib \
98+
&& cp -a /etc/GeoIP.conf /etc/GeoIP.conf.orig \
99+
&& mv /etc/GeoIP.conf /opt/odoo/auto/geoip/GeoIP.conf \
100+
&& ln -s /opt/odoo/auto/geoip/GeoIP.conf /etc/GeoIP.conf \
101+
&& sed -i 's/.*DatabaseDirectory .*$/DatabaseDirectory \/opt\/odoo\/auto\/geoip\//g' /opt/odoo/auto/geoip/GeoIP.conf \
102+
&& sync
103+
104+
# Doodba-QA dependencies in a separate virtualenv
105+
COPY qa /qa
106+
RUN python -m venv --system-site-packages /qa/venv \
107+
&& . /qa/venv/bin/activate \
108+
&& pip install \
109+
click \
110+
coverage \
111+
&& deactivate \
112+
&& mkdir -p /qa/artifacts
113+
114+
ARG ODOO_SOURCE=OCA/OCB
115+
ARG ODOO_VERSION=18.0
116+
ENV ODOO_VERSION="$ODOO_VERSION"
117+
118+
# Install Odoo hard & soft dependencies, and Doodba utilities
119+
RUN build_deps=" \
120+
build-essential \
121+
libfreetype6-dev \
122+
libfribidi-dev \
123+
libghc-zlib-dev \
124+
libharfbuzz-dev \
125+
libjpeg-dev \
126+
liblcms2-dev \
127+
libldap2-dev \
128+
libopenjp2-7-dev \
129+
libpq-dev \
130+
libsasl2-dev \
131+
libtiff5-dev \
132+
libwebp-dev \
133+
libxml2-dev \
134+
libxslt-dev \
135+
tcl-dev \
136+
tk-dev \
137+
zlib1g-dev \
138+
" \
139+
&& apt-get update \
140+
&& apt-get install -yqq --no-install-recommends $build_deps \
141+
&& curl -o requirements.txt https://raw.githubusercontent.com/$ODOO_SOURCE/$ODOO_VERSION/requirements.txt \
142+
&& \
143+
if [ "$TARGETARCH" = "arm64" ]; then \
144+
echo "Upgrading odoo requirements.txt with gevent==21.12.0 (minimum version compatible with arm64)" && \
145+
sed -i 's/gevent==[0-9\.]*/gevent==21.12.0/' requirements.txt; \
146+
fi \
147+
&& pip install -r requirements.txt \
148+
'websocket-client~=0.56' \
149+
astor \
150+
click-odoo-contrib \
151+
debugpy \
152+
pydevd-odoo \
153+
git+https://github.com/mailgun/[email protected]#egg=flanker[validator] \
154+
geoip2 \
155+
"git-aggregator==4.0" \
156+
inotify \
157+
pdfminer.six \
158+
pg_activity \
159+
phonenumbers \
160+
plumbum \
161+
pudb \
162+
pyOpenSSL \
163+
python-magic \
164+
watchdog \
165+
wdb \
166+
&& (python3 -m compileall -q /usr/local/lib/python3.10/ || true) \
167+
# generate flanker cached tables during install when /usr/local/lib/ is still intended to be written to
168+
# https://github.com/Tecnativa/doodba/issues/486
169+
&& python3 -c 'from flanker.addresslib import address' >/dev/null 2>&1 \
170+
&& apt-get purge -yqq $build_deps \
171+
&& apt-get autopurge -yqq \
172+
&& rm -Rf /var/lib/apt/lists/* /tmp/*
173+
174+
# Metadata
175+
ARG VCS_REF
176+
ARG BUILD_DATE
177+
ARG VERSION
178+
LABEL org.label-schema.schema-version="$VERSION" \
179+
org.label-schema.vendor=Tecnativa \
180+
org.label-schema.license=Apache-2.0 \
181+
org.label-schema.build-date="$BUILD_DATE" \
182+
org.label-schema.vcs-ref="$VCS_REF" \
183+
org.label-schema.vcs-url="https://github.com/Tecnativa/doodba"
184+
185+
# Onbuild version, with all the magic
186+
FROM base AS onbuild
187+
188+
# Enable setting custom uids for odoo user during build of scaffolds
189+
ONBUILD ARG UID=1000
190+
ONBUILD ARG GID=1000
191+
192+
# Enable Odoo user and filestore
193+
ONBUILD RUN groupadd -g $GID odoo -o \
194+
&& useradd -l -md /home/odoo -s /bin/false -u $UID -g $GID odoo \
195+
&& mkdir -p /var/lib/odoo \
196+
&& chown -R odoo:odoo /var/lib/odoo /qa/artifacts \
197+
&& chmod a=rwX /qa/artifacts \
198+
&& sync
199+
200+
# Subimage triggers
201+
ONBUILD ENTRYPOINT ["/opt/odoo/common/entrypoint"]
202+
ONBUILD CMD ["/usr/local/bin/odoo"]
203+
ONBUILD ARG AGGREGATE=true
204+
ONBUILD ARG DEFAULT_REPO_PATTERN="https://github.com/OCA/{}.git"
205+
ONBUILD ARG DEFAULT_REPO_PATTERN_ODOO="https://github.com/OCA/OCB.git"
206+
ONBUILD ARG DEPTH_DEFAULT=1
207+
ONBUILD ARG DEPTH_MERGE=100
208+
ONBUILD ARG CLEAN=true
209+
ONBUILD ARG COMPILE=true
210+
ONBUILD ARG FONT_MONO="Liberation Mono"
211+
ONBUILD ARG FONT_SANS="Liberation Sans"
212+
ONBUILD ARG FONT_SERIF="Liberation Serif"
213+
ONBUILD ARG PIP_INSTALL_ODOO=true
214+
ONBUILD ARG ADMIN_PASSWORD=admin
215+
ONBUILD ARG SMTP_SERVER=smtp
216+
ONBUILD ARG SMTP_PORT=25
217+
ONBUILD ARG SMTP_USER=false
218+
ONBUILD ARG SMTP_PASSWORD=false
219+
ONBUILD ARG SMTP_SSL=false
220+
ONBUILD ARG EMAIL_FROM=""
221+
ONBUILD ARG PROXY_MODE=false
222+
ONBUILD ARG WITHOUT_DEMO=all
223+
ONBUILD ARG PGUSER=odoo
224+
ONBUILD ARG PGPASSWORD=odoopassword
225+
ONBUILD ARG PGHOST=db
226+
ONBUILD ARG PGPORT=5432
227+
ONBUILD ARG PGDATABASE=prod
228+
229+
# Config variables
230+
ONBUILD ENV ADMIN_PASSWORD="$ADMIN_PASSWORD" \
231+
DEFAULT_REPO_PATTERN="$DEFAULT_REPO_PATTERN" \
232+
DEFAULT_REPO_PATTERN_ODOO="$DEFAULT_REPO_PATTERN_ODOO" \
233+
UNACCENT="$UNACCENT" \
234+
PGUSER="$PGUSER" \
235+
PGPASSWORD="$PGPASSWORD" \
236+
PGHOST="$PGHOST" \
237+
PGPORT=$PGPORT \
238+
PGDATABASE="$PGDATABASE" \
239+
PROXY_MODE="$PROXY_MODE" \
240+
SMTP_SERVER="$SMTP_SERVER" \
241+
SMTP_PORT=$SMTP_PORT \
242+
SMTP_USER="$SMTP_USER" \
243+
SMTP_PASSWORD="$SMTP_PASSWORD" \
244+
SMTP_SSL="$SMTP_SSL" \
245+
EMAIL_FROM="$EMAIL_FROM" \
246+
WITHOUT_DEMO="$WITHOUT_DEMO"
247+
ONBUILD ARG LOCAL_CUSTOM_DIR=./custom
248+
ONBUILD COPY --chown=root:odoo $LOCAL_CUSTOM_DIR /opt/odoo/custom
249+
250+
# https://docs.python.org/3/library/logging.html#levels
251+
ONBUILD ARG LOG_LEVEL=INFO
252+
ONBUILD RUN [ -d ~root/.ssh ] && rm -r ~root/.ssh; \
253+
mkdir -p /opt/odoo/custom/ssh \
254+
&& ln -s /opt/odoo/custom/ssh ~root/.ssh \
255+
&& chmod -R u=rwX,go= /opt/odoo/custom/ssh \
256+
&& sync
257+
ONBUILD ARG DB_VERSION=latest
258+
ONBUILD RUN /opt/odoo/common/build && sync
259+
ONBUILD VOLUME ["/var/lib/odoo"]
260+
ONBUILD USER odoo

tests/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
DIR = dirname(__file__)
1818
ODOO_PREFIX = ("odoo", "--stop-after-init", "--workers=0")
19-
ODOO_VERSIONS = frozenset(environ.get("DOCKER_TAG", "17.0").split())
20-
PG_VERSIONS = frozenset(environ.get("PG_VERSIONS", "15").split())
19+
ODOO_VERSIONS = frozenset(environ.get("DOCKER_TAG", "18.0").split())
20+
PG_VERSIONS = frozenset(environ.get("PG_VERSIONS", "16").split())
2121
SCAFFOLDINGS_DIR = join(DIR, "scaffoldings")
2222
GEIOP_CREDENTIALS_PROVIDED = environ.get("GEOIP_LICENSE_KEY", False) and environ.get(
2323
"GEOIP_ACCOUNT_ID", False

0 commit comments

Comments
 (0)