From f05f915dfd427fe9f01ea2b099219d72d249b295 Mon Sep 17 00:00:00 2001 From: "senol.colak" Date: Wed, 28 Jan 2026 17:22:02 +0100 Subject: [PATCH 1/3] Makefile to build cobaltcore version of Ceph - cherrypicket version --- Makefile | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000000000..810e0eb24b0e9 --- /dev/null +++ b/Makefile @@ -0,0 +1,23 @@ +# --- Ceph container build for Rook (CobaltCore) --- + +REGISTRY ?= ghcr.io/cobaltcore-dev +IMAGE_NAME ?= ceph +# upstream v19.2.3 + CobaltCore build 1 +IMAGE_TAG ?= v19.2.3-cc1 + +# This is the Ceph/container build script described in ContainerBuild.md +# In recent Ceph it is build-with-container.py; if the CLI differs in your branch, +# just adjust the command here. +CEPH_CONTAINER_BUILD ?= ./src/script/build-with-container.py + +.PHONY: ceph-image-build +ceph-image-build: + $(CEPH_CONTAINER_BUILD) \ + --image-repo $(REGISTRY)/$(IMAGE_NAME) \ + --tag $(IMAGE_TAG) + +.PHONY: ceph-image-push +ceph-image-push: ceph-image-build + docker push $(REGISTRY)/$(IMAGE_NAME):$(IMAGE_TAG) + @echo "Pushed $(REGISTRY)/$(IMAGE_NAME):$(IMAGE_TAG)" + From c22e634cabf292aaae513e686bb089b1e994f58d Mon Sep 17 00:00:00 2001 From: "senol.colak" Date: Fri, 13 Feb 2026 18:00:22 +0100 Subject: [PATCH 2/3] action runner test --- .github/workflows/build-ceph-custom.sh | 130 +++++++++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 .github/workflows/build-ceph-custom.sh diff --git a/.github/workflows/build-ceph-custom.sh b/.github/workflows/build-ceph-custom.sh new file mode 100644 index 0000000000000..85e24f0f8b888 --- /dev/null +++ b/.github/workflows/build-ceph-custom.sh @@ -0,0 +1,130 @@ +name: Build Custom Ceph Image (with PRs) + +on: + workflow_dispatch: + inputs: + pr_numbers: + description: 'List of PR numbers to apply (space separated, e.g., "55123 56789")' + required: false + type: string + ceph_tag: + description: 'Base Ceph Version' + required: true + default: 'v19.2.3' + push_image: + description: 'Push image to GitHub Packages?' + type: boolean + default: true + +jobs: + build-ceph: + name: Build Ceph Squid + runs-on: self-hosted # MUST be a large runner (32GB+ RAM recommended) + permissions: + contents: read + packages: write # Required to push to ghcr.io + + steps: + # --- 1. SETUP & CLEAN --- + - name: Checkout Code + uses: actions/checkout@v4 + with: + ref: ${{ inputs.ceph_tag }} + submodules: recursive + fetch-depth: 0 + + - name: Clean Workspace + run: | + git clean -fdx + git submodule foreach --recursive git clean -fdx + git submodule update --init --recursive + + # --- 2. APPLY PULL REQUESTS --- + - name: Apply Custom PRs + if: "${{ inputs.pr_numbers != '' }}" + run: | + PRS="${{ inputs.pr_numbers }}" + echo "Applying PRs: $PRS" + + for PR in $PRS; do + echo "Fetching PR #$PR..." + git fetch origin pull/$PR/head:pr-$PR + + echo "Merging PR #$PR..." + git config user.email "ci-bot@example.com" + git config user.name "CI Bot" + git merge --no-edit pr-$PR + done + git submodule update --init --recursive + + # --- 3. PATCH BUILDER --- + - name: Patch Builder Script + run: | + sed -i 's/dnf install -y \/usr\/bin\/rpmbuild/dnf install -y --allowerasing \/usr\/bin\/rpmbuild/g' src/script/buildcontainer-setup.sh + + # --- 4. COMPILE CEPH --- + - name: Compile RPMs + run: | + # Dynamic RAM allocation + CORE_COUNT=$(nproc) + MEM_GB=$(free -g | awk '/^Mem:/{print $2}') + JOBS=$((MEM_GB / 2)) + [[ $JOBS -lt 2 ]] && JOBS=2 + [[ $JOBS -gt $CORE_COUNT ]] && JOBS=$CORE_COUNT + export NINJAJOBS=$JOBS + + ./src/script/build-with-container.py \ + -d centos9 \ + -e rpm \ + -- \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DENABLE_LTO=OFF \ + -DWITH_TESTS=OFF + + # --- 5. OPTIMIZE (SLIM) --- + - name: Filter RPMs + run: | + mkdir -p staging_rpms + find rpmbuild/RPMS -name "*.rpm" \ + ! -name "*debuginfo*" ! -name "*debugsource*" \ + ! -name "*devel*" ! -name "*test*" ! -name "*static*" \ + -exec cp {} staging_rpms/ \; + + # --- 6. GENERATE DOCKERFILE --- + - name: Generate Dockerfile + run: | + cat < Dockerfile + FROM quay.io/centos/centos:stream9 + RUN dnf install -y epel-release && /usr/bin/crb enable && dnf makecache + RUN dnf install -y lvm2 python3 python3-pyyaml libibverbs librdmacm \ + libicu libaio nss nspr cryptsetup lua-devel && dnf clean all + COPY staging_rpms/*.rpm /tmp/rpms/ + RUN dnf localinstall -y /tmp/rpms/*.rpm --skip-broken --setopt=install_weak_deps=False && \ + dnf clean all && rm -rf /tmp/rpms + RUN mkdir -p /var/run/ceph /var/lib/ceph /var/log/ceph && \ + chmod 770 /var/run/ceph /var/lib/ceph /var/log/ceph + ENTRYPOINT ["/usr/bin/ceph"] + EOF + + # --- 7. PUSH TO GITHUB PACKAGES --- + - name: Lowercase Repo Name + run: echo "REPO_LOWER=${GITHUB_REPOSITORY,,}" >> ${GITHUB_ENV} + + - name: Login to GitHub Container Registry + if: ${{ inputs.push_image }} + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and Push + if: ${{ inputs.push_image }} + uses: docker/build-push-action@v5 + with: + context: . + file: Dockerfile + push: true + tags: | + ghcr.io/${{ env.REPO_LOWER }}:${{ inputs.ceph_tag }} + ghcr.io/${{ env.REPO_LOWER }}:latest From d15e316e124825b2351fefc7349afbe6caab051e Mon Sep 17 00:00:00 2001 From: "senol.colak" Date: Fri, 13 Feb 2026 18:25:41 +0100 Subject: [PATCH 3/3] makefile removed --- Makefile | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 Makefile diff --git a/Makefile b/Makefile deleted file mode 100644 index 810e0eb24b0e9..0000000000000 --- a/Makefile +++ /dev/null @@ -1,23 +0,0 @@ -# --- Ceph container build for Rook (CobaltCore) --- - -REGISTRY ?= ghcr.io/cobaltcore-dev -IMAGE_NAME ?= ceph -# upstream v19.2.3 + CobaltCore build 1 -IMAGE_TAG ?= v19.2.3-cc1 - -# This is the Ceph/container build script described in ContainerBuild.md -# In recent Ceph it is build-with-container.py; if the CLI differs in your branch, -# just adjust the command here. -CEPH_CONTAINER_BUILD ?= ./src/script/build-with-container.py - -.PHONY: ceph-image-build -ceph-image-build: - $(CEPH_CONTAINER_BUILD) \ - --image-repo $(REGISTRY)/$(IMAGE_NAME) \ - --tag $(IMAGE_TAG) - -.PHONY: ceph-image-push -ceph-image-push: ceph-image-build - docker push $(REGISTRY)/$(IMAGE_NAME):$(IMAGE_TAG) - @echo "Pushed $(REGISTRY)/$(IMAGE_NAME):$(IMAGE_TAG)" -