]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
project config: adding rook orchestrator e2e testing job
authorRedouane Kachach <rkachach@redhat.com>
Fri, 29 Sep 2023 08:33:13 +0000 (10:33 +0200)
committerRedouane Kachach <rkachach@redhat.com>
Fri, 3 Nov 2023 10:42:25 +0000 (11:42 +0100)
Fixes: https://tracker.ceph.com/issues/63019
Signed-off-by: Redouane Kachach <rkachach@redhat.com>
ceph-rook-e2e/build/cleanup [new file with mode: 0755]
ceph-rook-e2e/config/definitions/ceph-orchestrator-rook-e2e.yml [new file with mode: 0644]
scripts/rook-orch/install-rook-e2e-deps.sh [new file with mode: 0644]

diff --git a/ceph-rook-e2e/build/cleanup b/ceph-rook-e2e/build/cleanup
new file mode 100755 (executable)
index 0000000..baffd7f
--- /dev/null
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+set +x
+echo "Starting cleanup..."
+docker container prune -f
+minikube stop
+minikube delete
+echo "Cleanup completed."
diff --git a/ceph-rook-e2e/config/definitions/ceph-orchestrator-rook-e2e.yml b/ceph-rook-e2e/config/definitions/ceph-orchestrator-rook-e2e.yml
new file mode 100644 (file)
index 0000000..7ce064e
--- /dev/null
@@ -0,0 +1,96 @@
+- job:
+    name: ceph-orchestrator-rook-e2e
+    project-type: freestyle
+    defaults: global
+    concurrent: true
+    node: huge && jammy && x86_64
+    display-name: 'ceph: Rook Orchestrator E2E'
+    quiet-period: 5
+    block-downstream: false
+    block-upstream: false
+    retry-count: 3
+    properties:
+      - build-discarder:
+          days-to-keep: 15
+          num-to-keep: 300
+          artifact-days-to-keep: -1
+          artifact-num-to-keep: -1
+      - github:
+          url: https://github.com/ceph/ceph/
+      - rebuild:
+          auto-rebuild: true
+      - inject:
+          properties-content: |
+            TERM=xterm
+    parameters:
+      - string:
+          name: sha1
+          description: "commit id or a refname, like 'origin/pr/72/head'"
+
+    triggers:
+      - github-pull-request:
+          cancel-builds-on-update: true
+          allow-whitelist-orgs-as-admins: true
+          org-list:
+            - ceph
+          white-list-labels:
+            - orchestrator
+            - rook
+          black-list-target-branches:
+            - luminous
+            - mimic
+            - nautilus
+          trigger-phrase: 'jenkins test rook orchestrator'
+          skip-build-phrase: '^jenkins do not test.*'
+          only-trigger-phrase: false
+          github-hooks: true
+          permit-all: true
+          auto-close-on-fail: false
+          status-context: "ceph rook orchestrator e2e tests"
+          started-status: "running ceph rook orchestrator e2e tests"
+          success-status: "ceph rook orchestrator e2e tests succeeded"
+          failure-status: "ceph rook orchestrator e2e tests failed"
+
+    scm:
+      - git:
+          url: https://github.com/ceph/ceph.git
+          branches:
+            - origin/pr/${ghprbPullId}/merge
+          refspec: +refs/pull/${ghprbPullId}/*:refs/remotes/origin/pr/${ghprbPullId}/*
+          browser: auto
+          timeout: 20
+          skip-tag: true
+          shallow-clone: true
+          wipe-workspace: true
+
+      - git:
+          url: https://github.com/ceph/ceph-build.git
+          branches:
+            - main
+          basedir: ceph-build
+
+    builders:
+      - shell:
+          !include-raw:
+             - ../../../scripts/rook-orch/install-rook-e2e-deps.sh
+      - shell: |
+          export COMMIT_INFO_MESSAGE="$ghprbPullTitle"
+          timeout 3600 ./src/pybind/mgr/rook/ci/run-rook-e2e-tests.sh
+    wrappers:
+      - inject-passwords:
+          global: true
+          mask-password-params: true
+      - ansicolor
+
+    publishers:
+
+      - postbuildscript:
+          builders:
+            - role: SLAVE
+              build-on:
+                - SUCCESS
+                - UNSTABLE
+                - FAILURE
+                - ABORTED
+              build-steps:
+                - shell: "${WORKSPACE}/ceph-build/ceph-rook-e2e/build/cleanup"
diff --git a/scripts/rook-orch/install-rook-e2e-deps.sh b/scripts/rook-orch/install-rook-e2e-deps.sh
new file mode 100644 (file)
index 0000000..bab2175
--- /dev/null
@@ -0,0 +1,43 @@
+#!/usr/bin/env bash
+
+set -ex
+
+install_docker(){
+    DISTRO="$(lsb_release -cs)"
+    if [[ $(command -v docker) == '' ]]; then
+       # Set up docker official repo and install docker.
+       curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
+       echo \
+            "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
+        ${DISTRO} stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
+       sudo apt update -y
+       sudo apt install -y docker-ce docker-ce-cli containerd.io
+    fi
+    sudo groupadd docker || true
+    sudo usermod -aG docker $(id -un)
+    sudo systemctl start docker
+    sudo chgrp "$(id -un)" /var/run/docker.sock
+
+    docker info
+    docker container prune -f
+}
+
+configure_libvirt(){
+    sudo usermod -aG libvirt $(id -un)
+    sudo su -l $USER  # Avoid having to log out and log in for group addition to take effect.
+    sudo systemctl enable --now libvirtd
+    sudo systemctl restart libvirtd
+    sleep 10 # wait some time for libvirtd service to restart
+}
+
+# install dependencies
+sudo apt update -y
+sudo apt install -y qemu-kvm libvirt-daemon-driver-qemu libvirt-clients libvirt-daemon-system  runc python3
+sudo apt install -y python3-pip
+pip3 install behave
+configure_libvirt
+install_docker
+
+# install minikube
+curl -LO https://storage.googleapis.com/minikube/releases/v1.31.2/minikube-linux-amd64
+sudo install minikube-linux-amd64 /usr/local/bin/minikube