Skip to content

Commit

Permalink
docker: add Ceph-Dashboard support
Browse files Browse the repository at this point in the history
Signed-off-by: Ernesto Puerta <[email protected]>
  • Loading branch information
epuertat committed Jan 12, 2024
1 parent 4300218 commit fa819e4
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ SPDK_CENTOS_REPO_VER="9.0-21.el9"

# Ceph Cluster
CEPH_CLUSTER_VERSION="${CEPH_VERSION}"
CEPH_VSTART_ARGS="--without-dashboard --memstore"
CEPH_VSTART_ARGS="--memstore"
CEPH_DEVEL_MGR_PATH=/home/epuertat/git/ceph

# Demo settings
RBD_POOL=rbd
Expand Down
26 changes: 24 additions & 2 deletions Dockerfile.ceph
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# syntax = docker/dockerfile:1.4
# vim: syntax=dockerfile
FROM quay.io/centos/centos:stream9-minimal AS build

ARG CEPH_CLUSTER_VERSION
Expand Down Expand Up @@ -27,11 +28,24 @@ ARG CEPH_PACKAGES="\
ceph-osd \
ceph-mds \
ceph-mgr \
ceph-mgr-dashboard \
ceph-radosgw \
ceph-exporter \
hostname \
jq \
net-tools \
iproute \
"
# TODO: To remove when ceph-mgr-dashboard defines these as deps
ARG EXTRA_PACKAGES="\
python3-grpcio\
python3-grpcio-tools \
"
ARG DEBUG_PACKAGES="\
procps-ng \
strace \
perf \
ltrace \
"

RUN rpm -vih https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
Expand All @@ -47,7 +61,9 @@ RUN \
--setopt=install_weak_deps=0 \
--setopt=keepcache=1 \
--setopt=cachedir=/var/cache/microdnf \
$CEPH_PACKAGES
$CEPH_PACKAGES \
$EXTRA_PACKAGES \
$DEBUG_PACKAGES

#------------------------------------------------------------------------------
FROM build
Expand All @@ -67,7 +83,7 @@ ENV MON=1 \
RGW=0 \
NFS=0 \
CEPH_PORT=10000 \
CEPH_VSTART_ARGS="--without-dashboard"
CEPH_VSTART_ARGS="--memstore"

ENV CEPH_BIN=/usr/bin \
CEPH_LIB=/usr/lib64/ceph \
Expand All @@ -88,6 +104,12 @@ USER ceph
WORKDIR /ceph
ADD --chown=ceph:ceph --chmod=755 https://raw.githubusercontent.com/ceph/ceph/v$CEPH_CLUSTER_VERSION/src/vstart.sh .

COPY <<EOF ./CMakeCache.txt
ceph_SOURCE_DIR:STATIC=/ceph
WITH_MGR_DASHBOARD_FRONTEND:BOOL=ON
WITH_RBD:BOOL=ON
EOF

ENTRYPOINT \
./vstart.sh --new $CEPH_VSTART_ARGS && \
sleep infinity
11 changes: 8 additions & 3 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,9 @@ services:
labels:
io.ceph.nvmeof:
environment:
CEPH_VSTART_ARGS:
VSTART_ARGS: --without-dashboard --memstore
TOUCHFILE: /tmp/ceph.touch
entrypoint: >-
sh -c './vstart.sh --new $$VSTART_ARGS &&
sh -c './vstart.sh --new $$CEPH_VSTART_ARGS &&
ceph osd pool create rbd &&
sleep infinity'
healthcheck:
Expand All @@ -81,6 +79,13 @@ services:
default:
ipv4_address: 192.168.13.2
ipv6_address: 2001:db8::2
ceph-devel:
extends:
service: ceph
image: $QUAY_CEPH-devel:$CEPH_CLUSTER_VERSION
container_name: ceph-devel
volumes:
- ${CEPH_DEVEL_MGR_PATH?Define the path of your local Ceph repo}/src/pybind/mgr:/usr/share/ceph/mgr
nvmeof-base:
build:
context: .
Expand Down

0 comments on commit fa819e4

Please sign in to comment.