From 8f5de335f1a537568d580b0976115422e68cb17c Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Mon, 20 Feb 2023 14:31:48 -0700 Subject: [PATCH] systemd test --- containers/teuthology-dev/Dockerfile | 3 +++ .../teuthology-dispatcher@.service | 20 +++++++++++++++++++ containers/teuthology-dev/teuthology.sh | 5 +---- 3 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 containers/teuthology-dev/teuthology-dispatcher@.service diff --git a/containers/teuthology-dev/Dockerfile b/containers/teuthology-dev/Dockerfile index a486644d82..e601654c5d 100644 --- a/containers/teuthology-dev/Dockerfile +++ b/containers/teuthology-dev/Dockerfile @@ -9,6 +9,7 @@ RUN apt-get update && \ ipmitool \ python3-pip \ python3-venv \ + systemd \ vim \ libev-dev \ libvirt-dev \ @@ -30,7 +31,9 @@ RUN \ COPY containers/teuthology-dev/containerized_node.yaml /teuthology COPY containers/teuthology-dev/.teuthology.yaml /root COPY containers/teuthology-dev/teuthology.sh / +COPY containers/teuthology-dev/teuthology-dispatcher@.service /etc/systemd/system/ RUN \ + systemctl enable teuthology-dispatcher@machinetype && \ mkdir $HOME/.ssh && \ touch $HOME/.ssh/id_rsa && \ chmod 600 $HOME/.ssh/id_rsa && \ diff --git a/containers/teuthology-dev/teuthology-dispatcher@.service b/containers/teuthology-dev/teuthology-dispatcher@.service new file mode 100644 index 0000000000..b800e2ddf8 --- /dev/null +++ b/containers/teuthology-dev/teuthology-dispatcher@.service @@ -0,0 +1,20 @@ +[Unit] +Description=Teuthology Dispatcher + +Wants=network.target +After=network.target + +[Install] +WantedBy=multi-user.target + +[Service] +Type=simple +User=teuthworker +ExecStart=~/src/git.ceph.com_git_teuthology_main/virtualenv/bin/teuthology-dispatcher \ + -v \ + --archive-dir ~/archive \ + --log-dir ~/archive/worker-logs \ + --tube %i +ExecStop=touch /tmp/teuthology-stop-dispatcher +Restart=on-failure +TimeoutStopSec=infinity diff --git a/containers/teuthology-dev/teuthology.sh b/containers/teuthology-dev/teuthology.sh index 66672bd822..50314f13da 100755 --- a/containers/teuthology-dev/teuthology.sh +++ b/containers/teuthology-dev/teuthology.sh @@ -35,7 +35,4 @@ if [ "$TEUTHOLOGY_SUITE" != "none" ]; then 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 +exec /usr/lib/systemd/systemd --system -- 2.39.5