【发布时间】:2020-03-15 00:19:16
【问题描述】:
我使用 ddev 设置了验收测试。他们在ddev composer cookieman:test 上本地运行。我想对 Github 操作使用相同的设置。
有人在 Github 操作/工作流程中使用 ddev 运气吗?我一直到这里 ddev 的健康检查失败:
... 创建 ddev-router ...完成 无法启动 extension-cookieman-master:ddev-router 无法准备好:logOutput=2019/11/15 02:24:19 [emerg] 1630#1630:/etc/nginx/conf.d 中的上游没有服务器/default.conf:89 nginx:[emerg] /etc/nginx/conf.d/default.conf:89 的上游没有服务器 nginx:配置文件 /etc/nginx/nginx.conf 测试失败 % 总计 % 接收 % Xferd 平均速度 时间 时间 时间 当前 下载上传总花费剩余速度 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 curl:(22)请求的URL返回错误:404 Not Found ddev-router 健康检查端点没有响应 , err=container /ddev-router unhealthy: 2019/11/15 02:24:19 [emerg] 1630#1630: /etc/nginx/conf.d/default.conf:89 的上游没有服务器 nginx:[emerg] /etc/nginx/conf.d/default.conf:89 的上游没有服务器 nginx:配置文件 /etc/nginx/nginx.conf 测试失败 % 总计 % 接收 % Xferd 平均速度 时间 时间 时间 当前 下载上传总花费剩余速度 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 curl:(22)请求的URL返回错误:404 Not Found ddev-router 健康检查端点没有响应 ##[错误]进程完成,退出代码为 1。.github/workflows/tests.yml:
名称:测试 上:[推,拉请求] 工作: 测试通过-ddev: 运行:ubuntu-latest 脚步: - 使用:actions/checkout@v1 - 运行:导出 DEBIAN_FRONTEND=noninteractive # 更新码头工人 - 运行:sudo -E apt-get purge -y docker docker-engine docker.io containerd runc nginx - 运行:curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key 添加 - - 运行:sudo -E add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" - 运行:sudo -E apt-get update - 运行:sudo -E apt-get -y -o Dpkg::Options::="--force-confnew" 安装 docker-ce # 安装 linuxbrew - 运行:sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)" - 运行:回声“::add-path::/home/linuxbrew/.linuxbrew/bin” # 安装 ddev + docker-compose - 运行:brew tap drud/ddev && brew install ddev docker-compose # 启动 ddev - 运行:ddev 开始 ||出口 0 # 调试 - 运行:ls -als .ddev/ - 运行:卷曲 127.0.0.1 ||出口 0 - 运行:curl 127.0.0.1/healthcheck ||出口 0 - 运行:docker ps ||出口 0 # 我们想要 Clover 覆盖 - 运行:ddev exec enable_xdebug # 运行测试 - 运行:ddev composer cookieman:test我试过了
使用 Ubuntu 16.04
全面升级 Ubuntu 16.04/18.04 上的所有软件包
-
像这样配置 ddev:
run: ddev config global --router-bind-all-interfaces=truerun: ddev config global --omit-containers=dba,ddev-ssh-agent
更改为非特权路由器端口(在 config.yaml 中设置 router_http_port、router_https_port)
如果我强制它继续使用ddev start || exit 0,我可以看到容器启动并运行:
- run: docker ps || exit 0
容器 ID 图像命令创建状态端口名称
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 秒前 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 秒前 Up 30 seconds 4444/tcp ddev-extension-cookieman-master-chrome
6c852ae62974 drud/ddev-dbserver:v1.11.0-10.2-built "/docker-entrypoint...." 32 秒前 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
编辑/修改:
这是从ddev-router 生成的(错误)/etc/nginx/conf.d/default.conf:
# 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 和底层 docker 守护程序之间通过套接字通信错误。
【问题讨论】:
-
感谢您分享到目前为止的食谱!看起来 github 操作上的 docker 实例不允许 ddev-router 管道工作。 ddev-router 有这个(通过检查):``` "Binds": [ "/var/run/docker.sock:/tmp/docker.sock:ro", "ddev-global-cache:/mnt/ddev- global-cache:rw" ], ``` 在我看来它无法从 Web 容器中获取任何信息。
-
那个挂载docker.sock失败可能是个bug,后续去github吧。
-
谢谢!这可能是根本问题。在
ddev start之后,我设法将/etc/nginx/conf.d/default.conf从ddev-router 中取出。它是相当空的(张贴在上面)。所有这一切都是因为插座出现故障;)例如docker-compose 正在工作,我猜套接字是可访问的。你知道我该如何检查吗? -
似乎与套接字的通信本身不是问题。我玩弄了 jwilder/nginx-proxy,它的行为是一样的。 docker-gen 只是不报告 nginx 的任何上游 {} 配置。我添加了很多调试输出github.com/dmind-gmbh/extension-cookieman/commit/…
标签: github typo3 github-actions acceptance-testing ddev