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

Feature/add self client #27

Merged
merged 4 commits into from
Sep 15, 2021
Merged

Feature/add self client #27

merged 4 commits into from
Sep 15, 2021

Conversation

ktkfree
Copy link
Contributor

@ktkfree ktkfree commented Sep 10, 2021

tks service 간 호출 일관성을(logging, connection) 위해 자기 자신을 호출하도록 하는 static pkg 를 추가합니다.
추후 tks-common static library project 가 생성된다면 그쪽에서 구현되는 것도 좋겠습니다.

주요 변경 사항
• self-client 추가
• image tag 변경 ( branch 명에서 commit hash )

연관 Ticket
tks-cluster-lcm 을 통한 user-cluster 생성

@github-actions
Copy link

This PR is stale because it has been open 3 days with no activity. Remove stale label or comment or this will be closed in 3 days.

@github-actions github-actions bot added the Stale There has been no activity on this label Sep 13, 2021
@ktkfree ktkfree closed this Sep 15, 2021
@ktkfree ktkfree reopened this Sep 15, 2021
@@ -24,6 +24,6 @@ jobs:
uses: docker/build-push-action@v2
with:
push: true
tags: seungkyua/tks-info:${{ github.head_ref }}
tags: seungkyua/tks-info:${{ github.sha }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

중요한 건 아닌데, 가능하다면 개인 registry 대신 팀에서 사용하는 "sktdev" 등의 registry 를 사용하는 게 더 좋을 것 같습니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

네 이부분 저도 전 PR에서 언급한 부분이긴합니다. 팀 공식 repository 가 확정되면, 제가 tks 서비스 전체 일괄 수정하도록 하겠습니다.

cspInfoClient pb.CspInfoServiceClient
)

func RequestLogging() grpc.UnaryClientInterceptor {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

특정 RPC 호출에 대해 로깅을 남기는 용도로 보이는데, 실제 사용 시는 어떤 식으로 사용하면 될까요? README 라던가 아니면 간단히 comment 형태로라도 설명이 있으면 좋을거 같아요.

Copy link
Contributor Author

@ktkfree ktkfree Sep 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

사실 이 코드는 임시 코드이고, tks-common 등의 common project 만들때 logging 및 jaeger 로직등 추가하여 정리하려고 합니다~
( 이 function 은 public 이 아닌 private function 으로 보심 좋겠어요. 외부 노출을 위한 함수는 아닙니다. )

모든 RPC 에 대해 아래와 같은 형식으로 일단 남기게 해두었습니다.

INFO 로그 ( 단순 호출 이력과 에러만 )
. [GRPC:/pbgo.ContractService/GetContract][START:2021-09-15T14:54:52+09:00][END:2021-09-15T14:54:52+09:00][ERR:]

DEBUG 로그 ( request / response 포함 )
. [GRPC:/pbgo.ContractService/GetContract][REQUEST contract_id:"011b88fa-4d53-439f-9336-67845f994051"][REPLY contract:{contractor_name:"tks-admin-contract" contract_id:"011b88fa-4d53-439f-9336-67845f994051" quota:{cpu:1200 memory:1200 block:1200 block_ssd:1200 fs:1200 fs_ssd:1200} available_services:"Hello" updated_at:{seconds:1629860324 nanos:225202000} created_at:{seconds:1629860324 nanos:225202000}}]

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아 네, 임시 코드라는 건 이해했습니다^^ 다만 실제 코드에서 이 함수를 어떻게 사용해야 하는지 usage (또는 문법?)를 여쭤본 거였습니다.

@ktkfree ktkfree merged commit 4650d3f into main Sep 15, 2021
@ktkfree ktkfree deleted the feature/add_self_client branch September 15, 2021 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Stale There has been no activity on this
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants