Closed yongjun823 closed 5 years ago
안녕하세요.
해당 문제는 새로운 도커 이미지를 만들고, 그 안에 원하는 라이브러리를 설치하셔서 새로 세팅하셔서 해결하시면 됩니다.
다음 문서 링크에서 "apt-get 으로 패키지를 설치해야 할 필요가 있을 경우" 파트를 참조하시기 바랍니다. https://n-clair.github.io/vision-docs/_build/html/ko_KR/contents/session/prepare_a_session_environment.html
FROM nsml/ml:cuda9.0-cudnn7-tf-1.11torch0.4keras2.2
RUN pip3 install --upgrade pip
RUN pip3 install --user opencv-contrib-python==3.3.0.10
기존 nsml 이미지에 명령어를 추가해서 Dockerfile을 만들었습니다
Step 7/11 : RUN pip --no-cache-dir install redis==2.10.6 minio==4.0.0 dill pymongo simplejson confluent-kafka[avro]
---> Running in 9677fec7ca02
Collecting redis==2.10.6
Downloading https://files.pythonhosted.org/packages/3b/f6/7a76333cf0b9251ecf49efff635015171843d9b977e4ffcf59f9c4428052/redis-2.10.6-py2.py3-none-any.whl (64kB)
Collecting minio==4.0.0
Downloading https://files.pythonhosted.org/packages/bb/82/7137e57d625b362756ef28e7c44cd32b5c03b87b02057e642062187011e1/minio-4.0.0-py2.py3-none-any.whl (50kB)
Collecting dill
Downloading https://files.pythonhosted.org/packages/fe/42/bfe2e0857bc284cbe6a011d93f2a9ad58a22cb894461b199ae72cfef0f29/dill-0.2.9.tar.gz (150kB)
Collecting pymongo
Downloading https://files.pythonhosted.org/packages/93/bf/d5234f8dc5eaae6d8391154f282dbefb7f82c2d8305af60cb5face86e880/pymongo-3.7.2-cp35-cp35m-manylinux1_x86_64.whl (408kB)
Collecting simplejson
Downloading https://files.pythonhosted.org/packages/e3/24/c35fb1c1c315fc0fffe61ea00d3f88e85469004713dab488dee4f35b0aff/simplejson-3.16.0.tar.gz (81kB)
Collecting confluent-kafka[avro]
Downloading https://files.pythonhosted.org/packages/30/7b/11880d74f6af94729fa794292127e9df44d3398868a03f0b980fdb4b693a/confluent_kafka-0.11.6-cp35-cp35m-manylinux1_x86_64.whl (3.9MB)
Requirement already satisfied: certifi in /opt/conda/lib/python3.5/site-packages (from minio==4.0.0) (2018.8.24)
Requirement already satisfied: urllib3 in /opt/conda/lib/python3.5/site-packages (from minio==4.0.0) (1.23)
Collecting pytz (from minio==4.0.0)
Downloading https://files.pythonhosted.org/packages/61/28/1d3920e4d1d50b19bc5d24398a7cd85cc7b9a75a490570d5a30c57622d34/pytz-2018.9-py2.py3-none-any.whl (510kB)
Collecting python-dateutil (from minio==4.0.0)
Downloading https://files.pythonhosted.org/packages/74/68/d87d9b36af36f44254a8d512cbfc48369103a3b9e474be9bdfe536abfc45/python_dateutil-2.7.5-py2.py3-none-any.whl (225kB)
Collecting avro-python3; extra == "avro" (from confluent-kafka[avro])
Downloading https://files.pythonhosted.org/packages/63/b4/7a81640bb69c844c912987007ba36276c29690d6fde2cd41fec16cd24c3b/avro-python3-1.8.2.tar.gz
Collecting fastavro; extra == "avro" (from confluent-kafka[avro])
Downloading https://files.pythonhosted.org/packages/bd/60/98df68f3702b84325abb64ffadc5fd6db07734ca8303f79305386b74159e/fastavro-0.21.17-cp35-cp35m-manylinux1_x86_64.whl (1.2MB)
Requirement already satisfied: requests; extra == "avro" in /opt/conda/lib/python3.5/site-packages (from confluent-kafka[avro]) (2.19.1)
Requirement already satisfied: six>=1.5 in /opt/conda/lib/python3.5/site-packages (from python-dateutil->minio==4.0.0) (1.11.0)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /opt/conda/lib/python3.5/site-packages (from requests; extra == "avro"->confluent-kafka[avro]) (3.0.4)
Requirement already satisfied: idna<2.8,>=2.5 in /opt/conda/lib/python3.5/site-packages (from requests; extra == "avro"->confluent-kafka[avro]) (2.7)
[91mException:
Traceback (most recent call last):
File "/opt/conda/lib/python3.5/site-packages/pip/_internal/cli/base_command.py", line 176, in main
status = self.run(options, args)
File "/opt/conda/lib/python3.5/site-packages/pip/_internal/commands/install.py", line 346, in run
session=session, autobuilding=True
File "/opt/conda/lib/python3.5/site-packages/pip/_internal/wheel.py", line 848, in build
assert building_is_possible
AssertionError
[0m
Vision_Magicians/ir_ph2/10: building is failed
[]
Done
Error: Failed to build docker image
time="2019/01/23 17:22:21.037" level=fatal msg="Internal server error"
Step 7/11 : RUN pip --no-cache-dir install redis==2.10.6 minio==4.0.0 dill pymongo simplejson confluent-kafka[avro]
---> Running in ab66434b2ea6
새로 만든 이미지로 실행시키면 오류가 뜹니다
FROM nsml/ml:cuda9.0-cudnn7-tf-1.11torch0.4keras2.2
RUN pip3 install --upgrade pip
RUN pip3 install --user opencv-contrib-python==3.3.0.10
RUN pip3 install redis==2.10.6 minio==4.0.0 dill pymongo simplejson
제가 만든 Dockerfile로 테스트해봤는데
7번 명령어에서 --no-cache-dir
이부분을 제거하면 이미지가 잘 생성됩니다
Dockerfile 만들때 추가해야하는 부분이 있을까요?
FROM nsml/ml:cuda9.0-cudnn7-tf-1.11torch0.4keras2.2
RUN pip3 install --upgrade pip
RUN pip3 install --user opencv-contrib-python==3.3.0.10
RUN pip3 install redis==2.10.6 minio==4.0.0 dill pymongo simplejson confluent-kafka[avro]
Dockerfile 이렇게 만들어도 같은 오류가 발생합니다
안녕하세요, Dockerfile 만들때는 제한이 없지만 위와같이 redis,minio,pymongo등은 nsml에서사용하는 패키지들이라서 세션실행에 필요한 패키지들입니다.
아무래도 opencv-contrib-python
패키지설치하다가 위의 패키지들과 충들이 난것같은데요, 그부분을 고려해서 도커파일을 다시 만들어주셔야 할것같습니다.
그냥 opencv
는 이미지내에 이미설치가되어서 따로 설치할필요가없는데요 그부분도 고려해보시기바랍니다.
참고로 nsml/ml:cuda9.0-cudnn7-tf-1.11torch0.4keras2.2
가 빌드된 도커파일은 다음 링크에서 확인하실수있습니다.
감사합니다.
Informations
CLI
WEB
NSML login ID 가 무엇인가요? audzms2776
문제가 발생한 세션은 어떤건가요? (bug message or screenshot)
재현방법은 어떻게 되나요? setup.py에
'opencv-contrib-python',
추가했습니다예상했던 동작방식은 무엇인가요? 라이브러리 설치
제안하고 싶은 해결방법이 있나요?