-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- [x] Containerize and isolate spdk build (ubi8 and ubi9) - [x] Containerize nvme-of build (ubi9, although 8 would be trivial) - [x] Manage Python package dependencies and metadata (Poetry) - [x] Remove dependencies from /usr/libexec (since those are not intended for external usage). - [x] Simplify build & deployment (docker-compose instead of make) Signed-off-by: Ernesto Puerta <epuertat@redhat.com>
- Loading branch information
Showing
16 changed files
with
433 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
__pycache__ | ||
spdk | ||
ceph_nvmeof/generated | ||
server.crt | ||
server.key | ||
client.crt | ||
client.key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# syntax = docker/dockerfile:1.4 | ||
FROM ceph/spdk-ubi9 as ceph-nvmeof | ||
|
||
ARG SUMMARY="Platform for building and running Python $PYTHON_VERSION applications" \ | ||
DESCRIPTION="Python $PYTHON_VERSION available as container is a base platform for \ | ||
building and running various Python $PYTHON_VERSION applications and frameworks. \ | ||
Python is an easy to learn, powerful programming language. It has efficient high-level \ | ||
data structures and a simple but effective approach to object-oriented programming. \ | ||
Python's elegant syntax and dynamic typing, together with its interpreted nature, \ | ||
make it an ideal language for scripting and rapid application development in many areas \ | ||
on most platforms." \ | ||
NAME="ceph-nvmeof" \ | ||
VERSION="0" \ | ||
MAINTAINER="Ceph Developers <dev@ceph.io>" | ||
|
||
LABEL summary="$SUMMARY" \ | ||
description="$DESCRIPTION" \ | ||
name="$NAME" \ | ||
version="$VERSION" \ | ||
maintainer="$MAINTAINER" | ||
|
||
ENV PYTHONUNBUFFERED=1 \ | ||
PYTHONIOENCODING=UTF-8 \ | ||
LC_ALL=en_US.UTF-8 \ | ||
LANG=en_US.UTF-8 \ | ||
PIP_NO_CACHE_DIR=off | ||
|
||
# TODO: switch to non-root user | ||
|
||
WORKDIR /src | ||
|
||
ENV PYTHON_MODULE=ceph_nvmeof | ||
ENV PYTHONPATH=/src/$PYTHON_MODULE/generated | ||
|
||
RUN dnf install -y python3-pip python3-rados | ||
RUN pip3 install "poetry<1.4" | ||
RUN poetry self add poetry-grpc-plugin | ||
|
||
COPY . . | ||
RUN poetry install | ||
RUN poetry protoc | ||
|
||
ENTRYPOINT python3 -m $PYTHON_MODULE -c ceph-nvmeof.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
# syntax = docker/dockerfile:1.4 | ||
ARG OS_RELEASE=9 | ||
FROM registry.access.redhat.com/ubi$OS_RELEASE/ubi:latest as prebase | ||
ARG OS_RELEASE | ||
|
||
# Speed up dnf | ||
COPY <<EOF /etc/dnf/dnf.conf | ||
[main] | ||
gpgcheck=1 | ||
installonly_limit=3 | ||
clean_requirements_on_remove=True | ||
skip_if_unavailable=False | ||
best=False | ||
fastestmirror=True | ||
max_parallel_downloads=10 | ||
tsflags=nodocs | ||
EOF | ||
|
||
#------------------------------------------------------------------------------ | ||
FROM prebase as base_release_8 | ||
ARG CENTOS_PACKAGE_VERSION="8-6" | ||
ARG CENTOS_MIRROR="mirror.centos.org/centos" | ||
|
||
#------------------------------------------------------------------------------ | ||
FROM prebase as base_release_9 | ||
ARG CENTOS_PACKAGE_VERSION="9.0-20" | ||
ARG CENTOS_MIRROR="mirror.stream.centos.org" | ||
|
||
#------------------------------------------------------------------------------ | ||
FROM base_release_$OS_RELEASE as base | ||
|
||
ARG CENTOS_URL="http://$CENTOS_MIRROR/$OS_RELEASE-stream/BaseOS/x86_64/os/Packages" | ||
ARG CENTOS_GPG_PACKAGE="$CENTOS_URL/centos-gpg-keys-$CENTOS_PACKAGE_VERSION.el$OS_RELEASE.noarch.rpm" | ||
ARG CENTOS_REPO_PACKAGE="$CENTOS_URL/centos-stream-repos-$CENTOS_PACKAGE_VERSION.el$OS_RELEASE.noarch.rpm" | ||
|
||
ARG CEPH_VERSION="17.2.5" | ||
|
||
|
||
COPY <<EOF /etc/yum.repos.d/ceph.repo | ||
[Ceph] | ||
name=Ceph packages for \$basearch | ||
baseurl=http://download.ceph.com/rpm-$CEPH_VERSION/el\$releasever/\$basearch | ||
enabled=1 | ||
gpgcheck=1 | ||
type=rpm-md | ||
gpgkey=https://download.ceph.com/keys/release.asc | ||
|
||
[Ceph-noarch] | ||
name=Ceph noarch packages | ||
baseurl=http://download.ceph.com/rpm-$CEPH_VERSION/el\$releasever/noarch | ||
enabled=1 | ||
gpgcheck=1 | ||
type=rpm-md | ||
gpgkey=https://download.ceph.com/keys/release.asc | ||
|
||
[ceph-source] | ||
name=Ceph source packages | ||
baseurl=http://download.ceph.com/rpm-$CEPH_VERSION/el\$releasever/SRPMS | ||
enabled=1 | ||
gpgcheck=1 | ||
type=rpm-md | ||
gpgkey=https://download.ceph.com/keys/release.asc | ||
EOF | ||
|
||
RUN \ | ||
--mount=type=cache,target=/var/cache/dnf \ | ||
--mount=type=cache,target=/var/lib/dnf \ | ||
dnf remove -y dnf-plugin-subscription-manager \ | ||
&& dnf install -y \ | ||
$CENTOS_GPG_PACKAGE \ | ||
$CENTOS_REPO_PACKAGE | ||
|
||
#------------------------------------------------------------------------------ | ||
FROM base as build | ||
|
||
ARG SPDK_VERSION | ||
|
||
ARG RPM_RELEASE | ||
ARG MAKEFLAGS | ||
ARG PKGDEP_ARGS="--rbd" | ||
ARG CONFIGURE_ARGS="\ | ||
--with-rbd \ | ||
--disable-tests \ | ||
--disable-unit-tests \ | ||
--disable-examples \ | ||
" | ||
|
||
WORKDIR /src | ||
COPY . . | ||
|
||
RUN \ | ||
--mount=type=cache,target=/var/cache/dnf \ | ||
--mount=type=cache,target=/var/lib/dnf \ | ||
--mount=type=cache,target=/root/.cache/pip \ | ||
dnf install -y \ | ||
rpm-build \ | ||
git \ | ||
&& scripts/pkgdep.sh $PKGDEP_ARGS | ||
|
||
RUN DEPS="no" rpmbuild/rpm.sh $CONFIGURE_ARGS | ||
|
||
#------------------------------------------------------------------------------ | ||
FROM base as ceph-spdk | ||
|
||
# @TODO: Add LABELs | ||
|
||
RUN \ | ||
--mount=type=bind,from=build,source=/root/rpmbuild/rpm,target=/rpm \ | ||
--mount=type=cache,target=/var/cache/dnf \ | ||
--mount=type=cache,target=/var/lib/dnf \ | ||
dnf install -y /rpm/$(uname -m)/*.rpm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.