У меня есть приемочные испытания, настроенные с помощью ddev. Они запускаются локально на ddev composer cookieman:test
. Я хотел бы использовать ту же настройку с действиями Github.
Кому-нибудь повезло с ddev в действиях / рабочем процессе Github? Я добираюсь до того момента, когда проверка работоспособности ddev терпит неудачу:
... Creating ddev-router ... done Failed to start extension-cookieman-master: ddev-router failed to become ready: logOutput=2019/11/15 02:24:19 [emerg] 1630#1630: no servers are inside upstream in /etc/nginx/conf.d/default.conf:89 nginx: [emerg] no servers are inside upstream in /etc/nginx/conf.d/default.conf:89 nginx: configuration file /etc/nginx/nginx.conf test failed % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 curl: (22) The requested URL returned error: 404 Not Found ddev-router healthcheck endpoint not responding , err=container /ddev-router unhealthy: 2019/11/15 02:24:19 [emerg] 1630#1630: no servers are inside upstream in /etc/nginx/conf.d/default.conf:89 nginx: [emerg] no servers are inside upstream in /etc/nginx/conf.d/default.conf:89 nginx: configuration file /etc/nginx/nginx.conf test failed % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 curl: (22) The requested URL returned error: 404 Not Found ddev-router healthcheck endpoint not responding ##[error]Process completed with exit code 1.
.github / рабочие процессы / tests.yml:
name: Tests on: [push, pull_request] jobs: tests-via-ddev: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - run: export DEBIAN_FRONTEND=noninteractive # update docker - run: sudo -E apt-get purge -y docker docker-engine docker.io containerd runc nginx - run: curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - - run: sudo -E add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" - run: sudo -E apt-get update - run: sudo -E apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce # install linuxbrew - run: sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)" - run: echo "::add-path::/home/linuxbrew/.linuxbrew/bin" # install ddev + docker-compose - run: brew tap drud/ddev && brew install ddev docker-compose # Start ddev - run: ddev start || exit 0 # Debug - run: ls -als .ddev/ - run: curl 127.0.0.1 || exit 0 - run: curl 127.0.0.1/healthcheck || exit 0 - run: docker ps || exit 0 # we want Clover coverage - run: ddev exec enable_xdebug # Run tests - run: ddev composer cookieman:test
Я пытался
с использованием Ubuntu 16.04
полное обновление всех пакетов на Ubuntu 16.04 / 18.04
настройка ddev вот так:
run: ddev config global --router-bind-all-interfaces=true
run: ddev config global --omit-containers=dba,ddev-ssh-agent
переход на непривилегированные порты роутера (настройки router_http_port, router_https_port в config.yaml)
Если я заставлю его продолжить с ddev start || exit 0
, я увижу, что контейнеры работают:
- run: docker ps || exit 0
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES c36601a06fd6 drud/ddev-router:v1.11.0 "/app/docker-entrypo…" 27 seconds ago Up 24 seconds (unhealthy) 0.0.0.0:4430->4430/tcp, 0.0.0.0:4444->4444/tcp, 0.0.0.0:8025->8025/tcp, 80/tcp, 0.0.0.0:8080->8080/tcp ddev-router 18152602a054 drud/ddev-webserver:v1.11.0-built "/start.sh" 30 seconds ago Up 28 seconds (healthy) 8025/tcp, 127.0.0.1:32770->80/tcp, 127.0.0.1:32769->443/tcp ddev-extension-cookieman-master-web 33aca55715f2 selenium/standalone-chrome:3.12 "/opt/bin/entry_poin…" 32 seconds ago Up 30 seconds 4444/tcp ddev-extension-cookieman-master-chrome 6c852ae62974 drud/ddev-dbserver:v1.11.0-10.2-built "/docker-entrypoint.…" 32 seconds ago Up 30 seconds (healthy) 127.0.0.1:32768->3306/tcp ddev-extension-cookieman-master-db
curl 127.0.0.1
дает начальную страницу nginx по умолчанию (хотя я ожидал, что "503: серверный сайт ddev недоступен")
curl 127.0.0.1/healthcheck
дает 404
Итак, мой вывод: ddev-router доступен, но его nginx не имеет соответствующей конфигурации (серверы не находятся внутри восходящего потока в /etc/nginx/conf.d/default.conf). Таким образом, ddev запускает только предварительную форму ловушки config.yaml. пост-старт не дошел.
Вы можете увидеть результат последних запусков здесь https://github.com/dmind-gmbh/extension-cookieman/actions?query=branch%3Afeat%2Facceptance-tests
ИЗМЕНИТЬ / ИЗМЕНИТЬ: Это (неправильно) сгенерированный /etc/nginx/conf.d/default.conf
из ddev-router
:
# If we receive X-Forwarded-Proto, pass it through; otherwise, pass along the
# scheme used to connect to this server
map $http_x_forwarded_proto $proxy_x_forwarded_proto {
default $http_x_forwarded_proto;
'' $scheme;
}
# If we receive X-Forwarded-Port, pass it through; otherwise, pass along the
# server port the client connected to
map $http_x_forwarded_port $proxy_x_forwarded_port {
default $http_x_forwarded_port;
'' $server_port;
}
# If we receive Upgrade, set Connection to "upgrade"; otherwise, delete any
# Connection header that may have been passed to this server
map $http_upgrade $proxy_connection {
default upgrade;
'' close;
}
# Apply fix for very long server names
server_names_hash_bucket_size 128;
# Default dhparam
# ssl_dhparam /etc/nginx/dhparam/dhparam.pem;
# Set appropriate X-Forwarded-Ssl header
map $scheme $proxy_x_forwarded_ssl {
default off;
https on;
}
rfay упомянул недопонимание между ddev-router и базовым демоном докеров через сокеты.
/etc/nginx/conf.d/default.conf
из ddev-router послеddev start
. И он довольно пустой (выкладываю выше). Все это из-за неисправной розетки;) Как, например, docker-compose работает, думаю, сокет доступен. У тебя есть идея, как я могу это проверить? - person Jonas Eberle   schedule 19.11.2019