Skip to content

Commit

Permalink
Try containerized build
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Indenbaum <[email protected]>
  • Loading branch information
Alexander Indenbaum committed Nov 19, 2024
1 parent c5eacfc commit c114adf
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/build-container.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
name: "Containerized CEPH build"
on:
push:
tags:
- '*'
branches:
- '*'
pull_request:
branches:
- main
# Credit: https://stackoverflow.com/a/72408109
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
BUILD_ARTIFACT: build.tar.bz2
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 480 # Set timeout to 8 hours
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive

- name: Build ceph in centos9 stream container
run: |
docker run --rm -v "$(pwd):/src" -w /src quay.io/centos/centos:stream9 /bin/bash -c "./do_containerized_build.sh"
- name: Save ceph build
run: |
tar -cjf ${{ env.BUILD_ARTIFACT }} -C ./build .
- name: Upload ceph build
uses: actions/upload-artifact@v4
with:
name: ceph_build
path: |
${{ env.BUILD_ARTIFACT }}
23 changes: 23 additions & 0 deletions do_containerized_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh -ex

# This script is intended to run within centos-9 container
# image name: quay.io/centos/centos:stream9
# docker run --rm -v "$(pwd):/src" -w /src quay.io/centos/centos:stream9 /bin/bash -c "./do_containerized_build.sh"
# Based on https://docs.ceph.com/en/reef/install/build-ceph/#:~:text=You%20can%20get%20Ceph%20software,packages%20and%20install%20the%20packages.


# Before you can build Ceph source code, you need to install several libraries and tools:
./install-deps.sh

# The container root ownership issue
#fatal: detected dubious ownership in repository at '/src'
# To add an exception for this directory, call:
git config --global --add safe.directory /src

# Ceph is built using cmake.
./do_cmake.sh
cd build
ninja

# return the ownership to the user
#sudo chown -R $(id -u):$(id -g) .

0 comments on commit c114adf

Please sign in to comment.