- uses: actions/checkout@v2
- name: Test using docker-compose
run: ./start.sh
- working-directory: ./docs/docker-compose
+ working-directory: ./containers/docker-compose
+++ /dev/null
-# For beanstalkd 1.12 use edge branch
-#FROM alpine:edge
-
-FROM alpine:3.12.3
-
-MAINTAINER Kyrylo Shatskyy <kyrylo.shatskyy@suse.com>
-
-RUN apk update && apk add beanstalkd beanstalkd-doc
-
-ENV BEANSTALK_ADDR "0.0.0.0"
-ENV BEANSTALK_PORT "11300"
-
-CMD /usr/bin/beanstalkd -V -l $BEANSTALK_ADDR -p $BEANSTALK_PORT
--- /dev/null
+# For beanstalkd 1.12 use edge branch
+#FROM alpine:edge
+
+FROM alpine:3.12.3
+
+MAINTAINER Kyrylo Shatskyy <kyrylo.shatskyy@suse.com>
+
+RUN apk update && apk add beanstalkd beanstalkd-doc
+
+ENV BEANSTALK_ADDR "0.0.0.0"
+ENV BEANSTALK_PORT "11300"
+
+CMD /usr/bin/beanstalkd -V -l $BEANSTALK_ADDR -p $BEANSTALK_PORT
--- /dev/null
+# Teuthology Development Environment Instruction
+
+The purpose of this guide is to help developers set
+up a development environment for Teuthology. We will be using
+Docker to set up all the containers for
+Postgres, Paddles, Pulpito, Beanstalk, and Teuthology.
+
+Currently, it's possible to execute against two classes of test nodes:
+
+* Using containerized test nodes
+ * Advantage: No need for a lab at all!
+ * Disadvantage: Cannot run all Ceph tests; best for exercising the framework itself
+* Using nodes from an existing lab (e.g. the Sepia lab)
+ * Advantage: Can run all Ceph tests
+ * Disadvantage: Requires lab access
+
+
+Additionally, there are two modes of execution:
+* One-shot (the default): Containers start up, schedule and run the `teuthology:no-ceph` suite, and shut down. Success or failure is indicated by the `start.sh` exit code.
+* Wait: Containers start up, and `teuthology-dispatcher` is started, but no jobs are scheduled. Runs until the user presses Ctrl-C or `docker-compose down` is run.
+
+The teuthology container will be built with code from the repository clone that's currently in use.
+
+## Prerequisites
+
+### Installing and Running Docker
+
+For Docker installation see:
+https://docs.docker.com/get-docker/
+
+### Using Containerized Nodes
+
+There's nothing special to do; see the Running Tests section below.
+
+### Using an Existing Lab
+
+This document assumes you have access to the lab that you intend to use, and that you're already familiar with its VPN and SSH infrastructure.
+
+Depending on your local operating system, it may be necessary to connect to the VPN before starting Docker.
+
+#### Using your SSH private key
+
+In your local shell, simply:
+```bash
+export SSH_PRIVKEY_PATH=$HOME/.ssh/id_rsa
+```
+The teuthology container will write it to a file at runtime.
+
+#### Reserving Machines in the Lab
+
+Taking the Sepia lab as an example once again, most users will want to do something like:
+
+```bash
+ssh teuthology.front.sepia.ceph.com
+~/teuthology/virtualenv/bin/teuthology-lock \
+ --lock-many 1 \
+ --machine-type smithi \
+ --desc "teuthology dev testing"
+```
+
+When you are done, don't forget to unlock!
+
+#### Using Lab Machines
+
+Once you have your machines locked, you need to provide a list of their hostnames and their machine type:
+
+```bash
+export TESTNODES="smithi999.front.sepia.ceph.com,smithi123.front.sepia.ceph.com"
+export MACHINE_TYPE="smithi"
+```
+
+If the lab uses a "secrets" or "inventory" repository for [ceph-cm-ansible](https://github.com/ceph/ceph-cm-ansible), you'll need to provide a URL for that. In Sepia:
+```bash
+export ANSIBLE_INVENTORY_REPO="https://github.com/ceph/ceph-sepia-secrets"
+```
+This repo will be cloned locally, using your existing `git` configuration, and copied into the teuthology container at build time.
+
+## Running Tests
+
+To run the default `teuthology:no-ceph` suite in one-shot mode:
+```bash
+./start.sh
+```
+
+To run in wait mode:
+```bash
+TEUTHOLOGY_WAIT=1 ./start.sh
+```
+
+To schedule tests in wait mode:
+```bash
+docker exec docker-compose_teuthology_1 /venv/bin/teuthology-suite ...
+```
\ No newline at end of file
--- /dev/null
+version: '3.8'
+
+services:
+ postgres:
+ image: postgres:14
+ healthcheck:
+ test: [ "CMD", "pg_isready", "-q", "-d", "paddles", "-U", "admin" ]
+ timeout: 5s
+ interval: 10s
+ retries: 2
+ environment:
+ - POSTGRES_USER=root
+ - POSTGRES_PASSWORD=password
+ - APP_DB_USER=admin
+ - APP_DB_PASS=password
+ - APP_DB_NAME=paddles
+ volumes:
+ - ../postgres/db:/docker-entrypoint-initdb.d/:Z
+ ports:
+ - 5432:5432
+ paddles:
+ image: quay.io/ceph-infra/paddles
+ environment:
+ PADDLES_SERVER_HOST: 0.0.0.0
+ PADDLES_SQLALCHEMY_URL: postgresql+psycopg2://admin:password@postgres:5432/paddles
+ depends_on:
+ postgres:
+ condition: service_healthy
+ links:
+ - postgres
+ healthcheck:
+ test: ["CMD", "curl", "-f", "http://0.0.0.0:8080"]
+ timeout: 5s
+ interval: 30s
+ retries: 2
+ ports:
+ - 8080:8080
+ pulpito:
+ image: quay.io/ceph-infra/pulpito
+ environment:
+ PULPITO_PADDLES_ADDRESS: http://paddles:8080
+ depends_on:
+ paddles:
+ condition: service_healthy
+ links:
+ - paddles
+ healthcheck:
+ test: ["CMD", "curl", "-f", "http://0.0.0.0:8081"]
+ timeout: 5s
+ interval: 10s
+ retries: 2
+ ports:
+ - 8081:8081
+ beanstalk:
+ build: ../beanstalk/alpine
+ ports:
+ - "11300:11300"
+ teuthology:
+ build:
+ context: ../../
+ dockerfile: ./containers/teuthology-dev/Dockerfile
+ args:
+ SSH_PRIVKEY_FILE: $SSH_PRIVKEY_FILE
+ depends_on:
+ paddles:
+ condition: service_healthy
+ links:
+ - paddles
+ - beanstalk
+ environment:
+ SSH_PRIVKEY:
+ SSH_PRIVKEY_FILE:
+ MACHINE_TYPE:
+ TESTNODES:
+ TEUTHOLOGY_WAIT:
+ TEUTH_BRANCH:
+ testnode:
+ build:
+ context: ../testnode-docker-compose
+ dockerfile: ./Dockerfile
+ deploy:
+ replicas: 3
+ depends_on:
+ paddles:
+ condition: service_healthy
+ links:
+ - paddles
+ ports:
+ - "22"
+ environment:
+ SSH_PUBKEY:
+ platform: linux/amd64
--- /dev/null
+#!/bin/bash
+set -e
+export TEUTHOLOGY_BRANCH=${TEUTHOLOGY_BRANCH:-$(git branch --show-current)}
+export TEUTH_BRANCH=${TEUTHOLOGY_BRANCH}
+if [ -n "$ANSIBLE_INVENTORY_REPO" ]; then
+ basename=$(basename $ANSIBLE_INVENTORY_REPO | cut -d. -f1)
+ if [ ! -d "$basename" ]; then
+ git clone \
+ --depth 1 \
+ $ANSIBLE_INVENTORY_REPO
+ fi
+ mkdir -p teuthology/ansible_inventory
+ cp -rf $basename/ansible/ teuthology/ansible_inventory
+ if [ ! -d teuthology/ansible_inventory/hosts ]; then
+ mv -f teuthology/ansible_inventory/inventory teuthology/ansible_inventory/hosts
+ fi
+fi
+# Make the hosts and secrets directories, so that the COPY instruction in the
+# Dockerfile does not cause a build failure when not using this feature.
+mkdir -p teuthology/ansible_inventory/hosts teuthology/ansible_inventory/secrets
+
+if [ -n "$CUSTOM_CONF" ]; then
+ cp "$CUSTOM_CONF" teuthology/
+fi
+
+# Generate an SSH keypair to use if necessary
+if [ -z "$SSH_PRIVKEY_PATH" ]; then
+ SSH_PRIVKEY_PATH=$(mktemp -u /tmp/teuthology-ssh-key-XXXXXX)
+ ssh-keygen -t rsa -N '' -f $SSH_PRIVKEY_PATH
+ export SSH_PRIVKEY=$(cat $SSH_PRIVKEY_PATH)
+ export SSH_PUBKEY=$(cat $SSH_PRIVKEY_PATH.pub)
+ export SSH_PRIVKEY_FILE=id_rsa
+else
+ export SSH_PRIVKEY=$(cat $SSH_PRIVKEY_PATH)
+ export SSH_PRIVKEY_FILE=$(basename $SSH_PRIVKEY_PATH | cut -d. -f1)
+fi
+
+if [ -z "$TEUTHOLOGY_WAIT" ]; then
+ DC_EXIT_FLAG='--abort-on-container-exit --exit-code-from teuthology'
+ DC_AUTO_DOWN_CMD='docker-compose down'
+fi
+export TEUTHOLOGY_WAIT
+
+trap "docker-compose down" SIGINT
+docker-compose up \
+ --build \
+ $DC_EXIT_FLAG
+$DC_AUTO_DOWN_CMD
--- /dev/null
+set -e
+export PGPASSWORD=$POSTGRES_PASSWORD;
+psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
+ CREATE USER $APP_DB_USER WITH PASSWORD '$APP_DB_PASS';
+ CREATE DATABASE $APP_DB_NAME;
+ GRANT ALL PRIVILEGES ON DATABASE $APP_DB_NAME TO $APP_DB_USER;
+ \connect $APP_DB_NAME $APP_DB_USER
+EOSQL
\ No newline at end of file
--- /dev/null
+FROM ubuntu:focal
+ENV DEBIAN_FRONTEND=noninteractive
+RUN apt update && \
+ apt -y install \
+ sudo \
+ openssh-server \
+ hostname \
+ curl \
+ python3-pip \
+ apache2 \
+ nfs-kernel-server && \
+ apt clean all
+COPY testnode_start.sh /
+COPY testnode_stop.sh /
+COPY testnode_sudoers /etc/sudoers.d/teuthology
+RUN \
+ ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N '' && \
+ sed -i 's/#PermitRootLogin yes/PermitRootLogin yes/' /etc/ssh/sshd_config && \
+ mkdir -p /root/.ssh && \
+ chmod 700 /root/.ssh && \
+ useradd -g sudo ubuntu && \
+ mkdir -p /home/ubuntu/.ssh && \
+ chmod 700 /home/ubuntu/.ssh && \
+ chown -R ubuntu /home/ubuntu
+EXPOSE 22
+ENTRYPOINT /testnode_start.sh
--- /dev/null
+#!/usr/bin/bash
+set -x
+echo "$SSH_PUBKEY" > /root/.ssh/authorized_keys
+echo "$SSH_PUBKEY" > /home/ubuntu/.ssh/authorized_keys
+chown ubuntu /home/ubuntu/.ssh/authorized_keys
+payload="{\"name\": \"$(hostname)\", \"machine_type\": \"testnode\", \"up\": true, \"locked\": false, \"os_type\": \"ubuntu\", \"os_version\": \"20.04\"}"
+for i in $(seq 1 5); do
+ echo "attempt $i"
+ curl -v -f -d "$payload" http://paddles:8080/nodes/ && break
+ sleep 1
+done
+mkdir -p /run/sshd
+exec /usr/sbin/sshd -D
--- /dev/null
+#!/usr/bin/bash
+set -x
+hostname=$(hostname)
+payload="{\"name\": \"$hostname\", \"machine_type\": \"testnode\", \"up\": false}"
+for i in $(seq 1 5); do
+ echo "attempt $i"
+ curl -s -f -X PUT -d "$payload" http://paddles:8080/nodes/$hostname/ && break
+ sleep 1
+done
+pkill sshd
\ No newline at end of file
--- /dev/null
+%sudo ALL=(ALL) NOPASSWD: ALL
+# For ansible pipelining
+Defaults !requiretty
+Defaults visiblepw
--- /dev/null
+FROM ubuntu:focal
+ENV DEBIAN_FRONTEND=noninteractive
+RUN apt update && \
+ apt -y install \
+ sudo \
+ openssh-server \
+ hostname \
+ curl \
+ python3-pip \
+ apache2 \
+ nfs-kernel-server && \
+ apt clean all
+COPY testnode_start.sh /
+COPY testnode_stop.sh /
+COPY testnode_sudoers /etc/sudoers.d/teuthology
+RUN \
+ ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N '' && \
+ sed -i 's/#PermitRootLogin yes/PermitRootLogin yes/' /etc/ssh/sshd_config && \
+ mkdir -p /root/.ssh && \
+ chmod 700 /root/.ssh && \
+ useradd -g sudo ubuntu && \
+ mkdir -p /home/ubuntu/.ssh && \
+ chmod 700 /home/ubuntu/.ssh && \
+ chown -R ubuntu /home/ubuntu
+EXPOSE 22
+ENTRYPOINT /testnode_start.sh
--- /dev/null
+#!/usr/bin/bash
+set -x
+echo "$SSH_PUBKEY" > /root/.ssh/authorized_keys
+echo "$SSH_PUBKEY" > /home/ubuntu/.ssh/authorized_keys
+chown ubuntu /home/ubuntu/.ssh/authorized_keys
+payload="{\"name\": \"$(hostname)\", \"machine_type\": \"testnode\", \"up\": true, \"locked\": false, \"os_type\": \"ubuntu\", \"os_version\": \"20.04\"}"
+for i in $(seq 1 5); do
+ echo "attempt $i"
+ curl -v -f -d "$payload" http://paddles:8080/nodes/ && break
+ sleep 1
+done
+mkdir -p /run/sshd
+exec /usr/sbin/sshd -D
--- /dev/null
+#!/usr/bin/bash
+set -x
+hostname=$(hostname)
+payload="{\"name\": \"$hostname\", \"machine_type\": \"testnode\", \"up\": false}"
+for i in $(seq 1 5); do
+ echo "attempt $i"
+ curl -s -f -X PUT -d "$payload" http://paddles:8080/nodes/$hostname/ && break
+ sleep 1
+done
+pkill sshd
\ No newline at end of file
--- /dev/null
+%sudo ALL=(ALL) NOPASSWD: ALL
+# For ansible pipelining
+Defaults !requiretty
+Defaults visiblepw
--- /dev/null
+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: ''
\ No newline at end of file
--- /dev/null
+FROM ubuntu:latest
+ARG SSH_PRIVKEY_FILE=id_ed25519
+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 -p /etc/ansible
+COPY containers/teuthology-dev/ansible_inventory/hosts /etc/ansible/
+COPY containers/teuthology-dev/ansible_inventory/secrets /etc/ansible/
+RUN \
+ mkdir $HOME/.ssh && \
+ touch $HOME/.ssh/${SSH_PRIVKEY_FILE} && \
+ chmod 600 $HOME/.ssh/${SSH_PRIVKEY_FILE} && \
+ echo "StrictHostKeyChecking=no" > $HOME/.ssh/config && \
+ echo "UserKnownHostsFile=/dev/null" >> $HOME/.ssh/config
+ENTRYPOINT /teuthology.sh
\ No newline at end of file
--- /dev/null
+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
--- /dev/null
+#!/usr/bin/bash
+set -e
+# We don't want -x yet, in case the private key is sensitive
+if [ -n "$SSH_PRIVKEY_FILE" ]; then
+ echo "$SSH_PRIVKEY" > $HOME/.ssh/$SSH_PRIVKEY_FILE
+fi
+source /teuthology/virtualenv/bin/activate
+set -x
+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 [ -z "$TEUTHOLOGY_WAIT" ]; then
+ if [ -n "$TEUTH_BRANCH" ]; then
+ TEUTH_BRANCH_FLAG="--teuthology-branch $TEUTH_BRANCH"
+ fi
+ teuthology-suite -v \
+ $TEUTH_BRANCH_FLAG \
+ --ceph-repo https://github.com/ceph/ceph.git \
+ --suite-repo https://github.com/ceph/ceph.git \
+ -c main \
+ -m $MACHINE_TYPE \
+ --limit 1 \
+ -n 100 \
+ --suite teuthology:no-ceph \
+ --filter-out "libcephfs,kclient,stream,centos,rhel" \
+ -d ubuntu -D 20.04 \
+ --suite-branch main \
+ --subset 9000/100000 \
+ -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
+++ /dev/null
-# Teuthology Development Environment Instruction
-
-The purpose of this guide is to help developers set
-up a development environment for Teuthology. We will be using
-Docker to set up all the containers for
-Postgres, Paddles, Pulpito, Beanstalk, and Teuthology.
-
-Currently, it's possible to execute against two classes of test nodes:
-
-* Using containerized test nodes
- * Advantage: No need for a lab at all!
- * Disadvantage: Cannot run all Ceph tests; best for exercising the framework itself
-* Using nodes from an existing lab (e.g. the Sepia lab)
- * Advantage: Can run all Ceph tests
- * Disadvantage: Requires lab access
-
-
-Additionally, there are two modes of execution:
-* One-shot (the default): Containers start up, schedule and run the `teuthology:no-ceph` suite, and shut down. Success or failure is indicated by the `start.sh` exit code.
-* Wait: Containers start up, and `teuthology-dispatcher` is started, but no jobs are scheduled. Runs until the user presses Ctrl-C or `docker-compose down` is run.
-
-The teuthology container will be built with code from the repository clone that's currently in use.
-
-## Prerequisites
-
-### Installing and Running Docker
-
-For Docker installation see:
-https://docs.docker.com/get-docker/
-
-### Using Containerized Nodes
-
-There's nothing special to do; see the Running Tests section below.
-
-### Using an Existing Lab
-
-This document assumes you have access to the lab that you intend to use, and that you're already familiar with its VPN and SSH infrastructure.
-
-Depending on your local operating system, it may be necessary to connect to the VPN before starting Docker.
-
-#### Using your SSH private key
-
-In your local shell, simply:
-```bash
-export SSH_PRIVKEY_PATH=$HOME/.ssh/id_rsa
-```
-The teuthology container will write it to a file at runtime.
-
-#### Reserving Machines in the Lab
-
-Taking the Sepia lab as an example once again, most users will want to do something like:
-
-```bash
-ssh teuthology.front.sepia.ceph.com
-~/teuthology/virtualenv/bin/teuthology-lock \
- --lock-many 1 \
- --machine-type smithi \
- --desc "teuthology dev testing"
-```
-
-When you are done, don't forget to unlock!
-
-#### Using Lab Machines
-
-Once you have your machines locked, you need to provide a list of their hostnames and their machine type:
-
-```bash
-export TESTNODES="smithi999.front.sepia.ceph.com,smithi123.front.sepia.ceph.com"
-export MACHINE_TYPE="smithi"
-```
-
-If the lab uses a "secrets" or "inventory" repository for [ceph-cm-ansible](https://github.com/ceph/ceph-cm-ansible), you'll need to provide a URL for that. In Sepia:
-```bash
-export ANSIBLE_INVENTORY_REPO="https://github.com/ceph/ceph-sepia-secrets"
-```
-This repo will be cloned locally, using your existing `git` configuration, and copied into the teuthology container at build time.
-
-## Running Tests
-
-To run the default `teuthology:no-ceph` suite in one-shot mode:
-```bash
-./start.sh
-```
-
-To run in wait mode:
-```bash
-TEUTHOLOGY_WAIT=1 ./start.sh
-```
-
-To schedule tests in wait mode:
-```bash
-docker exec docker-compose_teuthology_1 /venv/bin/teuthology-suite ...
-```
\ No newline at end of file
+++ /dev/null
-set -e
-export PGPASSWORD=$POSTGRES_PASSWORD;
-psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
- CREATE USER $APP_DB_USER WITH PASSWORD '$APP_DB_PASS';
- CREATE DATABASE $APP_DB_NAME;
- GRANT ALL PRIVILEGES ON DATABASE $APP_DB_NAME TO $APP_DB_USER;
- \connect $APP_DB_NAME $APP_DB_USER
-EOSQL
\ No newline at end of file
+++ /dev/null
-version: '3.8'
-
-services:
- postgres:
- image: postgres:14
- healthcheck:
- test: [ "CMD", "pg_isready", "-q", "-d", "paddles", "-U", "admin" ]
- timeout: 5s
- interval: 10s
- retries: 2
- environment:
- - POSTGRES_USER=root
- - POSTGRES_PASSWORD=password
- - APP_DB_USER=admin
- - APP_DB_PASS=password
- - APP_DB_NAME=paddles
- volumes:
- - ./db:/docker-entrypoint-initdb.d/
- ports:
- - 5432:5432
- paddles:
- image: quay.io/ceph-infra/paddles
- environment:
- PADDLES_SERVER_HOST: 0.0.0.0
- PADDLES_SQLALCHEMY_URL: postgresql+psycopg2://admin:password@postgres:5432/paddles
- depends_on:
- postgres:
- condition: service_healthy
- links:
- - postgres
- healthcheck:
- test: ["CMD", "curl", "-f", "http://0.0.0.0:8080"]
- timeout: 5s
- interval: 30s
- retries: 2
- ports:
- - 8080:8080
- pulpito:
- image: quay.io/ceph-infra/pulpito
- environment:
- PULPITO_PADDLES_ADDRESS: http://paddles:8080
- depends_on:
- paddles:
- condition: service_healthy
- links:
- - paddles
- healthcheck:
- test: ["CMD", "curl", "-f", "http://0.0.0.0:8081"]
- timeout: 5s
- interval: 10s
- retries: 2
- ports:
- - 8081:8081
- beanstalk:
- build: ../../beanstalk/alpine
- ports:
- - "11300:11300"
- teuthology:
- build:
- context: ../../
- dockerfile: ./docs/docker-compose/teuthology/Dockerfile
- args:
- SSH_PRIVKEY_FILE: $SSH_PRIVKEY_FILE
- depends_on:
- paddles:
- condition: service_healthy
- links:
- - paddles
- - beanstalk
- environment:
- SSH_PRIVKEY:
- SSH_PRIVKEY_FILE:
- MACHINE_TYPE:
- TESTNODES:
- TEUTHOLOGY_WAIT:
- TEUTH_BRANCH:
- testnode:
- build:
- context: ./testnode
- dockerfile: ./Dockerfile
- deploy:
- replicas: 3
- depends_on:
- paddles:
- condition: service_healthy
- links:
- - paddles
- ports:
- - "22"
- environment:
- SSH_PUBKEY:
- platform: linux/amd64
+++ /dev/null
-#!/bin/bash
-set -e
-export TEUTHOLOGY_BRANCH=${TEUTHOLOGY_BRANCH:-$(git branch --show-current)}
-export TEUTH_BRANCH=${TEUTHOLOGY_BRANCH}
-if [ -n "$ANSIBLE_INVENTORY_REPO" ]; then
- basename=$(basename $ANSIBLE_INVENTORY_REPO | cut -d. -f1)
- if [ ! -d "$basename" ]; then
- git clone \
- --depth 1 \
- $ANSIBLE_INVENTORY_REPO
- fi
- mkdir -p teuthology/ansible_inventory
- cp -rf $basename/ansible/ teuthology/ansible_inventory
- if [ ! -d teuthology/ansible_inventory/hosts ]; then
- mv -f teuthology/ansible_inventory/inventory teuthology/ansible_inventory/hosts
- fi
-fi
-# Make the hosts and secrets directories, so that the COPY instruction in the
-# Dockerfile does not cause a build failure when not using this feature.
-mkdir -p teuthology/ansible_inventory/hosts teuthology/ansible_inventory/secrets
-
-if [ -n "$CUSTOM_CONF" ]; then
- cp "$CUSTOM_CONF" teuthology/
-fi
-
-# Generate an SSH keypair to use if necessary
-if [ -z "$SSH_PRIVKEY_PATH" ]; then
- SSH_PRIVKEY_PATH=$(mktemp -u /tmp/teuthology-ssh-key-XXXXXX)
- ssh-keygen -t rsa -N '' -f $SSH_PRIVKEY_PATH
- export SSH_PRIVKEY=$(cat $SSH_PRIVKEY_PATH)
- export SSH_PUBKEY=$(cat $SSH_PRIVKEY_PATH.pub)
- export SSH_PRIVKEY_FILE=id_rsa
-else
- export SSH_PRIVKEY=$(cat $SSH_PRIVKEY_PATH)
- export SSH_PRIVKEY_FILE=$(basename $SSH_PRIVKEY_PATH | cut -d. -f1)
-fi
-
-if [ -z "$TEUTHOLOGY_WAIT" ]; then
- DC_EXIT_FLAG='--abort-on-container-exit --exit-code-from teuthology'
- DC_AUTO_DOWN_CMD='docker-compose down'
-fi
-export TEUTHOLOGY_WAIT
-
-trap "docker-compose down" SIGINT
-docker-compose up \
- --build \
- $DC_EXIT_FLAG
-$DC_AUTO_DOWN_CMD
+++ /dev/null
-FROM ubuntu:focal
-ENV DEBIAN_FRONTEND=noninteractive
-RUN apt update && \
- apt -y install \
- sudo \
- openssh-server \
- hostname \
- curl \
- python3-pip \
- apache2 \
- nfs-kernel-server && \
- apt clean all
-COPY testnode_start.sh /
-COPY testnode_stop.sh /
-COPY testnode_sudoers /etc/sudoers.d/teuthology
-RUN \
- ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N '' && \
- sed -i 's/#PermitRootLogin yes/PermitRootLogin yes/' /etc/ssh/sshd_config && \
- mkdir -p /root/.ssh && \
- chmod 700 /root/.ssh && \
- useradd -g sudo ubuntu && \
- mkdir -p /home/ubuntu/.ssh && \
- chmod 700 /home/ubuntu/.ssh && \
- chown -R ubuntu /home/ubuntu
-EXPOSE 22
-ENTRYPOINT /testnode_start.sh
+++ /dev/null
-#!/usr/bin/bash
-set -x
-echo "$SSH_PUBKEY" > /root/.ssh/authorized_keys
-echo "$SSH_PUBKEY" > /home/ubuntu/.ssh/authorized_keys
-chown ubuntu /home/ubuntu/.ssh/authorized_keys
-payload="{\"name\": \"$(hostname)\", \"machine_type\": \"testnode\", \"up\": true, \"locked\": false, \"os_type\": \"ubuntu\", \"os_version\": \"20.04\"}"
-for i in $(seq 1 5); do
- echo "attempt $i"
- curl -v -f -d "$payload" http://paddles:8080/nodes/ && break
- sleep 1
-done
-mkdir -p /run/sshd
-exec /usr/sbin/sshd -D
+++ /dev/null
-#!/usr/bin/bash
-set -x
-hostname=$(hostname)
-payload="{\"name\": \"$hostname\", \"machine_type\": \"testnode\", \"up\": false}"
-for i in $(seq 1 5); do
- echo "attempt $i"
- curl -s -f -X PUT -d "$payload" http://paddles:8080/nodes/$hostname/ && break
- sleep 1
-done
-pkill sshd
\ No newline at end of file
+++ /dev/null
-%sudo ALL=(ALL) NOPASSWD: ALL
-# For ansible pipelining
-Defaults !requiretty
-Defaults visiblepw
+++ /dev/null
-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: ''
\ No newline at end of file
+++ /dev/null
-FROM ubuntu:latest
-ARG SSH_PRIVKEY_FILE=id_ed25519
-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 docs/docker-compose/teuthology/containerized_node.yaml /teuthology
-COPY docs/docker-compose/teuthology/.teuthology.yaml /root
-COPY docs/docker-compose/teuthology/teuthology.sh /
-RUN mkdir -p /etc/ansible
-COPY docs/docker-compose/teuthology/ansible_inventory/hosts /etc/ansible/
-COPY docs/docker-compose/teuthology/ansible_inventory/secrets /etc/ansible/
-RUN \
- mkdir $HOME/.ssh && \
- touch $HOME/.ssh/${SSH_PRIVKEY_FILE} && \
- chmod 600 $HOME/.ssh/${SSH_PRIVKEY_FILE} && \
- echo "StrictHostKeyChecking=no" > $HOME/.ssh/config && \
- echo "UserKnownHostsFile=/dev/null" >> $HOME/.ssh/config
-ENTRYPOINT /teuthology.sh
\ No newline at end of file
+++ /dev/null
-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
+++ /dev/null
-#!/usr/bin/bash
-set -e
-# We don't want -x yet, in case the private key is sensitive
-if [ -n "$SSH_PRIVKEY_FILE" ]; then
- echo "$SSH_PRIVKEY" > $HOME/.ssh/$SSH_PRIVKEY_FILE
-fi
-source /teuthology/virtualenv/bin/activate
-set -x
-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 [ -z "$TEUTHOLOGY_WAIT" ]; then
- if [ -n "$TEUTH_BRANCH" ]; then
- TEUTH_BRANCH_FLAG="--teuthology-branch $TEUTH_BRANCH"
- fi
- teuthology-suite -v \
- $TEUTH_BRANCH_FLAG \
- --ceph-repo https://github.com/ceph/ceph.git \
- --suite-repo https://github.com/ceph/ceph.git \
- -c main \
- -m $MACHINE_TYPE \
- --limit 1 \
- -n 100 \
- --suite teuthology:no-ceph \
- --filter-out "libcephfs,kclient,stream,centos,rhel" \
- -d ubuntu -D 20.04 \
- --suite-branch main \
- --subset 9000/100000 \
- -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