본문 바로가기

전체 글

(67)
os.system significantly take time more than shutil. dataset을 옮기는 과정중에 파이썬 스크립트를 짜서 몇십만장의 image를 복사해야했다. 파일을 복사하는 방법은 여러가지이고, 많은 블로그들에서 알려주고 있다. 하지만 그러한 방법 중 os.system을 통해 shell 명령어와 똑같이 쓰는 방법이 쉬울 거 같아아서 썼지만, 대략 한개의 image를 복사하는데 0.4~0.5초가 걸렸다. 이렇게 가다가는 15만장 * 0.4 = 60000초 = 약17시간이 걸린다. 그래서 다른 방법중 shutil.copy()를 써서 돌렸는데 세상에나 10분도 채 안되서 복사가 된 것이다. 어마어마한 차이를 보여 이유를 찾아봤다. os.system은 subshell을 만들어 copy작업을 수행하는 시간이 길고, shutil은 직접적으로 system call을 요청하기 때문..
(에러)bash: /usr/bin/docker-compose: /usr/bin/python: bad interpreter: No such file or directory docker-compose up 할 때 이러한 에러가 나올 때 어떻게 해야할까? 저 위의 에러는 간단히 말하면 /usr/bin/python파일이 없다라는 의미이다. 하지만, 우리가 docker를 쓰는 이유는 환경설정하기 싫고 docker 안에서 가상환경을 설치하고 싶은 것 때문이지 않나? 따라서 현재 local에서 가지고 있는 환경과는 독립적이라고 생각했기 때문에, 저런 에러가 왜 뜨는지 궁금했다. 그래서 왜 저런 에러가 뜨는지를 알아보자. 일단 docker-compose up이 아니라 docker-compose --version할 때에도 위 같은 에러가 뜬다. 그렇다면 image 빌드할 때 local python이 필요한게 아니라 docker-compose에 문제가 있음을 알 수 있다. 그래서 일단 /..
kubernetes Auto Scaling, metric server kubernetes Autoscailing은 Cluster level scalability와 Pods layer autoscale로 나뉠 수 있다. Cluster level scalability는 pod를 node에 실행할 때 자원이 없어 pending상태라면 CA(Cluster Autoscailing)이 새로운 node를 확장한다. 이는 CSP환경(AWS, GCP, ASURE)에 적합하다. Pods layer autoscale은 HPA(Horizontal Pod Autocaler)는 pod개수를 계속적으로 증가해주는 것이고, VPA(Vertical Pods Autoscaler)는 pod의 request 자원의 limit을 증가시키는 것. Autoscailing을 사용하기 위해서는 Metrics-Serv..
kubernetes Volumes, pv, pvc, Storage class 기본적인 kubernetes resource, option 등을 설명한 블로그입니다. 추가적인 기능을 보고싶으시면 docs를 참고바랍니다. https://kubernetes.io/docs/home/ Kubernetes Documentation Kubernetes is an open source container orchestration engine for automating deployment, scaling, and management of containerized applications. The open source project is hosted by the Cloud Native Computing Foundation. kubernetes.io Volume은 kubernetes 스토리지의 추상화 개..
kubernetes auth, certificates 기본적인 kubernetes resource, option 등을 설명한 블로그입니다. 추가적인 기능을 보고싶으시면 docs를 참고바랍니다. https://kubernetes.io/docs/home/ Kubernetes Documentation Kubernetes is an open source container orchestration engine for automating deployment, scaling, and management of containerized applications. The open source project is hosted by the Cloud Native Computing Foundation. kubernetes.io 인증을 하는 방식은 여러가지가 있는데 static pa..
kubernetes scheduling 기본적인 kubernetes resource, option 등을 설명한 블로그입니다. 추가적인 기능을 보고싶으시면 docs를 참고바랍니다. https://kubernetes.io/docs/home/ Kubernetes Documentation Kubernetes is an open source container orchestration engine for automating deployment, scaling, and management of containerized applications. The open source project is hosted by the Cloud Native Computing Foundation. kubernetes.io Pod를 scheduling할 때 Node Select..
kubernetes configmap, secret 기본적인 kubernetes resource, option 등을 설명한 블로그입니다. 추가적인 기능을 보고싶으시면 docs를 참고바랍니다. https://kubernetes.io/docs/home/ Kubernetes Documentation Kubernetes is an open source container orchestration engine for automating deployment, scaling, and management of containerized applications. The open source project is hosted by the Cloud Native Computing Foundation. kubernetes.io configmap -> 컨테이너 구성 정보를 한 곳에서..
symbolic link is red and relative path? certbot을 이용해 인증서를 만들면 다음과 같은 link를 볼 수 있다. 자동으로 인증서를 배포하려는 script를 작성하려고 ln 명령어를 쓰면 빨간색의 link가 뜨고 No such file or directory 에러가 뜨는 경우가 있다. 첫번째로 빨간색의 의미는 link를 받는 대상의 해당파일이나 폴더가 없다는 것이다. 그래서 No such file or directory 에러가 뜨는 것이다. 그런데 그 경로로 가면 파일이 있다. 그 이유는 ln -s [path_first] [path_second]를 실행할 때 절대경로를 쓰면 문제가 안되지만, 상대경로를 쓴다면, path_second 링크를 만들고 그 기준으로 path_first를 살펴봐서 연결하는 것인데, 보통 오해하기 쉬운데 예를 들면 ~..