Skip to content
Open
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
1 change: 1 addition & 0 deletions containers/manila/buildrequirements.lock
220 changes: 220 additions & 0 deletions containers/manila/buildrequirements.lock.master
Original file line number Diff line number Diff line change
@@ -0,0 +1,220 @@
#
# This file is autogenerated by pip-compile with Python 3.14
# by the following command:
#
# pybuild-deps compile --output-file=buildrequirements.lock.master requirements.lock.master
#
build==1.5.0
# via cmd2
calver==2025.10.20
# via trove-classifiers
cffi==2.0.0
# via pynacl
cython==3.2.9
# via
# lxml
# pyyaml
# sqlalchemy
flit-core==3.12.0
# via
# jinja2
# markdown-it-py
# mdurl
# pyparsing
# pyproject-hooks
# typing-extensions
# wheel
flit-core==4.0.2
# via
# build
# idna
# packaging
# pathspec
hatch-fancy-pypi-readme==25.1.0
# via
# attrs
# jsonschema
hatch-vcs==0.5.0
# via
# attrs
# eventlet
# jsonschema
# jsonschema-specifications
# platformdirs
# prettytable
# referencing
# testresources
# testscenarios
# urllib3
hatchling==1.31.0
# via
# attrs
# dnspython
# eventlet
# hatch-fancy-pypi-readme
# hatch-vcs
# jsonschema
# jsonschema-specifications
# legacy-cgi
# platformdirs
# prettytable
# pygments
# redis
# referencing
# rich-argparse
# testresources
# testscenarios
# uhashring
# urllib3
# wcwidth
maturin==1.14.1
# via rpds-py
packaging==26.2
# via
# build
# hatchling
# setuptools-scm
# vcs-versioning
# wheel
pathspec==1.1.1
# via hatchling
pbr==7.0.3
# via
# castellan
# cliff
# debtcollector
# futurist
# keystoneauth1
# keystonemiddleware
# openstacksdk
# os-service-types
# osc-lib
# oslo-cache
# oslo-concurrency
# oslo-config
# oslo-context
# oslo-db
# oslo-i18n
# oslo-log
# oslo-messaging
# oslo-metrics
# oslo-middleware
# oslo-policy
# oslo-privsep
# oslo-reports
# oslo-rootwrap
# oslo-serialization
# oslo-service
# oslo-upgradecheck
# oslo-utils
# osprofiler
# pycadf
# python-barbicanclient
# python-cinderclient
# python-keystoneclient
# python-neutronclient
# python-novaclient
# stevedore
# tooz
pluggy==1.6.0
# via hatchling
poetry-core==2.4.1
# via
# iso8601
# rich
pycparser==3.0
# via cffi
pyproject-hooks==1.2.0
# via build
semantic-version==2.10.0
# via setuptools-rust
setuptools-rust==1.13.0
# via
# bcrypt
# maturin
setuptools-scm==10.2.1
# via
# cachetools
# cmd2
# cotyledon
# hatch-vcs
# pluggy
# setuptools-rust
# tenacity
# urllib3
setuptools-scm==7.1.0
# via python-dateutil
trove-classifiers==2026.6.1.19
# via hatchling
typing-extensions==4.15.0
# via setuptools-scm
vcs-versioning==2.2.3
# via setuptools-scm
wheel==0.47.0
# via
# autopage
# bcrypt
# fasteners
# mako
# pycparser
# pynacl
# python-dateutil
# python-novaclient
# tzdata
# voluptuous
# wrapt

# The following packages are considered to be unsafe in a requirements file:
setuptools==82.0.1
# via charset-normalizer
setuptools==83.0.0
# via
# alembic
# autopage
# bcrypt
# cachetools
# calver
# certifi
# cffi
# cmd2
# cotyledon
# decorator
# dogpile-cache
# fasteners
# greenlet
# invoke
# lxml
# mako
# markupsafe
# maturin
# msgpack
# netaddr
# paramiko
# pastedeploy
# pathspec
# pbr
# pluggy
# prometheus-client
# prompt-toolkit
# psutil
# pycparser
# pyjwt
# pymysql
# pynacl
# pyperclip
# python-dateutil
# python-novaclient
# pyyaml
# repoze-lru
# requests
# setuptools-rust
# setuptools-scm
# sqlalchemy
# sqlalchemy-utils
# statsd
# tenacity
# trove-classifiers
# tzdata
# vcs-versioning
# wrapt
# yappi
1 change: 1 addition & 0 deletions containers/manila/common/manila-sudoers
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
manila ALL = (root) NOPASSWD: /usr/bin/manila-rootwrap /etc/manila/rootwrap.conf *
103 changes: 103 additions & 0 deletions containers/manila/manila-api/Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
ARG BASE_IMAGE=localhost/openstack/openstack-base:latest

# --- Build stage: compile wheels from source ---
FROM ${BASE_IMAGE} AS build

ARG SERVICE_SRC=/src/manila

ARG CONSTRAINTS_FILE=requirements.lock
COPY ${CONSTRAINTS_FILE} /deps-upper-constraints.txt
COPY src/ /src/
COPY manila-api/src/ /src/

# We can force build from source of all packages optionally
ARG PIP_NO_BINARY=""
ENV PIP_NO_BINARY=${PIP_NO_BINARY}
# required to build rpds-py from source
ENV MATURIN_NO_INSTALL_RUST=true

COPY manila-api/builddeps.txt /tmp/builddeps.txt
RUN pkgs=$(cat /tmp/builddeps.txt | grep -v '^#' | grep -v '^$' | tr '\n' ' ') && \
if [ -n "${pkgs}" ]; then microdnf -y install ${pkgs} && microdnf clean all; fi

COPY manila-api/pythonbuilddeps.txt /tmp/pythonbuilddeps.txt
RUN pkgs=$(cat /tmp/pythonbuilddeps.txt | grep -v '^#' | grep -v '^$' | tr '\n' ' ') && \
if [ -n "${pkgs}" ]; then pip3 install --no-cache-dir -c /deps-upper-constraints.txt ${pkgs}; fi && \
rm /tmp/pythonbuilddeps.txt

RUN cp /deps-upper-constraints.txt /tmp/build-constraints.txt && \
for src_dir in /src/*/ /src/overrides/*/; do \
if [ -d "${src_dir}" ] && [ -f "${src_dir}/setup.cfg" ]; then \
pkg_name=$(grep -m1 '^name' "${src_dir}/setup.cfg" | sed 's/.*=\s*//'); \
sed -i "/^${pkg_name}[=!<>]/Id" /tmp/build-constraints.txt; \
fi; \
done

RUN for pkg in /src/*/ /src/overrides/*/; do \
if [ -d "${pkg}" ] && [ -f "${pkg}/setup.cfg" -o -f "${pkg}/setup.py" -o -f "${pkg}/pyproject.toml" ]; then \
pip3 wheel --no-cache-dir --no-deps \
--wheel-dir=/wheels/pkgs "${pkg}"; \
fi; \
done

RUN pip3 wheel --no-cache-dir \
-c /deps-upper-constraints.txt \
--find-links=/wheels/pkgs \
--wheel-dir=/wheels/deps /wheels/pkgs/*.whl

RUN for src_dir in /src/*/ /src/overrides/*/; do \
if [ -d "${src_dir}" ] && [ -f "${src_dir}/setup.cfg" ]; then \
pkg_name=$(grep -m1 '^name' "${src_dir}/setup.cfg" | sed 's/.*=\s*//'); \
commit=$(git -C "${src_dir}" rev-parse HEAD 2>/dev/null || echo "unknown"); \
version=$(ls /wheels/pkgs/${pkg_name//-/_}-*.whl 2>/dev/null | head -1 | sed 's/.*-\([0-9][^-]*\)-.*/\1/' || echo "unknown"); \
echo "${pkg_name},${commit},${version}"; \
fi; \
done > /source-built-packages.txt


RUN mkdir -p /configfiles/etc/manila && \
cp -a ${SERVICE_SRC}/etc/manila/api-paste.ini /configfiles/etc/manila/

# --- Runtime stage ---
FROM ${BASE_IMAGE}

LABEL summary="OpenStack Manila API" \
io.k8s.description="Manila API service (WSGI via httpd) built from source with kolla interface"

RUN uid_gid_manage manila

COPY manila-api/bindeps.txt /tmp/bindeps.txt
RUN pkgs=$(cat /tmp/bindeps.txt | grep -v '^#' | grep -v '^$' | tr '\n' ' ') && \
if [ -n "${pkgs}" ]; then microdnf -y install ${pkgs} && microdnf clean all; fi && \
rm /tmp/bindeps.txt

COPY --from=build /wheels /wheels
COPY --from=build /tmp/build-constraints.txt /deps-upper-constraints.txt
COPY --from=build /source-built-packages.txt /source-built-packages.txt
COPY manila-api/pythondeps.txt /tmp/pythondeps.txt
RUN extrapkgs=$(cat /tmp/pythondeps.txt | grep -v '^#' | grep -v '^$' | tr '\n' ' ') && \
pip3 install --no-cache-dir --prefix=/usr \
-c /deps-upper-constraints.txt \
--find-links=/wheels/deps \
--find-links=/wheels/pkgs \
/wheels/pkgs/*.whl ${extrapkgs} && \
rm -rf /wheels /tmp/pythondeps.txt

RUN mkdir -p /etc/manila /var/log/manila /var/lib/manila /var/cache/manila && \
chown -R manila:manila /etc/manila /var/log/manila /var/lib/manila /var/cache/manila && \
chmod 770 /var/log/manila /var/lib/manila /var/cache/manila

COPY --from=build /configfiles/etc/manila/api-paste.ini /etc/manila/api-paste.ini

RUN chmod 640 /etc/manila/api-paste.ini && \
chown manila:manila /etc/manila/api-paste.ini

RUN mkdir -p /var/www/cgi-bin/manila
COPY scripts/manila-wsgi /var/www/cgi-bin/manila
RUN chown -R manila /var/www/cgi-bin/manila && chmod 755 /var/www/cgi-bin/manila/manila-wsgi

RUN sed -i -r 's,^(Listen 80),#\1,' /etc/httpd/conf/httpd.conf && \
sed -i -r 's,^(Listen 443),#\1,' /etc/httpd/conf.d/ssl.conf 2>/dev/null || true && \
usermod --append --groups apache manila

USER manila
8 changes: 8 additions & 0 deletions containers/manila/manila-api/bindeps.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Apache WSGI server for manila-api
httpd
mod_ssl
python3-mod_wsgi
python3
python3-pip
# cryptography from RPM for certifications and CVE handling
python3-cryptography
17 changes: 17 additions & 0 deletions containers/manila/manila-api/builddeps.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Compiler toolchain and headers for building Python C extensions
git-core
gcc
gcc-c++
python3-devel
python3-setuptools
python3-wheel
libffi-devel
openssl-devel
python3-cryptography
# Required to build lxml
libxml2-devel
libxslt-devel
# To build bcrypt from source
rust
# To build rpds-py from source
cargo
1 change: 1 addition & 0 deletions containers/manila/manila-api/pythonbuilddeps.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pbr
4 changes: 4 additions & 0 deletions containers/manila/manila-api/pythondeps.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Database driver (mysql extra for oslo.db)
oslo.db[mysql]
# Caching backend (dogpile extra for oslo.cache)
oslo.cache[dogpile]
Empty file.
Loading