]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
Added dockerfile + docker-compose script dev setup
authorKamoltat Sirivadhna <ksirivad@redhat.com>
Wed, 4 Aug 2021 19:00:09 +0000 (15:00 -0400)
committerKamoltat Sirivadhna <ksirivad@redhat.com>
Mon, 29 Nov 2021 14:54:21 +0000 (09:54 -0500)
Developers can now use start.sh to build the images
and set up postgresql, paddles, pulpito and teuthology
for development.

This PR is also pending for:
https://github.com/ceph/teuthology/pull/1650
https://github.com/ceph/paddles/pull/94

to be merged, as currently we use these branches
as images for paddles and pulpito.

Signed-off-by: Kamoltat Sirivadhna <ksirivad@redhat.com>
Dockerfile [new file with mode: 0644]
docs/docker-compose/db/01-init.sh [new file with mode: 0755]
docs/docker-compose/docker-compose.yml [new file with mode: 0644]
docs/docker-compose/start.sh [new file with mode: 0755]

diff --git a/Dockerfile b/Dockerfile
new file mode 100644 (file)
index 0000000..414fa90
--- /dev/null
@@ -0,0 +1,25 @@
+FROM ubuntu:latest
+ENV DEBIAN_FRONTEND=nonintercative
+COPY . /teuthology
+WORKDIR /teuthology
+RUN chmod +x /teuthology/bootstrap
+RUN apt-get update && apt-get install -y \ 
+    git qemu-utils python3-dev libssl-dev \
+    python3-pip python3-virtualenv vim \
+    libev-dev libvirt-dev libffi-dev \
+    libyaml-dev lsb-release && apt-get \ 
+    clean all
+RUN echo -e 'lock_server: http://paddles:8080\n\
+results_server: http://paddles:8080\n\
+queue_host: 0.0.0.0\n\
+queue_port: 11300\n\
+teuthology_path: ./' >> ~/.teuthology.yaml
+RUN mkdir archive_dir
+RUN mkdir log
+CMD  ./bootstrap && ./virtualenv/bin/teuthology-suite \
+-v --ceph-repo https://github.com/ceph/ceph.git \
+--suite-repo https://github.com/ceph/ceph.git \
+-c master -m smithi --subset 9000/100000 --limit 1 \
+--suite rados:mgr -k distro --filter 'tasks/progress' \
+--suite-branch master -p 75 --force-priority -n 100 \
+&& tail -f /dev/null
\ No newline at end of file
diff --git a/docs/docker-compose/db/01-init.sh b/docs/docker-compose/db/01-init.sh
new file mode 100755 (executable)
index 0000000..b9e5adc
--- /dev/null
@@ -0,0 +1,8 @@
+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
diff --git a/docs/docker-compose/docker-compose.yml b/docs/docker-compose/docker-compose.yml
new file mode 100644 (file)
index 0000000..9d1705e
--- /dev/null
@@ -0,0 +1,60 @@
+version: '1'
+
+services:
+  postgres:
+    image: postgres:latest
+    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:
+    build: ./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: 10s
+        retries: 2
+    ports: 
+        - 8080:8080
+  pulpito:
+    build: ./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
+  teutholgy:
+    build: ./teuthology
+    depends_on:
+        pulpito:
+            condition: service_healthy
+    links:
+        - paddles
\ No newline at end of file
diff --git a/docs/docker-compose/start.sh b/docs/docker-compose/start.sh
new file mode 100755 (executable)
index 0000000..1cdb9aa
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/bash
+git clone https://github.com/ceph/paddles.git
+cd paddles
+git fetch origin pull/94/head:wip-amathuria-removing-beanstalkd
+git checkout wip-amathuria-removing-beanstalkd
+cd ../
+git clone https://github.com/ceph/pulpito.git
+git clone https://github.com/ceph/teuthology.git
+cd teuthology
+git fetch origin pull/1650/head:wip-amathuria-replace-beanstalkd-paddles
+git checkout wip-amathuria-replace-beanstalkd-paddles
+docker-compose up
\ No newline at end of file