Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ceph: improve building of dev images #512

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from
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
4 changes: 3 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,12 @@ SPDK_CENTOS_REPO_VER="9.0-21.el9"

# Ceph Cluster
CEPH_CLUSTER_VERSION="${CEPH_VERSION}"
#CEPH_CLUSTER_VSTART_VERSION="v${CEPH_VERSION}"
CEPH_CLUSTER_VSTART_VERSION="main"
CEPH_BRANCH=ceph-nvmeof-mon
CEPH_SHA=a4f2962ef7ad30b6e015c14e2c398015a766695a
CEPH_VSTART_ARGS="--memstore"
baum marked this conversation as resolved.
Show resolved Hide resolved
CEPH_DEVEL_MGR_PATH=../ceph
#CEPH_CLUSTER_CEPH_REPO_BASEURL=https://1.chacra.ceph.com/r/ceph/main/71e6beb6de9ad34b7d44be0ccdf38721ae92202d/centos/9/flavors/default

# Demo settings
RBD_POOL=rbd
Expand Down
20 changes: 14 additions & 6 deletions Dockerfile.ceph
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ FROM quay.io/centos/centos:stream9-minimal AS build


ARG CEPH_CLUSTER_VERSION
ARG CEPH_CLUSTER_VSTART_VERSION
ARG CEPH_CLUSTER_CEPH_REPO_BASEURL
ARG CEPH_BRANCH
ARG CEPH_SHA
ARG CEPH_CLUSTER_EPEL_REPO_URL="https://copr.fedorainfracloud.org/coprs/ceph/el9/repo/epel-9/ceph-el9-epel-9.repo"

ARG MICRODNF_OPTS="\
Expand Down Expand Up @@ -48,6 +51,9 @@ RUN <<EOF
echo ======================================================================
echo CEPH_CLUSTER_CEPH_REPO_BASEURL=$CEPH_CLUSTER_CEPH_REPO_BASEURL
echo CEPH_CLUSTER_VERSION=$CEPH_CLUSTER_VERSION
echo CEPH_CLUSTER_VSTART_VERSION=$CEPH_CLUSTER_VSTART_VERSION
echo CEPH_BRANCH=$CEPH_BRANCH
echo CEPH_SHA=$CEPH_SHA
echo ======================================================================
EOF

Expand All @@ -73,6 +79,8 @@ RUN rpm -vih https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.
RUN rpm --import 'https://download.ceph.com/keys/release.asc'
RUN curl -O --output-dir /etc/yum.repos.d/ ${CEPH_CLUSTER_EPEL_REPO_URL:?}

RUN cat /etc/yum.repos.d/ceph.repo

RUN --mount=type=cache,target=/var/cache/microdnf \
microdnf install -y $MICRODNF_OPTS \
$CEPH_PACKAGES \
Expand All @@ -83,12 +91,12 @@ RUN --mount=type=cache,target=/var/cache/microdnf \
#------------------------------------------------------------------------------
FROM build

LABEL maintainer \
LABEL maintainer="$MAINTAINER" \
ceph=True \
RELEASE \
GIT_REPO \
GIT_BRANCH \
GIT_COMMIT
RELEASE="$RELEASE" \
GIT_REPO="$GIT_REPO" \
GIT_BRANCH="$GIT_BRANCH" \
GIT_COMMIT="$GIT_COMMIT"

ENV MON=1 \
MGR=1 \
Expand Down Expand Up @@ -118,7 +126,7 @@ RUN ln -sf $EC_PATH/* $CEPH_LIB && \
USER ceph
WORKDIR /ceph
ADD --chown=ceph:ceph --chmod=755 \
https://raw.githubusercontent.com/ceph/ceph/v${CEPH_CLUSTER_VERSION:?}/src/vstart.sh .
https://raw.githubusercontent.com/ceph/ceph/${CEPH_CLUSTER_VSTART_VERSION:?}/src/vstart.sh .

COPY <<EOF ./CMakeCache.txt
ceph_SOURCE_DIR:STATIC=/ceph
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile.spdk
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ ARG SPDK_CENTOS_REPO_VER="9.0-21.el9"

ARG SPDK_PKGDEP_ARGS \
SPDK_CONFIGURE_ARGS \
SPDK_MAKEFLAGS
SPDK_MAKEFLAGS \
SPDK_TARGET_ARCH

ARG SPDK_NAME \
SPDK_SUMMARY \
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ build: export SPDK_GIT_BRANCH != git -C spdk name-rev --name-only HEAD
build: export SPDK_GIT_COMMIT != git rev-parse HEAD:spdk
build: export BUILD_DATE != date -u +"%Y-%m-%d %H:%M:%S %Z"
build: export NVMEOF_GIT_MODIFIED_FILES != git status -s | grep -e "^ *M" | sed 's/^ *M //' | xargs
build: export CEPH_CLUSTER_CEPH_REPO_BASEURL != curl -s https://shaman.ceph.com/api/repos/ceph/$(CEPH_BRANCH)/$(CEPH_SHA)/centos/9/ | jq -r '.[0].url'
build: export CEPH_CLUSTER_CEPH_REPO_BASEURL ?= $(shell curl -s https://shaman.ceph.com/api/repos/ceph/$(CEPH_BRANCH)/$(CEPH_SHA)/centos/9/ | jq -r '.[0].url' )

up: ## Launch services
up: SCALE?= 1 ## Number of gateways
Expand Down
7 changes: 4 additions & 3 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,16 @@ services:
dockerfile: Dockerfile.ceph
args:
CEPH_CLUSTER_VERSION:
CEPH_CLUSTER_VSTART_VERSION:
CEPH_CLUSTER_CEPH_REPO_BASEURL:
CEPH_BRANCH:
CEPH_SHA:
labels:
io.ceph.nvmeof:
environment:
TOUCHFILE: /tmp/ceph.touch
NVMEOF_GW: ${NVMEOF_IP_ADDRESS}:${NVMEOF_GW_PORT}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is the NVMEOF_GW variable utilized? And what occurs in a multi-gateway deployment?

entrypoint: >-
sh -c './vstart.sh --new $$CEPH_VSTART_ARGS &&
ceph osd pool create rbd &&
echo ceph dashboard nvmeof-gateway-add -i <(echo nvmeof-devel:5500) nvmeof.1 &&
sleep infinity'
healthcheck:
test: ceph osd pool stats rbd
baum marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
Loading