Docker μ΄λ―Έμ§κ° λ΄ μμ€ν
μμ μ λλ‘ μ€νλκ³ μμ§λ§ μμ§ μ€μΌμ€νΈλ μ΄μ
μμ μ€ννλ©΄ μ€λ₯κ° νμλ©λλ€.
λ΄ μμ€ν
μμ μλ²½νκ² μ€ν:
λ΄κ° μ€ννλ λͺ
λ Ήμ λ€μκ³Ό κ°μ΅λλ€.
curl -X POST "192.168.43.11:56001/api/v1/orchestration/services" -H "μλ½: μ ν리μΌμ΄μ
/json" -H "μ½ν
μΈ μ ν: μ ν리μΌμ΄μ
/json" -d "{ \"μλΉμ€ μ΄λ¦\": \ "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://192.168.43.11 :8888/api/v1/services/notification\"}"
@Deepak-Enc μ€λ₯κ° μλ κ·νμ μ¬λ‘λ₯Ό μ±κ³΅μ μΌλ‘ μ¬ννμΌλ©° 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:~$ 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:~$
μ€ν μ€μΈ 컨ν μ΄λλ₯Ό μ€μ§ν ν edge-orchestration μ¬μ©μ μμν μ μμ΅λλ€.
λΉμ μ κ²°κ³Όλ 무μμ λκΉ? λͺ¨λ κ²μ΄ λΉμ μ μν΄ μ λμκΈ°λ₯Ό λ°λλλ€. μ§λ¬Έμ΄ μμΌμλ©΄ κΈ°κΊΌμ΄ λ΅λ³ν΄ λλ¦¬κ² μ΅λλ€!
κ°μ μ€λ₯κ° λ°μν©λλ€.
container execution status : 1
νμ νλ‘κ·Έλ¨ μ체μμ μ€λ₯κ° λ°μνμμ λνλ΄λ―λ‘ animeshj123/age_det_image:02
컨ν
μ΄λμ νλ‘κ·Έλ¨μ΄ μ¬λ°λ₯΄κ² μμλλμ§ νμΈν΄μΌ ν©λλ€.
λλ κ·Έκ²μ ν κ²μ μ μν©λλ€. κ·Έ ν λͺ¨λ κ²μ΄ μ¬λ°λ₯΄κ² μλνλ€λ κ²μ μμμ΅λλ€.
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, [email protected] μ΄:
λΉμ μ 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- μ λμ€:/tmp/.X11-unix --env="QT_X11_NO_MITSHM=1" animeshj123/age_det_ μ΄λ―Έμ§: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μκ° μ μλ‘ 17μκ° 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 "{ \"μλΉμ€ μ΄λ¦\": \"μ°λ Ή κ°μ§\", \"μλΉμ€ μ 보\": [{ \"μ€ν μ ν\": \"컨ν μ΄λ\", \"ExecCmd\": [ \"λ컀\", \" μ€ν\", \"-it\",\"--rm\",\"--device=/dev/video0\", \"--net=νΈμ€νΈ\",\"--ipc=νΈμ€νΈ\ ", \"-e\",\"DISPLAY=$DISPLAY\",\"-v\",\"/tmp/.X11-unix:/tmp/.X11-unix\",\"-e\ "\"QT_X11_NO_MITSHM 1 = \ "\"animeshj123 / age_det_ μ΄λ―Έμ§ : 02 \ "]}] \"StatusCallbackURI \ "\" http://127.0.0.1 : 8888 / API / V1 / μλΉμ€ / ν΅μ§ \ "}"
{"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
μ€λ₯λ edge-orchestratorκ° λ°ννλ κ²κ³Ό λμΌν©λλ€.
νλ‘κ·Έλ¨μ΄ μ λλ‘ μλνμ§ μλ μ΄μ λ₯Ό μ°ΎμμΌ νλ€κ³ μκ°ν©λλ€(μ: /dev/video0
λλ κΈ°νμ μ‘μΈμ€ν μ μμ)
μΉμ νκ² λ΄ μμ¬μ ν΄κ²°νμμμ€. λ΄ νΈμ€νΈ μ»΄ν¨ν°μμ μ μλνκ³ μλ€λ κ²μ λ컀 컨ν μ΄λλ λ컀 νμΌμ λ¬Έμ κ° μμμ μλ―Έν©λλ€. 컨ν μ΄λ λλ λ컀 νμΌμμ κ°μ§ν μ μκΈ° λλ¬Έμ μμ§ μ€μΌμ€νΈλ μ΄μ μ λ¬Έμ κ° μμ μ μμ΅λλ€.
@Deepak-Enc "μμ§ μ€μΌμ€νΈλ μ΄μ
λ¬Έμ "κ° λ¬΄μμΈμ§ μμΈν μ€λͺ
ν΄ μ£ΌμΈμ. λ΄ μ΄ν΄μμ νκ²ν
컨ν
μ΄λλ λ컀 컨ν
μ΄λ/λ컀 νμΌμ ν΅ν΄ λ‘컬 νΈμ€νΈμμ μ±κ³΅μ μΌλ‘ μ€νλμ§λ§ μμ§ μ€μΌμ€νΈλ μ΄μ
μμ μ€ννλ €κ³ νλ©΄ μ€ν¨ν©λλ€. λͺ κ°μ§ κΆμ₯ μ¬νμ μλ΄νμ§λ§ μ¬μ ν μ΄ λ¬Έμ λ₯Ό ν΄κ²°νλ κ²μ΄ λΆνμ€ν©λλ€. μ°λ¦¬κ° λ§μ΅λκΉ?
@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] λ°λͺ¬μ μ€λ₯ μλ΅: 컨ν
μ΄λ μ κ±° c22c72a303bff50d18b4af5d5b7d644256cdd8fb2c7d2b08ccbfa2κ° μ΄λ―Έ μ§ν μ€μ
λλ€.
μ£μ§ μ€μΌμ€νΈλ μ΄μ μμ μ°λ Ή κ°μ§ 컨ν μ΄λ(μ€μκ° λ° λΉλμ€)λ₯Ό μ€ννλ λμ μ΄λ¬ν μ€λ₯κ° λ°μν©λλ€. μμ© νλ‘κ·Έλ¨μ 첫 λ²μ§Έ νλ μμ μΊ‘μ²νμ§λ§ μλμΌλ‘ 컨ν μ΄λκ° μ£½μ 컨ν μ΄λλ‘ νμλ©λλ€.
@Deepak-Enc : μΌλΆ μ€λ₯λ‘ μΈν΄ 첫 λ²μ§Έ νλ μμ μ½μ ν 컨ν μ΄λκ° μ κ±° λμμΌλ‘ νμλλ κ²μ λ‘κ·Έμμ λ³Ό μ μμ΅λλ€. κ·Έλ¬λ μ νν μ°λ¦¬κ° μ°ΎμΌλ €λ μ΄μ μ΄κΈ°λ ν©λλ€. μ 체 μ€λ₯ λ‘κ·Έ νμΌμ 곡μ ν μ μμ΅λκΉ? κ·Έλ¦¬κ³ λΉμ μ΄ ν λ¨κ³μ λΉλμ€λ₯Ό 곡μ ν μ μλ€λ©΄ ν° λμμ΄ λ κ²μ λλ€.
μλλ μμ§ μ€μΌμ€νΈλ μ΄μ μμ 컨ν μ΄λκ° μλνλ λ°©μμ λν λΉλμ€μ λλ€.
Ubuntu_v16_04 [μ€ν μ€] - Oracle VM VirtualBox 6_16_2020 9_30_15 AM.zip
μ μ‘ν λ‘κ·Έλ 컨ν μ΄λμ μ ν리μΌμ΄μ μ΄ μ¬λ°λ₯΄κ² μλ£λμ§ μμμμ 보μ¬μ€λλ€. λ λ§μ λ°μ΄ν° νμ
@Deepak-Enc : Baobab λΈλμΉλ₯Ό κ°μ§κ³ μλ리μ€λ₯Ό μλν μ μμ΅λκΉ?
μμ§ μ€μΌμ€νΈλ μ΄μ
μμ μμλ μλΉμ€μ λν΄ μ»¨ν
μ΄λ νμ΄νΈλ¦¬μ€νΈκ° μνλμ§ μλ κ² κ°μ΅λλ€.
μ€λ₯ := verifier.GetInstance().ContainerIsInWhiteList(s.ParamStr[paramLen-1]).
λ°λΌμ ν λ² Baobab μ§μ μΌλ‘ μλνκ³ κ²°κ³Όλ₯Ό μλ €μ£Όμμμ€.
λ°μ€λ°₯λ무μμ μΌνκ³ μμ΅λλ€. κ°μ¬ ν΄μ.
λ¬Έμ κ° ν΄κ²°λμμ΅λλ€. @suresh-lc @tdrozdovsky @Deepak-Enc λͺ¨λ κ΄μ¬κ³Ό μ΄μ μ κ°μ¬λ립λλ€!
κ°μ₯ μ μ©ν λκΈ
λ°μ€λ°₯λ무μμ μΌνκ³ μμ΅λλ€. κ°μ¬ ν΄μ.