From 78a58e2f0bf47f30b1c7a425930a2ee82ce28f87 Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Tue, 26 Sep 2023 14:32:25 -0700 Subject: [PATCH] Add containers/teuthology-dev This is nearly identical to docs/docker-compose/teuthology, but with some changes to better work with ceph-devstack. The bits in docs/docker-compose should be able to be adapted easily to work with this container. Signed-off-by: Zack Cerza --- containers/teuthology-dev/.teuthology.yaml | 9 ++++ containers/teuthology-dev/Dockerfile | 39 ++++++++++++++++++ .../teuthology-dev/containerized_node.yaml | 12 ++++++ containers/teuthology-dev/teuthology.sh | 41 +++++++++++++++++++ 4 files changed, 101 insertions(+) create mode 100644 containers/teuthology-dev/.teuthology.yaml create mode 100644 containers/teuthology-dev/Dockerfile create mode 100644 containers/teuthology-dev/containerized_node.yaml create mode 100755 containers/teuthology-dev/teuthology.sh diff --git a/containers/teuthology-dev/.teuthology.yaml b/containers/teuthology-dev/.teuthology.yaml new file mode 100644 index 0000000000..cdac7f02ce --- /dev/null +++ b/containers/teuthology-dev/.teuthology.yaml @@ -0,0 +1,9 @@ +queue_host: beanstalk +queue_port: 11300 +lock_server: http://paddles:8080 +results_server: http://paddles:8080 +results_ui_server: http://pulpito:8081/ +teuthology_path: /teuthology +archive_base: /archive_dir +reserve_machines: 0 +lab_domain: '' diff --git a/containers/teuthology-dev/Dockerfile b/containers/teuthology-dev/Dockerfile new file mode 100644 index 0000000000..a486644d82 --- /dev/null +++ b/containers/teuthology-dev/Dockerfile @@ -0,0 +1,39 @@ +FROM ubuntu:focal +ENV DEBIAN_FRONTEND=noninteractive +RUN apt-get update && \ + apt-get install -y \ + git \ + qemu-utils \ + python3-dev \ + libssl-dev \ + ipmitool \ + python3-pip \ + python3-venv \ + vim \ + libev-dev \ + libvirt-dev \ + libffi-dev \ + libyaml-dev \ + lsb-release && \ + apt-get clean all +WORKDIR /teuthology +COPY requirements.txt bootstrap /teuthology/ +RUN \ + cd /teuthology && \ + mkdir ../archive_dir && \ + mkdir log && \ + chmod +x /teuthology/bootstrap && \ + PIP_INSTALL_FLAGS="-r requirements.txt" ./bootstrap +COPY . /teuthology +RUN \ + ./bootstrap +COPY containers/teuthology-dev/containerized_node.yaml /teuthology +COPY containers/teuthology-dev/.teuthology.yaml /root +COPY containers/teuthology-dev/teuthology.sh / +RUN \ + mkdir $HOME/.ssh && \ + touch $HOME/.ssh/id_rsa && \ + chmod 600 $HOME/.ssh/id_rsa && \ + echo "StrictHostKeyChecking=no" > $HOME/.ssh/config && \ + echo "UserKnownHostsFile=/dev/null" >> $HOME/.ssh/config +ENTRYPOINT /teuthology.sh diff --git a/containers/teuthology-dev/containerized_node.yaml b/containers/teuthology-dev/containerized_node.yaml new file mode 100644 index 0000000000..8d8563be92 --- /dev/null +++ b/containers/teuthology-dev/containerized_node.yaml @@ -0,0 +1,12 @@ +overrides: + ansible.cephlab: + skip_tags: "timezone,nagios,monitoring-scripts,ssh,hostname,pubkeys,zap,sudoers,kerberos,selinux,lvm,ntp-client,resolvconf,packages,cpan,nfs" + vars: + containerized_node: true + ansible_user: root + cm_user: root + start_rpcbind: false + cephadm: + image: quay.ceph.io/ceph-ci/ceph:main + osd_method: raw + no_cgroups_split: true diff --git a/containers/teuthology-dev/teuthology.sh b/containers/teuthology-dev/teuthology.sh new file mode 100755 index 0000000000..44b2ddc730 --- /dev/null +++ b/containers/teuthology-dev/teuthology.sh @@ -0,0 +1,41 @@ +#!/usr/bin/bash +set -e +source /teuthology/virtualenv/bin/activate +set -x +cat /run/secrets/id_rsa > $HOME/.ssh/id_rsa +if [ -n "$TESTNODES" ]; then + for node in $(echo $TESTNODES | tr , ' '); do + teuthology-update-inventory -m $MACHINE_TYPE $node + done + CUSTOM_CONF=${CUSTOM_CONF:-} +else + CUSTOM_CONF=/teuthology/containerized_node.yaml +fi +export MACHINE_TYPE=${MACHINE_TYPE:-testnode} +if [ "$TEUTHOLOGY_SUITE" != "none" ]; then + if [ -n "$TEUTH_BRANCH" ]; then + TEUTH_BRANCH_FLAG="--teuthology-branch $TEUTH_BRANCH" + fi + teuthology-suite -v \ + $TEUTH_BRANCH_FLAG \ + --ceph-repo "${TEUTHOLOGY_CEPH_REPO:-https://github.com/ceph/ceph.git}" \ + -c ${CEPH_BRANCH:-main} \ + -m $MACHINE_TYPE \ + --limit 1 \ + -n 100 \ + --suite ${TEUTHOLOGY_SUITE:-teuthology:no-ceph} \ + --suite-branch "${TEUTHOLOGY_SUITE_BRANCH:-main}" \ + --suite-repo "${TEUTHOLOGY_SUITE_REPO:-https://github.com/ceph/ceph.git}" \ + --filter-out "libcephfs,kclient" \ + -p 75 \ + --seed 349 \ + --force-priority \ + $CUSTOM_CONF + DISPATCHER_EXIT_FLAG='--exit-on-empty-queue' + teuthology-queue -m $MACHINE_TYPE -s | \ + python3 -c "import sys, json; assert json.loads(sys.stdin.read())['count'] > 0, 'queue is empty!'" +fi +teuthology-dispatcher -v \ + --log-dir /teuthology/log \ + --tube $MACHINE_TYPE \ + $DISPATCHER_EXIT_FLAG