Docker 映像在我的系统上运行良好,但是在边缘编排上运行时,它向我显示了错误:
在我的系统上完美运行:
这是我正在运行的命令:
curl -X POST "192.168.43.11:56001/api/v1/orchestration/services" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"ServiceName\": \ "age_detection\", \"ServiceInfo\": [{ \"ExecutionType\": \"container\", \"ExecCmd\": [ \"docker\", \"run\", \"-it\" ,\"--rm\",\"--device=/dev/video0\",\"-e\",\"DISPLAY=$DISPLAY \",\"-v\",\"$XSOCK: $XSOCK\",\"-v\",\"$XAUTH:$XAUTH\",\"-e\",\"XAUTHORITY=$XAUTH\",\"-e\",\" QT_X11_NO_MITSHM=1 \",\"animeshj123/age_det_ image:02\ "]}],\"StatusCallbackURI\":\" http :
@Deepak-Enc 我成功复制了您的案例,但出现错误,并使用边缘编排成功启动了容器。
以下是我为成功启动而执行的命令
virtual-pc@virtualpc-VirtualBox:~$ curl -X POST "127.0.0.1:56001/api/v1/orchestration/services" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"ServiceName\": \"age_detection\", \"ServiceInfo\": [{ \"ExecutionType\": \"container\", \"ExecCmd\": [ \"docker\", \"run\", \"-it\",\"--rm\",\"--device=/dev/video0\", \"--net=host\",\"--ipc=host\", \"-e\",\"DISPLAY=$DISPLAY\",\"-v\",\"/tmp/.X11-unix:/tmp/.X11-unix\",\"-e\",\"QT_X11_NO_MITSHM=1\",\"animeshj123/age_det_image:02\"]}], \"StatusCallbackURI\": \"http://127.0.0.1:8888/api/v1/services/notification\"}"
{"Message":"ERROR_NONE","RemoteTargetInfo":{"ExecutionType":"container","Target":"10.0.2.15"},"ServiceName":"age_detection"}
virtual-pc@virtualpc-VirtualBox:~$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
0d73793665d9 animeshj123/age_det_image:02 "python detect_age_c…" 16 minutes ago Up 16 minutes crazy_visvesvaraya
f1a1dacb70fd edge-orchestration:baobab "sh run.sh" 16 minutes ago Up 16 minutes edge-orchestration
virtual-pc@virtualpc-VirtualBox:~$
停止正在运行的容器,然后就可以开始使用边缘编排
请给出反馈你的结果是什么? 我希望一切都对你有用。 如果您有任何问题,我们将很乐意为您解答!
收到同样的错误。
您需要确保animeshj123/age_det_image:02
容器中的程序正确启动,因为container execution status : 1
行表明程序本身发生了错误。
我建议这样做。 之后,我看到一切正常:
virtual-pc@virtualpc-VirtualBox:~$ sudo docker run --rm -ti --device=/dev/video0 --net=host --ipc=host -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix --env="QT_X11_NO_MITSHM=1" animeshj123/age_det_image:02
[sudo] password for virtual-pc:
[INFO] loading face detector model...
[INFO] loading age detector model...
[INFO] starting video stream...
^CTraceback (most recent call last):
File "detect_age_cam.py", line 121, in <module>
results = detect_and_predict_age(frame, faceNet, ageNet,
File "detect_age_cam.py", line 29, in detect_and_predict_age
detections = faceNet.forward()
KeyboardInterrupt
virtual-pc@virtualpc-VirtualBox:~$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f1a1dacb70fd edge-orchestration:baobab "sh run.sh" 17 hours ago Up 17 hours edge-orchestration
virtual-pc@virtualpc-VirtualBox:~$ curl -X POST "127.0.0.1:56001/api/v1/orchestration/services" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"ServiceName\": \"age_detection\", \"ServiceInfo\": [{ \"ExecutionType\": \"container\", \"ExecCmd\": [ \"docker\", \"run\", \"-it\",\"--rm\",\"--device=/dev/video0\", \"--net=host\",\"--ipc=host\", \"-e\",\"DISPLAY=$DISPLAY\",\"-v\",\"/tmp/.X11-unix:/tmp/.X11-unix\",\"-e\",\"QT_X11_NO_MITSHM=1\",\"animeshj123/age_det_image:02\"]}], \"StatusCallbackURI\": \"http://127.0.0.1:8888/api/v1/services/notification\"}"
{"Message":"ERROR_NONE","RemoteTargetInfo":{"ExecutionType":"container","Target":"10.0.2.15"},"ServiceName":"age_detection"}virtual-pc@virtualpc-VirtualBox:~$
virtual-pc@virtualpc-VirtualBox:~$
我也看到这样的错误。
如果重启 docker (service docker restart) 可以修复
同一个容器在你的边缘和我的本地主机上运行良好
意味着程序没有问题。 我的可能有问题
edge-orchestration 如何解决这个问题。
在 2020 年 6 月 15 日星期一 16:25 tdrozdovsky, notifications @github.com 写道:
你需要确保animeshj123/age_det_ image:02中的程序
容器正确启动,作为容器执行状态:1 行
表明程序本身发生了错误。
[图片:изображение]
https://user-images.githubusercontent.com/45031429/84649763-bd171c00-af0f-11ea-9ff6-7ba80aea6662.png我建议这样做。 之后,我看到一切正常:
virtual-pc@virtualpc-VirtualBox :~$ sudo docker run --rm -ti --device=/dev/video0 --net=host --ipc=host -e DISPLAY=$DISPLAY -v /tmp/.X11- unix:/tmp/.X11-unix --env="QT_X11_NO_MITSHM=1" Animeshj123/age_det_ image:02
[sudo] 虚拟 PC 的密码:
[INFO] 正在加载人脸检测器模型...
[INFO] 正在加载年龄检测器模型...
[信息] 正在启动视频流...
^CTraceback(最近一次通话):
文件“detect_age_cam.py”,第 121 行,在
results = detect_and_predict_age(frame, faceNet, ageNet,
文件“detect_age_cam.py”,第 29 行,在 detect_and_predict_age 中
detections = faceNet.forward()
键盘中断
virtual-pc@virtualpc-VirtualBox :~$ docker ps -a
容器 ID 图像命令创建状态端口名称
f1a1dacb70fd edge-orch estration :baobab "sh run.sh" 17 hours ago Up 17 hours edge-orchestration
virtual-pc@virtualpc-VirtualBox :~$ curl -X POST "127.0.0.1:56001/api/v1/orchestration/services" -H "accept: application/json" -H "Content-Type: application/json" - d "{ \"ServiceName\": \"age_detection\", \"ServiceInfo\": [{ \"ExecutionType\": \"container\", \"ExecCmd\": [ \"docker\", \"运行\", \"-it\",\"--rm\",\"--device=/dev/video0\", \"--net=host\",\"--ipc=host\ ", \"-e\",\"DISPLAY=$DISPLAY\",\"-v\",\"/tmp/.X11-unix:/tmp/.X11-unix\",\"-e\ ",\"QT_X11_NO_MITSHM=1\",\"animeshj123/age_det_ image:02\ "]}],\"StatusCallbackURI\":\" http :
{"Message":"ERROR_NONE","RemoteTargetInfo":{"ExecutionType":"container","Target":"10.0.2.15"},"ServiceName":"age_detection"} virtual-pc@virtualpc-VirtualBox :~ $
virtual-pc@virtualpc-VirtualBox :~$
我也看到这样的错误。
[图片:изображение]
https://user-images.githubusercontent.com/45031429/84649385-1d598e00-af0f-11ea-9b6a-43a7780c7cf5.png
如果重启 docker (service docker restart) 可以修复—
你收到这个是因为你被提到了。
直接回复本邮件,在GitHub上查看
https://github.com/lf-edge/edge-home-orchestration-go/issues/91#issuecomment-644056795 ,
或退订
https://github.com/notifications/unsubscribe-auth/ANR2JO4EKLU3UYAYP4OSZB3RWX4ZPANCNFSM4N42UCTA
.
以下是它可能无法正常工作的示例
virtual-pc@virtualpc-VirtualBox:~$ docker run --rm -ti --device=/dev/video0 --net=host --ipc=host -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix --env="QT_X11_NO_MITSHM=1" animeshj123/age_det_image:02
[sudo] password for virtual-pc:
[INFO] loading face detector model...
[INFO] loading age detector model...
[INFO] starting video stream...
[ WARN:0] global /io/opencv/modules/videoio/src/cap_v4l.cpp (887) open VIDEOIO(V4L2:/dev/video0): can't open camera by index
Traceback (most recent call last):
File "detect_age_cam.py", line 117, in <module>
frame = imutils.resize(frame, width=400)
File "/usr/local/lib/python3.8/site-packages/imutils/convenience.py", line 69, in resize
(h, w) = image.shape[:2]
AttributeError: 'NoneType' object has no attribute 'shape'
现在看错误代码
virtual-pc@virtualpc-VirtualBox:~$ echo $?
1
错误与边缘编排器返回的相同
我认为有必要寻找程序无法正常运行的原因(例如,无法访问/dev/video0
或其他)
请解开我的疑惑。 它在我的主机上运行良好,这意味着 docker 容器或 docker 文件没有问题。 边缘编排可能存在问题,因为我无法在容器或 docker 文件中检测到。
@Deepak-Enc 请详细描述什么是“边缘编排问题”。 根据我的理解,您的目标容器通过 docker 容器/docker 文件成功地在本地主机上运行,但是当您尝试在边缘编排上运行它时却失败了。 我们已经为您提供了几项建议,但仍不清楚解决此问题。 我们正确吗?
@suresh-lc 你有什么看法? 这似乎不仅仅是一个配置问题。
2020/06/16 04:27:56 containerexecutor.go:84: [containerexecutor] 创建容器:c22c72a303
2020/06/16 04:28:01 containerexecutor.go:102: [containerexecutor] 容器执行状态:1
2020/06/16 04:28:01 containerexecutor.go:111: [containerexecutor] 来自守护进程的错误响应:无法从已死或标记为删除的容器中获取日志
2020/06/16 04:28:01 Orchestration_api.go:340:[orchestrationapi] 服务状态已更改 [appNames:age_detection][status:]
2020/06/16 04:28:01 containerexecutor.go:122: [containerexecutor] 来自守护进程的错误响应:删除容器 c22c72a303bff50d18b4af5d5b7d644256cdd8fb2c7d2b025ccfa2a 已经在进行中
我在边缘编排上运行年龄检测容器(实时和视频)时收到这些错误。 它捕获应用程序的第一帧,然后自动将容器标记为死容器。
@Deepak-Enc:我们可以从日志中看到,由于某些错误,在读取第一帧后,容器被标记为删除。 但究竟为什么我们也在努力寻找。 你能分享完整的错误日志文件吗? 而且,如果您可以分享您所做步骤的视频,那将是非常有帮助的。
下面是容器如何在边缘编排下工作的视频
Ubuntu_v16_04 [运行] - Oracle VM VirtualBox 6_16_2020 9_30_15 AM.zip
您发送的日志显示容器中的应用程序未正确完成。 需要更多数据
@Deepak-Enc:你能拿猴面包树分支试试这个场景吗?
看起来容器白名单没有为从边缘编排启动的服务完成。
错误:= verifier.GetInstance().ContainerIsInWhiteList(s.ParamStr[paramLen-1])。
因此,您可以尝试使用 Baobab 分支并告诉我们结果。
它正在研究猴面包树。 谢谢你。
问题解决了。 @suresh-lc @tdrozdovsky @Deepak-Enc 感谢您的所有兴趣和热情!
最有用的评论
它正在研究猴面包树。 谢谢你。