Skip to content

Commit

Permalink
Added dockerfile + docker-compose script dev setup
Browse files Browse the repository at this point in the history
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:
#1650
ceph/paddles#94

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

Signed-off-by: Kamoltat Sirivadhna <[email protected]>
  • Loading branch information
kamoltat committed Sep 16, 2021
1 parent 63133ca commit 5f7df56
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 0 deletions.
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions docs/docker-compose/db/01-init.sh
Original file line number Diff line number Diff line change
@@ -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
60 changes: 60 additions & 0 deletions docs/docker-compose/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions docs/docker-compose/start.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 5f7df56

Please sign in to comment.