Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add etcd-centric kvstore and replace cb-store #1690

Merged
merged 6 commits into from
Jul 26, 2024

Conversation

yunkon-kim
Copy link
Member

@yunkon-kim yunkon-kim commented Jul 26, 2024

This PR will replace the existing cb-store with kvstore based on etcd.

Due to this, etcd must be running to run CB-Tumblebug. To reduce inconvenience, docker-compose can help you to deploy etcd. By etcd-setup-auth, simple authentication will be supported.

To minimize the impact on upstream, I would like to open this PR targeted to a separate branch and keep testing and gathering feedback for a while.

This PR includes:

  • kvstore pkg:

    • New kvstore pkg based on etcd.
    • Replacement of cb-store with the kvstore.
    • Initialization of etcd and kvstore
  • Authentication setup:

    • setup-auth.sh and .env for Docker Compose
    • etcd auth setup by etcd-setup-auth (ephemeral container)
  • Configuration enhancements:

    • Environment variables to use etcd, including auth info
    • The retry mechanism for connecting to the etcd server
    • Updates of examples to test with etcd simply
  • Code and dependency updates:

    • Excluded "key not found" errors from functions like kvstore.Get()
    • Updated configs and dependencies.
    • Updated README.md

Test completed

  • Run etcd, etcd-setup-auth (ephemeral container), cb-spider and cb-mapui
  • Build and run cb-tumblebug to test
  • Encrypt credentials by ./scripts/init/genCredential.sh
  • Configure Multi-Cloud info by ./scripts/init/init.sh
  • Create and delete an MCIS on CB-MapUI

Please let me know if you have any feedback, concerns, comments, enhancements and so on :-)

* Add `setup-auth.sh` and `.env`, which is used by Docker Compose
* Set up or apply auth on etcd server through `etcd-setup-auth` (an ephemeral container)
* Improve configuration for connecting to `etcd` and `kvstore`
  - Add environment variables of `etcd`
  - Read envs and set to the configs (including auth info)
  - Retry several times until you connect to the `etcd` server
* Update examples for `etcd` test
@yunkon-kim yunkon-kim self-assigned this Jul 26, 2024
@github-actions github-actions bot added the docs Improvements or additions to documentation label Jul 26, 2024
@seokho-son seokho-son removed the docs Improvements or additions to documentation label Jul 26, 2024
@seokho-son
Copy link
Member

@yunkon-kim
감사합니다! dev 브랜치에서 작업하시는 것에 동의하긴 하는데,
워낙 수정 영역이 넓은 피쳐라, 향후 main 병합시 컨플릭트 등으로 병합이 까다롭지는 않을지 걱정이 됩니다. ^^;

@yunkon-kim
Copy link
Member Author

yunkon-kim commented Jul 26, 2024

@seokho-son (cc. @sykim-etri)

걱정해주셔서 감사합니다 ^^ 광범위한 변경이라서 가능한 이슈 없이 Merge 하고자 (잠시 동안) 별도의 브랜치에서 의견 수렴 및 개선을 진행하고자 했습니다.

현 개발 내용을 활용 또는 테스트 해보실 수 있도록, 일부러 upstream에 branch를 생성한 측면도 있습니다.

K8s 부분은 대부분 Tumblebug에 반영해 주셨다고 합니다 ^^

다음주 월요일까지 의견/걱정/개선 사항을 기다려보고요. 이후에 개선 또는 main에 머지하도록 하겠습니다.

(참고)

  • 앞으로 Tumblebug 실행을 위해서 사전에 etcd 구동이 필요합니다.
  • etcd를 조금이나마 편리하게(?) 구동하실 수 있도록 docker-compose 를 통한 배포/구동을 지원합니다.
  • Watch, Dist-lock 기능이 추가되었으니 필요한 부분에 활용하시면 될 것 같습니다.

@seokho-son
Copy link
Member

/approve

@github-actions github-actions bot added the approved This PR is approved and will be merged soon. label Jul 26, 2024
@cb-github-robot cb-github-robot merged commit 74ac071 into cloud-barista:replace-with-etcd Jul 26, 2024
1 of 2 checks passed
@yunkon-kim yunkon-kim deleted the 240725-09 branch July 30, 2024 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved This PR is approved and will be merged soon.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants