apiVersion: api/v1
kind: Plan
name: brie-acceptance-long-time
schedule: "@weekly"
tags: ["brie", "acceptance"]
failFast: false
testbed:
  generateName: brie-acceptance-long-time-
  resourcePool: default
  reclaimPolicy:
    gcStrategy:
      onFailure:
        artifact:
          monitor: true
          log: true
        reserveEnv:
          durationOnWorkingHour: '{{meta.parameters.onFailureReserveDurationOnWorkingHour}}'
        notification:
          feishu: https://open.feishu.cn/open-apis/bot/v2/hook/372b1771-5d59-40e2-8adc-6026edd05f1d
      onSuccess:
        notification:
          feishu: https://open.feishu.cn/open-apis/bot/v2/hook/372b1771-5d59-40e2-8adc-6026edd05f1d
  items:
  - provider: "github.com/pingcap/test-infra/sdk/resource/impl/k8s.TiDBClusterClient"
    name: upstream
    type: TIDB_CLUSTER
    spec:
      version: '{{meta.parameters.base_image_version}}'
      pd:
        replicas: 1
        baseImage: '{{meta.parameters.pd_base_image}}'
        requests:
          cpu: 8000m
          memory: 16Gi
        limits:
          cpu: 8000m
          memory: 16Gi
        version: '{{meta.parameters.pd_component_version}}'
      tikv:
        replicas: 4
        baseImage: '{{meta.parameters.tikv_base_image}}'
        storageClassName: fast-disks
        requests:
          cpu: 8000m
          memory: 32Gi
          storage: 3000Gi
        limits:
          cpu: 8000m
          memory: 32Gi
          storage: 3000Gi
        version: '{{meta.parameters.tikv_component_version}}'
      tidb:
        replicas: 1
        baseImage: '{{meta.parameters.tidb_base_image}}'
        requests:
          cpu: 8000m
          memory: 16Gi
        limits:
          cpu: 8000m
          memory: 16Gi
        version: '{{meta.parameters.tidb_component_version}}'
      postStart:
        sql: |
          set global tidb_txn_assertion_level="STRICT"
  - provider: "github.com/pingcap/test-infra/sdk/resource/impl/k8s.TiDBClusterClient"
    name: downstream
    type: TIDB_CLUSTER
    spec:
      version: '{{meta.parameters.base_image_version}}'
      pd:
        replicas: 1
        baseImage: '{{meta.parameters.pd_base_image}}'
        requests:
          cpu: 8000m
          memory: 16Gi
        limits:
          cpu: 8000m
          memory: 16Gi
        version: '{{meta.parameters.pd_component_version}}'
      tikv:
        replicas: 4
        baseImage: '{{meta.parameters.tikv_base_image}}'
        storageClassName: fast-disks
        requests:
          cpu: 8000m
          memory: 32Gi
          storage: 3000Gi
        limits:
          cpu: 8000m
          memory: 32Gi
          storage: 3000Gi
        version: '{{meta.parameters.tikv_component_version}}'
      tidb:
        replicas: 1
        baseImage: '{{meta.parameters.tidb_base_image}}'
        requests:
          cpu: 8000m
          memory: 16Gi
        limits:
          cpu: 8000m
          memory: 16Gi
        version: '{{meta.parameters.tidb_component_version}}'
      postStart:
        sql: |
          set global tidb_txn_assertion_level="STRICT"
  - provider: "github.com/pingcap/test-infra/sdk/resource/impl/k8s.LightningClient"
    name: lightning
    type: TIDB_LIGHTNING
    spec:
      image: '{{meta.parameters.lightning_image}}'
      resources:
        requests:
          cpu: 8000m
          memory: 16Gi
          storage: 1000Gi
      volumeMount:
        mountPath: "/tmp/sorted-kv-dir"
      storageClassName: fast-disks
      storage: 1000Gi
      artifact:
        artifactPaths:
        - /tmp/lightning.log*
        - /tmp/tidb-lightning.toml
  - provider: "github.com/pingcap/test-infra/sdk/resource/impl/k8s.WorkloadNodeClient"
    name: dumpling
    type: WORKLOAD_NODE
    spec:
      container:
        name: dumpling
        image: '{{meta.parameters.dumpling_image}}'
        resources:
          requests:
            cpu: 8000m
            memory: 16Gi
            storage: 1000Gi
        command:
        - tail
        - "-f"
        - "/dev/null"
  - provider: "github.com/pingcap/test-infra/sdk/resource/impl/k8s.WorkloadNodeClient"
    name: br
    type: WORKLOAD_NODE
    spec:
      container:
        name: br
        image: '{{meta.parameters.br_image}}'
        resources:
          requests:
            cpu: 8000m
            memory: 16Gi
        artifact:
          artifactPaths:
          - /tmp/br.log*
        command:
        - tail
        - "-f"
        - "/dev/null"
  - provider: "github.com/pingcap/test-infra/sdk/resource/impl/k8s.WorkloadNodeClient"
    name: tools
    type: WORKLOAD_NODE
    spec:
      container:
        name: tools
        image: '{{meta.parameters.tools_image}}'
        resources:
          requests:
            cpu: 8000m
            memory: 8Gi
        command:
        - tail
        - "-f"
        - "/dev/null"
  - provider: "github.com/pingcap/test-infra/sdk/resource/impl/k8s.MySQLClient"
    name: mysql
    type: MYSQL_NODE
    spec:
      image: "{{meta.parameters.mysql_image}}"
      port: 3306
      env:
        MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
        MYSQL_ROOT_HOST: "%"

steps:
- name: lightning-import-70gb-shard-row-id
  caseName: lightning_import_70gb_shard_row_id
  arguments:
  - name: target
    value: '{{testbed.upstream}}'
  - name: lightning
    value: '{{testbed.lightning}}'
- name: br-70gb-shard-row-id-backup-restore
  caseName: br_70gb_shard_row_id_backup_restore
  arguments:
  - name: src_tidb
    value: '{{testbed.upstream}}'
  - name: dst_tidb
    value: '{{testbed.downstream}}'
  - name: br
    value: '{{testbed.br}}'
  - name: mc
    value: '{{testbed.tools}}'
- name: dumpling-70gb-shard-row-id
  caseName: dumpling_70gb_shard_row_id
  arguments:
  - name: target
    value: '{{testbed.upstream}}'
  - name: dumpling
    value: '{{testbed.dumpling}}'
  - name: mc
    value: '{{testbed.tools}}'
- name: lightning-list-partition-1k-import-local-backend
  caseName: lightning_list_partition_1.5k_import_local_backend
  arguments:
  - name: target
    value: '{{testbed.upstream}}'
  - name: lightning
    value: '{{testbed.lightning}}'
- name: br-list-partition-1k-backup-restore
  caseName: br_list_partition_1.5k_backup_restore
  arguments:
  - name: src_tidb
    value: '{{testbed.upstream}}'
  - name: dst_tidb
    value: '{{testbed.downstream}}'
  - name: br
    value: '{{testbed.br}}'
  - name: mc
    value: '{{testbed.tools}}'
- name: dumpling-list-partition-1k-tables
  caseName: dumpling_list_partition_1.5k_tables
  arguments:
  - name: target
    value: '{{testbed.upstream}}'
  - name: dumpling
    value: '{{testbed.dumpling}}'
- name: lightning-import-1TB-clustered-index
  caseName: lightning_import_1TB_clustered_index
  arguments:
    - name: target
      value: '{{testbed.upstream}}'
    - name: lightning
      value: '{{testbed.lightning}}'
- name: br-1TB-clustered-index-backup-restore
  caseName: br_1TB_clustered_index_backup_restore
  arguments:
    - name: src_tidb
      value: '{{testbed.upstream}}'
    - name: dst_tidb
      value: '{{testbed.downstream}}'
    - name: br
      value: '{{testbed.br}}'
    - name: mc
      value: '{{testbed.tools}}'
- name: dumpling-1TB-clustered-index
  caseName: dumpling_list_partition_1.5k_tables
  arguments:
    - name: target
      value: '{{testbed.upstream}}'
    - name: dumpling
      value: '{{testbed.dumpling}}'