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

feat: scaling component google cloud functions instance #121

Merged
merged 14 commits into from
Aug 2, 2023

Conversation

bryan-stclab
Copy link
Contributor

@bryan-stclab bryan-stclab commented Aug 1, 2023

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • DevOps process (non-breaking change which improves efficiency and reliability for CI/CD)
  • Documentation only

What this PR does / why we need it:

The Google Cloud Functions Scaling Component has been added to enable scaling of Google Cloud Functions instances.

Which issue/s this PR fixes

#116

How Has This Been Tested?

I wrote a plan YAML file and conducted tests in my actual Google Cloud Platform environment. (Google Cloud Functions instance)
Only Google Cloud Functions API tests and unit tests have been written, and the unit test code consists of test forms only.
We plan to enhance and add more unit tests in the future.

Checklist:

@bryan-stclab bryan-stclab added target: scaling-component target: type: new-feature type: New feature or request labels Aug 1, 2023
@bryan-stclab bryan-stclab added this to the v0.0.10 milestone Aug 1, 2023
@bryan-stclab bryan-stclab linked an issue Aug 1, 2023 that may be closed by this pull request
@bryan-stclab bryan-stclab changed the title 116 scaling component google cloud functions feat: scaling component google cloud functions Aug 1, 2023
@bryan-stclab bryan-stclab self-assigned this Aug 1, 2023
@bryan-stclab bryan-stclab removed the request for review from Ari-suhyeon August 1, 2023 18:31
@bryan-stclab bryan-stclab changed the title feat: scaling component google cloud functions feat: scaling component google cloud functions instance Aug 1, 2023
@pueding
Copy link
Member

pueding commented Aug 2, 2023

min instances
max instances

min instance count
max instance count

이 두개의 차이가 궁금합니다. v1, v2 둘다 결국 같은 의미로 데이터를 받는것 같은데, 나눈 이유가 궁금합니다! 🧐

@bryan-stclab
Copy link
Contributor Author

말씀해주신 변수 및 연관된 함수를 만들 때 기본적인 사상은, 최대한 Google Cloud Platform에서 지원하는 Key-Value 형태를 유지하려고 하였고, 내부적으로 동일한 의미를 갖더라도 상위 개념이 다른 제품, 버전, 또는 설정을 의미한다면 서로 구분하는 방향으로 하였습니다. 이렇게 하면 Google Cloud Platform을 숙지하고 있는 사용자 입장, 그리고 개발자의 디버깅 입장에서 조금 더 명확하지 않을까라는 생각으로 나누었습니다.

Google Cloud Platform을 조사하면서, 실질적인 변경 값은 JSON 형태로 Payload를 보내고, 해당 변경 사항에 대하여 Query를 통해 수정하려는 것이 어떤 것인지 명확히 요청에 담아 표현하는 것을 확인하였습니다.
이에 대하여, 저는 add_to_payload_and_query라는 함수를 만들었고, 이 함수는 Google Cloud Platform API와 호환 가능한 Payload, 그리고 Query 형태로 조합합니다. 내부 동작은 각각에 대한 Key-Value 쌍을 입력 값으로 받고 최종 형태로 두 개의 출력 값을 생성합니다.

@bryan-stclab
Copy link
Contributor Author

bryan-stclab commented Aug 2, 2023

논의 결과 공유 드립니다.
v2에 맞게 변수 이름 통합하고 버전을 확인하는 로직을 통해 API 호출 시 수정하여 전송합니다.
(예: minInstanceCount(min_instance_count), maxInstanceCount(max_instance_count), maxRequestPerInstance(max_request_per_instance))

@pueding pueding merged commit c376e88 into main Aug 2, 2023
1 check passed
@pueding pueding deleted the 116-scaling-component-google-cloud-functions branch August 2, 2023 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
target: scaling-component target: type: new-feature type: New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Google Cloud Functions
2 participants