给定带有容器定义的yaml文件definition.yml
apiVersion: 2019-12-01
location: germanywestcentral
name: nameforcontainergroup
properties:
containers:
- name: selenium-hub
properties:
image: selenium/standalone-chrome:4.1.1-20211217
resources:
requests:
cpu: 1
memoryInGb: 1
environmentVariables:
- name: SCREEN_WIDTH
value: "1920"
- name: SCREEN_HEIGHT
value: "1080"
- name: VNC_NO_PASSWORD
value: 1
ports:
- port: 4444
- name: chrome-node-1-video
properties:
image: selenium/video:ffmpeg-4.3.1-20211217
resources:
requests:
cpu: 1
memoryInGb: 2
environmentVariables:
- name: DISPLAY_CONTAINER_NAME
value: selenium-hub
- name: FILE_NAME
value: chrome-node-video.mp4
volumeMounts:
- name: videos
mountPath: /videos
osType: Linux
volumes:
- name: devshm
emptyDir: {}
- name: downloads
emptyDir: {}
- name: videos
emptyDir: {}
ipAddress:
ports:
- protocol: tcp
port: '4444'
type: Public
dnsNameLabel: some-dns-label
tags: null
type: Microsoft.ContainerInstance/containerGroups假设存在组group-name,则部署从Azure : az登录az容器创建-资源-组名称-文件definition.yml运行的容器。
已部署容器,网格正在运行,但视频容器无法连接到网格。
Cannot open display selenium-hub:99.0, error 1.
selenium-hub:99.0: Input/output error完整的集装箱日志:
2021-12-30 09:06:38,504 CRIT Supervisor is running as root. Privileges were not dropped because no user is specified in the config file. If you intend to run as root, you can set user=root in the config file to avoid this message.
2021-12-30 09:06:38,508 INFO supervisord started with pid 31
2021-12-30 09:06:39,511 INFO spawned: 'video-recording' with pid 36
2021-12-30 09:06:39,515 INFO spawned: 'video-ready' with pid 37
Checking if the display is open...
2021-12-30 09:06:39,524 INFO success: video-recording entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2021-12-30 09:06:39,525 INFO success: video-ready entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
Waiting before next display check...
Waiting before next display check...
Waiting before next display check...
Waiting before next display check...
Waiting before next display check...
Waiting before next display check...
Waiting before next display check...
Waiting before next display check...
ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 9 (Ubuntu 9.3.0-17ubuntu1~20.04)
configuration: --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-avresample --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-gpl --enable-libass --enable-fontconfig --enable-libfreetype --enable-libvidstab --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libxcb --enable-libx265 --enable-libxvid --enable-libx264 --enable-nonfree --enable-openssl --enable-libfdk_aac --enable-postproc --enable-small --enable-version3 --enable-libbluray --enable-libzmq --extra-libs=-ldl --prefix=/opt/ffmpeg --enable-libopenjpeg --enable-libkvazaar --enable-libaom --extra-libs=-lpthread --enable-libsrt --enable-libaribb24 --extra-cflags=-I/opt/ffmpeg/include --extra-ldflags=-L/opt/ffmpeg/lib
libavutil 56. 51.100 / 56. 51.100
libavcodec 58. 91.100 / 58. 91.100
libavformat 58. 45.100 / 58. 45.100
libavdevice 58. 10.100 / 58. 10.100
libavfilter 7. 85.100 / 7. 85.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100
[x11grab @ 0x556baa816b80] Cannot open display selenium-hub:99.0, error 1.
selenium-hub:99.0: Input/output error
2021-12-30 09:07:05,243 INFO exited: video-recording (exit status 1; not expected)我错过了一些配置吗?
Yaml参考资料:https://learn.microsoft.com/en-us/azure/container-instances/container-instances-reference-yaml
更新1:版本与集线器+节点+视频节点.节点被注册到集线器,但是视频节点失败,与独立节点的错误完全相同。
apiVersion: 2019-12-01
location: germanywestcentral
name: nameforcontainergroup2
properties:
containers:
- name: selenium-hub
properties:
image: selenium/hub:4.1.1-20211217
resources:
requests:
cpu: 1
memoryInGb: 1
ports:
- port: 4444
- name: chrome-node
properties:
image: selenium/node-chrome:4.1.1-20211217
resources:
requests:
cpu: 1
memoryInGb: 2
environmentVariables:
- name: SE_EVENT_BUS_HOST
value: localhost
- name: SE_EVENT_BUS_PUBLISH_PORT
value: 4442
- name: SE_EVENT_BUS_SUBSCRIBE_PORT
value: 4443
- name: SE_NODE_PORT
value: 5560
- name: VNC_NO_PASSWORD
value: 1
volumeMounts:
- name: devshm
mountPath: /dev/shm
- name: downloads
mountPath: /home/seluser/downloads
- name: chrome-node-1-video
properties:
image: selenium/video:ffmpeg-4.3.1-20211217
resources:
requests:
cpu: 1
memoryInGb: 2
environmentVariables:
- name: DISPLAY_CONTAINER_NAME
value: chrome-node
- name: FILE_NAME
value: chrome-node_video.mp4
volumeMounts:
- name: videos
mountPath: /videos
osType: Linux
volumes:
- name: devshm
emptyDir: {}
- name: downloads
emptyDir: {}
- name: videos
emptyDir: {}
ipAddress:
ports:
- protocol: tcp
port: '4444'
type: Public
dnsNameLabel: some-dns-label
tags: null
type: Microsoft.ContainerInstance/containerGroups发布于 2021-12-31 11:43:32
请检查这些参考资料是否给出了解决方法的想法:
请检查是否遗漏了给主机的端口,如selenium环境变量中的发布端口,并将其用于chrome.Make,肯定也会打开其他端口。并检查是否正确配置了selenium集线器和铬容器,并将其用于视频记录。
-name: selenium-node-chrome
image: selenium/standalone-chrome:4.1.1-20211217
....
...
environmentVariables:
- name: SE_EVENT_BUS_HOST
value: selenium-hub
- name: SE_EVENT_BUS_PUBLISH_PORT
value: '4442'
- name: SE_EVENT_BUS_SUBSCRIBE_PORT
value: '4443'
- name: SE_NODE_HOST
value: node-chrome
- name: SE_NODE_PORT
value: '5555'用于视频
- name: chrome-node-1-video
....//other properties
image: selenium/video:ffmpeg-4.3.1-20211217
.....
environmentVariables:
- name: DISPLAY_CONTAINER_NAME
value: selenium-node-chrome
- name: FILE_NAME
value: chrome-node-video.mp4
…..配置硒轮毂
-name:selenium-hub
image: selenium/hub:4.1.1-20211217
container_name: selenium-hub
ports:
- "4442:4442"
- "4443:4443"
- "4444:4444"参考资料:
https://stackoverflow.com/questions/70529733
复制相似问题