DE-labtory / tesseract

Tesseract is a library to run SmartContract on Docker Container.
Apache License 2.0
10 stars 8 forks source link

docker container 실행방식 변경 #9

Closed hackurity01 closed 6 years ago

hackurity01 commented 6 years ago

컨테이너를 만들고 CellCode를 실행할 때 필요한 파일들이 많아서 (cell.go, message.pb.go = 소켓관련 파일 등)
아예 tesseract 디렉토리 자체를 binding 하도록 변경했습니다.

CellCode가 빌드되고 실행되면 binding 했던 디렉토리들을 다시 umount 하여, 컨테이너 안에서 소스 파일을 변경하지 못하도록 했습니다.

(이 브런치는 소켓 구현 브런치인데, 하다보니 docker를 수정해서 일단 docker 소스 먼저 push합니다.)

junbeomlee commented 6 years ago

아그리고 명칭을 grcp bistream을 사용하니 socket이 아닌 다르게 불러야 할 것 같습니다!

hackurity01 commented 6 years ago

호스트와 docker container 사이에 stream 연결이 안돼서 헤매고 있습니다 ㅠ

테스트 할 때, default_docker_test의 TestStartContainer()를 실행시키면 docker container가 하나 생성됩니다.

이 후, docker exec -i -t [container id] /bin/bash 위 명령을 이용하여 container에 들어간 후 /go/cellcode /go/icode.so cellcode를 실행시킵니다.

기다리면 콘솔에 "in Listen" 로그가 찍히면 정상적으로 실행되고 stream 서버가 대기합니다.

(여기 까지는 원래 한 큐로 가는데, 아래 문제 원인을 확인 해보려고 스탭을 분할 했습니다.)

여기서 부터 문제인건데,

defaultClientStream_test에서 TestConnect() 함수를 실행하면 에러를 뱉으면서 서버와 연결이 안 됩니다 ㅠ

hackurity01 commented 6 years ago

@junbeomlee grpc 유닛 테스트 작성 tesseract 통합 테스트 예정

변경 내용 확인 요망