version: 1
kind: stack

requires:
  - gcp
  - kubernetes

extensions:
  include:
    - params.yaml
    - params-inference.yaml
    - params-ingress.yaml
    - params-kubeflow.yaml
    - params-db.yaml
  init:
    - gcp
  configure:
    - gcp
    - bin/configure-gke-cluster
    - bin/configure-gke-addons
    - bin/configure-oidc
    - kubernetes
    - env

components:
  - name: external-dns
    source:
      dir: components/external-dns
      git:
        remote: https://github.com/epam/hub-kubeflow-components.git
        subDir: external-dns
    hooks:
    - file: bin/externaldns-pre-deploy
      triggers: [pre-deploy] 
    depends:
    - nginx

  - name: cert-manager
    source:
      dir: components/cert-manager
      git:
        remote: https://github.com/epam/hub-kubeflow-components.git
        subDir: cert-manager
    depends:
    - nginx
    hooks:
    - file: bin/certmanager-pre-deploy
      triggers: [pre-deploy]
    - file: bin/certmanager-post-deploy
      triggers: [post-deploy]
    - file: bin/certmanager-post-undeploy
      triggers: [post-undeploy]

  - name: nginx
    source:
      dir: components/nginx
      git:
        remote: https://github.com/epam/hub-kubeflow-components.git
        subDir: nginx-ingress

  - name: istio-base
    source:
      dir: components/istio-base
      git:
        remote: https://github.com/epam/kubeflow-components.git
        subDir: istio-base

  - name: istio-discovery
    source:
      dir: components/istio-discovery
      git:
        remote: https://github.com/epam/kubeflow-components.git
        subDir: istio-discovery
    depends:
      - istio-base

  - name: istio-ingressgateway
    source:
      dir: components/istio-ingressgateway
      git:
        remote: https://github.com/epam/kubeflow-components.git
        subDir: istio-ingressgateway
    depends:
      - istio-discovery

  - name: dex
    source:
      dir: components/dex
      git:
        remote: https://github.com/epam/kubeflow-components.git
        subDir: dex

  - name: gsbucket
    source:
      dir: components/gsbucket
      git:
        remote: https://github.com/epam/google-components.git
        subDir: gsbucket
    hooks:
    - file: bin/gsbucket-pre-deploy
      triggers: [pre-deploy]   

  - name: kserve-etcd
    source:
      dir: components/etcd
      git:
        remote: https://github.com/epam/kubeflow-components.git
        subDir: etcd

  - name: argo-db
    source:
      dir: components/postgresql
      git:
        remote: https://github.com/agilestacks/kubeflow-components.git
        subDir: postgresql
        ref: develop

  - name: kubeflow-db
    source:
      dir: components/mysql
      git:
        remote: https://github.com/agilestacks/kubeflow-components.git
        subDir: mysql
        ref: develop

  - name: argo
    source:
      dir: components/argo
      git:
        remote: https://github.com/epam/kubeflow-components.git
        subDir: argo
    depends:
      - argo-db
      - gsbucket
      - dex

  - name: kubeflow-common
    source:
      dir: components/kubeflow-common
      git:
        remote: https://github.com/epam/kubeflow-components.git
        subDir: kubeflow-common
    depends:
      - dex

  - name: kubeflow-authn
    source:
      dir: components/kubeflow-authn
      git:
        remote: https://github.com/epam/kubeflow-components.git
        subDir: kubeflow-authn
    depends:
      - dex
      - kubeflow-common
      - istio-ingressgateway

  - name: kubeflow-profiles
    source:
      dir: components/kubeflow-profiles
      git:
        remote: https://github.com/epam/kubeflow-components.git
        subDir: kubeflow-profiles
    depends:
      - istio-base
      - kubeflow-authn
      - kubeflow-common

  - name: kubeflow-centraldashboard
    source:
      dir: components/kubeflow-centraldashboard
      git:
        remote: https://github.com/epam/kubeflow-components.git
        subDir: kubeflow-centraldashboard
    depends:
      - istio-ingressgateway
      - kubeflow-common
      - kubeflow-profiles

  - name: kubeflow-jupyter
    source:
      dir: components/kubeflow-jupyter
      git:
        remote: https://github.com/epam/kubeflow-components.git
        subDir: kubeflow-jupyter
    depends:
      - istio-ingressgateway
      - kubeflow-common
      - kubeflow-profiles
      - kubeflow-webhooks

  - name: kubeflow-tensorboard
    source:
      dir: components/kubeflow-tensorboard
      git:
        remote: https://github.com/epam/kubeflow-components.git
        subDir: kubeflow-tensorboard
    depends:
      - kubeflow-common
      - kubeflow-profiles
      - istio-ingressgateway

  - name: kubeflow-volumes
    source:
      dir: components/kubeflow-volumes
      git:
        remote: https://github.com/epam/kubeflow-components.git
        subDir: kubeflow-volumes
    depends:
      - kubeflow-common
      - kubeflow-profiles
      - istio-ingressgateway

  - name: kubeflow-katib
    source:
      dir: components/kubeflow-katib
      git:
        remote: https://github.com/epam/kubeflow-components.git
        subDir: kubeflow-katib
    depends:
      - kubeflow-common
      - kubeflow-db

  - name: kubeflow-metadata
    source:
      dir: components/kubeflow-metadata
      git:
        remote: https://github.com/epam/kubeflow-components.git
        subDir: kubeflow-metadata
    depends:
      - kubeflow-common
      - kubeflow-db

  - name: kubeflow-pipelines
    source:
      dir: components/kubeflow-pipeline
      git:
        remote: https://github.com/epam/kubeflow-components.git
        subDir: kubeflow-pipeline
    depends:
      - kubeflow-profiles
      - kubeflow-metadata
      - kubeflow-db
      - gsbucket

  # - name: knative
  #   source:
  #     dir: components/knative
  #     git:
  #       remote: https://github.com/epam/kubeflow-components.git
  #       subDir: knative

  # - name: kserve
  #   source:
  #     dir: components/kserve
  #     git:
  #       remote: https://github.com/epam/kubeflow-components.git
  #       subDir: kserve
  #   depends:
  #     - istio-ingressgateway
  #     - kubeflow-common
  #     - knative
  #     - kserve-etcd

  - name: kubeflow-webhooks
    source:
      dir: components/kubeflow-webhooks
      git:
        remote: https://github.com/epam/kubeflow-components.git
        subDir: kubeflow-webhooks
        ref: develop
    depends:
      - kubeflow-common

  - name: kubeflow-training-operator
    source:
      dir: components/kubeflow-training-operator
      git:
        remote: https://github.com/epam/kubeflow-components.git
        subDir: kubeflow-training-operator
    depends:
      - kubeflow-common

  - name: seldon-core-operator
    source:
      dir: components/seldon-core
      git:
        remote: https://github.com/epam/kubeflow-components.git
        subDir: seldon-core
    depends:
      - istio-ingressgateway

  - name: replikate
    source:
      dir: components/replikate
      git:
        remote: https://github.com/epam/kubeflow-stacks.git
        subDir: apps/replikate/kustomize
    depends:
      - gsbucket
      - istio-ingressgateway
      - kubeflow-pipelines
