apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
  annotations:
    build.appstudio.openshift.io/repo: https://github.com/containers/ramalama?rev={{revision}}
    build.appstudio.redhat.com/commit_sha: '{{revision}}'
    build.appstudio.redhat.com/pull_request_number: '{{pull_request_number}}'
    build.appstudio.redhat.com/target_branch: '{{target_branch}}'
    pipelinesascode.tekton.dev/cancel-in-progress: "true"
    pipelinesascode.tekton.dev/max-keep-runs: "3"
    pipelinesascode.tekton.dev/on-cel-expression: >-
      event == "pull_request" && target_branch == "main" && body.action != "ready_for_review" &&
      (
        "container-images/common/Containerfile.rag".pathChanged() ||
        "container-images/common/requirements-rag-rocm6.3.txt".pathChanged() ||
        "container-images/scripts/build_rag.sh".pathChanged() ||
        "container-images/scripts/doc2rag".pathChanged() ||
        "container-images/scripts/rag_framework".pathChanged() ||
        ".tekton/pipelines/pull-request-pipeline.yaml".pathChanged() ||
        ".tekton/rocm-rag/rocm-rag-pull-request.yaml".pathChanged()
      )
  labels:
    appstudio.openshift.io/application: ramalama
    appstudio.openshift.io/component: rocm-rag
    pipelines.appstudio.openshift.io/type: build
  name: rocm-rag-on-pull-request
  namespace: ramalama-tenant
spec:
  params:
  - name: git-url
    value: '{{source_url}}'
  - name: revision
    value: '{{revision}}'
  - name: output-image
    value: quay.io/redhat-user-workloads/ramalama-tenant/rocm-rag:on-pr-{{revision}}
  - name: image-expires-after
    value: 5d
  - name: build-platforms
    value:
    - linux-d160-c8xlarge/amd64
  - name: dockerfile
    value: container-images/common/Containerfile.rag
  - name: build-args
    value:
    - TORCH_BACKEND=rocm6.3
  pipelineRef:
    name: pull-request-pipeline
  timeouts:
    pipeline: 12h
    finally: 15m
  taskRunTemplate:
    serviceAccountName: build-pipeline-rocm-rag
  workspaces:
  - name: git-auth
    secret:
      secretName: '{{ git_auth_secret }}'
