drone 构建一直卡住,心力憔悴

68 天前
knightgao2  knightgao2
drone 也是在站内看到的,觉得 jenkins 太丑了,想换个新的试试。
## docker-compose.yml
services:
drone:
image: drone/drone:2
container_name: drone
restart: always
ports:
- "443:443"
volumes:
- ./data:/data
- ./ssl:/etc/ssl:ro # 将 SSL 证书文件挂载到容器中
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
environment:
- DRONE_USER_CREATE=username:admin,admin:true
- DRONE_GITEA_SERVER=https://XXXXXX
- DRONE_GITEA_CLIENT_ID=XXXXXX
- DRONE_GITEA_CLIENT_SECRET=XXXXX
- DRONE_RPC_SECRET=970106f1f4bb07fa1ab0589a6df09b51
- DRONE_SERVER_HOST=drone.XXXXXX.cn
- DRONE_TLS_CERT=/etc/ssl/your_certificate.pem # 指向证书文件路径
- DRONE_TLS_KEY=/etc/ssl/your_private_key.key # 指向私钥文件路径
- DRONE_SERVER_PROTO=https
- DRONE_LOGS_DEBUG=true

runner:
image: drone/drone-runner-docker:latest
container_name: drone-runner-445
restart: always
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
environment:
- DRONE_RPC_PROTO=https
- DRONE_RPC_HOST=drone.XXXXXX.cn
- DRONE_RPC_SECRET=970106f1f4bb07fa1ab0589a6df09b51
- DRONE_RUNNER_CAPACITY=4
- DRONE_RUNNER_NAME=drone-runner-445
- DRONE_RUNNER_LABELS=type:docker
- DRONE_LOGS_DEBUG=true
- DRONE_RPC_INSECURE=true

## drone.yml
kind: pipeline
type: docker
name: default

steps:
- name: hello
image: alpine
pull: if-not-exists
commands:
- echo "Starting build..."
- pwd
- ls -la
- echo "Hello World"
- echo "Build completed"

trigger:
branch:
- main
event:
- push
- pull_request
- tag
- schedule
- custom
## 故障
可以触发新的 build,但是一直卡住,把对应的包加载到服务器了,但是一直 Step is pending ,卡住了
ubuntu@VM-4-13-ubuntu:~$ sudo docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
alpine latest b0c9d60fc5e3 12 days ago 7.83MB
drone/drone 2 649ae58d4a6a 2 months ago 59.2MB
drone/drone-runner-docker latest e2de942d714a 15 months ago 26MB
drone/drone-runner-docker 1 42f73cc80149 2 years ago 25.7MB
drone/git latest b263385b74bd 2 years ago 198MB
drone/drone-runner-ssh latest 59c90b8fb99d 2 years ago 19.5MB
1954 次点击
所在节点   DevOps  DevOps
38 条回复
knightgao2
68 天前
我看其他人都可以的,不知道哪里出问题了,家资不厚,愿意解决的大佬,请一杯咖啡( 50 元)
knightgao2
68 天前
不一定要死磕 drone 啊,主要是搞了几天想搞明白为啥,有除了 jenkins 的其他推荐也行,主要打包前后端,后续会集成进 k8s
maichael
68 天前
构建日志?
defunct9
68 天前
开 ssh ,让我上去看看
presoul
68 天前
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": [
"https://docker.unsee.tech"
]
}
EOF

重启 docker ,不配置 docker 镜像不行的
knightgao2
68 天前
@maichael 没有构建日志,第一步都没进去
presoul
68 天前
这个地址 docker-0.unsee.tech
knightgao2
68 天前
@defunct9 你这让我想起来一位故人
knightgao2
68 天前
@presoul #7 谢谢,我去试试
defunct9
68 天前
故人江海别,几度隔山川。
乍见翻疑梦,相悲各问年。
knightgao2
68 天前
大概这个症状,换了 docker 源了,感觉还是没啥动静
knightgao2
68 天前
源应该是生效了,可以拉镜像

ubuntu@VM-4-13-ubuntu:/opt/docker/drone$ sudo docker pull nginx
Using default tag: latest
latest: Pulling from library/nginx
af302e5c37e9: Pull complete
207b812743af: Pull complete
841e383b441e: Pull complete
0256c04a8d84: Pull complete
38e992d287c5: Pull complete
9e9aab598f58: Pull complete
4de87b37f4ad: Pull complete
Digest: sha256:0a399eb16751829e1af26fea27b20c3ec28d7ab1fb72182879dcae1cca21206a
Status: Downloaded newer image for nginx:latest
docker.io/library/nginx:latest
ubuntu@VM-4-13-ubuntu:/opt/docker/drone$ cat /etc/docker/daemon.json
{
"registry-mirrors": [
"https://docker-0.unsee.tech"
]
}
Vegetable
68 天前
去看看 runner output 的日志,就是你 drone-runner-445 这个容器的 docker log ,有没有收到 task, 现在在干什么,在 drone 看看 runner 的状态。好多年没用这东西了。
knightgao2
68 天前
MyBules
68 天前
@defunct9 #4 哈哈哈
knightgao2
68 天前
我这边 drone-runner-445 没有映射出去端口有关系吗,我理解只要能 runner 主动访问到 服务就行,不需要服务去主动访问 runner
wu67
68 天前
drone.yml 里面的 volumes 定义一下.

trigger 换成 when. 无关的 event 去掉.
knightgao2
68 天前
@wu67 修改好了
kind: pipeline
type: docker
name: default

steps:
- name: hello
image: alpine
pull: if-not-exists
volumes:
- name: cache
path: /tmp/cache
commands:
- echo "Starting build..."
- pwd
- ls -la
- echo "Hello World"
- echo "Build completed"

volumes:
- name: cache
host:
path: /var/lib/cache

when:
branch:
- main
event:
- push
- pull_request
- custom
knightgao2
68 天前
@knightgao2 #18 觉得大概是噶了
knightgao2
68 天前
@defunct9 #10 来个 wx 尼,给你权限

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/1106817

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX