Skip to content

Commit d0164d6

Browse files
Merge pull request #3 from Akrog/osc-plugins
OSC plugins
2 parents 930223c + f1249fe commit d0164d6

8 files changed

Lines changed: 1995 additions & 1492 deletions

File tree

Containerfile

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
FROM registry.access.redhat.com/ubi9/python-312:latest AS builder
1+
# Use this base image so everything comes from RPM packages (including OSC plugins)
2+
ARG BUILDER_IMAGE=quay.rdoproject.org/podified-master-centos10/openstack-openstackclient:current-tested
3+
ARG BASE_IMAGE=quay.rdoproject.org/podified-master-centos10/openstack-openstackclient:current-tested
4+
5+
FROM $BUILDER_IMAGE AS builder
26

37
WORKDIR /app
48

@@ -7,7 +11,23 @@ COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
711

812
# Copy dependency manifests and README first (build backend needs README.md).
913
# Dependency layer is reused when only application code changes.
10-
COPY pyproject.toml uv.lock README.md ./
14+
COPY --chown=cloud-admin:cloud-admin pyproject.toml uv.lock README.md ./
15+
16+
# Using `--no-install-package` in `uv sync` for these 3 packages only prevents
17+
# the top level package from installing, not their dependencies, installing
18+
# incompatible versions of the dependencies.
19+
RUN echo -e '\n[tool.uv]\nexclude-dependencies = [\n "openstackclient",\n "python-openstackclient",\n "stevedore"\n]' >> pyproject.toml
20+
21+
# This should be safe because uv’s resolver is highly conservative and should
22+
# keep every existing package pinned to its current locked version.
23+
# Checked this with `uv lock --dry-run`
24+
RUN uv lock
25+
26+
# Create the virtual environment enabling system's site-packages (RPM packages
27+
# from base container) since `uv sync` doesn't support it.
28+
RUN uv venv --system-site-packages /app/.venv
29+
30+
# Install dependencies but without the packages that come from the base image
1131
RUN uv sync --frozen --no-dev --no-editable --no-install-project
1232

1333
# Copy application code and install the package into the venv.
@@ -20,7 +40,7 @@ RUN curl -o oc.tar.gz https://mirror.openshift.com/pub/openshift-v4/clients/ocp/
2040
rm oc.tar.gz
2141

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

2545
LABEL com.redhat.component="rhos-ls-mcps" \
2646
name="openstack-lightspeed/rhos-mcps" \

pyproject.toml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,22 @@ dev = [
2525
"pre-commit>=4.6.0"
2626
]
2727

28+
osc-plugins = [
29+
"osc-placement",
30+
"python-barbicanclient",
31+
"python-designateclient",
32+
"python-glanceclient",
33+
"python-heatclient",
34+
"python-ironicclient",
35+
"python-ironic-inspector-client",
36+
"python-manilaclient",
37+
"python-observabilityclient",
38+
"python-octaviaclient",
39+
"aodhclient",
40+
"python-cloudkittyclient",
41+
"python-watcherclient",
42+
]
43+
2844
[build-system]
2945
requires = ["uv_build>=0.11.16,<0.12"]
3046
build-backend = "uv_build"

scripts/allow-deny-list.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,11 @@
151151
"metric_benchmark measures add",
152152
"metric_measures_batch-metrics",
153153
"metric_measures_batch-resources-metrics",
154+
"metric_clean-tombstones",
155+
"metric_snapshot",
156+
"rating_scope_patch",
157+
"share_service_ensure_shares",
158+
"share_replica_resync",
154159
# This sounds intrusive: https://docs.openstack.org/senlin/rocky/user/nodes.html#checking-a-node
155160
"cluster_node_check",
156161
}
@@ -183,6 +188,11 @@
183188
"workflow_engine_",
184189
"data_processing_",
185190
"orchestration_",
191+
"observabilityclient_",
192+
"placement_",
193+
"share_",
194+
"alarm_",
195+
"rating_",
186196
}
187197

188198

0 commit comments

Comments
 (0)