]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
docker-compose: Use repo root as build context
authorZack Cerza <zack@redhat.com>
Fri, 1 Apr 2022 18:02:05 +0000 (14:02 -0400)
committerZack Cerza <zack@redhat.com>
Wed, 13 Apr 2022 21:34:10 +0000 (15:34 -0600)
Rather than add more logic to support things like cloning different
forks of the repo, let's just not clone at all.

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/Dockerfile

index f7d0a8809b2ddc6435fada89e672d8b703bb4cec..eae95c83612378a8677e33c5a521d598321351e3 100644 (file)
@@ -14,6 +14,8 @@ 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.
+
 ## Prerequisites
 
 ### Installing and Running Docker
@@ -66,11 +68,6 @@ This repo will be cloned locally, using your existing `git` configuration, and c
 
 ## Running Tests
 
-If you want the teuthology container to use a different teuthology branch:
-```bash
-export TEUTHOLOGY_BRANCH=my-branch
-```
-
 When you are ready to run tests:
 ```bash
 ./start.sh
index a170752207f5e7b2126debd29ac788bec1c0fed8..1a049efd4f02f2301e67aa3cf75858300a708af5 100644 (file)
@@ -60,7 +60,8 @@ services:
             - "11300:11300"
   teuthology:
     build:
-      context: ./teuthology
+      context: ../../
+      dockerfile: ./docs/docker-compose/teuthology/Dockerfile
       args:
         SSH_PRIVKEY_FILE: $SSH_PRIVKEY_FILE
     depends_on:
index a408892d6a9eca138375c613a72cc3e498807a42..0c9ba89b6e7f73ec37df287de9625ae9ee519ac6 100755 (executable)
@@ -1,16 +1,5 @@
 #!/bin/bash
 set -e
-pushd teuthology
-if [ -z "$TEUTHOLOGY_BRANCH" -a -n "$GITHUB_HEAD_REF" ]; then
-    TEUTHOLOGY_BRANCH=${GITHUB_HEAD_REF}
-fi
-if [ ! -d ./teuthology ]; then
-    git clone \
-    --depth 1 \
-    -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
index fcc9341a60633ddcb8735c1f650282dd554437d1..06fb5a3f8bb4cd75ee4f09504d7699b4fc8c40ff 100644 (file)
@@ -19,22 +19,23 @@ RUN apt-get update && \
     lsb-release && \
     apt-get clean all
 WORKDIR /teuthology
-COPY teuthology /teuthology
+COPY . /teuthology
 RUN \
     cd /teuthology && \
     mkdir ../archive_dir && \
     mkdir log && \
     chmod +x /teuthology/bootstrap && \
-    ./bootstrap
-COPY containerized_node.yaml /teuthology
-COPY .teuthology.yaml /root
+    VENV=$VENV ./bootstrap
+COPY docs/docker-compose/teuthology/containerized_node.yaml /teuthology
+COPY docs/docker-compose/teuthology/.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 /
+COPY docs/docker-compose/teuthology/teuthology.sh /
 RUN mkdir -p /etc/ansible
-COPY ansible_inventory/hosts ansible_inventory/secrets /etc/ansible/
+COPY docs/docker-compose/teuthology/ansible_inventory/hosts /etc/ansible/
+COPY docs/docker-compose/teuthology/ansible_inventory/secrets /etc/ansible/
 ENTRYPOINT /teuthology.sh
\ No newline at end of file