apiVersion: api/v1
kind: Plan
name: br-oneshot
type: ONE_SHOT
testbed:
    generateName: cy-br-
    items:
        -   name: upstream
            type: TIDB_CLUSTER
            spec:
                pd:
                    replicas: 1
                    image: 'hub-new.pingcap.net/qa/pd:master'
                tikv:
                    replicas: 1
                    image: 'hub-new.pingcap.net/qa/tikv:master'
                tidb:
                    replicas: 1
                    image: 'hub-new.pingcap.net/qa/tidb:master'
        -   name: downstream
            type: TIDB_CLUSTER
            spec:
                pd:
                    replicas: 1
                    image: 'hub-new.pingcap.net/qa/pd:master'
                tikv:
                    replicas: 1
                    image: 'hub-new.pingcap.net/qa/tikv:master'
                tidb:
                    replicas: 1
                    image: 'hub-new.pingcap.net/qa/tidb:master'
        -   name: br
            type: WORKLOAD_NODE
            spec:
                container:
                    name: br
                    image: hub-new.pingcap.net/qa/br:master
                    command:
                        - tail
                        - "-f"
                        - "/dev/null"
        -   name: mc
            type: WORKLOAD_NODE
            spec:
                container:
                    name: loader
                    image: hub-new.pingcap.net/chengyou/tools-with-mc:latest
                    command:
                        - tail
                        - "-f"
                        - "/dev/null"
        -   name: lightning
            type: TIDB_LIGHTNING
            spec:
                image: hub-new.pingcap.net/qa/tidb-lightning:master
steps:
    -   name: lightning-import-csv-from-minio-with-cli
        caseName: lightning_import_csv_from_minio_with_cli
        arguments:
            -   name: target
                value: '{{testbed.upstream}}'
            -   name: lightning
                value: '{{testbed.lightning}}'
    -   name: import-parquet-from-minio-with-cli-tidb-backend
        caseName: lightning_import_parquet_from_minio_with_cli_tidb_backend
        arguments:
            -   name: target
                value: '{{testbed.upstream}}'
            -   name: lightning
                value: '{{testbed.lightning}}'
    -   name: br-backup-database-to-minio-restore
        caseName: br_backup_database_to_minio_restore
        arguments:
            -   name: src_tidb
                value: '{{testbed.upstream}}'
            -   name: dst_tidb
                value: '{{testbed.downstream}}'
            -   name: br
                value: '{{testbed.br}}'
            -   name: mc
                value: '{{testbed.mc}}'
            -   name: br_opts
                value: |
                    {"storage":"s3://tmp/br-backup-basic?access-key=minioadmin&secret-access-key=minioadmin&endpoint=http%3a%2f%2fminio.pingcap.net%3a9000&force-path-style=true","timeout":"10m","crc32-checksum":1440344869,"database":"import"}
    -   name: br-backup-table-to-minio-restore
        caseName: br_backup_table_to_minio_restore
        arguments:
            -   name: src_tidb
                value: '{{testbed.upstream}}'
            -   name: dst_tidb
                value: '{{testbed.downstream}}'
            -   name: br
                value: '{{testbed.br}}'
            -   name: mc
                value: '{{testbed.mc}}'
            -   name: br_opts
                value: |
                    {"storage":"s3://tmp/br-backup-basic?access-key=minioadmin&secret-access-key=minioadmin&endpoint=http%3a%2f%2fminio.pingcap.net%3a9000&force-path-style=true","timeout":"10m","crc32-checksum":1440344869,"database":"import","table":"jxtest"}
    -   name: br-backup-with-filter-to-minio-restore
        caseName: br_backup_with_filter_to_minio_restore
        arguments:
            -   name: src_tidb
                value: '{{testbed.upstream}}'
            -   name: dst_tidb
                value: '{{testbed.downstream}}'
            -   name: br
                value: '{{testbed.br}}'
            -   name: mc
                value: '{{testbed.mc}}'
            -   name: br_opts
                value: |
                    {"storage":"s3://tmp/br-backup-basic?access-key=minioadmin&secret-access-key=minioadmin&endpoint=http%3a%2f%2fminio.pingcap.net%3a9000&force-path-style=true","timeout":"10m","crc32-checksum":411827708,"filter":"test.order*"}
failFast: false