]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
docker-compose: Separate build contexts
authorZack Cerza <zack@redhat.com>
Mon, 28 Mar 2022 21:05:37 +0000 (15:05 -0600)
committerZack Cerza <zack@redhat.com>
Tue, 29 Mar 2022 02:34:15 +0000 (20:34 -0600)
Signed-off-by: Zack Cerza <zack@redhat.com>
18 files changed:
docs/docker-compose/.teuthology.yaml [deleted file]
docs/docker-compose/Dockerfile [deleted file]
docs/docker-compose/Dockerfile-testnode [deleted file]
docs/docker-compose/containerized_node.yaml [deleted file]
docs/docker-compose/docker-compose.yml
docs/docker-compose/start.sh
docs/docker-compose/testnode/Dockerfile [new file with mode: 0644]
docs/docker-compose/testnode/testnode_start.sh [new file with mode: 0755]
docs/docker-compose/testnode/testnode_stop.sh [new file with mode: 0755]
docs/docker-compose/testnode/testnode_sudoers [new file with mode: 0644]
docs/docker-compose/testnode_start.sh [deleted file]
docs/docker-compose/testnode_stop.sh [deleted file]
docs/docker-compose/testnode_sudoers [deleted file]
docs/docker-compose/teuthology.sh [deleted file]
docs/docker-compose/teuthology/.teuthology.yaml [new file with mode: 0644]
docs/docker-compose/teuthology/Dockerfile [new file with mode: 0644]
docs/docker-compose/teuthology/containerized_node.yaml [new file with mode: 0644]
docs/docker-compose/teuthology/teuthology.sh [new file with mode: 0755]

diff --git a/docs/docker-compose/.teuthology.yaml b/docs/docker-compose/.teuthology.yaml
deleted file mode 100644 (file)
index bac8ec1..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-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
diff --git a/docs/docker-compose/Dockerfile b/docs/docker-compose/Dockerfile
deleted file mode 100644 (file)
index 11d6dee..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-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-virtualenv \
-    vim \
-    libev-dev \
-    libvirt-dev \
-    libffi-dev \
-    libyaml-dev \
-    lsb-release && \
-    apt-get clean all
-COPY . /teuthology
-COPY .teuthology.yaml ./root
-WORKDIR /teuthology
-RUN \
-    mkdir ../archive_dir && \
-    mkdir log && \
-    chmod +x /teuthology/bootstrap && \
-    ./bootstrap
-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
-COPY teuthology.sh /
-RUN mkdir -p /etc/ansible
-COPY ansible_inventory/hosts ansible_inventory/secrets /etc/ansible/
-ENTRYPOINT /teuthology.sh
\ No newline at end of file
diff --git a/docs/docker-compose/Dockerfile-testnode b/docs/docker-compose/Dockerfile-testnode
deleted file mode 100644 (file)
index f09ba09..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-FROM ubuntu:latest
-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
\ No newline at end of file
diff --git a/docs/docker-compose/containerized_node.yaml b/docs/docker-compose/containerized_node.yaml
deleted file mode 100644 (file)
index 0230488..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-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
index df8477ac02417e4f85e45a548f87eee50bb36d70..1ef829e4001e336771eaf9510efad54a14db053e 100644 (file)
@@ -76,8 +76,8 @@ services:
       TESTNODES:
   testnode:
     build:
-      context: .
-      dockerfile: ./Dockerfile-testnode
+      context: ./testnode
+      dockerfile: ./Dockerfile
     deploy:
       replicas: 3
     depends_on:
index 3d812c6a90d42513677aacc8ff72952a7d3c3b03..32deb153ddb34016219a3be3610a80a124895da6 100755 (executable)
@@ -1,5 +1,6 @@
 #!/bin/bash
 set -e
+pushd teuthology
 if [ -z "$TEUTHOLOGY_BRANCH" -a -n "$GITHUB_HEAD_REF" ]; then
     TEUTHOLOGY_BRANCH=${GITHUB_HEAD_REF}
 fi
@@ -9,6 +10,7 @@ if [ ! -d ./teuthology ]; then
     -b ${TEUTHOLOGY_BRANCH:-$(git branch --show-current)} \
     https://github.com/ceph/teuthology.git
 fi
+popd
 if [ -n "$ANSIBLE_INVENTORY_REPO" ]; then
     basename=$(basename $ANSIBLE_INVENTORY_REPO | cut -d. -f1)
     if [ ! -d "$basename" ]; then
@@ -26,16 +28,10 @@ fi
 # Dockerfile does not cause a build failure when not using this feature.
 mkdir -p teuthology/ansible_inventory/hosts teuthology/ansible_inventory/secrets
 
-cp .teuthology.yaml teuthology/
-cp Dockerfile teuthology/
-cp teuthology.sh teuthology/
-cp containerized_node.yaml teuthology/
 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)
diff --git a/docs/docker-compose/testnode/Dockerfile b/docs/docker-compose/testnode/Dockerfile
new file mode 100644 (file)
index 0000000..f09ba09
--- /dev/null
@@ -0,0 +1,26 @@
+FROM ubuntu:latest
+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
\ No newline at end of file
diff --git a/docs/docker-compose/testnode/testnode_start.sh b/docs/docker-compose/testnode/testnode_start.sh
new file mode 100755 (executable)
index 0000000..d29c3b6
--- /dev/null
@@ -0,0 +1,13 @@
+#!/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
diff --git a/docs/docker-compose/testnode/testnode_stop.sh b/docs/docker-compose/testnode/testnode_stop.sh
new file mode 100755 (executable)
index 0000000..2e1044d
--- /dev/null
@@ -0,0 +1,10 @@
+#!/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
diff --git a/docs/docker-compose/testnode/testnode_sudoers b/docs/docker-compose/testnode/testnode_sudoers
new file mode 100644 (file)
index 0000000..35828ad
--- /dev/null
@@ -0,0 +1,4 @@
+%sudo ALL=(ALL) NOPASSWD: ALL
+# For ansible pipelining
+Defaults !requiretty
+Defaults visiblepw
diff --git a/docs/docker-compose/testnode_start.sh b/docs/docker-compose/testnode_start.sh
deleted file mode 100755 (executable)
index d29c3b6..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/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
diff --git a/docs/docker-compose/testnode_stop.sh b/docs/docker-compose/testnode_stop.sh
deleted file mode 100755 (executable)
index 2e1044d..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/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
diff --git a/docs/docker-compose/testnode_sudoers b/docs/docker-compose/testnode_sudoers
deleted file mode 100644 (file)
index 35828ad..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-%sudo ALL=(ALL) NOPASSWD: ALL
-# For ansible pipelining
-Defaults !requiretty
-Defaults visiblepw
diff --git a/docs/docker-compose/teuthology.sh b/docs/docker-compose/teuthology.sh
deleted file mode 100755 (executable)
index edc377b..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/bash
-# 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}
-teuthology-suite -v \
-    --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
-teuthology-dispatcher -v \
-    --log-dir /teuthology/log \
-    --tube $MACHINE_TYPE \
-    --exit-on-empty-queue
\ No newline at end of file
diff --git a/docs/docker-compose/teuthology/.teuthology.yaml b/docs/docker-compose/teuthology/.teuthology.yaml
new file mode 100644 (file)
index 0000000..bac8ec1
--- /dev/null
@@ -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: ''
\ No newline at end of file
diff --git a/docs/docker-compose/teuthology/Dockerfile b/docs/docker-compose/teuthology/Dockerfile
new file mode 100644 (file)
index 0000000..5c9285f
--- /dev/null
@@ -0,0 +1,39 @@
+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-virtualenv \
+    vim \
+    libev-dev \
+    libvirt-dev \
+    libffi-dev \
+    libyaml-dev \
+    lsb-release && \
+    apt-get clean all
+WORKDIR /teuthology
+COPY teuthology /teuthology
+RUN \
+    cd /teuthology && \
+    mkdir ../archive_dir && \
+    mkdir log && \
+    chmod +x /teuthology/bootstrap && \
+    ./bootstrap
+COPY containerized_node.yaml /teuthology
+COPY .teuthology.yaml /root
+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
+COPY teuthology.sh /
+RUN mkdir -p /etc/ansible
+COPY ansible_inventory/hosts ansible_inventory/secrets /etc/ansible/
+ENTRYPOINT /teuthology.sh
\ No newline at end of file
diff --git a/docs/docker-compose/teuthology/containerized_node.yaml b/docs/docker-compose/teuthology/containerized_node.yaml
new file mode 100644 (file)
index 0000000..0230488
--- /dev/null
@@ -0,0 +1,8 @@
+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
diff --git a/docs/docker-compose/teuthology/teuthology.sh b/docs/docker-compose/teuthology/teuthology.sh
new file mode 100755 (executable)
index 0000000..edc377b
--- /dev/null
@@ -0,0 +1,36 @@
+#!/usr/bin/bash
+# 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}
+teuthology-suite -v \
+    --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
+teuthology-dispatcher -v \
+    --log-dir /teuthology/log \
+    --tube $MACHINE_TYPE \
+    --exit-on-empty-queue
\ No newline at end of file