첫번째 Opensource Contribution 성공 후기 (docker 프로젝트) :: 행복한 프로그래머

posted by 쁘로그램어 2017. 12. 19. 14:52

첫번째 Opensource Contribution 성공 후기를 포스팅합니다.

docker(moby/moby) 프로젝트의 오타를 잡아서 Contribution 해본 후기글을 작성합니다.


# contribution (Pull Request 및 merge 확인)

https://github.com/moby/moby/pull/35714

https://github.com/moby/moby/commit/040033b89a201c8bb28fb847db994481d4a7f401


Opensource Contribution은 처음이라 몇번 실패를 반복하고,

결국은 docker master branch에 merge가 되었습니다.

(연습으로 해본것이라 오타 한글자를 수정하였고, 로직의 오타도 아니고 주석의 오타입니다ㅎㅎ)


소스 코드에서 오타를 찾는 방법은 아래 게시글을 참고해주세요.

참고: http://jhhwang4195.tistory.com/56?category=800698


저는 Pull Request 보내고 merge 되는데 약 12시간 걸렸네요.

인기 오픈소스인 경우는 절차가 복잡하고, 몇일 이상 걸리는 경우도 많은거 같습니다.

그리고 오픈소스별로 Contribution 가이드가 조금씩 다릅니다.

(대형 프로젝트 or 인기 오픈소스 일수록 Contribution하는 절차가 복잡하고 까다로운거 같습니다.)


이번 기회를 통해 Opensource Contribution 진행 과정 및 절차에 대해 많이 배웠고 자신감이 생겼네요. 이제는 뭔가 로직을 추가 or 개선하고 싶은 생각이 듭니다.


Opensource Contribution을 해보고 싶다면,

github에 Pull Request(이하 PR)에 대해 이해를 하고 있어야합니다.


만약 Pull Request에 대해 잘 모르신다면 "[TIP] Pull Request 정리"를 먼저 해보시는걸 추천합니다^^

참고: http://jhhwang4195.tistory.com/48?category=800698


Pull Request 과정 및 절차를 이해하셨다면,

실제 github 프로젝트를 골라서 Opensource Contribution을 진행해보시기 바랍니다.


참고로 Ubuntu 16.04에서 테스트하였습니다.


 Pull Request 절차 

1. moby repository fork

https://github.com/moby/moby


2. git clone

$ git clone https://github.com/jhhwang4195/moby.git moby

$ cd moby 


3. git config 설정

$ git config --local user.name "Jihyun Hwang"

$ git config --local user.email "jhhwang4195@gmail.com"

 

4. docker source의 오타 수정

$ vi daemon/graphdriver/lcow/lcow.go            // +827 line (reliablity -> reliability)

$ git diff daemon/graphdriver/lcow/lcow.go


5. fork한 repo에 source push

$ git commit -s -am "fixed typo (reliablity -> reliability)"

$ git push'


참고1) docker project는 contributing guide에 Signed-off-by를 반드시 추가하라고 권고!! 추가안하면 Jenkins Fail 발생


참고2) -s 옵션을 주면 commit 메시지에 Signed-off-by: 정보가 추가됨.

-s, --signoff

           Add Signed-off-by line by the committer at the end of the commit log message.

 

6. git log 확인

$ git log

commit 518c50c9b21225ee991d5147cccb687ea8640afc

Author: Jihyun Hwang <jhhwang4195@gmail.com>

Date:   Wed Dec 6 09:51:53 2017 +0900

    fixed typo (reliablity -> reliability)

    

    Signed-off-by: Jihyun Hwang <jhhwang4195@gmail.com>


7. Pull Request 수행 및 comment 작성

fixed typo (reliablity -> reliability)


Signed-off-by: jhhwang 


jhhwang4195@gmail.com


8. Pull Request 진행 상태 및 merge 확인

 TIP


docker 프로젝트는 Pull Request 요청시, comment는 아래와 같은 형식으로 작성하라고 권고한다.

참고: https://github.com/moby/moby/pull/35697

 

- What I did

The Golang built-in gzip library is serialized, and fairly slow

at decompressing. It also only decompresses on demand, versus

pipelining decompression. This fixes those problems.


- How I did it

This change switches to trying to use parallel gzip for gzip decompression as opposed to the

golang one. If it isn't available, it'll fall back to the default. This code path can also be disabled by environment variable.


- How to verify it

There are existing tests for this codepath to ensure correctness of this implementation. I ran some manual benchmarks, and I found I was able to get about 50% better performance as opposed to the build in library. These performance gains were primarily seen on images with layers about 10MB.


- Description for the changelog

Make image (layer) downloads faster by using pgzip


- A picture of a cute animal (not mandatory but encouraged)


docker는 pull request 날리면 jenkins에서 full build는 아닌거 같은데 대략 2시간이나 걸리는거 같다.

(jenkins 로그를 보면 항목별로 SKIP, PASS가 있는거로 봐서는 full build는 아닌거 같다.)


빌드 시간이 어느정도 걸리는지 궁금하다면,

이전 Pull Request의 merge된 jenkins history를 보면 대충 확인이 가능하다.


※ 참고 사이트 ※

http://juranosaurus.blogspot.kr/2015/09/how-to-be-open-source-contributor-2.html

https://github.com/moby/moby/blob/master/CONTRIBUTING.md


■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■

저는 IT 기술에 대해 관심이 많고, 기술적인 토론하는 것을 매우 좋아합니다^^

github following 해주시면 정말로 감사하겠습니다^^

github: https://github.com/jhhwang4195


어떠한 댓글이든 환영합니다^^

댓글 좀 달아주세요^^ (구걸 모드) 

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■


이 글이 도움이 되셨다면 아래에 있는 "♡공감" 버튼을 클릭해주세요