공부하고 기록하는, 경제학과 출신 개발자의 노트

강연

KubeCon 2022 Europe - Create your first CNCF Serverless Workflow Project with Kogito and Knative

inspirit941 2022. 6. 18. 15:33
반응형

Create your first CNCF Serverless Workflow Project with Kogito and Knative

선요약

  • Kogito: Redhat에서 진행중인 knative serving / eventing 컴포넌트의 조합을 묶어 workflow를 구성해 주는 프로덕트
  • 사용자에게서 json / yaml 형태의 선언형으로 input을 받고, 주어진 값을 토대로 quarkus을 활용해서 knative object를 만들어준다
  • 추후에는 low code 형태로도 개발해서 소스코드를 입력하지 않고도, 비개발자도 사용할 수 있는 방향을 구상하고 있다고 함.

스크린샷 2022-06-16 오전 10 57 02

 

스크린샷 2022-06-16 오전 10 59 06

CNCF Serverless Workflow project - Kogito

스크린샷 2022-06-16 오전 10 59 36

  • CNCF Sandbox incubating project로, DSL to Describe workflows.
  • Based on Standard. -> OPENAPI / GRPC 등등..

 

스크린샷 2022-06-16 오전 11 02 55

  • CloudEvent로 workflow를 trigger하거나, workflow 결과로 cloudevent를 생성하거나 전부 가능함.
  • 외부와 연동하기 위한 OpenAPI spec. async api / grpc / graphql 등등.
  • 여러 형태의 Workflow Pattern을 지원함.
    • Control Flow for Execution Order
    • Error Handling
    • Data Management / Filtering / Transformation 등등.
    • jq / jsonpath도 지원함. workflow runtime에서 데이터를 변경해야 한다면 jq / jsonpath를 사용할 수 있음.

 

스크린샷 2022-06-16 오후 12 06 36

fundamental structure, based on the serverless workflow

  1. functions 항목은 'how to call the functions / how that functions should look like' 를 입력하는 영역. argument / input / authentication 등등.
  2. events : workflow에서 어떤 이벤트를 produce / consume할지 결정.
  3. states : workflow의 상태를 정의하는 항목.

json / yaml 활용해서 정의할 수 있다.

 

스크린샷 2022-06-16 오후 12 45 45

  • implementation : json / yaml로 정의한 fundamental structure를 실행하는 영역. Redhat에서는 kogito를 개발 중이며, 상용 프로덕트는 아니고 community.
  • building blocks : quarkus (java framework for cloud Native Application.)
  • infrastructure: k8s + knative 기반 프로덕트. serverless를 위한 프레임워크 개념으로 knative를 도입

Demo

 

스크린샷 2022-06-16 오후 12 59 37

뉴스레터 구독 서비스의 workflow.

  1. subscription 요청
  2. email verification
  3. subscribe
  4. wait for verification
  5. Broadcast new Subscription

 

스크린샷 2022-06-16 오후 1 05 49

 

스크린샷 2022-06-16 오후 1 41 59

  • 런타임 때 engine이 functions에 정의된 open api spec을 따라 코드를 생성한다고 함.
  • 예시 코드의 flow는 아래와 같음

 

newsletter-subscription-flow스크린샷 2022-06-16 오후 1 55 49

  • Hands-on 진행. first iteration이므로 지금은 개발자를 목표로 하고 있지만, 추후에는 java를 모르는 사람도 쉽게 작업할 수 있도록 하는 것이 목표라고 함
    • drag / drop + describe and architecturing functions 등등을 구상하고 있음.
    • 현재는 cli로 시연 및 테스트 가능하도록.
quarkus create app -x=kogito-quarkus-serverless-workflow -x=quarkus-container-image-jib -x=quarkus-resteasy-jackson -x=quarkus-smallrye-openapi -x=kubernetes org.acme:my-first-ksw:1.0

 

스크린샷 2022-06-16 오후 2 17 19

  • yaml파일을 정의하면 다이어그램도 같이 그려줌

 

스크린샷 2022-06-16 오후 2 18 52

  • kogito의 역할: workflow + description 받아서 new rest application을 생성해준다.

Tight Integration with Knative.

  • workflow에서 eventing 관련 connection이 필요한 경우 -> knative eventing에 필요한 object를 전부 생성함. source / sink / bindings / triggers / brokers ...
반응형