배포 구성 샘플

config/config.yaml 파일은 일반적으로 config/config.yaml.example 템플릿에서 초기화되며 Cortex Framework 배포의 기본 구성 역할을 합니다. 여기에는 대상 Google Cloud 실행 프로젝트, 소스 및 대상 BigQuery 데이터 세트, 저장소 및 작업공간 이름과 같은 Dataform 사양을 비롯한 중요한 매개변수가 정의되어 있습니다.

다음 섹션에서는 config/config.yaml 구조를 자세히 설명합니다.

빌드 환경

빌드 환경 프로젝트는 BigQuery 작업 (DD03L 읽기)과 같은 빌드 작업에 대해 청구되는 프로젝트입니다.

buildEnvironment:
  buildProjectId: YOUR_BUILD_PROJECT_ID

다음 표에서는 빌드 환경 매개변수를 설명합니다.

파라미터 의미 기본값 설명
buildEnvironment.buildProjectId 빌드 프로젝트 ID YOUR_BUILD_PROJECT_ID Google Cloud 빌드 작업이 실행되는 프로젝트 ID입니다.

데이터

구성 파일의 data: 섹션은 데이터 소스, 대상, 데이터 Foundation 및 데이터 제품의 특정 모듈을 정의합니다. 일반적인 구조는 다음과 같습니다.

data:
   # Geographic location for BigQuery datasets (for example: US, EU, us-central1)
   # For full list see: https://docs.cloud.google.com/cortex/docs/supported-locations
  bigQueryLocation: US
  # List of namespaces for data foundation and product modules.
  namespaces:
    - name: cortex
      path: cortex
  # List of source datasets.
  sources:
    - ...
  # List of target datasets.
  targets:
    - ...

  # Configuration for data foundation and product modules.
  modules:
    # List of foundation modules.
    foundation:
    - ... 
    # List of data product modules.
    product:
    - ...

데이터: BigQuery 위치

BigQuery 소스 및 대상 데이터 세트의 위치를 정의합니다.

파라미터 의미 기본값 설명
data.bigQueryLocation BigQuery 위치 US BigQuery 데이터 세트 위치 (예: US, us-central1, europe-west1).

데이터: Cortex 네임스페이스

Cortex Framework 네임스페이스를 정의합니다.

파라미터 의미 기본값 설명
data.namespaces.name 네임스페이스 이름 - Cortex Framework 네임스페이스 이름입니다. 예를 들면 cortex입니다.
data.namespaces.path 네임스페이스 경로 - src 및 config 폴더 내에서 사용되는 하위 디렉터리의 Cortex Framework 네임스페이스 경로입니다. 예를 들면 cortex입니다.

데이터: BigQuery 소스 및 대상 데이터 세트

소스 목록은 소스 시스템의 원시 데이터가 복제되거나 스트리밍된 BigQuery 데이터 세트를 정의합니다.

대상은 Dataform 처리된 데이터 세트가 저장될 BigQuery 데이터 세트 목록을 정의합니다.

소스 및 대상은 각각 고유 ID를 사용하여 모듈에서 참조됩니다.

# Data source and target mapping
sources:
  - id: sap_raw
    projectId: YOUR_SOURCE_PROJECT_ID
    datasetId: cortex_sap_raw

targets:
  - id: sap_foundation
    projectId: YOUR_TARGET_PROJECT_ID
    datasetId: cortex7_sap_data_foundation

다음 표에서는 데이터 소스 및 대상 매핑 매개변수를 설명합니다.

파라미터 의미 기본값 설명
data.sources.id 소스 ID - 데이터를 가져올 소스 데이터 세트의 'id'를 정의합니다. 예를 들면 sap_raw입니다.
data.sources.projectId 소스 프로젝트 ID YOUR_SOURCE_PROJECT_ID 소스 데이터가 있는 Google Cloud 프로젝트 ID를 참조합니다.
data.sources.datasetId 소스 BigQuery 데이터 세트 ID - 소스 데이터가 있는 BigQuery 데이터 세트 ID를 참조합니다. 예를 들면 cortex_sap_raw입니다.
data.targets.id 대상 ID - 대상 데이터 세트의 'id'를 정의합니다. 예를 들면 cortex_data_foundation입니다.
data.targets.projectId 대상 프로젝트 ID YOUR_TARGET_PROJECT_ID 대상 데이터의 Google Cloud 프로젝트 ID를 참조합니다.
data.targets.datasetId 대상 BigQuery 데이터 세트 ID - 대상 데이터의 BigQuery 데이터 세트 ID를 참조합니다. 예를 들면 cortex_sap_data_foundation입니다.

데이터: 모듈

모듈은 Dataform 데이터 파이프라인의 구조와 구성요소를 정의합니다.

데이터: 모듈: Foundation

이 섹션에서는 데이터 Foundation 레이어 모듈을 구성하여 원시 레이어 (CDC 스트림)의 데이터를 소스 데이터의 표준화된 최신 레코드 표현으로 처리합니다. 소스에서 최신 레코드에 대한 뷰를 직접 제공하거나 이러한 변환이 소스 시스템 커넥터에 의해 실행되는 경우 모듈을 외부 데이터 Foundation 소스로 구성할 수 있습니다.

modules:
  # List of foundation modules.
  foundation:
    # Unique identifier for the module instance.
    - moduleId: erp
      # Type of the module (namespaced, for example, cortex.sap).
      type: cortex.sap
      # Reference to the source dataset ID.
      dataSourceId: sap_raw
      # Reference to the target dataset ID.
      dataTargetId: sap_foundation
      # Module-specific configuration settings.
      moduleSettings:
        # SAP version (for example, ecc, s4).
        sapVersion: ecc
        # SAP client number.
        mandt: "100"
      # Whether the module is enabled.
      # enabled: true
      # Whether the foundation is external (does not create target dataset).
      # external: false
      # Path to the table settings configuration file.
      # tableSettings: "config/data_foundation/sap/table_settings.yaml"

다음 표에서는 modules.foundation 구성의 데이터 Foundation 모듈 매개변수를 설명합니다.

파라미터 의미 기본값 설명
moduleId 모듈 식별자 erp 특정 데이터 Foundation 변환 모듈 인스턴스의 고유 식별자입니다.
type 모듈 로직 유형 cortex.sap 적용된 비즈니스 로직 또는 템플릿을 정의합니다 (예: 고객, sales_documents).
dataSourceId 소스 링크 sap_raw 데이터를 가져올 data.sources 목록의 'id'를 참조합니다.
dataTargetId 대상 링크 sap_foundation 데이터를 푸시할 대상 목록의 'id'를 참조합니다.
moduleSettings.sapVersion SAP 시스템 버전 ecc SAP 데이터 소스에만 적용됩니다. ecc (ECC) 또는 s4 (S/4HANA) 시스템의 소스별 로직을 결정합니다.
moduleSettings.mandt SAP 클라이언트 (Mandant) 100 SAP 데이터 소스에만 적용됩니다. 데이터 행을 필터링하는 데 사용되는 3자리 SAP 클라이언트 식별자입니다.
enabled 모듈 사용 설정 true 모듈이 사용 설정되었는지 여부를 지정합니다.
external 외부 Foundation false Foundation이 외부인지 (대상 데이터 세트를 만들지 않음) 여부를 지정합니다.
tableSettings 테이블 설정 config/cortex/data_foundation/{source_system}/table_settings.yaml 테이블 설정 구성 파일의 경로입니다.

데이터: 모듈: 데이터 제품

데이터 제품 모듈은 원시 데이터를 특정 비즈니스 사용 사례를 충족하는 통계로 변환하는 데 필요한 집계, 계산, 조인을 정의합니다.

데이터 제품을 구성하면 고유 ID를 설정하고, 종속 항목을 정의하고, 결과가 저장될 데이터 Foundation 모듈 및 대상 데이터 세트를 참조할 수 있습니다.

지정된 데이터 제품의 세부 구성은 키 tableSettings에서 참조되는 파일 내에 정의됩니다.

modules:
  # List of data product modules.
  product:
    # Unique identifier for the data product instance.
    - moduleId: sap_purchasing_organizations
      # Type of the data product (namespaced).
      type: cortex.purchasing_organizations
      # Map of module dependencies.
      dependsOn:
        sapModule: erp
      # Reference to the target dataset ID.
      dataTargetId: product_target
      # Whether the module is enabled.
      # enabled: true
      # Path to the table settings configuration file.
      # tableSettings:   "config/cortex/data_product/purchasing_organizations/table_settings.yaml"

다음 표에서는 modules.product 구성의 데이터 제품 모듈 매개변수를 설명합니다.

파라미터 의미 기본값 설명
moduleId 모듈 식별자 - 특정 변환 모듈 인스턴스의 고유 식별자입니다.
type 모듈 로직 유형 - src/data_modules/{namespace}/data_product 폴더에 정의된 적용된 비즈니스 로직 또는 템플릿을 정의합니다.
dataTargetId 대상 링크 sap_foundation 데이터를 푸시할 대상 목록의 'id'를 참조합니다.
dependsOn 업스트림 종속 항목 sapModule: erp 제품 모듈을 빌드하기 전에 있어야 하는 Foundation 모듈을 지정합니다.
enabled 모듈 사용 설정 true 모듈이 사용 설정되었는지 여부를 지정합니다.
tableSettings 테이블 설정 "config/{namespace}/data_product/data_product_name/table_settings.yaml" 테이블 설정 구성 파일의 경로입니다.

배포 환경

Cortex Framework는 Dataform을 사용하여 BigQuery 내에서 SQL 변환을 오케스트레이션합니다. deployment: 블록은 저장소 프로젝트, 위치, 저장소 이름, Dataform 작업공간 이름을 비롯한 데이터 파이프라인 실행을 담당하는 Dataform 구성을 정의합니다.

deployment:
  targets:
    - type: dataform
      enabled: true
      targetSettings:
        repositoryProjectId: YOUR_REPO_PROJECT_ID
        repositoryRegion: us-central1
        repositoryName: cortex-repository
        workspaceName: dev

다음 표에서는 배포 대상 위치 매개변수(deployment.targets:)를 설명합니다.

Google Cloud
파라미터 의미 기본값 설명
type 배포 유형 dataform 배포 대상의 유형입니다.
enabled 사용 설정됨/ 사용 중지됨 true 지정된 배포 대상이 사용 설정되었는지 또는 사용 중지되었는지 지정합니다.
targetSettings.repositoryProjectId 저장소 프로젝트 ID YOUR_REPO_PROJECT_ID Dataform 저장소가 관리되는 프로젝트 ID입니다. Google Cloud
targetSettings.repositoryRegion 저장소 리전 us-central1 Dataform 저장소의 리전입니다 (예: us-central1 또는 europe-west1). Google Cloud
targetSettings.repositoryName 저장소 이름 cortex-repository Dataform 저장소의 구체적인 이름입니다.
targetSettings.workspaceName 작업공간 이름 dev 배포 주기에 사용되는 구체적인 Dataform 작업공간입니다.