Skip to content

Commit

Permalink
Merge pull request #3773 from ilausuch/89719_docker-compose_up_fails_…
Browse files Browse the repository at this point in the history
…on_master
  • Loading branch information
okurz committed Mar 18, 2021
2 parents bd222fb + 44ade25 commit 6ccbaed
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: compose
# yamllint disable-line rule:truthy
on: [push, pull_request]
jobs:
webui-docker-compose:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
- name: Verify that containers can be composed
run: make test-containers-compose
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ test: test-with-database
else
test: test-checkstyle-standalone test-with-database
endif
ifeq ($(CONTAINER_TEST),1)
test: test-containers-compose
endif
endif

.PHONY: test-checkstyle
Expand Down Expand Up @@ -295,6 +298,10 @@ test-check-containers:
tidy: tidy-js
tools/tidy

.PHONY: test-containers-compose
test-containers-compose:
tools/test_containers_compose

.PHONY: update-deps
update-deps:
tools/update-deps --specfile dist/rpm/openQA.spec
8 changes: 8 additions & 0 deletions container/webui/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ version: '3.8'
services:
data:
image: openqa_data
build: ../openqa_data/
restart: always
volumes:
- ./workdir/data/factory:/data/factory
Expand All @@ -22,6 +23,7 @@ services:

websockets:
image: openqa_webui
build: .
ports:
- "9527:9527" # worker connection
volumes:
Expand All @@ -37,6 +39,7 @@ services:

gru:
image: openqa_webui
build: .
volumes:
- ./workdir/data/factory:/data/factory
- ./workdir/data/tests:/data/tests
Expand All @@ -49,6 +52,7 @@ services:

livehandler:
image: openqa_webui
build: .
ports:
- "9528:9528" # handle live view
volumes:
Expand All @@ -64,6 +68,7 @@ services:

webui:
image: openqa_webui
build: .
ports:
- "9526"
volumes:
Expand Down Expand Up @@ -91,6 +96,9 @@ services:

nginx:
image: openqa_webui_lb
build:
context: .
dockerfile: Dockerfile-lb
restart: always
ports:
- "9526:9526"
Expand Down
4 changes: 4 additions & 0 deletions dist/rpm/openQA.spec
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,10 @@ rm \
# within CI systems, e.g. OBS. See t/lib/OpenQA/Test/TimeLimit.pm
export CI=1
export OPENQA_TEST_TIMEOUT_SCALE_CI=10
# Skip container tests that would need additional requirements, e.g.
# docker-compose. Also, these tests are less relevant (or not relevant) for
# packaging
export CONTAINER_TEST=0
make test PROVE_ARGS='-r -v' CHECKSTYLE=0 TEST_PG_PATH=%{buildroot}/DB
rm -rf %{buildroot}/DB
%endif
Expand Down
12 changes: 12 additions & 0 deletions tools/test_containers_compose
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

set -euo pipefail

for i in webui; do
(
cd container/$i/ &&
sudo docker-compose build -q --parallel &&
sudo docker-compose up -d &&
(docker-compose ps --services --filter status=stopped | grep "^[[:space:]]*$") || (docker-compose logs; sudo docker-compose ps; exit 1)
) || exit 1;
done

0 comments on commit 6ccbaed

Please sign in to comment.