]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
docker-compose: Add wait mode
authorZack Cerza <zack@redhat.com>
Thu, 7 Apr 2022 18:07:29 +0000 (12:07 -0600)
committerZack Cerza <zack@redhat.com>
Mon, 18 Apr 2022 20:11:55 +0000 (14:11 -0600)
Instead of scheduling the teuthology:no-ceph suite and then exiting
when it finishes, schedule nothing and don't exit automatically. This
allows running whatever - and however many - tests are desired.

Signed-off-by: Zack Cerza <zack@redhat.com>
docs/docker-compose/README.md
docs/docker-compose/docker-compose.yml
docs/docker-compose/start.sh
docs/docker-compose/teuthology/teuthology.sh

index 52d81009013ee613e80c3568e0a87cca56526feb..e69d1bf7f130f1b280dc311f3914cc025ef2a2a6 100644 (file)
@@ -5,7 +5,7 @@ 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, there are two modes of execution
+Currently, it's possible to execute against two classes of test nodes
 
 * Using containerized test nodes
   * Advantage: No need for a lab at all!
@@ -14,7 +14,12 @@ Currently, there are two modes of execution:
   * Advantage: Can run all Ceph tests
   * Disadvantage: Requires lab access
 
-In both cases, the teuthology container will be built with code from the repository clone that's currently in use.
+
+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
 
@@ -72,7 +77,17 @@ This repo will be cloned locally, using your existing `git` configuration, and c
 
 ## Running Tests
 
-When you are ready to run 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
index 1a049efd4f02f2301e67aa3cf75858300a708af5..ba770fef63500c79880c5c6a102a8c868e3ab6cc 100644 (file)
@@ -75,6 +75,7 @@ services:
       SSH_PRIVKEY_FILE:
       MACHINE_TYPE:
       TESTNODES:
+      TEUTHOLOGY_WAIT:
   testnode:
     build:
       context: ./testnode
index 0c9ba89b6e7f73ec37df287de9625ae9ee519ac6..4aebd22660d8d80a0008ce28124a6bf10248d3be 100755 (executable)
@@ -33,10 +33,15 @@ else
     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
+
 set +e
 trap "docker-compose down" SIGINT
 docker-compose up \
     --build \
-    --abort-on-container-exit \
-    --exit-code-from teuthology
-docker-compose down
\ No newline at end of file
+    $DC_EXIT_FLAG
+$DC_AUTO_DOWN_CMD
\ No newline at end of file
index 682e5167da44e02e535a782a46307ddcb98ebe9b..050f2893edb908737ddcc23cc6801f115acd03e9 100755 (executable)
@@ -16,24 +16,27 @@ else
     CUSTOM_CONF=/teuthology/containerized_node.yaml
 fi
 export MACHINE_TYPE=${MACHINE_TYPE:-testnode}
-teuthology-suite -v \
-    --teuthology-branch $TEUTHOLOGY_BRANCH \
-    --ceph-repo https://github.com/ceph/ceph.git \
-    --suite-repo https://github.com/ceph/ceph.git \
-    -c master \
-    -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 master \
-    --subset 9000/100000 \
-    -p 75 \
-    --seed 349 \
-    --force-priority \
-    $CUSTOM_CONF
+if [ -z "$TEUTHOLOGY_WAIT" ]; then
+    teuthology-suite -v \
+        --teuthology-branch $TEUTHOLOGY_BRANCH \
+        --ceph-repo https://github.com/ceph/ceph.git \
+        --suite-repo https://github.com/ceph/ceph.git \
+        -c master \
+        -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 master \
+        --subset 9000/100000 \
+        -p 75 \
+        --seed 349 \
+        --force-priority \
+        $CUSTOM_CONF
+    DISPATCHER_EXIT_FLAG='--exit-on-empty-queue'
+fi
 teuthology-dispatcher -v \
     --log-dir /teuthology/log \
     --tube $MACHINE_TYPE \
-    --exit-on-empty-queue
\ No newline at end of file
+    $DISPATCHER_EXIT_FLAG
\ No newline at end of file