From: Redouane Kachach Date: Fri, 29 Sep 2023 08:33:13 +0000 (+0200) Subject: project config: adding rook orchestrator e2e testing job X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b0076b06a89f7bbfa985b9648105f65cc498d5b0;p=ceph-build.git project config: adding rook orchestrator e2e testing job Fixes: https://tracker.ceph.com/issues/63019 Signed-off-by: Redouane Kachach --- diff --git a/ceph-rook-e2e/build/cleanup b/ceph-rook-e2e/build/cleanup new file mode 100755 index 00000000..baffd7fa --- /dev/null +++ b/ceph-rook-e2e/build/cleanup @@ -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 index 00000000..7ce064e8 --- /dev/null +++ b/ceph-rook-e2e/config/definitions/ceph-orchestrator-rook-e2e.yml @@ -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 index 00000000..bab21757 --- /dev/null +++ b/scripts/rook-orch/install-rook-e2e-deps.sh @@ -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