]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
Add ceph-source-dist job 2357/head
authorZack Cerza <zack@cerza.org>
Mon, 14 Apr 2025 19:48:18 +0000 (13:48 -0600)
committerZack Cerza <zack@cerza.org>
Wed, 7 May 2025 19:53:28 +0000 (13:53 -0600)
Signed-off-by: Zack Cerza <zack@cerza.org>
ceph-source-dist/build/Jenkinsfile [new file with mode: 0644]
ceph-source-dist/config/definitions/ceph-source-dist.yml [new file with mode: 0644]

diff --git a/ceph-source-dist/build/Jenkinsfile b/ceph-source-dist/build/Jenkinsfile
new file mode 100644 (file)
index 0000000..6b1f138
--- /dev/null
@@ -0,0 +1,111 @@
+pipeline {
+  agent {
+    label "gigantic"
+  }
+  stages {
+    stage("set environment variables") {
+      steps {
+        script {
+          switch (env.FLAVOR) {
+            case "default":
+              env.CEPH_EXTRA_RPMBUILD_ARGS="--with tcmalloc"
+              env.CEPH_EXTRA_CMAKE_ARGS+=" -DALLOCATOR=tcmalloc"
+              env.CEPH_EXTRA_CMAKE_ARGS+=" -DWITH_SYSTEM_BOOST=OFF -DWITH_BOOST_VALGRIND=ON"
+              env.DEB_BUILD_PROFILES=""
+              break
+            case "crimson":
+              env.CEPH_EXTRA_RPMBUILD_ARGS="--with seastar"
+              env.CEPH_EXTRA_CMAKE_ARGS+=" -DCMAKE_BUILD_TYPE=Debug"
+              env.DEB_BUILD_PROFILES="pkg.ceph.crimson"
+              break
+            case "jaeger":
+              env.CEPH_EXTRA_RPMBUILD_ARGS="--with jaeger"
+              env.DEB_BUILD_PROFILES="pkg.ceph.jaeger"
+              break
+            default:
+              println "FLAVOR={env.FLAVOR} is invalid"
+              assert false
+          }
+        }
+      }
+    }
+    stage("repository") {
+      steps {
+        dir("ceph") {
+          checkout scmGit(
+            branches: [[name: env.BRANCH]],
+            userRemoteConfigs: [[
+              url: env.CEPH_REPO,
+              credentialsId: 'jenkins-build'
+            ]],
+            extensions: [
+              [$class: 'CleanBeforeCheckout'],
+              [
+                $class: 'CloneOption',
+                shallow: true,
+                depth:   100,
+                timeout: 90
+              ],
+            ],
+          )
+          script {
+            sh 'git fetch --tags https://github.com/ceph/ceph.git'
+          }
+        }
+      }
+    }
+    stage("tarball") {
+      steps {
+        script {
+          dir("ceph") {
+            def ceph_version_git = sh(
+                  script: "git describe --abbrev=8 --match 'v*' | sed s/^v//",
+                  returnStdout: true,
+            ).trim()
+            sh """
+              mkdir dist
+              echo ${ceph_version_git} > dist/version
+              rm -f ceph-*.tar.*
+            """
+            sh """#!/bin/bash
+              ./make-dist ${ceph_version_git}
+            """
+            sh '''#!/bin/bash -ex
+              declare -A compression=( ["bz2"]="j" ["gz"]="z" ["xz"]="J" )
+              for cmp in "${!compression[@]}"; do
+                extension="tar.$cmp"
+                ceph_version_tarball=$(ls ceph-*.$extension | cut -c 6- | sed "s/.$extension//" || true)
+                flag="${compression[$cmp]}"
+                extract_flags="${flag}xf"
+                compress_flags="${flag}cf"
+                if [ "$ceph_version_tarball" != "" ]; then break; fi
+              done
+              echo tarball vers $ceph_version_tarball
+
+              ln ceph.spec dist/
+              ln ceph-$ceph_version_tarball.$extension dist/
+
+              echo "SHA1=$(git rev-parse HEAD)" > dist/sha1
+              echo "BRANCH=${BRANCH}" > dist/branch
+
+              # - CEPH_EXTRA_RPMBUILD_ARGS are consumed by build_rpm before
+              #   the switch to cmake;
+              # - CEPH_EXTRA_CMAKE_ARGS is for after cmake
+              # - DEB_BUILD_PROFILES is consumed by build_debs()
+              echo > dist/other_envvars
+              echo "CEPH_EXTRA_RPMBUILD_ARGS=${CEPH_EXTRA_RPMBUILD_ARGS}" >> dist/other_envvars
+              echo "CEPH_EXTRA_CMAKE_ARGS=${CEPH_EXTRA_CMAKE_ARGS}" >> dist/other_envvars
+              echo "DEB_BUILD_PROFILES=${DEB_BUILD_PROFILES}" >> dist/other_envvars
+              mv dist ..
+            '''
+          }
+        }
+      }
+    }
+  }
+  post {
+    always {
+      archiveArtifacts artifacts: 'dist/**', fingerprint: true
+    }
+  }
+}
diff --git a/ceph-source-dist/config/definitions/ceph-source-dist.yml b/ceph-source-dist/config/definitions/ceph-source-dist.yml
new file mode 100644 (file)
index 0000000..27ac68a
--- /dev/null
@@ -0,0 +1,70 @@
+- job:
+    name: ceph-source-dist
+    project-type: pipeline
+    concurrent: true
+    pipeline-scm:
+      scm:
+        - git:
+            url: https://github.com/ceph/ceph-build
+            branches:
+              - ${{CEPH_BUILD_BRANCH}}
+            shallow-clone: true
+            submodule:
+              disable: true
+            wipe-workspace: true
+      script-path: ceph-source-dist/build/Jenkinsfile
+      lightweight-checkout: true
+      do-not-fetch-tags: true
+    properties:
+      - build-discarder:
+          days-to-keep: -1
+          num-to-keep: 100
+          artifact-days-to-keep: -1
+          artifact-num-to-keep: 50
+      - copyartifact:
+          projects: ceph-dev-pipeline,ceph-dev,ceph-dev-build,ceph-dev-new,ceph-dev-new-build
+
+    parameters:
+      - choice:
+          name: CEPH_REPO
+          choices:
+            - git@github.com:ceph/ceph-ci.git
+            - git@github.com:ceph/ceph.git
+            - https://github.com/ceph/ceph-ci
+            - https://github.com/ceph/ceph
+
+      - string:
+          name: BRANCH
+          description: "The Ceph branch to build"
+
+      - choice:
+          name: FLAVOR
+          choices:
+            - default
+            - crimson
+            - jaeger
+
+      - string:
+          name: CEPH_BUILD_BRANCH
+          description: "Use the Jenkinsfile from this ceph-build branch"
+          default: main
+
+    scm:
+      - git:
+          url: ${{CEPH_REPO}}
+          # Use the SSH key attached to the ceph-jenkins GitHub account.
+          credentials-id: "jenkins-build"
+          branches:
+            - $BRANCH
+          timeout: 20
+          skip-tag: true
+          wipe-workspace: true
+
+    wrappers:
+      - inject-passwords:
+          global: true
+          mask-password-params: true
+      - credentials-binding:
+          - text:
+              credential-id: shaman-api-key
+              variable: SHAMAN_API_KEY