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
22 changes: 18 additions & 4 deletions Containerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
FROM registry.access.redhat.com/ubi9/python-312:latest AS builder
# Use this base image so everything comes from RPM packages (including OSC plugins)
ARG BUILDER_IMAGE=quay.rdoproject.org/podified-master-centos10/openstack-openstackclient:current-tested
ARG BASE_IMAGE=quay.rdoproject.org/podified-master-centos10/openstack-openstackclient:current-tested

FROM $BUILDER_IMAGE AS builder

WORKDIR /app

Expand All @@ -8,19 +12,29 @@ COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
# Copy dependency manifests and README first (build backend needs README.md).
# Dependency layer is reused when only application code changes.
COPY pyproject.toml uv.lock README.md ./
RUN uv sync --frozen --no-dev --no-editable --no-install-project
# Install dependencies but without the packages that come from the base image
RUN uv sync --frozen --no-dev --no-editable --no-install-project \
--no-install-package openstackclient \
--no-install-package python-openstackclient \
--no-install-package stevedore

# Copy application code and install the package into the venv.
COPY src/ src/
RUN uv sync --frozen --no-dev --no-editable
RUN uv sync --frozen --no-dev --no-editable \
--no-install-package openstackclient \
--no-install-package python-openstackclient \
--no-install-package stevedore

# FIX: Manually force the venv to look at system RPM packages at runtime
RUN sed -i 's/include-system-site-packages = false/include-system-site-packages = true/' /app/.venv/pyvenv.cfg

RUN curl -o oc.tar.gz https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable-4.18/openshift-client-linux.tar.gz && \
tar xvf oc.tar.gz oc && \
chmod +x oc && \
rm oc.tar.gz

# Final stage: smaller image without uv or build tools.
FROM registry.access.redhat.com/ubi9/python-312:latest
FROM $BASE_IMAGE

LABEL com.redhat.component="rhos-ls-mcps" \
name="openstack-lightspeed/rhos-mcps" \
Expand Down
16 changes: 16 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,22 @@ dev = [
"pre-commit>=4.6.0"
]

osc-plugins = [
"osc-placement",
"python-barbicanclient",
"python-designateclient",
"python-glanceclient",
"python-heatclient",
"python-ironicclient",
"python-ironic-inspector-client",
"python-manilaclient",
"python-observabilityclient",
"python-octaviaclient",
"aodhclient",
"python-cloudkittyclient",
"python-watcherclient",
]

[build-system]
requires = ["uv_build>=0.11.16,<0.12"]
build-backend = "uv_build"
Expand Down
10 changes: 10 additions & 0 deletions scripts/allow-deny-list.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,11 @@
"metric_benchmark measures add",
"metric_measures_batch-metrics",
"metric_measures_batch-resources-metrics",
"metric_clean-tombstones",
"metric_snapshot",
"rating_scope_patch",
"share_service_ensure_shares",
"share_replica_resync",
# This sounds intrusive: https://docs.openstack.org/senlin/rocky/user/nodes.html#checking-a-node
"cluster_node_check",
}
Expand Down Expand Up @@ -183,6 +188,11 @@
"workflow_engine_",
"data_processing_",
"orchestration_",
"observabilityclient_",
"placement_",
"share_",
"alarm_",
"rating_",
}


Expand Down
Loading
Loading