apiVersion: v1
kind: ConfigMap
metadata:
  namespace: prow
  name: config
data:
  config.yaml: |
    prowjob_namespace: prow
    pod_namespace: prow-pods
    plank:
      job_url_template: '{{if .Spec.Refs}}{{if eq .Spec.Refs.Org "kubernetes-security"}}http://console.cloud.google.com/storage/browser/kubernetes-security-prow/{{else}}http://dev-prow.mindspore.cn/view/gcs/prow-artifacts/{{end}}{{else}}http://dev-prow.mindspore.cn/view/gcs/prow-artifacts/{{end}}{{if eq .Spec.Type "presubmit"}}pr-logs/pull{{else if eq .Spec.Type "batch"}}pr-logs/pull{{else}}logs{{end}}{{if eq .Spec.Type "presubmit"}}{{if .Spec.Refs}}{{if eq .Spec.Refs.Org "kubernetes"}}{{if ne .Spec.Refs.Repo "kubernetes"}}/{{.Spec.Refs.Repo}}{{end}}{{else}}/{{.Spec.Refs.Org}}_{{.Spec.Refs.Repo}}{{end}}{{end}}/{{with index .Spec.Refs.Pulls 0}}{{.Number}}{{end}}{{else if eq .Spec.Type "batch"}}/batch{{end}}/{{.Spec.Job}}/{{.Status.BuildID}}/'
      job_url_prefix_config:
        '*': http://dev-prow.mindspore.cn/view/gcs/
      pod_pending_timeout: 15m
      pod_unscheduled_timeout: 1m
      default_decoration_configs:
        '*':
          utility_images: # using the tag we identified above
            entrypoint: "gcr.io/k8s-prow/entrypoint:v20200302-c921a880e"
            clonerefs: "mindspore/clonerefs:v20200228-31c76444b"
            initupload: "mindspore/initupload:v20200228-31c76444b"
            sidecar: "mindspore/sidecar:v20200228-31c76444b"
          gcs_configuration:
            bucket: mindspore-prow-artifacts # the bucket we just made
            path_strategy: explicit
          gcs_credentials_secret: gcs-credentials

    github_reporter:
      job_types_to_report:
      - presubmit
      - postsubmit

    sinker:
      resync_period: 1m
      max_prowjob_age: 48h
      max_pod_age: 48h
      terminated_pod_ttl: 30m

    deck:
      spyglass:
        size_limit: 500000000 # 500MB
        gcs_browser_prefix: https://storage.huaweicloud.com/obs/
        testgrid_config: gs://k8s-testgrid/config
        testgrid_root: http://testgrid.k8s.io/
        lenses:
        - lens:
            name: metadata
          required_files:
          - started.json|finished.json
          optional_files:
          - podinfo.json
        - lens:
            name: buildlog
          required_files:
            - build-log.txt
        - lens:
            name: junit
          required_files:
            - artifacts/junit.*\.xml
        - lens:
            name: coverage
          required_files:
            - artifacts/filtered.cov
          optional_files:
            - artifacts/filtered.html
        - lens:
            name: podinfo
          required_files:
            - podinfo.json

    presets:
    - env:
      - name: MINDSPORE_DEPLOY_USER
        value: mindspore_ci
      - name: MINDSPORE_DEPLOY_TOKEN_PATH
        value: /etc/mindspore_deploy_token/token
      volumes:
      - name: mindspore-deploy-token
        secret:
          secretName: mindspore-deploy-token
      volumeMounts:
      - name: mindspore-deploy-token
        mountPath: /etc/mindspore_deploy_token
        readOnly: true

    presubmits:
      mindspore-ai/mindinsight:
      - name: cppcheck
        decorate: true
        always_run: true
        # skip_report: true
        skip_submodules: true
        spec:
          containers:
          - image: swr.cn-north-1.myhuaweicloud.com/mindspore/ms_check_slave:0.0.4
            securityContext:
              runAsUser: 0
            command:
            - /bin/sh
            - -c
            - |
              git clone https://github.com/mindspore-ai/infrastructure.git /tmp/mindspore-infrastructure
              /tmp/mindspore-infrastructure/production/prowjobs/mindinsight/cppcheck.sh

      - name: cpplint
        decorate: true
        always_run: true
        # skip_report: true
        skip_submodules: true
        spec:
          containers:
          - image: swr.cn-north-1.myhuaweicloud.com/mindspore/ms_check_slave:0.0.4
            securityContext:
              runAsUser: 0
            command:
            - /bin/sh
            - -c
            - |
              git clone https://github.com/mindspore-ai/infrastructure.git /tmp/mindspore-infrastructure
              /tmp/mindspore-infrastructure/production/prowjobs/mindinsight/cpplint.sh

      - name: pylint
        decorate: true
        always_run: true
        # skip_report: true
        skip_submodules: true
        spec:
          containers:
          - image: swr.cn-north-1.myhuaweicloud.com/mindspore/ms_check_slave:0.0.4
            securityContext:
              runAsUser: 0
            command:
            - /bin/sh
            - -c
            - |
              git clone https://github.com/mindspore-ai/infrastructure.git /tmp/mindspore-infrastructure
              /tmp/mindspore-infrastructure/production/prowjobs/mindinsight/pylint.sh

      - name: shellcheck
        decorate: true
        always_run: true
        # skip_report: true
        skip_submodules: true
        spec:
          containers:
          - image: swr.cn-north-1.myhuaweicloud.com/mindspore/ms_check_slave:0.0.4
            securityContext:
              runAsUser: 0
            command:
            - /bin/sh
            - -c
            - |
              git clone https://github.com/mindspore-ai/infrastructure.git /tmp/mindspore-infrastructure
              /tmp/mindspore-infrastructure/production/prowjobs/mindinsight/shellcheck.sh

      mindspore-ai/mindspore:
      - name: cppcheck
        decorate: true
        always_run: true
        # skip_report: true
        skip_submodules: true
        spec:
          containers:
          - image: swr.cn-north-1.myhuaweicloud.com/mindspore/ms_check_slave:0.0.4
            securityContext:
              runAsUser: 0
            command:
            - /bin/sh
            - -c
            - |
              git clone https://github.com/mindspore-ai/infrastructure.git /tmp/mindspore-infrastructure
              /tmp/mindspore-infrastructure/production/prowjobs/mindspore/cppcheck.sh

      - name: cpplint
        decorate: true
        always_run: true
        # skip_report: true
        skip_submodules: true
        spec:
          containers:
          - image: swr.cn-north-1.myhuaweicloud.com/mindspore/ms_check_slave:0.0.4
            securityContext:
              runAsUser: 0
            command:
            - /bin/sh
            - -c
            - |
              git clone https://github.com/mindspore-ai/infrastructure.git /tmp/mindspore-infrastructure
              /tmp/mindspore-infrastructure/production/prowjobs/mindspore/cpplint.sh

      - name: pylint
        decorate: true
        always_run: true
        # skip_report: true
        skip_submodules: true
        spec:
          containers:
          - image: swr.cn-north-1.myhuaweicloud.com/mindspore/ms_check_slave:0.0.4
            securityContext:
              runAsUser: 0
            command:
            - /bin/sh
            - -c
            - |
              git clone https://github.com/mindspore-ai/infrastructure.git /tmp/mindspore-infrastructure
              /tmp/mindspore-infrastructure/production/prowjobs/mindspore/pylint.sh

      - name: shellcheck
        decorate: true
        always_run: true
        # skip_report: true
        skip_submodules: true
        spec:
          containers:
          - image: swr.cn-north-1.myhuaweicloud.com/mindspore/ms_check_slave:0.0.4
            securityContext:
              runAsUser: 0
            command:
            - /bin/sh
            - -c
            - |
              git clone https://github.com/mindspore-ai/infrastructure.git /tmp/mindspore-infrastructure
              /tmp/mindspore-infrastructure/production/prowjobs/mindspore/shellcheck.sh

      mindspore-ai/graphengine:
      - name: cppcheck
        decorate: true
        always_run: true
        # skip_report: true
        skip_submodules: true
        spec:
          containers:
          - image: swr.cn-north-1.myhuaweicloud.com/mindspore/ms_check_slave:0.0.4
            securityContext:
              runAsUser: 0
            command:
            - /bin/sh
            - -c
            - |
              git clone https://github.com/mindspore-ai/infrastructure.git /tmp/mindspore-infrastructure
              /tmp/mindspore-infrastructure/production/prowjobs/graphengine/cppcheck.sh

      - name: cpplint
        decorate: true
        always_run: true
        # skip_report: true
        skip_submodules: true
        spec:
          containers:
          - image: swr.cn-north-1.myhuaweicloud.com/mindspore/ms_check_slave:0.0.4
            securityContext:
              runAsUser: 0
            command:
            - /bin/sh
            - -c
            - |
              git clone https://github.com/mindspore-ai/infrastructure.git /tmp/mindspore-infrastructure
              /tmp/mindspore-infrastructure/production/prowjobs/graphengine/cpplint.sh

      - name: pylint
        decorate: true
        always_run: true
        # skip_report: true
        skip_submodules: true
        spec:
          containers:
          - image: swr.cn-north-1.myhuaweicloud.com/mindspore/ms_check_slave:0.0.4
            securityContext:
              runAsUser: 0
            command:
            - /bin/sh
            - -c
            - |
              git clone https://github.com/mindspore-ai/infrastructure.git /tmp/mindspore-infrastructure
              /tmp/mindspore-infrastructure/production/prowjobs/graphengine/pylint.sh

      - name: shellcheck
        decorate: true
        always_run: true
        # skip_report: true
        skip_submodules: true
        spec:
          containers:
          - image: swr.cn-north-1.myhuaweicloud.com/mindspore/ms_check_slave:0.0.4
            securityContext:
              runAsUser: 0
            command:
            - /bin/sh
            - -c
            - |
              git clone https://github.com/mindspore-ai/infrastructure.git /tmp/mindspore-infrastructure
              /tmp/mindspore-infrastructure/production/prowjobs/graphengine/shellcheck.sh

      mindspore-ai/mindarmour:
      - name: cppcheck
        decorate: true
        always_run: true
        # skip_report: true
        skip_submodules: true
        spec:
          containers:
          - image: swr.cn-north-1.myhuaweicloud.com/mindspore/ms_check_slave:0.0.4
            securityContext:
              runAsUser: 0
            command:
            - /bin/sh
            - -c
            - |
              git clone https://github.com/mindspore-ai/infrastructure.git /tmp/mindspore-infrastructure
              /tmp/mindspore-infrastructure/production/prowjobs/mindarmour/cppcheck.sh

      - name: cpplint
        decorate: true
        always_run: true
        # skip_report: true
        skip_submodules: true
        spec:
          containers:
          - image: swr.cn-north-1.myhuaweicloud.com/mindspore/ms_check_slave:0.0.4
            securityContext:
              runAsUser: 0
            command:
            - /bin/sh
            - -c
            - |
              git clone https://github.com/mindspore-ai/infrastructure.git /tmp/mindspore-infrastructure
              /tmp/mindspore-infrastructure/production/prowjobs/mindarmour/cpplint.sh

      - name: pylint
        decorate: true
        always_run: true
        # skip_report: true
        skip_submodules: true
        spec:
          containers:
          - image: swr.cn-north-1.myhuaweicloud.com/mindspore/ms_check_slave:0.0.4
            securityContext:
              runAsUser: 0
            command:
            - /bin/sh
            - -c
            - |
              git clone https://github.com/mindspore-ai/infrastructure.git /tmp/mindspore-infrastructure
              /tmp/mindspore-infrastructure/production/prowjobs/mindarmour/pylint.sh

      - name: shellcheck
        decorate: true
        always_run: true
        # skip_report: true
        skip_submodules: true
        spec:
          containers:
          - image: swr.cn-north-1.myhuaweicloud.com/mindspore/ms_check_slave:0.0.4
            securityContext:
              runAsUser: 0
            command:
            - /bin/sh
            - -c
            - |
              git clone https://github.com/mindspore-ai/infrastructure.git /tmp/mindspore-infrastructure
              /tmp/mindspore-infrastructure/production/prowjobs/mindarmour/shellcheck.sh
