Skip to content

Commit

Permalink
build: create stand-alone packages
Browse files Browse the repository at this point in the history
Fixes: #168

Signed-off-by: Ernesto Puerta <epuertat@redhat.com>
  • Loading branch information
epuertat committed Aug 1, 2023
1 parent 3e440c4 commit 9ee5a0d
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 4 deletions.
4 changes: 4 additions & 0 deletions Dockerfile.spdk
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ RUN \
MAKEFLAGS=$SPDK_MAKEFLAGS \
rpmbuild/rpm.sh $SPDK_CONFIGURE_ARGS

#------------------------------------------------------------------------------
FROM registry.access.redhat.com/ubi9/ubi AS rpm-export
COPY --from=build /root/rpmbuild/rpm /rpm

#------------------------------------------------------------------------------
FROM registry.access.redhat.com/ubi9/ubi

Expand Down
12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,21 @@ up: override OPTS += --no-build --remove-orphans --scale nvmeof=$(SCALE)
clean: override HUGEPAGES = 0
clean: $(CLEAN) setup ## Clean-up environment

update-lockfile: SVC=nvmeof-builder
update-lockfile: SVC=nvmeof-builder-base
update-lockfile: override OPTS+=--entrypoint=pdm
update-lockfile: CMD=update --no-sync --no-isolation --no-self --no-editable
update-lockfile: pyproject.toml run ## Update dependencies in lockfile (pdm.lock)

export-rpms: SVC=spdk-rpm-export
export-rpms: OPTS=--entrypoint=cp -v /tmp:/tmp
export-rpms: CMD=-r /rpm /tmp
export-rpms: run ## Build SPDK RPMs and copy them to /tmp/rpm

export-python: SVC=nvmeof-builder
export-python: OPTS=--entrypoint=pdm -v /tmp:/tmp
export-python: CMD=build -d /tmp
export-python: run ## Build Ceph NVMe-oF Gateway Python package and copy it to /tmp

help: AUTOHELP_SUMMARY = Makefile to build and deploy the Ceph NVMe-oF Gateway
help: autohelp

Expand Down
18 changes: 16 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ services:
SPDK_GIT_COMMIT:
labels:
io.ceph.nvmeof:
# Used to export RPM packages externally (via bind mount)
spdk-rpm-export:
extends:
service: spdk
build:
target: rpm-export
ceph:
image: quay.io/ceph/vstart-cluster:$CEPH_CLUSTER_VERSION
container_name: ceph
Expand Down Expand Up @@ -99,14 +105,22 @@ services:
depends_on:
ceph:
condition: service_healthy
nvmeof-builder:
# Used to update lockfile (make update-lockfile)
nvmeof-builder-base:
extends:
service: nvmeof-base
image: nvmeof-builder
image: nvmeof-builder-base
build:
target: builder-base
volumes:
- .:/src
# Used to export Python package
nvmeof-builder:
extends:
service: nvmeof-base
image: nvmeof-builder
build:
target: builder
nvmeof-devel:
# Runs from source code in current dir
extends:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "pdm.backend"

[project]
name = "ceph-nvmeof"
dynamic = ["version"]
version = "0.0.1"
description = "Service to provide Ceph storage over NVMe-oF protocol"
readme = "README.md"
requires-python = "~=3.9"
Expand Down

0 comments on commit 9ee5a0d

Please sign in to comment.