├── llms └── llm-0001 │ ├── llm_agent │ ├── __init__.py │ ├── stop-ray-cluster.sh │ ├── start-ray-serve.sh │ ├── rag │ │ ├── __init__.py │ │ ├── service.yaml │ │ ├── utils.py │ │ ├── config.py │ │ └── embed.py │ ├── start-ray-cluster.sh │ ├── test-query-llm.py │ ├── model.py │ ├── ray-serve-test.py │ └── env-sample │ ├── argocd │ ├── argocd-ns.yaml │ └── 020-argocd-application.yaml │ └── yamls │ ├── 010-pgsql-02-cm.yaml │ ├── 010-pgsql-04-svc.yaml │ ├── 020-llm-02-serve-svc.yaml │ └── 010-pgsql-05-setup-db.yaml ├── kube_scripts ├── install-libpq-dev.sh ├── socat-argocd-server.sh ├── socat-forward-dashboard.sh ├── socat-ray-serve.sh ├── port-forward-svc-argocd.sh ├── postgres-port-forward.sh ├── pg_isready.sh ├── psql_cmd.sh ├── port-forward-svc-ray-serve.sh ├── test-db-connection.sh ├── setup-pgvector.sh ├── create-cm-llm-configs.sh ├── create-embedding-vector-table.sh ├── download-ray-docs.sh ├── create-embedding-vector-table.sql ├── test-query-llm.py └── test-query-llm.sh ├── docker-images ├── llm-runner │ ├── readme.md │ ├── Pipfile │ ├── docker-compose.yaml │ ├── Dockerfile │ └── Makefile └── cuda-llm-runner │ ├── readme.md │ ├── Pipfile │ ├── docker-compose.yaml │ ├── Makefile │ └── Dockerfile ├── local_scripts ├── install-libpq-dev.sh ├── port-forward-argocd.sh ├── socat-argocd-server.sh ├── port-forward-dashboard.sh ├── argocd-svc-port-forward.sh ├── postgres-port-forward.sh ├── pg_isready.sh ├── psql_cmd.sh ├── test-db-connection.sh ├── setup-pgvector.sh ├── create-cm-llm-configs.sh ├── create-embedding-vector-table.sh ├── download-ray-docs.sh └── create-embedding-vector-table.sql ├── .env.kube.global ├── microk8s-setup ├── core-apps │ ├── kubeflow-pipelines │ │ └── manifests │ │ │ └── kustomize │ │ │ ├── third-party │ │ │ ├── argo │ │ │ │ ├── .krmignore │ │ │ │ ├── base │ │ │ │ │ ├── params.yaml │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ └── workflow-controller-deployment-patch.yaml │ │ │ │ ├── upstream │ │ │ │ │ └── manifests │ │ │ │ │ │ ├── base │ │ │ │ │ │ ├── crds │ │ │ │ │ │ │ ├── minimal │ │ │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ │ │ │ ├── argoproj.io_workflowtemplates.yaml │ │ │ │ │ │ │ │ ├── argoproj.io_workfloweventbindings.yaml │ │ │ │ │ │ │ │ ├── argoproj.io_clusterworkflowtemplates.yaml │ │ │ │ │ │ │ │ ├── argoproj.io_cronworkflows.yaml │ │ │ │ │ │ │ │ └── argoproj.io_workflowtasksets.yaml │ │ │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ │ │ └── full │ │ │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ │ │ └── kustomization.yaml │ │ │ │ │ │ ├── argo-server │ │ │ │ │ │ │ ├── argo-server-sa.yaml │ │ │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ │ │ ├── argo-server-service.yaml │ │ │ │ │ │ │ └── argo-server-deployment.yaml │ │ │ │ │ │ ├── workflow-controller │ │ │ │ │ │ │ ├── workflow-controller-sa.yaml │ │ │ │ │ │ │ ├── workflow-controller-configmap.yaml │ │ │ │ │ │ │ ├── workflow-controller-priorityclass.yaml │ │ │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ │ │ └── workflow-controller-metrics-service.yaml │ │ │ │ │ │ └── kustomization.yaml │ │ │ │ │ │ ├── quick-start │ │ │ │ │ │ ├── sso │ │ │ │ │ │ │ ├── dex │ │ │ │ │ │ │ │ ├── dex-sa.yaml │ │ │ │ │ │ │ │ ├── dev-svc.yaml │ │ │ │ │ │ │ │ ├── dex-role.yaml │ │ │ │ │ │ │ │ ├── dex-rb.yaml │ │ │ │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ │ │ │ ├── dex-deploy.yaml │ │ │ │ │ │ │ │ └── dex-cm.yaml │ │ │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ │ │ └── overlays │ │ │ │ │ │ │ │ ├── argo-server-sa.yaml │ │ │ │ │ │ │ │ └── workflow-controller-configmap.yaml │ │ │ │ │ │ ├── base │ │ │ │ │ │ │ ├── webhooks │ │ │ │ │ │ │ │ ├── github.com-sa.yaml │ │ │ │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ │ │ │ ├── github.com-rolebinding.yaml │ │ │ │ │ │ │ │ ├── submit-workflow-template-role.yaml │ │ │ │ │ │ │ │ └── argo-workflows-webhook-clients-secret.yaml │ │ │ │ │ │ │ ├── minio │ │ │ │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ │ │ │ ├── my-minio-cred-secret.yaml │ │ │ │ │ │ │ │ ├── minio-service.yaml │ │ │ │ │ │ │ │ └── minio-deploy.yaml │ │ │ │ │ │ │ ├── argo-server-sso-secret.yaml │ │ │ │ │ │ │ ├── prometheus │ │ │ │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ │ │ │ ├── prometheus-service.yaml │ │ │ │ │ │ │ │ ├── prometheus-config-cluster.yaml │ │ │ │ │ │ │ │ └── prometheus-deployment.yaml │ │ │ │ │ │ │ ├── agent-default-rolebinding.yaml │ │ │ │ │ │ │ ├── executor-default-rolebinding.yaml │ │ │ │ │ │ │ ├── memoizer-default-rolebinding.yaml │ │ │ │ │ │ │ ├── pod-manager-default-rolebinding.yaml │ │ │ │ │ │ │ ├── workflow-default-rolebinding.yaml │ │ │ │ │ │ │ ├── executor │ │ │ │ │ │ │ │ ├── kubelet │ │ │ │ │ │ │ │ │ ├── kubelet-executor-clusterrole.yaml │ │ │ │ │ │ │ │ │ ├── kubelet-executor-default-clusterrolebinding.yaml │ │ │ │ │ │ │ │ │ └── executor-role.yaml │ │ │ │ │ │ │ │ ├── emissary │ │ │ │ │ │ │ │ │ └── executor-role.yaml │ │ │ │ │ │ │ │ ├── docker │ │ │ │ │ │ │ │ │ └── executor-role.yaml │ │ │ │ │ │ │ │ ├── pns │ │ │ │ │ │ │ │ │ └── executor-role.yaml │ │ │ │ │ │ │ │ └── k8sapi │ │ │ │ │ │ │ │ │ └── executor-role.yaml │ │ │ │ │ │ │ ├── workflow-manager-default-rolebinding.yaml │ │ │ │ │ │ │ ├── overlays │ │ │ │ │ │ │ │ └── argo-server-deployment.yaml │ │ │ │ │ │ │ ├── memoizer-role.yaml │ │ │ │ │ │ │ ├── pod-manager-role.yaml │ │ │ │ │ │ │ ├── workflow-manager-role.yaml │ │ │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ │ │ ├── agent-role.yaml │ │ │ │ │ │ │ └── artifact-repositories-configmap.yaml │ │ │ │ │ │ ├── minimal │ │ │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ │ │ └── overlays │ │ │ │ │ │ │ │ └── workflow-controller-configmap.yaml │ │ │ │ │ │ ├── mysql │ │ │ │ │ │ │ ├── argo-mysql-config-secret.yaml │ │ │ │ │ │ │ ├── mysql-service.yaml │ │ │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ │ │ ├── overlays │ │ │ │ │ │ │ │ └── workflow-controller-configmap.yaml │ │ │ │ │ │ │ └── mysql-deployment.yaml │ │ │ │ │ │ └── postgres │ │ │ │ │ │ │ ├── argo-postgres-config-secret.yaml │ │ │ │ │ │ │ ├── postgres-service.yaml │ │ │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ │ │ ├── overlays │ │ │ │ │ │ │ └── workflow-controller-configmap.yaml │ │ │ │ │ │ │ └── postgres-deployment.yaml │ │ │ │ │ │ ├── namespace-install │ │ │ │ │ │ ├── overlays │ │ │ │ │ │ │ ├── argo-server-deployment.yaml │ │ │ │ │ │ │ └── workflow-controller-deployment.yaml │ │ │ │ │ │ ├── argo-server-rbac │ │ │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ │ │ ├── argo-server-rolebinding.yaml │ │ │ │ │ │ │ └── argo-server-role.yaml │ │ │ │ │ │ ├── workflow-controller-rbac │ │ │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ │ │ └── workflow-controller-rolebinding.yaml │ │ │ │ │ │ └── kustomization.yaml │ │ │ │ │ │ ├── cluster-install │ │ │ │ │ │ ├── argo-server-rbac │ │ │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ │ │ ├── argo-server-clusterolebinding.yaml │ │ │ │ │ │ │ └── argo-server-clusterole.yaml │ │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ │ └── workflow-controller-rbac │ │ │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ │ │ ├── workflow-controller-rolebinding.yaml │ │ │ │ │ │ │ ├── workflow-controller-clusterrolebinding.yaml │ │ │ │ │ │ │ └── workflow-controller-role.yaml │ │ │ │ │ │ └── Kptfile │ │ │ │ ├── Kptfile │ │ │ │ ├── installs │ │ │ │ │ ├── cluster │ │ │ │ │ │ ├── workflow-controller-clusterrolebinding-patch.json │ │ │ │ │ │ └── kustomization.yaml │ │ │ │ │ └── namespace │ │ │ │ │ │ ├── workflow-controller-deployment-patch.json │ │ │ │ │ │ ├── cluster-scoped │ │ │ │ │ │ └── kustomization.yaml │ │ │ │ │ │ └── kustomization.yaml │ │ │ │ ├── Makefile │ │ │ │ └── README.md │ │ │ ├── grafana │ │ │ │ ├── grafana-sa.yaml │ │ │ │ ├── grafana-service.yaml │ │ │ │ ├── kustomization.yaml │ │ │ │ ├── grafana-rolebinding.yaml │ │ │ │ └── grafana-role.yaml │ │ │ ├── prometheus │ │ │ │ ├── prometheus-sa.yaml │ │ │ │ ├── prometheus-service.yaml │ │ │ │ ├── kustomization.yaml │ │ │ │ ├── prometheus-rolebinding.yaml │ │ │ │ ├── prometheus-role.yaml │ │ │ │ ├── prometheus-deployment.yaml │ │ │ │ └── prometheus-configmap.yaml │ │ │ ├── mysql │ │ │ │ ├── base │ │ │ │ │ ├── mysql-serviceaccount.yaml │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ ├── mysql-pv-claim.yaml │ │ │ │ │ ├── mysql-service.yaml │ │ │ │ │ └── mysql-deployment.yaml │ │ │ │ └── options │ │ │ │ │ └── istio │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ └── istio-authorization-policy.yaml │ │ │ ├── application │ │ │ │ ├── application-controller-sa.yaml │ │ │ │ ├── kustomization.yaml │ │ │ │ ├── application-controller-rolebinding.yaml │ │ │ │ ├── application-controller-service.yaml │ │ │ │ ├── cluster-scoped │ │ │ │ │ └── kustomization.yaml │ │ │ │ ├── application-controller-role.yaml │ │ │ │ └── application-controller-deployment.yaml │ │ │ ├── metacontroller │ │ │ │ └── base │ │ │ │ │ ├── service-account.yaml │ │ │ │ │ ├── cluster-role-binding.yaml │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ └── stateful-set.yaml │ │ │ └── minio │ │ │ │ ├── options │ │ │ │ └── istio │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ └── istio-authorization-policy.yaml │ │ │ │ └── base │ │ │ │ ├── mlpipeline-minio-artifact-secret.yaml │ │ │ │ ├── minio-pvc.yaml │ │ │ │ ├── kustomization.yaml │ │ │ │ ├── minio-service.yaml │ │ │ │ └── minio-deployment.yaml │ │ │ ├── base │ │ │ ├── metadata │ │ │ │ ├── overlays │ │ │ │ │ └── db │ │ │ │ │ │ ├── secrets.env │ │ │ │ │ │ ├── params.env │ │ │ │ │ │ ├── metadata-db-pvc.yaml │ │ │ │ │ │ ├── metadata-db-service.yaml │ │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ │ ├── patches │ │ │ │ │ │ └── metadata-grpc-deployment.yaml │ │ │ │ │ │ └── metadata-db-deployment.yaml │ │ │ │ ├── base │ │ │ │ │ ├── metadata-grpc-sa.yaml │ │ │ │ │ ├── metadata-grpc-configmap.yaml │ │ │ │ │ ├── metadata-envoy-service.yaml │ │ │ │ │ ├── metadata-grpc-service.yaml │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ └── metadata-envoy-deployment.yaml │ │ │ │ └── options │ │ │ │ │ └── istio │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ ├── destination-rule.yaml │ │ │ │ │ ├── istio-authorization-policy.yaml │ │ │ │ │ └── virtual-service.yaml │ │ │ ├── installs │ │ │ │ ├── multi-user │ │ │ │ │ ├── pipelines-profile-controller │ │ │ │ │ │ ├── params.env │ │ │ │ │ │ ├── requirements-dev.txt │ │ │ │ │ │ ├── service.yaml │ │ │ │ │ │ ├── run_tests.sh │ │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ │ └── composite-controller.yaml │ │ │ │ │ ├── params.yaml │ │ │ │ │ ├── metadata-writer │ │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ │ ├── deployment-patch.yaml │ │ │ │ │ │ ├── cluster-role-binding.yaml │ │ │ │ │ │ └── cluster-role.yaml │ │ │ │ │ ├── persistence-agent │ │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ │ ├── deployment-patch.yaml │ │ │ │ │ │ ├── cluster-role-binding.yaml │ │ │ │ │ │ └── cluster-role.yaml │ │ │ │ │ ├── viewer-controller │ │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ │ ├── cluster-role-binding.yaml │ │ │ │ │ │ ├── deployment-patch.yaml │ │ │ │ │ │ └── cluster-role.yaml │ │ │ │ │ ├── api-service │ │ │ │ │ │ ├── params.env │ │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ │ ├── cluster-role-binding.yaml │ │ │ │ │ │ ├── deployment-patch.yaml │ │ │ │ │ │ └── cluster-role.yaml │ │ │ │ │ ├── scheduled-workflow │ │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ │ ├── cluster-role-binding.yaml │ │ │ │ │ │ ├── deployment-patch.yaml │ │ │ │ │ │ └── cluster-role.yaml │ │ │ │ │ ├── cache │ │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ │ ├── deployment-patch.yaml │ │ │ │ │ │ ├── cluster-role-binding.yaml │ │ │ │ │ │ └── cluster-role.yaml │ │ │ │ │ ├── pipelines-ui │ │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ │ ├── cluster-role-binding.yaml │ │ │ │ │ │ ├── configmap-patch.yaml │ │ │ │ │ │ ├── cluster-role.yaml │ │ │ │ │ │ └── deployment-patch.yaml │ │ │ │ │ ├── virtual-service.yaml │ │ │ │ │ └── kustomization.yaml │ │ │ │ └── generic │ │ │ │ │ ├── mysql-secret.yaml │ │ │ │ │ ├── params.yaml │ │ │ │ │ └── kustomization.yaml │ │ │ ├── cache │ │ │ │ ├── cache-sa.yaml │ │ │ │ ├── cache-service.yaml │ │ │ │ ├── cache-rolebinding.yaml │ │ │ │ ├── kustomization.yaml │ │ │ │ └── cache-role.yaml │ │ │ ├── pipeline │ │ │ │ ├── ml-pipeline-ui-sa.yaml │ │ │ │ ├── pipeline-runner-sa.yaml │ │ │ │ ├── viewer-sa.yaml │ │ │ │ ├── ml-pipeline-apiserver-sa.yaml │ │ │ │ ├── ml-pipeline-persistenceagent-sa.yaml │ │ │ │ ├── container-builder-sa.yaml │ │ │ │ ├── ml-pipeline-visualization-sa.yaml │ │ │ │ ├── ml-pipeline-scheduledworkflow-sa.yaml │ │ │ │ ├── ml-pipeline-viewer-crd-sa.yaml │ │ │ │ ├── metadata-writer │ │ │ │ │ ├── metadata-writer-sa.yaml │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ ├── metadata-writer-rolebinding.yaml │ │ │ │ │ ├── metadata-writer-role.yaml │ │ │ │ │ └── metadata-writer-deployment.yaml │ │ │ │ ├── kfp-launcher-configmap.yaml │ │ │ │ ├── cluster-scoped │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ ├── viewer-crd.yaml │ │ │ │ │ └── scheduled-workflow-crd.yaml │ │ │ │ ├── ml-pipeline-ui-configmap.yaml │ │ │ │ ├── ml-pipeline-visualization-service.yaml │ │ │ │ ├── ml-pipeline-ui-service.yaml │ │ │ │ ├── pipeline-runner-rolebinding.yaml │ │ │ │ ├── ml-pipeline-apiserver-rolebinding.yaml │ │ │ │ ├── ml-pipeline-ui-rolebinding.yaml │ │ │ │ ├── ml-pipeline-scheduledworkflow-rolebinding.yaml │ │ │ │ ├── ml-pipeline-persistenceagent-rolebinding.yaml │ │ │ │ ├── ml-pipeline-viewer-crd-rolebinding.yaml │ │ │ │ ├── ml-pipeline-persistenceagent-role.yaml │ │ │ │ ├── ml-pipeline-apiserver-service.yaml │ │ │ │ ├── ml-pipeline-viewer-crd-role.yaml │ │ │ │ ├── ml-pipeline-ui-role.yaml │ │ │ │ ├── ml-pipeline-scheduledworkflow-role.yaml │ │ │ │ ├── ml-pipeline-viewer-crd-deployment.yaml │ │ │ │ ├── ml-pipeline-apiserver-role.yaml │ │ │ │ ├── ml-pipeline-scheduledworkflow-deployment.yaml │ │ │ │ ├── ml-pipeline-persistenceagent-deployment.yaml │ │ │ │ └── pipeline-runner-role.yaml │ │ │ ├── application │ │ │ │ └── kustomization.yaml │ │ │ └── cache-deployer │ │ │ │ ├── cluster-scoped │ │ │ │ ├── cache-deployer-sa.yaml │ │ │ │ ├── kustomization.yaml │ │ │ │ ├── cache-deployer-clusterrolebinding.yaml │ │ │ │ └── cache-deployer-clusterrole.yaml │ │ │ │ ├── kustomization.yaml │ │ │ │ ├── cache-deployer-role.yaml │ │ │ │ ├── cache-deployer-rolebinding.yaml │ │ │ │ └── cache-deployer-deployment.yaml │ │ │ └── cluster-scoped-resources │ │ │ ├── namespace.yaml │ │ │ ├── params.yaml │ │ │ └── kustomization.yaml │ ├── kubeflow-notebook-controller │ │ └── apps │ │ │ └── jupyter │ │ │ └── notebook-controller │ │ │ └── upstream │ │ │ ├── manager │ │ │ ├── service-account.yaml │ │ │ ├── kustomization.yaml │ │ │ ├── params.env │ │ │ └── service.yaml │ │ │ ├── overlays │ │ │ ├── kubeflow │ │ │ │ ├── patches │ │ │ │ │ └── remove-namespace.yaml │ │ │ │ └── kustomization.yaml │ │ │ └── standalone │ │ │ │ └── kustomization.yaml │ │ │ ├── base │ │ │ └── kustomization.yaml │ │ │ ├── samples │ │ │ ├── _v1_notebook.yaml │ │ │ ├── _v1alpha1_notebook.yaml │ │ │ └── _v1beta1_notebook.yaml │ │ │ ├── crd │ │ │ ├── patches │ │ │ │ ├── trivial_conversion_patch.yaml │ │ │ │ ├── cainjection_in_notebooks.yaml │ │ │ │ └── webhook_in_notebooks.yaml │ │ │ ├── kustomizeconfig.yaml │ │ │ └── kustomization.yaml │ │ │ ├── rbac │ │ │ ├── role_binding.yaml │ │ │ ├── auth_proxy_role_binding.yaml │ │ │ ├── leader_election_role_binding.yaml │ │ │ ├── auth_proxy_role.yaml │ │ │ ├── kustomization.yaml │ │ │ ├── auth_proxy_service.yaml │ │ │ ├── leader_election_role.yaml │ │ │ ├── role.yaml │ │ │ └── user_cluster_roles.yaml │ │ │ └── default │ │ │ ├── manager_image_patch.yaml │ │ │ ├── manager_prometheus_metrics_patch.yaml │ │ │ ├── manager_webhook_patch.yaml │ │ │ ├── webhookcainjection_patch.yaml │ │ │ └── manager_auth_proxy_patch.yaml │ ├── 020-install-kubeflow-jupyter-controller.sh │ ├── 010-install-kubeflow-pipelines.sh │ └── 000-install-argo-cd.sh └── enable-addons.sh ├── README.md ├── Pipfile └── deploy.sh /llms/llm-0001/llm_agent/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /llms/llm-0001/llm_agent/stop-ray-cluster.sh: -------------------------------------------------------------------------------- 1 | ray stop 2 | -------------------------------------------------------------------------------- /kube_scripts/install-libpq-dev.sh: -------------------------------------------------------------------------------- 1 | sudo apt-get install libpq-dev 2 | -------------------------------------------------------------------------------- /docker-images/llm-runner/readme.md: -------------------------------------------------------------------------------- 1 | check .env file for parameters 2 | -------------------------------------------------------------------------------- /local_scripts/install-libpq-dev.sh: -------------------------------------------------------------------------------- 1 | sudo apt-get install libpq-dev 2 | -------------------------------------------------------------------------------- /docker-images/cuda-llm-runner/readme.md: -------------------------------------------------------------------------------- 1 | check .env file for parameters 2 | -------------------------------------------------------------------------------- /llms/llm-0001/llm_agent/start-ray-serve.sh: -------------------------------------------------------------------------------- 1 | serve run serve_llm_agent:deployment 2 | -------------------------------------------------------------------------------- /.env.kube.global: -------------------------------------------------------------------------------- 1 | REMOTE_GIT_REPO=https://github.com/halilagin/LLMs-on-kubernetes.git 2 | -------------------------------------------------------------------------------- /kube_scripts/socat-argocd-server.sh: -------------------------------------------------------------------------------- 1 | socat TCP-LISTEN:20081,fork TCP:127.0.0.1:20080 2 | -------------------------------------------------------------------------------- /local_scripts/port-forward-argocd.sh: -------------------------------------------------------------------------------- 1 | socat TCP-LISTEN:18265,fork TCP:127.0.0.1:8265 2 | -------------------------------------------------------------------------------- /local_scripts/socat-argocd-server.sh: -------------------------------------------------------------------------------- 1 | socat TCP-LISTEN:20081,fork TCP:127.0.0.1:20080 2 | -------------------------------------------------------------------------------- /kube_scripts/socat-forward-dashboard.sh: -------------------------------------------------------------------------------- 1 | socat TCP-LISTEN:18265,fork TCP:127.0.0.1:8265 2 | -------------------------------------------------------------------------------- /local_scripts/port-forward-dashboard.sh: -------------------------------------------------------------------------------- 1 | socat TCP-LISTEN:18265,fork TCP:127.0.0.1:8265 2 | -------------------------------------------------------------------------------- /kube_scripts/socat-ray-serve.sh: -------------------------------------------------------------------------------- 1 | set -x 2 | socat TCP-LISTEN:20091,fork TCP:127.0.0.1:20090 3 | -------------------------------------------------------------------------------- /llms/llm-0001/llm_agent/rag/__init__.py: -------------------------------------------------------------------------------- 1 | from dotenv import load_dotenv 2 | 3 | load_dotenv() 4 | -------------------------------------------------------------------------------- /llms/llm-0001/argocd/argocd-ns.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Namespace 3 | metadata: 4 | name: argocd 5 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/.krmignore: -------------------------------------------------------------------------------- 1 | upstream 2 | -------------------------------------------------------------------------------- /kube_scripts/port-forward-svc-argocd.sh: -------------------------------------------------------------------------------- 1 | microk8s.kubectl port-forward -n argocd svc/argocd-server 20080:80 2 | -------------------------------------------------------------------------------- /kube_scripts/postgres-port-forward.sh: -------------------------------------------------------------------------------- 1 | microk8s.kubectl port-forward -n $1 svc/postgresdb 15432:5432 2 | 3 | -------------------------------------------------------------------------------- /local_scripts/argocd-svc-port-forward.sh: -------------------------------------------------------------------------------- 1 | microk8s.kubectl port-forward -n argocd svc/argocd-server 20080:80 2 | -------------------------------------------------------------------------------- /local_scripts/postgres-port-forward.sh: -------------------------------------------------------------------------------- 1 | microk8s.kubectl port-forward -n $1 svc/postgresdb 15432:5432 2 | 3 | -------------------------------------------------------------------------------- /kube_scripts/pg_isready.sh: -------------------------------------------------------------------------------- 1 | set -a 2 | source llms/$1/llm_agent/.env.kube 3 | pg_isready "$DB_CONNECTION_STRING" 4 | -------------------------------------------------------------------------------- /kube_scripts/psql_cmd.sh: -------------------------------------------------------------------------------- 1 | set -a 2 | source llms/$1/llm_agent/.env.kube 3 | psql "$DB_CONNECTION_STRING" -c "$@" 4 | -------------------------------------------------------------------------------- /local_scripts/pg_isready.sh: -------------------------------------------------------------------------------- 1 | set -a 2 | source llms/$1/llm_agent/.env.local 3 | pg_isready "$DB_CONNECTION_STRING" 4 | -------------------------------------------------------------------------------- /local_scripts/psql_cmd.sh: -------------------------------------------------------------------------------- 1 | set -a 2 | source "llms/$1/llm_agent/.env.local" 3 | psql $DB_CONNECTION_STRING -c "${@:2}" 4 | -------------------------------------------------------------------------------- /kube_scripts/port-forward-svc-ray-serve.sh: -------------------------------------------------------------------------------- 1 | microk8s.kubectl port-forward -n llm-0001 svc/svc-llm-0001-serve 20090:8000 2 | -------------------------------------------------------------------------------- /kube_scripts/test-db-connection.sh: -------------------------------------------------------------------------------- 1 | set -a 2 | source llms/$1/llm_agent/.env.kube 3 | psql "$DB_CONNECTION_STRING" -c "select 1 as number;" 4 | -------------------------------------------------------------------------------- /local_scripts/test-db-connection.sh: -------------------------------------------------------------------------------- 1 | set -a 2 | source llms/$1/llm_agent/.env.local 3 | psql "$DB_CONNECTION_STRING" -c "select 1 as number;" 4 | -------------------------------------------------------------------------------- /kube_scripts/setup-pgvector.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -a 3 | source llm_agent/.env.kube 4 | psql $DB_CONNECTION_STRING -c "CREATE EXTENSION vector;" 5 | -------------------------------------------------------------------------------- /local_scripts/setup-pgvector.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -a 3 | source llm_agent/.env.local 4 | psql $DB_CONNECTION_STRING -c "CREATE EXTENSION vector;" 5 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/metadata/overlays/db/secrets.env: -------------------------------------------------------------------------------- 1 | MYSQL_USER_NAME=root 2 | MYSQL_ROOT_PASSWORD=test -------------------------------------------------------------------------------- /kube_scripts/create-cm-llm-configs.sh: -------------------------------------------------------------------------------- 1 | kubectl create ns llm-configs 2 | kubectl create configmap -n llm-configs llm-0001 --from-env-file=llm_agent/.env.kube 3 | -------------------------------------------------------------------------------- /local_scripts/create-cm-llm-configs.sh: -------------------------------------------------------------------------------- 1 | kubectl create ns llm-configs 2 | kubectl create configmap -n llm-configs llm-0001 --from-env-file=llm_agent/.env.local 3 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/installs/multi-user/pipelines-profile-controller/params.env: -------------------------------------------------------------------------------- 1 | DISABLE_ISTIO_SIDECAR=false 2 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/base/params.yaml: -------------------------------------------------------------------------------- 1 | varReference: 2 | - path: data/artifactRepository 3 | kind: ConfigMap 4 | -------------------------------------------------------------------------------- /microk8s-setup/enable-addons.sh: -------------------------------------------------------------------------------- 1 | microk8s enable dns 2 | microk8s enable helm 3 | microk8s enable hostpath-storage 4 | microk8s enable gpu 5 | microk8s enable registry 6 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/metadata/overlays/db/params.env: -------------------------------------------------------------------------------- 1 | MYSQL_DATABASE=metadb 2 | MYSQL_PORT=3306 3 | MYSQL_ALLOW_EMPTY_PASSWORD=true -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/grafana/grafana-sa.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: 4 | name: grafana 5 | -------------------------------------------------------------------------------- /kube_scripts/create-embedding-vector-table.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -a 3 | source llm_agent/.env.kube 4 | set -x 5 | psql $DB_CONNECTION_STRING -f create-embedding-vector-table.sql 6 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/cache/cache-sa.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: 4 | name: kubeflow-pipelines-cache 5 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/pipeline/ml-pipeline-ui-sa.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: 4 | name: ml-pipeline-ui -------------------------------------------------------------------------------- /llms/llm-0001/llm_agent/start-ray-cluster.sh: -------------------------------------------------------------------------------- 1 | set -a 2 | source .env.kube 3 | #ray start --head --num-cpus=1 --num-gpus=1 4 | ray start --head --num-cpus=$NUM_CPUS --num-gpus=$NUM_GPUS 5 | -------------------------------------------------------------------------------- /local_scripts/create-embedding-vector-table.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -a 3 | source llm_agent/.env.local 4 | set -x 5 | psql $DB_CONNECTION_STRING -f create-embedding-vector-table.sql 6 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/installs/multi-user/pipelines-profile-controller/requirements-dev.txt: -------------------------------------------------------------------------------- 1 | pytest 2 | pytest-lazy-fixture 3 | requests 4 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/pipeline/pipeline-runner-sa.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: 4 | name: pipeline-runner 5 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/pipeline/viewer-sa.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: 4 | name: kubeflow-pipelines-viewer 5 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/prometheus/prometheus-sa.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: 4 | name: prometheus 5 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/pipeline/ml-pipeline-apiserver-sa.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: 4 | name: ml-pipeline 5 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/base/crds/minimal/README.md: -------------------------------------------------------------------------------- 1 | # Minimal CRDs 2 | 3 | These CRDs omit schema validation. 4 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/metadata/base/metadata-grpc-sa.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: 4 | name: metadata-grpc-server 5 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/mysql/base/mysql-serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: 4 | name: mysql 5 | 6 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/cluster-scoped-resources/namespace.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Namespace 3 | metadata: 4 | name: '$(kfp-cluster-scoped-namespace)' 5 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/application/application-controller-sa.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: 4 | name: application 5 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/pipeline/ml-pipeline-persistenceagent-sa.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: 4 | name: ml-pipeline-persistenceagent -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-notebook-controller/apps/jupyter/notebook-controller/upstream/manager/service-account.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: 4 | name: service-account 5 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/application/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | resources: 4 | - application.yaml 5 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/pipeline/container-builder-sa.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: 4 | name: kubeflow-pipelines-container-builder 5 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/pipeline/ml-pipeline-visualization-sa.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: 4 | name: ml-pipeline-visualizationserver 5 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/metacontroller/base/service-account.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: 4 | name: meta-controller-service 5 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/pipeline/ml-pipeline-scheduledworkflow-sa.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: 4 | name: ml-pipeline-scheduledworkflow 5 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/pipeline/ml-pipeline-viewer-crd-sa.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: 4 | name: ml-pipeline-viewer-crd-service-account 5 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/pipeline/metadata-writer/metadata-writer-sa.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: 4 | name: kubeflow-pipelines-metadata-writer 5 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/cluster-scoped-resources/params.yaml: -------------------------------------------------------------------------------- 1 | # Allow Kustomize var to replace following fields. 2 | varReference: 3 | - path: metadata/name 4 | kind: Namespace 5 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/sso/dex/dex-sa.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: # kpt-merge: /dex 4 | name: dex 5 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/cache-deployer/cluster-scoped/cache-deployer-sa.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: 4 | name: kubeflow-pipelines-cache-deployer-sa 5 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/base/crds/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | resources: 4 | - minimal 5 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/installs/generic/mysql-secret.yaml: -------------------------------------------------------------------------------- 1 | kind: Secret 2 | apiVersion: v1 3 | metadata: 4 | name: mysql-secret 5 | stringData: 6 | username: root 7 | password: "" 8 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/Kptfile: -------------------------------------------------------------------------------- 1 | apiVersion: kpt.dev/v1 2 | kind: Kptfile 3 | metadata: 4 | name: argo 5 | info: 6 | description: argo Kptfile in order to ignore upstream/ folder. 7 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/installs/multi-user/params.yaml: -------------------------------------------------------------------------------- 1 | # Allow Kustomize var to replace following fields. 2 | varReference: 3 | - path: spec/http/route/destination/host 4 | kind: VirtualService 5 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/base/argo-server/argo-server-sa.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: # kpt-merge: /argo-server 4 | name: argo-server 5 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/base/workflow-controller/workflow-controller-sa.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: # kpt-merge: /argo 4 | name: argo 5 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/namespace-install/overlays/argo-server-deployment.yaml: -------------------------------------------------------------------------------- 1 | - op: add 2 | path: /spec/template/spec/containers/0/args/- 3 | value: --namespaced 4 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/minio/options/istio/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | 4 | resources: 5 | - istio-authorization-policy.yaml 6 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/mysql/options/istio/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | 4 | resources: 5 | - istio-authorization-policy.yaml 6 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/020-install-kubeflow-jupyter-controller.sh: -------------------------------------------------------------------------------- 1 | export KUBECONFIG=./kubeconfig.kubectl.yaml 2 | kubectl apply -k package/010-preinstall/kubeflow-notebook-controller/apps/jupyter/notebook-controller/upstream/overlays/standalone 3 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/pipeline/kfp-launcher-configmap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: kfp-launcher 5 | data: 6 | defaultPipelineRoot: $(kfp-default-pipeline-root) 7 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/base/webhooks/github.com-sa.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: # kpt-merge: /github.com 4 | name: github.com 5 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-notebook-controller/apps/jupyter/notebook-controller/upstream/overlays/kubeflow/patches/remove-namespace.yaml: -------------------------------------------------------------------------------- 1 | $patch: delete 2 | apiVersion: v1 3 | kind: Namespace 4 | metadata: 5 | name: notebook-controller-system 6 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/pipeline/cluster-scoped/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | resources: 4 | - scheduled-workflow-crd.yaml 5 | - viewer-crd.yaml 6 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/namespace-install/overlays/workflow-controller-deployment.yaml: -------------------------------------------------------------------------------- 1 | - op: add 2 | path: /spec/template/spec/containers/0/args/- 3 | value: --namespaced 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | Please see the medium article [here](https://medium.com/@halilagin/auto-deploying-and-auto-scaling-llm-models-on-kubernetes-ef57f98d4905). 4 | 5 | For more details, please visit the directory `llms/llm-0001` for the `README`. 6 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/installs/multi-user/metadata-writer/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | resources: 4 | - cluster-role.yaml 5 | - cluster-role-binding.yaml 6 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/installs/multi-user/persistence-agent/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | resources: 4 | - cluster-role.yaml 5 | - cluster-role-binding.yaml 6 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/installs/multi-user/viewer-controller/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | resources: 4 | - cluster-role.yaml 5 | - cluster-role-binding.yaml 6 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/base/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | resources: 4 | - crds 5 | - workflow-controller 6 | - argo-server 7 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/installs/cluster/workflow-controller-clusterrolebinding-patch.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "op": "replace", 4 | "path": "/subjects/0/namespace", 5 | "value": "kubeflow" 6 | } 7 | ] 8 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/base/crds/full/README.md: -------------------------------------------------------------------------------- 1 | # Full CRDs 2 | 3 | These CRDs have full schema validation. As a result, they are large and probably not suitable to be used in your cluster. 4 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-notebook-controller/apps/jupyter/notebook-controller/upstream/manager/kustomization.yaml: -------------------------------------------------------------------------------- 1 | resources: 2 | - manager.yaml 3 | - service-account.yaml 4 | - service.yaml 5 | configMapGenerator: 6 | - name: config 7 | envs: 8 | - params.env 9 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/minio/base/mlpipeline-minio-artifact-secret.yaml: -------------------------------------------------------------------------------- 1 | kind: Secret 2 | apiVersion: v1 3 | metadata: 4 | name: mlpipeline-minio-artifact 5 | stringData: 6 | accesskey: minio 7 | secretkey: minio123 8 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-notebook-controller/apps/jupyter/notebook-controller/upstream/manager/params.env: -------------------------------------------------------------------------------- 1 | USE_ISTIO=true 2 | ISTIO_GATEWAY=kubeflow/kubeflow-gateway 3 | CLUSTER_DOMAIN=cluster.local 4 | ENABLE_CULLING=false 5 | CULL_IDLE_TIME=1440 6 | IDLENESS_CHECK_PERIOD=1 -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/installs/multi-user/api-service/params.env: -------------------------------------------------------------------------------- 1 | MULTIUSER=true 2 | DEFAULTPIPELINERUNNERSERVICEACCOUNT=default-editor 3 | VISUALIZATIONSERVICE_NAME=ml-pipeline-visualizationserver 4 | VISUALIZATIONSERVICE_PORT=8888 5 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/installs/namespace/workflow-controller-deployment-patch.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "op": "add", 4 | "path": "/spec/template/spec/containers/0/args/-", 5 | "value": "--namespaced" 6 | } 7 | ] 8 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/010-install-kubeflow-pipelines.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | export PIPELINE_VERSION=2.0.0 3 | kubectl apply -k kubeflow-pipelines/manifests/kustomize/cluster-scoped-resources 4 | kubectl apply -k kubeflow-pipelines/manifests/kustomize/env/platform-agnostic 5 | 6 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/cache/cache-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: cache-server 5 | spec: 6 | selector: 7 | app: cache-server 8 | ports: 9 | - port: 443 10 | targetPort: webhook-api -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/installs/multi-user/scheduled-workflow/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | namespace: kubeflow 4 | resources: 5 | - cluster-role.yaml 6 | - cluster-role-binding.yaml 7 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/installs/multi-user/cache/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | commonLabels: 4 | app: cache-server 5 | resources: 6 | - cluster-role.yaml 7 | - cluster-role-binding.yaml 8 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/metadata/options/istio/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | 4 | resources: 5 | - istio-authorization-policy.yaml 6 | - destination-rule.yaml 7 | - virtual-service.yaml 8 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/base/workflow-controller/workflow-controller-configmap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: # kpt-merge: /workflow-controller-configmap 4 | name: workflow-controller-configmap 5 | -------------------------------------------------------------------------------- /kube_scripts/download-ray-docs.sh: -------------------------------------------------------------------------------- 1 | export EFS_DIR=/tmp/raydocs 2 | rm -rf $EFS_DIR && mkdir -p $EFS_DIR 3 | wget --quiet https://github.com/meddash-cloud/meddash-public-datasets/raw/main/archives/docs.ray.io.tar.gz -P $EFS_DIR 4 | cd $EFS_DIR && tar xzf docs.ray.io.tar.gz && rm docs.ray.io.tar.gz 5 | -------------------------------------------------------------------------------- /local_scripts/download-ray-docs.sh: -------------------------------------------------------------------------------- 1 | export EFS_DIR=/tmp/raydocs 2 | rm -rf $EFS_DIR && mkdir -p $EFS_DIR 3 | wget --quiet https://github.com/meddash-cloud/meddash-public-datasets/raw/main/archives/docs.ray.io.tar.gz -P $EFS_DIR 4 | cd $EFS_DIR && tar xzf docs.ray.io.tar.gz && rm docs.ray.io.tar.gz 5 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/namespace-install/argo-server-rbac/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | resources: 4 | - argo-server-role.yaml 5 | - argo-server-rolebinding.yaml 6 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/mysql/base/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | 4 | resources: 5 | - mysql-deployment.yaml 6 | - mysql-pv-claim.yaml 7 | - mysql-service.yaml 8 | - mysql-serviceaccount.yaml 9 | -------------------------------------------------------------------------------- /kube_scripts/create-embedding-vector-table.sql: -------------------------------------------------------------------------------- 1 | CREATE EXTENSION IF NOT EXISTS vector; 2 | CREATE TABLE IF NOT EXISTS document ( 3 | id serial primary key, 4 | "text" text not null, 5 | source text not null, 6 | embedding vector(768) 7 | ); 8 | 9 | SELECT count(*) FROM document; 10 | -------------------------------------------------------------------------------- /kube_scripts/test-query-llm.py: -------------------------------------------------------------------------------- 1 | import requests 2 | import json 3 | 4 | params = {"query": "What is the default batch size for map_batches?"} 5 | response = requests.post("http://127.0.0.1:20091/query", params=params) 6 | #print(response.json()) 7 | print(response.status_code) 8 | print(response.content) 9 | -------------------------------------------------------------------------------- /local_scripts/create-embedding-vector-table.sql: -------------------------------------------------------------------------------- 1 | CREATE EXTENSION IF NOT EXISTS vector; 2 | CREATE TABLE IF NOT EXISTS document ( 3 | id serial primary key, 4 | "text" text not null, 5 | source text not null, 6 | embedding vector(768) 7 | ); 8 | 9 | SELECT count(*) FROM document; 10 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/base/argo-server/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | resources: 4 | - argo-server-deployment.yaml 5 | - argo-server-sa.yaml 6 | - argo-server-service.yaml 7 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/cluster-install/argo-server-rbac/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | resources: 4 | - argo-server-clusterole.yaml 5 | - argo-server-clusterolebinding.yaml 6 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/cluster-install/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | resources: 4 | - ../base 5 | - ./workflow-controller-rbac 6 | - ./argo-server-rbac 7 | namespace: argo 8 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/minio/base/minio-pvc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | name: minio-pvc 5 | spec: 6 | accessModes: 7 | - ReadWriteOnce 8 | resources: 9 | requests: 10 | storage: 20Gi 11 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/base/minio/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | resources: 4 | - minio-deploy.yaml 5 | - minio-service.yaml 6 | - my-minio-cred-secret.yaml 7 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/minio/base/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | 4 | resources: 5 | - minio-deployment.yaml 6 | - minio-pvc.yaml 7 | - minio-service.yaml 8 | - mlpipeline-minio-artifact-secret.yaml 9 | -------------------------------------------------------------------------------- /llms/llm-0001/llm_agent/test-query-llm.py: -------------------------------------------------------------------------------- 1 | import requests 2 | import json 3 | 4 | params = {"query": "What is the default batch size for map_batches?"} 5 | response = requests.post("http://127.0.0.1:20091/query", params=params) 6 | #print(response.json()) 7 | print(response.status_code) 8 | print(response.content) 9 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/base/workflow-controller/workflow-controller-priorityclass.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: scheduling.k8s.io/v1 2 | kind: PriorityClass 3 | metadata: # kpt-merge: /workflow-controller 4 | name: workflow-controller 5 | value: 1000000 6 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/minimal/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | resources: 4 | - ../base 5 | patchesStrategicMerge: 6 | - overlays/workflow-controller-configmap.yaml 7 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/sso/dex/dev-svc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: # kpt-merge: /dex 4 | name: dex 5 | spec: 6 | ports: 7 | - name: http 8 | port: 5556 9 | selector: 10 | app: dex 11 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/mysql/base/mysql-pv-claim.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | name: mysql-pv-claim 5 | spec: 6 | accessModes: 7 | - ReadWriteOnce 8 | resources: 9 | requests: 10 | storage: 20Gi 11 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/metadata/overlays/db/metadata-db-pvc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | name: metadata-mysql 5 | spec: 6 | accessModes: 7 | - ReadWriteOnce 8 | resources: 9 | requests: 10 | storage: 10Gi 11 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/namespace-install/workflow-controller-rbac/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | resources: 4 | - workflow-controller-role.yaml 5 | - workflow-controller-rolebinding.yaml 6 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/installs/multi-user/pipelines-ui/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | namespace: kubeflow 4 | commonLabels: 5 | app: ml-pipeline-ui 6 | resources: 7 | - cluster-role.yaml 8 | - cluster-role-binding.yaml 9 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/minio/base/minio-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: minio-service 5 | spec: 6 | ports: 7 | - name: http 8 | port: 9000 9 | protocol: TCP 10 | targetPort: 9000 11 | selector: 12 | app: minio 13 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/base/argo-server-sso-secret.yaml: -------------------------------------------------------------------------------- 1 | kind: Secret 2 | apiVersion: v1 3 | metadata: # kpt-merge: /argo-server-sso 4 | name: argo-server-sso 5 | stringData: 6 | clientID: argo-server 7 | clientSecret: ZXhhbXBsZS1hcHAtc2VjcmV0 8 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/base/prometheus/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | resources: 4 | - prometheus-deployment.yaml 5 | - prometheus-config-cluster.yaml 6 | - prometheus-service.yaml 7 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/installs/multi-user/pipelines-profile-controller/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: kubeflow-pipelines-profile-controller 5 | spec: 6 | ports: 7 | - name: http 8 | port: 80 9 | protocol: TCP 10 | targetPort: 8080 11 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/installs/namespace/cluster-scoped/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | bases: 4 | # Minimal CRDs omit schema validation, recommended for production cluster. 5 | - ../../../upstream/manifests/base/crds/minimal 6 | -------------------------------------------------------------------------------- /llms/llm-0001/llm_agent/model.py: -------------------------------------------------------------------------------- 1 | import dataclasses 2 | from dataclasses import dataclass 3 | from typing import List, Dict 4 | 5 | 6 | 7 | 8 | 9 | @dataclass 10 | class Query: 11 | query: str 12 | 13 | 14 | @dataclass 15 | class Answer: 16 | question: str 17 | sources: List[str] 18 | answer: str 19 | llm: str 20 | 21 | 22 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/installs/multi-user/api-service/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | resources: 4 | - cluster-role-binding.yaml 5 | - cluster-role.yaml 6 | configMapGenerator: 7 | - name: pipeline-api-server-config 8 | envs: 9 | - params.env 10 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/sso/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | resources: 4 | - ../base 5 | - dex 6 | patchesStrategicMerge: 7 | - overlays/workflow-controller-configmap.yaml 8 | - overlays/argo-server-sa.yaml 9 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/metadata/base/metadata-grpc-configmap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: metadata-grpc-configmap 5 | labels: 6 | component: metadata-grpc-server 7 | data: 8 | METADATA_GRPC_SERVICE_HOST: "metadata-grpc-service" 9 | METADATA_GRPC_SERVICE_PORT: "8080" 10 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/base/prometheus/prometheus-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: # kpt-merge: /prometheus 4 | name: prometheus 5 | spec: 6 | selector: 7 | app: prometheus 8 | ports: 9 | - name: metrics 10 | port: 9090 11 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/000-install-argo-cd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | helm repo add argo https://argoproj.github.io/argo-helm && helm repo update 3 | helm install --repo https://argoproj.github.io/argo-helm -f argocd-chart-values.yaml --create-namespace --namespace argocd argocd argo-cd --version 5.21.0 --set "configs.cm.application\.resourceTrackingMethod=annotation" --wait 4 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/metadata/options/istio/destination-rule.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: DestinationRule 3 | metadata: 4 | name: metadata-grpc-service 5 | spec: 6 | host: metadata-grpc-service.kubeflow.svc.cluster.local 7 | trafficPolicy: 8 | tls: 9 | mode: ISTIO_MUTUAL 10 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/pipeline/ml-pipeline-ui-configmap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: ml-pipeline-ui-configmap 5 | data: 6 | viewer-pod-template.json: |- 7 | { 8 | "spec": { 9 | "serviceAccountName": "kubeflow-pipelines-viewer" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/base/minio/my-minio-cred-secret.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | stringData: 3 | accesskey: admin 4 | secretkey: password 5 | kind: Secret 6 | metadata: # kpt-merge: /my-minio-cred 7 | name: my-minio-cred 8 | labels: 9 | app: minio 10 | type: Opaque 11 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/grafana/grafana-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | labels: 5 | app: grafana 6 | name: grafana 7 | spec: 8 | selector: 9 | app: grafana 10 | ports: 11 | - name: grafanaui 12 | protocol: TCP 13 | port: 3000 14 | targetPort: 3000 15 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/mysql/argo-mysql-config-secret.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | stringData: 3 | username: mysql 4 | password: password 5 | kind: Secret 6 | metadata: # kpt-merge: /argo-mysql-config 7 | name: argo-mysql-config 8 | labels: 9 | app: mysql 10 | type: Opaque 11 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-notebook-controller/apps/jupyter/notebook-controller/upstream/base/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | resources: 4 | - ../default 5 | images: 6 | - name: docker.io/kubeflownotebookswg/notebook-controller 7 | newName: docker.io/kubeflownotebookswg/notebook-controller 8 | newTag: v1.7.0-rc.0 9 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/metadata/options/istio/istio-authorization-policy.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: security.istio.io/v1beta1 2 | kind: AuthorizationPolicy 3 | metadata: 4 | name: metadata-grpc-service 5 | spec: 6 | action: ALLOW 7 | selector: 8 | matchLabels: 9 | component: metadata-grpc-server 10 | rules: 11 | - {} 12 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/pipeline/ml-pipeline-visualization-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: ml-pipeline-visualizationserver 5 | spec: 6 | ports: 7 | - name: http 8 | port: 8888 9 | protocol: TCP 10 | targetPort: 8888 11 | selector: 12 | app: ml-pipeline-visualizationserver -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/base/argo-server/argo-server-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: # kpt-merge: /argo-server 4 | name: argo-server 5 | spec: 6 | selector: 7 | app: argo-server 8 | ports: 9 | - name: web 10 | port: 2746 11 | targetPort: 2746 12 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/base/webhooks/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | resources: 4 | - submit-workflow-template-role.yaml 5 | - github.com-sa.yaml 6 | - github.com-rolebinding.yaml 7 | - argo-workflows-webhook-clients-secret.yaml 8 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/prometheus/prometheus-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | labels: 5 | app: prometheus 6 | name: prometheus 7 | spec: 8 | selector: 9 | app: prometheus 10 | ports: 11 | - name: promui 12 | protocol: TCP 13 | port: 9090 14 | targetPort: 9090 15 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/metadata/overlays/db/metadata-db-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: metadata-db 5 | labels: 6 | component: db 7 | spec: 8 | type: ClusterIP 9 | ports: 10 | - port: 3306 11 | protocol: TCP 12 | name: dbapi 13 | selector: 14 | component: db 15 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/pipeline/ml-pipeline-ui-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | labels: 5 | app: ml-pipeline-ui 6 | name: ml-pipeline-ui 7 | spec: 8 | ports: 9 | - name: http 10 | protocol: TCP 11 | port: 80 12 | targetPort: 3000 13 | selector: 14 | app: ml-pipeline-ui 15 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-notebook-controller/apps/jupyter/notebook-controller/upstream/overlays/standalone/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | resources: 4 | - ../../base 5 | namespace: notebook-controller-system 6 | configMapGenerator: 7 | - name: config 8 | behavior: merge 9 | literals: 10 | - USE_ISTIO=false 11 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-notebook-controller/apps/jupyter/notebook-controller/upstream/samples/_v1_notebook.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: kubeflow.org/v1 3 | kind: Notebook 4 | metadata: 5 | name: notebook-sample-v1 6 | spec: 7 | template: 8 | spec: 9 | containers: 10 | - name: notebook-sample-v1 11 | image: kubeflownotebookswg/jupyter:latest 12 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/installs/generic/params.yaml: -------------------------------------------------------------------------------- 1 | # Allow Kustomize var to replace following fields. 2 | varReference: 3 | - path: data/config 4 | kind: ConfigMap 5 | - path: data/defaultPipelineRoot 6 | kind: ConfigMap 7 | - path: metadata/name 8 | kind: Application 9 | - path: spec/descriptor/version 10 | kind: Application 11 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-notebook-controller/apps/jupyter/notebook-controller/upstream/crd/patches/trivial_conversion_patch.yaml: -------------------------------------------------------------------------------- 1 | 2 | apiVersion: apiextensions.k8s.io/v1 3 | kind: CustomResourceDefinition 4 | metadata: 5 | name: notebooks.kubeflow.org 6 | spec: 7 | preserveUnknownFields: false # TODO: Remove in Kubeflow 1.7 release 8 | conversion: 9 | strategy: None 10 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/mysql/mysql-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: # kpt-merge: /mysql 4 | name: mysql 5 | labels: 6 | app: mysql 7 | spec: 8 | selector: 9 | app: mysql 10 | ports: 11 | - protocol: TCP 12 | port: 3306 13 | targetPort: 3306 14 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/postgres/argo-postgres-config-secret.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | stringData: 3 | username: postgres 4 | password: password 5 | kind: Secret 6 | metadata: # kpt-merge: /argo-postgres-config 7 | name: argo-postgres-config 8 | labels: 9 | app: postgres 10 | type: Opaque 11 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/sso/dex/dex-role.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: Role 3 | metadata: # kpt-merge: /dex 4 | name: dex 5 | rules: 6 | - apiGroups: 7 | - "" 8 | resources: 9 | - secrets 10 | - configmaps 11 | verbs: 12 | - get 13 | - list 14 | - watch 15 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/grafana/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | resources: 4 | - grafana-deployment.yaml 5 | - grafana-service.yaml 6 | - grafana-role.yaml 7 | - grafana-sa.yaml 8 | - grafana-rolebinding.yaml 9 | images: 10 | - name: grafana/grafana 11 | newTag: 5.3.4 12 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-notebook-controller/apps/jupyter/notebook-controller/upstream/rbac/role_binding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: ClusterRoleBinding 3 | metadata: 4 | name: role-binding 5 | roleRef: 6 | apiGroup: rbac.authorization.k8s.io 7 | kind: ClusterRole 8 | name: role 9 | subjects: 10 | - kind: ServiceAccount 11 | name: service-account 12 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/pipeline/pipeline-runner-rolebinding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: RoleBinding 3 | metadata: 4 | name: pipeline-runner-binding 5 | roleRef: 6 | apiGroup: rbac.authorization.k8s.io 7 | kind: Role 8 | name: pipeline-runner 9 | subjects: 10 | - kind: ServiceAccount 11 | name: pipeline-runner 12 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/base/minio/minio-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: # kpt-merge: /minio 4 | name: minio 5 | labels: 6 | app: minio 7 | spec: 8 | selector: 9 | app: minio 10 | ports: 11 | - protocol: TCP 12 | port: 9000 13 | targetPort: 9000 14 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/minimal/overlays/workflow-controller-configmap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | data: 3 | retentionPolicy: | 4 | completed: 10 5 | failed: 3 6 | errored: 3 7 | kind: ConfigMap 8 | metadata: # kpt-merge: /workflow-controller-configmap 9 | name: workflow-controller-configmap 10 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/sso/dex/dex-rb.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: RoleBinding 3 | metadata: # kpt-merge: /dex 4 | name: dex 5 | roleRef: 6 | apiGroup: rbac.authorization.k8s.io 7 | kind: Role 8 | name: dex 9 | subjects: 10 | - kind: ServiceAccount 11 | name: dex 12 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/mysql/base/mysql-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: mysql 5 | spec: 6 | ports: 7 | - # We cannot have name: mysql here, because some requests through istio fail with it. 8 | port: 3306 9 | protocol: TCP 10 | targetPort: 3306 11 | selector: 12 | app: mysql 13 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-notebook-controller/apps/jupyter/notebook-controller/upstream/samples/_v1alpha1_notebook.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: kubeflow.org/v1alpha1 3 | kind: Notebook 4 | metadata: 5 | name: notebook-sample-v1alpha1 6 | spec: 7 | template: 8 | spec: 9 | containers: 10 | - name: notebook-sample-v1 11 | image: kubeflownotebookswg/jupyter:latest 12 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-notebook-controller/apps/jupyter/notebook-controller/upstream/samples/_v1beta1_notebook.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: kubeflow.org/v1beta1 3 | kind: Notebook 4 | metadata: 5 | name: notebook-sample-v1beta1 6 | spec: 7 | template: 8 | spec: 9 | containers: 10 | - name: notebook-sample-v1 11 | image: kubeflownotebookswg/jupyter:latest 12 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/metadata/base/metadata-envoy-service.yaml: -------------------------------------------------------------------------------- 1 | kind: Service 2 | apiVersion: v1 3 | metadata: 4 | labels: 5 | app: metadata-envoy 6 | name: metadata-envoy-service 7 | spec: 8 | selector: 9 | component: metadata-envoy 10 | type: ClusterIP 11 | ports: 12 | - port: 9090 13 | protocol: TCP 14 | name: md-envoy 15 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/metadata/base/metadata-grpc-service.yaml: -------------------------------------------------------------------------------- 1 | kind: Service 2 | apiVersion: v1 3 | metadata: 4 | labels: 5 | app: metadata 6 | name: metadata-grpc-service 7 | spec: 8 | selector: 9 | component: metadata-grpc-server 10 | type: ClusterIP 11 | ports: 12 | - port: 8080 13 | protocol: TCP 14 | name: grpc-api 15 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/grafana/grafana-rolebinding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: RoleBinding 3 | metadata: 4 | labels: 5 | app: grafana 6 | name: grafana 7 | roleRef: 8 | apiGroup: rbac.authorization.k8s.io 9 | kind: Role 10 | name: grafana 11 | subjects: 12 | - kind: ServiceAccount 13 | name: grafana 14 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/installs/multi-user/api-service/cluster-role-binding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: ClusterRoleBinding 3 | metadata: 4 | name: ml-pipeline 5 | roleRef: 6 | apiGroup: rbac.authorization.k8s.io 7 | kind: ClusterRole 8 | name: ml-pipeline 9 | subjects: 10 | - kind: ServiceAccount 11 | name: ml-pipeline 12 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/installs/multi-user/cache/deployment-patch.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: cache-server 5 | spec: 6 | template: 7 | spec: 8 | containers: 9 | - name: server 10 | env: 11 | - name: NAMESPACE_TO_WATCH 12 | value: '' 13 | valueFrom: null 14 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/installs/multi-user/pipelines-profile-controller/run_tests.sh: -------------------------------------------------------------------------------- 1 | # Build venv with required packages 2 | VENV=".venv" 3 | PYTHON_VENV="${VENV}/bin/python" 4 | python -m venv $VENV 5 | $PYTHON_VENV -m pip install -U pip 6 | $PYTHON_VENV -m pip install -r requirements-dev.txt 7 | 8 | # Run tests 9 | $PYTHON_VENV -m pytest ./test_sync.py 10 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/cache/cache-rolebinding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: RoleBinding 3 | metadata: 4 | name: kubeflow-pipelines-cache-binding 5 | roleRef: 6 | apiGroup: rbac.authorization.k8s.io 7 | kind: Role 8 | name: kubeflow-pipelines-cache-role 9 | subjects: 10 | - kind: ServiceAccount 11 | name: kubeflow-pipelines-cache -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/installs/multi-user/metadata-writer/deployment-patch.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: metadata-writer 5 | spec: 6 | template: 7 | spec: 8 | containers: 9 | - name: main 10 | env: 11 | - name: NAMESPACE_TO_WATCH 12 | value: '' 13 | valueFrom: null 14 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/mysql/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | resources: 4 | - ../base 5 | - argo-mysql-config-secret.yaml 6 | - mysql-deployment.yaml 7 | - mysql-service.yaml 8 | patchesStrategicMerge: 9 | - overlays/workflow-controller-configmap.yaml 10 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/postgres/postgres-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: # kpt-merge: /postgres 4 | name: postgres 5 | labels: 6 | app: postgres 7 | spec: 8 | selector: 9 | app: postgres 10 | ports: 11 | - protocol: TCP 12 | port: 5432 13 | targetPort: 5432 14 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/sso/dex/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | commonLabels: 4 | "app.kubernetes.io/part-of": "dex" 5 | resources: 6 | - dex-cm.yaml 7 | - dex-role.yaml 8 | - dex-sa.yaml 9 | - dex-rb.yaml 10 | - dex-deploy.yaml 11 | - dev-svc.yaml 12 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/installs/multi-user/pipelines-ui/cluster-role-binding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: ClusterRoleBinding 3 | metadata: 4 | name: ml-pipeline-ui 5 | roleRef: 6 | apiGroup: rbac.authorization.k8s.io 7 | kind: ClusterRole 8 | name: ml-pipeline-ui 9 | subjects: 10 | - kind: ServiceAccount 11 | name: ml-pipeline-ui 12 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/application/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | 4 | resources: 5 | - application-controller-deployment.yaml 6 | - application-controller-role.yaml 7 | - application-controller-rolebinding.yaml 8 | - application-controller-sa.yaml 9 | - application-controller-service.yaml 10 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/sso/overlays/argo-server-sa.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: # kpt-merge: /argo-server 4 | name: argo-server 5 | annotations: 6 | workflows.argoproj.io/rbac-rule: "'authors' in groups && email == 'kilgore@kilgore.trout'" 7 | workflows.argoproj.io/rbac-rule-precedence: "1" 8 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/prometheus/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | resources: 4 | - prometheus-configmap.yaml 5 | - prometheus-sa.yaml 6 | - prometheus-role.yaml 7 | - prometheus-rolebinding.yaml 8 | - prometheus-service.yaml 9 | - prometheus-deployment.yaml 10 | images: 11 | - name: prom/prometheus 12 | -------------------------------------------------------------------------------- /llms/llm-0001/llm_agent/rag/service.yaml: -------------------------------------------------------------------------------- 1 | name: "ray-assistant-public" 2 | cluster_env: ray-assistant 3 | config: 4 | access: 5 | use_bearer_token: False 6 | ray_serve_config: 7 | import_path: rag.serve:deployment 8 | runtime_env: 9 | working_dir: "." 10 | env_vars: 11 | RAY_ASSISTANT_SECRET: "ray-assistant-prod" 12 | RAY_ASSISTANT_LOGS: "/mnt/shared_storage/ray-assistant-logs/info.log" 13 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-notebook-controller/apps/jupyter/notebook-controller/upstream/rbac/auth_proxy_role_binding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: ClusterRoleBinding 3 | metadata: 4 | name: proxy-rolebinding 5 | roleRef: 6 | apiGroup: rbac.authorization.k8s.io 7 | kind: ClusterRole 8 | name: proxy-role 9 | subjects: 10 | - kind: ServiceAccount 11 | name: service-account 12 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/pipeline/ml-pipeline-apiserver-rolebinding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: RoleBinding 3 | metadata: 4 | labels: 5 | app: ml-pipeline 6 | name: ml-pipeline 7 | roleRef: 8 | apiGroup: rbac.authorization.k8s.io 9 | kind: Role 10 | name: ml-pipeline 11 | subjects: 12 | - kind: ServiceAccount 13 | name: ml-pipeline -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/prometheus/prometheus-rolebinding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: RoleBinding 3 | metadata: 4 | labels: 5 | app: prometheus 6 | name: prometheus 7 | roleRef: 8 | apiGroup: rbac.authorization.k8s.io 9 | kind: Role 10 | name: prometheus 11 | subjects: 12 | - kind: ServiceAccount 13 | name: prometheus 14 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-notebook-controller/apps/jupyter/notebook-controller/upstream/manager/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | labels: 5 | app: notebook-controller 6 | kustomize.component: notebook-controller 7 | name: service 8 | spec: 9 | ports: 10 | - port: 443 11 | selector: 12 | app: notebook-controller 13 | kustomize.component: notebook-controller 14 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/postgres/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | resources: 4 | - ../base 5 | - argo-postgres-config-secret.yaml 6 | - postgres-deployment.yaml 7 | - postgres-service.yaml 8 | patchesStrategicMerge: 9 | - overlays/workflow-controller-configmap.yaml 10 | -------------------------------------------------------------------------------- /kube_scripts/test-query-llm.sh: -------------------------------------------------------------------------------- 1 | URL='http://127.0.0.1:20091/query?query="What is the default batch size for map_batches?"' 2 | #response = requests.post("http://127.0.0.1:20091/query", params=params) 3 | 4 | 5 | # Set the query parameter 6 | query="What is the default batch size for map_batches?" 7 | 8 | # Make a POST request to the query endpoint 9 | curl -X POST $URL \ 10 | -H "Content-Type: application/json" 11 | 12 | 13 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-notebook-controller/apps/jupyter/notebook-controller/upstream/rbac/leader_election_role_binding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: RoleBinding 3 | metadata: 4 | name: leader-election-rolebinding 5 | roleRef: 6 | apiGroup: rbac.authorization.k8s.io 7 | kind: Role 8 | name: leader-election-role 9 | subjects: 10 | - kind: ServiceAccount 11 | name: service-account 12 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/cache-deployer/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | resources: 4 | - cache-deployer-role.yaml 5 | - cache-deployer-rolebinding.yaml 6 | - cache-deployer-deployment.yaml 7 | commonLabels: 8 | app: cache-deployer 9 | images: 10 | - name: gcr.io/ml-pipeline/cache-deployer 11 | newTag: 1.8.5 12 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/pipeline/metadata-writer/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | resources: 4 | - metadata-writer-deployment.yaml 5 | - metadata-writer-role.yaml 6 | - metadata-writer-rolebinding.yaml 7 | - metadata-writer-sa.yaml 8 | images: 9 | - name: gcr.io/ml-pipeline/metadata-writer 10 | newTag: 1.8.5 11 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/pipeline/ml-pipeline-ui-rolebinding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: RoleBinding 3 | metadata: 4 | labels: 5 | app: ml-pipeline-ui 6 | name: ml-pipeline-ui 7 | roleRef: 8 | apiGroup: rbac.authorization.k8s.io 9 | kind: Role 10 | name: ml-pipeline-ui 11 | subjects: 12 | - kind: ServiceAccount 13 | name: ml-pipeline-ui 14 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/application/application-controller-rolebinding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: RoleBinding 3 | metadata: 4 | name: application-manager-rolebinding 5 | roleRef: 6 | apiGroup: rbac.authorization.k8s.io 7 | kind: Role 8 | name: application-manager-role 9 | subjects: 10 | - kind: ServiceAccount 11 | name: application 12 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/base/workflow-controller/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | resources: 4 | - workflow-controller-configmap.yaml 5 | - workflow-controller-deployment.yaml 6 | - workflow-controller-sa.yaml 7 | - workflow-controller-metrics-service.yaml 8 | - workflow-controller-priorityclass.yaml 9 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-notebook-controller/apps/jupyter/notebook-controller/upstream/default/manager_image_patch.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: controller-manager 5 | namespace: system 6 | spec: 7 | template: 8 | spec: 9 | containers: 10 | # Change the value of image field below to your controller image URL 11 | - image: IMAGE_URL 12 | name: manager 13 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/cache/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | resources: 4 | - cache-deployment.yaml 5 | - cache-service.yaml 6 | - cache-role.yaml 7 | - cache-rolebinding.yaml 8 | - cache-sa.yaml 9 | commonLabels: 10 | app: cache-server 11 | images: 12 | - name: gcr.io/ml-pipeline/cache-server 13 | newTag: 1.8.5 14 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/installs/multi-user/persistence-agent/deployment-patch.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: ml-pipeline-persistenceagent 5 | spec: 6 | template: 7 | spec: 8 | containers: 9 | - name: ml-pipeline-persistenceagent 10 | env: 11 | - name: NAMESPACE 12 | value: '' 13 | valueFrom: null 14 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/base/agent-default-rolebinding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: RoleBinding 3 | metadata: # kpt-merge: /agent-default 4 | name: agent-default 5 | roleRef: 6 | apiGroup: rbac.authorization.k8s.io 7 | kind: Role 8 | name: agent 9 | subjects: 10 | - kind: ServiceAccount 11 | name: default 12 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/metacontroller/base/cluster-role-binding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: ClusterRoleBinding 3 | metadata: 4 | name: meta-controller-cluster-role-binding 5 | roleRef: 6 | apiGroup: rbac.authorization.k8s.io 7 | kind: ClusterRole 8 | name: cluster-admin 9 | subjects: 10 | - kind: ServiceAccount 11 | name: meta-controller-service 12 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/application/application-controller-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: controller-manager-service 5 | labels: 6 | control-plane: controller-manager 7 | controller-tools.k8s.io: "1.0" 8 | spec: 9 | selector: 10 | control-plane: controller-manager 11 | controller-tools.k8s.io: "1.0" 12 | ports: 13 | - port: 443 -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/cluster-install/workflow-controller-rbac/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | resources: 4 | - workflow-aggregate-roles.yaml 5 | - workflow-controller-clusterrole.yaml 6 | - workflow-controller-clusterrolebinding.yaml 7 | - workflow-controller-role.yaml 8 | - workflow-controller-rolebinding.yaml 9 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/pipeline/ml-pipeline-scheduledworkflow-rolebinding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: RoleBinding 3 | metadata: 4 | name: ml-pipeline-scheduledworkflow-binding 5 | roleRef: 6 | apiGroup: rbac.authorization.k8s.io 7 | kind: Role 8 | name: ml-pipeline-scheduledworkflow-role 9 | subjects: 10 | - kind: ServiceAccount 11 | name: ml-pipeline-scheduledworkflow -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/base/executor-default-rolebinding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: RoleBinding 3 | metadata: # kpt-merge: /executor-default 4 | name: executor-default 5 | roleRef: 6 | apiGroup: rbac.authorization.k8s.io 7 | kind: Role 8 | name: executor 9 | subjects: 10 | - kind: ServiceAccount 11 | name: default 12 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/base/memoizer-default-rolebinding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: RoleBinding 3 | metadata: # kpt-merge: /memoizer-default 4 | name: memoizer-default 5 | roleRef: 6 | apiGroup: rbac.authorization.k8s.io 7 | kind: Role 8 | name: memoizer 9 | subjects: 10 | - kind: ServiceAccount 11 | name: default 12 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-notebook-controller/apps/jupyter/notebook-controller/upstream/rbac/auth_proxy_role.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: ClusterRole 3 | metadata: 4 | name: proxy-role 5 | rules: 6 | - apiGroups: ["authentication.k8s.io"] 7 | resources: 8 | - tokenreviews 9 | verbs: ["create"] 10 | - apiGroups: ["authorization.k8s.io"] 11 | resources: 12 | - subjectaccessreviews 13 | verbs: ["create"] 14 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/installs/multi-user/cache/cluster-role-binding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: ClusterRoleBinding 3 | metadata: 4 | name: kubeflow-pipelines-cache-binding 5 | roleRef: 6 | apiGroup: rbac.authorization.k8s.io 7 | kind: ClusterRole 8 | name: kubeflow-pipelines-cache-role 9 | subjects: 10 | - kind: ServiceAccount 11 | name: kubeflow-pipelines-cache 12 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/pipeline/ml-pipeline-persistenceagent-rolebinding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: RoleBinding 3 | metadata: 4 | name: ml-pipeline-persistenceagent-binding 5 | roleRef: 6 | apiGroup: rbac.authorization.k8s.io 7 | kind: Role 8 | name: ml-pipeline-persistenceagent-role 9 | subjects: 10 | - kind: ServiceAccount 11 | name: ml-pipeline-persistenceagent 12 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/pipeline/ml-pipeline-viewer-crd-rolebinding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: RoleBinding 3 | metadata: 4 | name: ml-pipeline-viewer-crd-binding 5 | roleRef: 6 | apiGroup: rbac.authorization.k8s.io 7 | kind: Role 8 | name: ml-pipeline-viewer-controller-role 9 | subjects: 10 | - kind: ServiceAccount 11 | name: ml-pipeline-viewer-crd-service-account 12 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/cache-deployer/cache-deployer-role.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: Role 3 | metadata: 4 | labels: 5 | app: kubeflow-pipelines-cache-deployer-role 6 | name: kubeflow-pipelines-cache-deployer-role 7 | rules: 8 | - apiGroups: 9 | - "" 10 | resources: 11 | - secrets 12 | verbs: 13 | - create 14 | - delete 15 | - get 16 | - patch 17 | - list 18 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/cache-deployer/cache-deployer-rolebinding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: RoleBinding 3 | metadata: 4 | name: kubeflow-pipelines-cache-deployer-rolebinding 5 | roleRef: 6 | apiGroup: rbac.authorization.k8s.io 7 | kind: Role 8 | name: kubeflow-pipelines-cache-deployer-role 9 | subjects: 10 | - kind: ServiceAccount 11 | name: kubeflow-pipelines-cache-deployer-sa -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/base/pod-manager-default-rolebinding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: RoleBinding 3 | metadata: # kpt-merge: /pod-manager-default 4 | name: pod-manager-default 5 | roleRef: 6 | apiGroup: rbac.authorization.k8s.io 7 | kind: Role 8 | name: pod-manager 9 | subjects: 10 | - kind: ServiceAccount 11 | name: default 12 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/cluster-install/workflow-controller-rbac/workflow-controller-rolebinding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: RoleBinding 3 | metadata: # kpt-merge: /argo-binding 4 | name: argo-binding 5 | roleRef: 6 | apiGroup: rbac.authorization.k8s.io 7 | kind: Role 8 | name: argo-role 9 | subjects: 10 | - kind: ServiceAccount 11 | name: argo 12 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/namespace-install/workflow-controller-rbac/workflow-controller-rolebinding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: RoleBinding 3 | metadata: # kpt-merge: /argo-binding 4 | name: argo-binding 5 | roleRef: 6 | apiGroup: rbac.authorization.k8s.io 7 | kind: Role 8 | name: argo-role 9 | subjects: 10 | - kind: ServiceAccount 11 | name: argo 12 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/base/workflow-default-rolebinding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: RoleBinding 3 | metadata: # kpt-merge: /workflow-default-binding 4 | name: workflow-default-binding 5 | roleRef: 6 | apiGroup: rbac.authorization.k8s.io 7 | kind: Role 8 | name: workflow 9 | subjects: 10 | - kind: ServiceAccount 11 | name: default 12 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/pipeline/metadata-writer/metadata-writer-rolebinding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: RoleBinding 3 | metadata: 4 | name: kubeflow-pipelines-metadata-writer-binding 5 | roleRef: 6 | apiGroup: rbac.authorization.k8s.io 7 | kind: Role 8 | name: kubeflow-pipelines-metadata-writer-role 9 | subjects: 10 | - kind: ServiceAccount 11 | name: kubeflow-pipelines-metadata-writer -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/base/executor/kubelet/kubelet-executor-clusterrole.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: ClusterRole 3 | metadata: # kpt-merge: /kubelet-executor 4 | name: kubelet-executor 5 | rules: 6 | # This allows the kubelet executor. 7 | - apiGroups: 8 | - "" 9 | resources: 10 | - nodes/proxy 11 | verbs: 12 | - get 13 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/installs/multi-user/persistence-agent/cluster-role-binding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: ClusterRoleBinding 3 | metadata: 4 | name: ml-pipeline-persistenceagent-binding 5 | roleRef: 6 | apiGroup: rbac.authorization.k8s.io 7 | kind: ClusterRole 8 | name: ml-pipeline-persistenceagent-role 9 | subjects: 10 | - kind: ServiceAccount 11 | name: ml-pipeline-persistenceagent 12 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/namespace-install/argo-server-rbac/argo-server-rolebinding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: RoleBinding 3 | metadata: # kpt-merge: /argo-server-binding 4 | name: argo-server-binding 5 | roleRef: 6 | apiGroup: rbac.authorization.k8s.io 7 | kind: Role 8 | name: argo-server-role 9 | subjects: 10 | - kind: ServiceAccount 11 | name: argo-server 12 | -------------------------------------------------------------------------------- /llms/llm-0001/yamls/010-pgsql-02-cm.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | # Kind for kubernets ConfigMap 3 | kind: ConfigMap 4 | metadata: 5 | # Name your ConfigMap 6 | name: db-secret-credentials 7 | namespace: llm-0001 8 | labels: 9 | app: postgresdb 10 | annotations: 11 | argocd.argoproj.io/sync-wave: "2" 12 | data: 13 | # User DB 14 | POSTGRES_DB: testDB 15 | # Db user 16 | POSTGRES_USER: testUser 17 | # Db password 18 | POSTGRES_PASSWORD: testPassword 19 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-notebook-controller/apps/jupyter/notebook-controller/upstream/overlays/kubeflow/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | resources: 4 | - ../../base 5 | namespace: kubeflow 6 | patchesStrategicMerge: 7 | - patches/remove-namespace.yaml 8 | configMapGenerator: 9 | - name: config 10 | behavior: merge 11 | literals: 12 | - USE_ISTIO=true 13 | - ISTIO_GATEWAY=kubeflow/kubeflow-gateway 14 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/installs/multi-user/scheduled-workflow/cluster-role-binding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: ClusterRoleBinding 3 | metadata: 4 | name: ml-pipeline-scheduledworkflow-binding 5 | roleRef: 6 | apiGroup: rbac.authorization.k8s.io 7 | kind: ClusterRole 8 | name: ml-pipeline-scheduledworkflow-role 9 | subjects: 10 | - kind: ServiceAccount 11 | name: ml-pipeline-scheduledworkflow 12 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/installs/multi-user/viewer-controller/cluster-role-binding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: ClusterRoleBinding 3 | metadata: 4 | name: ml-pipeline-viewer-crd-binding 5 | roleRef: 6 | apiGroup: rbac.authorization.k8s.io 7 | kind: ClusterRole 8 | name: ml-pipeline-viewer-controller-role 9 | subjects: 10 | - kind: ServiceAccount 11 | name: ml-pipeline-viewer-crd-service-account 12 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/base/workflow-manager-default-rolebinding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: RoleBinding 3 | metadata: # kpt-merge: /workflow-manager-default 4 | name: workflow-manager-default 5 | roleRef: 6 | apiGroup: rbac.authorization.k8s.io 7 | kind: Role 8 | name: workflow-manager 9 | subjects: 10 | - kind: ServiceAccount 11 | name: default 12 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/metadata/base/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | resources: 4 | - metadata-grpc-configmap.yaml 5 | - metadata-grpc-deployment.yaml 6 | - metadata-grpc-service.yaml 7 | - metadata-envoy-deployment.yaml 8 | - metadata-envoy-service.yaml 9 | - metadata-grpc-sa.yaml 10 | images: 11 | - name: gcr.io/ml-pipeline/metadata-envoy 12 | newTag: 1.8.5 13 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/base/webhooks/github.com-rolebinding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: RoleBinding 3 | metadata: # kpt-merge: /github.com 4 | name: github.com 5 | roleRef: 6 | apiGroup: rbac.authorization.k8s.io 7 | kind: Role 8 | name: submit-workflow-template 9 | subjects: 10 | - kind: ServiceAccount 11 | name: github.com 12 | namespace: argo 13 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-notebook-controller/apps/jupyter/notebook-controller/upstream/crd/patches/cainjection_in_notebooks.yaml: -------------------------------------------------------------------------------- 1 | # The following patch adds a directive for certmanager to inject CA into the CRD 2 | # CRD conversion requires k8s 1.13 or later. 3 | apiVersion: apiextensions.k8s.io/v1 4 | kind: CustomResourceDefinition 5 | metadata: 6 | annotations: 7 | certmanager.k8s.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) 8 | name: notebooks.kubeflow.org 9 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/installs/multi-user/viewer-controller/deployment-patch.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: ml-pipeline-viewer-crd 5 | spec: 6 | template: 7 | spec: 8 | containers: 9 | - name: ml-pipeline-viewer-crd 10 | env: 11 | - name: NAMESPACE 12 | value: '' # Empty namespace let viewer controller watch all namespaces 13 | valueFrom: null 14 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/installs/multi-user/metadata-writer/cluster-role-binding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: ClusterRoleBinding 3 | metadata: 4 | name: kubeflow-pipelines-metadata-writer-binding 5 | roleRef: 6 | apiGroup: rbac.authorization.k8s.io 7 | kind: ClusterRole 8 | name: kubeflow-pipelines-metadata-writer-role 9 | subjects: 10 | - kind: ServiceAccount 11 | name: kubeflow-pipelines-metadata-writer 12 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/installs/multi-user/pipelines-ui/configmap-patch.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: ml-pipeline-ui-configmap 5 | data: 6 | # Temporary workarounds: 7 | # 1. Using default-editor because default-viewer isn't bound to workload identity 8 | viewer-pod-template.json: |- 9 | { 10 | "spec": { 11 | "serviceAccountName": "default-editor" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/application/cluster-scoped/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | resources: 4 | - application-crd.yaml 5 | 6 | # Update application CRD: 7 | # Copy the upstream file to application-crd.yaml of the current folder. 8 | # Upstream file: https://github.com/kubernetes-sigs/application/blob/master/config/crd/bases/app.k8s.io_applications.yaml 9 | # Keep label controller-tools.k8s.io. -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/grafana/grafana-role.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: Role 3 | metadata: 4 | labels: 5 | app: grafana 6 | name: grafana 7 | rules: 8 | - apiGroups: [""] 9 | resources: 10 | - nodes 11 | - services 12 | - endpoints 13 | - pods 14 | verbs: ["get", "list", "watch"] 15 | - apiGroups: 16 | - extensions 17 | resources: 18 | - ingresses 19 | verbs: ["get", "list", "watch"] 20 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/base/crds/full/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | resources: 4 | - argoproj.io_clusterworkflowtemplates.yaml 5 | - argoproj.io_cronworkflows.yaml 6 | - argoproj.io_workflows.yaml 7 | - argoproj.io_workflowtemplates.yaml 8 | - argoproj.io_workfloweventbindings.yaml 9 | - argoproj.io_workflowtasksets.yaml 10 | - argoproj.io_workflowtaskresults.yaml 11 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/pipeline/ml-pipeline-persistenceagent-role.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: Role 3 | metadata: 4 | name: ml-pipeline-persistenceagent-role 5 | rules: 6 | - apiGroups: 7 | - argoproj.io 8 | resources: 9 | - workflows 10 | verbs: 11 | - get 12 | - list 13 | - watch 14 | - apiGroups: 15 | - kubeflow.org 16 | resources: 17 | - scheduledworkflows 18 | verbs: 19 | - get 20 | - list 21 | - watch -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/base/crds/minimal/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | resources: 4 | - argoproj.io_clusterworkflowtemplates.yaml 5 | - argoproj.io_cronworkflows.yaml 6 | - argoproj.io_workflows.yaml 7 | - argoproj.io_workflowtemplates.yaml 8 | - argoproj.io_workfloweventbindings.yaml 9 | - argoproj.io_workflowtasksets.yaml 10 | - argoproj.io_workflowtaskresults.yaml 11 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/prometheus/prometheus-role.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: Role 3 | metadata: 4 | labels: 5 | app: prometheus 6 | name: prometheus 7 | rules: 8 | - apiGroups: [""] 9 | resources: 10 | - nodes 11 | - services 12 | - endpoints 13 | - pods 14 | verbs: ["get", "list", "watch"] 15 | - apiGroups: 16 | - extensions 17 | resources: 18 | - ingresses 19 | verbs: ["get", "list", "watch"] 20 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/cluster-install/workflow-controller-rbac/workflow-controller-clusterrolebinding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: ClusterRoleBinding 3 | metadata: # kpt-merge: /argo-binding 4 | name: argo-binding 5 | roleRef: 6 | apiGroup: rbac.authorization.k8s.io 7 | kind: ClusterRole 8 | name: argo-cluster-role 9 | subjects: 10 | - kind: ServiceAccount 11 | name: argo 12 | namespace: argo 13 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/base/prometheus/prometheus-config-cluster.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: # kpt-merge: /prometheus-config 4 | name: prometheus-config 5 | data: 6 | prometheus.yaml: | 7 | global: 8 | scrape_interval: 15s 9 | scrape_configs: 10 | - job_name: 'argo' 11 | static_configs: 12 | - targets: ['workflow-controller-metrics:9090', 'argo-server:2746'] 13 | -------------------------------------------------------------------------------- /llms/llm-0001/llm_agent/rag/utils.py: -------------------------------------------------------------------------------- 1 | import os 2 | import subprocess 3 | 4 | 5 | def get_credentials(llm): 6 | if llm.startswith("gpt"): 7 | return os.environ["OPENAI_API_BASE"], os.environ["OPENAI_API_KEY"] 8 | else: 9 | return os.environ["ANYSCALE_API_BASE"], os.environ["ANYSCALE_API_KEY"] 10 | 11 | 12 | def execute_bash(command): 13 | results = subprocess.run( 14 | command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True 15 | ) 16 | return results 17 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/installs/multi-user/persistence-agent/cluster-role.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: ClusterRole 3 | metadata: 4 | name: ml-pipeline-persistenceagent-role 5 | rules: 6 | - apiGroups: 7 | - argoproj.io 8 | resources: 9 | - workflows 10 | verbs: 11 | - get 12 | - list 13 | - watch 14 | - apiGroups: 15 | - kubeflow.org 16 | resources: 17 | - scheduledworkflows 18 | verbs: 19 | - get 20 | - list 21 | - watch 22 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/application/application-controller-role.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: Role 3 | metadata: 4 | name: application-manager-role 5 | rules: 6 | - apiGroups: 7 | - '*' 8 | resources: 9 | - '*' 10 | verbs: 11 | - get 12 | - list 13 | - update 14 | - patch 15 | - watch 16 | - apiGroups: 17 | - app.k8s.io 18 | resources: 19 | - '*' 20 | verbs: 21 | - '*' -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/base/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | 4 | bases: 5 | - ../upstream/manifests/base/workflow-controller 6 | 7 | patchesStrategicMerge: 8 | - workflow-controller-deployment-patch.yaml 9 | - workflow-controller-configmap-patch.yaml 10 | 11 | # Allow Kustomize vars to replace fields defined in params.yaml. 12 | # The vars can be defined anywhere. 13 | configurations: 14 | - params.yaml 15 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/cluster-install/argo-server-rbac/argo-server-clusterolebinding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: ClusterRoleBinding 3 | metadata: # kpt-merge: /argo-server-binding 4 | name: argo-server-binding 5 | roleRef: 6 | apiGroup: rbac.authorization.k8s.io 7 | kind: ClusterRole 8 | name: argo-server-cluster-role 9 | subjects: 10 | - kind: ServiceAccount 11 | name: argo-server 12 | namespace: argo 13 | -------------------------------------------------------------------------------- /llms/llm-0001/argocd/020-argocd-application.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: argoproj.io/v1alpha1 2 | kind: Application 3 | metadata: 4 | name: llm-0001 5 | namespace: argocd 6 | spec: 7 | destination: 8 | namespace: llm-0001 9 | server: https://kubernetes.default.svc 10 | project: default 11 | source: 12 | repoURL: https://github.com/halilagin/LLMs-on-kubernetes.git 13 | targetRevision: main 14 | path: llms/llm-0001/yamls 15 | syncPolicy: 16 | automated: {} 17 | syncOptions: 18 | - CreateNamespace=true 19 | -------------------------------------------------------------------------------- /llms/llm-0001/yamls/010-pgsql-04-svc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | # Kind for service 3 | kind: Service 4 | metadata: 5 | # Name your service 6 | name: postgresdb 7 | namespace: llm-0001 8 | labels: 9 | app: postgresdb 10 | annotations: 11 | argocd.argoproj.io/sync-wave: "4" 12 | spec: 13 | # Choose how to expose your service 14 | type: ClusterIP 15 | ports: 16 | # The port number to expose the service 17 | - port: 5432 18 | # Pod to route service traffic 19 | selector: 20 | app: postgresdb 21 | 22 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-notebook-controller/apps/jupyter/notebook-controller/upstream/rbac/kustomization.yaml: -------------------------------------------------------------------------------- 1 | resources: 2 | - role.yaml 3 | - role_binding.yaml 4 | - leader_election_role.yaml 5 | - leader_election_role_binding.yaml 6 | - user_cluster_roles.yaml 7 | # Comment the following 3 lines if you want to disable 8 | # the auth proxy (https://github.com/brancz/kube-rbac-proxy) 9 | # which protects your /metrics endpoint. 10 | # - auth_proxy_service.yaml 11 | # - auth_proxy_role.yaml 12 | # - auth_proxy_role_binding.yaml 13 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/base/executor/kubelet/kubelet-executor-default-clusterrolebinding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: ClusterRoleBinding 3 | metadata: # kpt-merge: /kubelet-executor-default 4 | name: kubelet-executor-default 5 | roleRef: 6 | apiGroup: rbac.authorization.k8s.io 7 | kind: ClusterRole 8 | name: kubelet-executor 9 | subjects: 10 | - kind: ServiceAccount 11 | name: default 12 | namespace: argo 13 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/cache-deployer/cluster-scoped/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | 4 | resources: 5 | - cache-deployer-clusterrole.yaml 6 | - cache-deployer-clusterrolebinding.yaml 7 | # HACK: although a service account(SA) is not a cluster-scoped resource. 8 | # Presence of a SA referred by a clusterrolebinding allows kustomize to auto-add 9 | # namespace for the clusterrolebinding's SA ref. 10 | - cache-deployer-sa.yaml 11 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/pipeline/ml-pipeline-apiserver-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: ml-pipeline 5 | annotations: 6 | prometheus.io/port: "8888" 7 | prometheus.io/scheme: http 8 | prometheus.io/scrape: "true" 9 | spec: 10 | ports: 11 | - name: http 12 | port: 8888 13 | protocol: TCP 14 | targetPort: 8888 15 | - name: grpc 16 | port: 8887 17 | protocol: TCP 18 | targetPort: 8887 19 | selector: 20 | app: ml-pipeline -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/base/overlays/argo-server-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: # kpt-merge: /argo-server 4 | name: argo-server 5 | spec: 6 | template: 7 | spec: 8 | containers: 9 | - name: argo-server 10 | args: 11 | - server 12 | - --namespaced 13 | - --auth-mode 14 | - server 15 | - --auth-mode 16 | - client 17 | -------------------------------------------------------------------------------- /Pipfile: -------------------------------------------------------------------------------- 1 | [[source]] 2 | url = "https://pypi.org/simple" 3 | verify_ssl = true 4 | name = "pypi" 5 | 6 | [packages] 7 | python-dotenv = "*" 8 | pyarrow = "*" 9 | langchain = "*" 10 | matplotlib = "*" 11 | bs4 = "*" 12 | tqdm = "*" 13 | sentence-transformers = "*" 14 | pandas = "*" 15 | cuda-python = "*" 16 | psycopg2-binary = "*" 17 | psycopg2 = "*" 18 | pgvector = "*" 19 | openai = "*" 20 | ipython = "*" 21 | fastapi = "*" 22 | ray = {extras = ["serve"], version = "*"} 23 | 24 | [dev-packages] 25 | 26 | [requires] 27 | python_version = "3.10" 28 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/base/memoizer-role.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: Role 3 | metadata: # kpt-merge: /memoizer 4 | name: memoizer 5 | annotations: 6 | workflows.argoproj.io/description: | 7 | Only needed if you are using ConfigMap-based cache for memoization. 8 | rules: 9 | - apiGroups: 10 | - "" 11 | resources: 12 | - configmaps 13 | verbs: 14 | - create 15 | - get 16 | - update 17 | -------------------------------------------------------------------------------- /llms/llm-0001/yamls/020-llm-02-serve-svc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | # Kind for service 3 | kind: Service 4 | metadata: 5 | # Name your service 6 | name: svc-llm-0001-serve 7 | namespace: llm-0001 8 | labels: 9 | app: llm-0001-serve 10 | annotations: 11 | argocd.argoproj.io/sync-wave: "7" 12 | spec: 13 | # Choose how to expose your service 14 | type: ClusterIP 15 | ports: 16 | # The port number to expose the service 17 | - port: 8000 18 | # Pod to route service traffic 19 | selector: 20 | app: llm-0001-serve 21 | 22 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/base/executor/emissary/executor-role.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: Role 3 | metadata: # kpt-merge: /executor 4 | name: executor 5 | annotations: 6 | workflows.argoproj.io/description: | 7 | Recomended minimum permissions for the `emissary` executor. 8 | rules: 9 | - apiGroups: 10 | - argoproj.io 11 | resources: 12 | - workflowtaskresults 13 | verbs: 14 | - create 15 | - patch 16 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/installs/multi-user/scheduled-workflow/deployment-patch.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: ml-pipeline-scheduledworkflow 5 | spec: 6 | template: 7 | spec: 8 | containers: 9 | - name: ml-pipeline-scheduledworkflow 10 | env: 11 | - name: NAMESPACE 12 | value: '' # Empty namespace let viewer controller watch all namespaces 13 | valueFrom: null # HACK: https://github.com/kubernetes-sigs/kustomize/issues/2606 14 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/cluster-install/workflow-controller-rbac/workflow-controller-role.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: Role 3 | metadata: # kpt-merge: /argo-role 4 | name: argo-role 5 | rules: 6 | - apiGroups: 7 | - coordination.k8s.io 8 | resources: 9 | - leases 10 | verbs: 11 | - create 12 | - get 13 | - update 14 | - apiGroups: 15 | - "" 16 | resources: 17 | - secrets 18 | verbs: 19 | - get 20 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/installs/multi-user/api-service/deployment-patch.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: ml-pipeline 5 | spec: 6 | template: 7 | spec: 8 | containers: 9 | - name: ml-pipeline-api-server 10 | envFrom: 11 | - configMapRef: 12 | name: pipeline-api-server-config 13 | env: 14 | - name: KUBEFLOW_USERID_HEADER 15 | value: kubeflow-userid 16 | - name: KUBEFLOW_USERID_PREFIX 17 | value: "" 18 | -------------------------------------------------------------------------------- /docker-images/cuda-llm-runner/Pipfile: -------------------------------------------------------------------------------- 1 | [[source]] 2 | url = "https://pypi.org/simple" 3 | verify_ssl = true 4 | name = "pypi" 5 | 6 | [packages] 7 | python-dotenv = "*" 8 | pyarrow = "*" 9 | langchain = "*" 10 | matplotlib = "*" 11 | bs4 = "*" 12 | tqdm = "*" 13 | sentence-transformers = "*" 14 | pandas = "*" 15 | cuda-python = "*" 16 | psycopg2-binary = "*" 17 | psycopg2 = "*" 18 | pgvector = "*" 19 | openai = "*" 20 | ipython = "*" 21 | fastapi = "*" 22 | ray = {extras = ["serve"], version = "*"} 23 | 24 | [dev-packages] 25 | 26 | [requires] 27 | python_version = "3.8" 28 | -------------------------------------------------------------------------------- /docker-images/llm-runner/Pipfile: -------------------------------------------------------------------------------- 1 | [[source]] 2 | url = "https://pypi.org/simple" 3 | verify_ssl = true 4 | name = "pypi" 5 | 6 | [packages] 7 | python-dotenv = "*" 8 | pyarrow = "*" 9 | langchain = "*" 10 | matplotlib = "*" 11 | bs4 = "*" 12 | tqdm = "*" 13 | sentence-transformers = "*" 14 | pandas = "*" 15 | cuda-python = "*" 16 | psycopg2-binary = "*" 17 | psycopg2 = "*" 18 | pgvector = "*" 19 | openai = "*" 20 | ipython = "*" 21 | fastapi = "*" 22 | ray = {extras = ["serve"], version = "*"} 23 | 24 | [dev-packages] 25 | 26 | [requires] 27 | python_version = "3.10" 28 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-notebook-controller/apps/jupyter/notebook-controller/upstream/rbac/auth_proxy_service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | annotations: 5 | prometheus.io/port: "8443" 6 | prometheus.io/scheme: https 7 | prometheus.io/scrape: "true" 8 | labels: 9 | control-plane: controller-manager 10 | name: controller-manager-metrics-service 11 | namespace: system 12 | spec: 13 | ports: 14 | - name: https 15 | port: 8443 16 | targetPort: https 17 | selector: 18 | control-plane: controller-manager 19 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/installs/multi-user/pipelines-profile-controller/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | namespace: kubeflow 4 | commonLabels: 5 | app: kubeflow-pipelines-profile-controller 6 | resources: 7 | - service.yaml 8 | - deployment.yaml 9 | - composite-controller.yaml 10 | configMapGenerator: 11 | - name: kubeflow-pipelines-profile-controller-code 12 | files: 13 | - sync.py 14 | - name: kubeflow-pipelines-profile-controller-env 15 | envs: 16 | - params.env 17 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/installs/multi-user/virtual-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: VirtualService 3 | metadata: 4 | name: ml-pipeline-ui 5 | spec: 6 | gateways: 7 | - kubeflow-gateway 8 | hosts: 9 | - '*' 10 | http: 11 | - match: 12 | - uri: 13 | prefix: /pipeline 14 | rewrite: 15 | uri: /pipeline 16 | route: 17 | - destination: 18 | host: ml-pipeline-ui.$(kfp-namespace).svc.cluster.local 19 | port: 20 | number: 80 21 | timeout: 300s 22 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/Kptfile: -------------------------------------------------------------------------------- 1 | apiVersion: kpt.dev/v1 2 | kind: Kptfile 3 | metadata: 4 | name: manifests 5 | upstream: 6 | type: git 7 | git: 8 | repo: https://github.com/argoproj/argo-workflows 9 | directory: /manifests 10 | ref: v3.3.8 11 | updateStrategy: resource-merge 12 | upstreamLock: 13 | type: git 14 | git: 15 | repo: https://github.com/argoproj/argo-workflows 16 | directory: /manifests 17 | ref: v3.3.8 18 | commit: 621b0d1a8e09634666ebe403ee7b8fc29db1dc4e 19 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/metadata/options/istio/virtual-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: VirtualService 3 | metadata: 4 | name: metadata-grpc 5 | namespace: kubeflow 6 | spec: 7 | gateways: 8 | - kubeflow-gateway 9 | hosts: 10 | - '*' 11 | http: 12 | - match: 13 | - uri: 14 | prefix: /ml_metadata 15 | rewrite: 16 | uri: /ml_metadata 17 | route: 18 | - destination: 19 | host: metadata-envoy-service.kubeflow.svc.cluster.local 20 | port: 21 | number: 9090 22 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/metacontroller/base/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | namespace: kubeflow 4 | resources: 5 | - cluster-role-binding.yaml 6 | - crd.yaml 7 | - service-account.yaml 8 | - stateful-set.yaml 9 | commonLabels: 10 | kustomize.component: metacontroller 11 | 12 | # Update metacontroller CRD: 13 | # Copy the upstream file to crd.yaml in this folder. 14 | # Upstream file: https://github.com/metacontroller/metacontroller/blob/master/manifests/production/metacontroller-crds-v1.yaml -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/cache-deployer/cluster-scoped/cache-deployer-clusterrolebinding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: ClusterRoleBinding 3 | metadata: 4 | name: kubeflow-pipelines-cache-deployer-clusterrolebinding 5 | roleRef: 6 | apiGroup: rbac.authorization.k8s.io 7 | kind: ClusterRole 8 | name: kubeflow-pipelines-cache-deployer-clusterrole 9 | subjects: 10 | - kind: ServiceAccount 11 | name: kubeflow-pipelines-cache-deployer-sa 12 | # namespace will be added by kustomize automatically according to the namespace field in kustomization.yaml 13 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/installs/multi-user/cache/cluster-role.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: ClusterRole 3 | metadata: 4 | name: kubeflow-pipelines-cache-role 5 | rules: 6 | - apiGroups: 7 | - "" 8 | resources: 9 | - pods 10 | verbs: 11 | - get 12 | - list 13 | - watch 14 | - update 15 | - patch 16 | - apiGroups: 17 | - "" 18 | resources: 19 | - configmaps 20 | verbs: 21 | - get 22 | - apiGroups: 23 | - argoproj.io 24 | resources: 25 | - workflows 26 | verbs: 27 | - get 28 | - list 29 | - watch 30 | - update 31 | - patch 32 | -------------------------------------------------------------------------------- /llms/llm-0001/llm_agent/rag/config.py: -------------------------------------------------------------------------------- 1 | 2 | from pathlib import Path 3 | 4 | # Directories 5 | EFS_DIR = Path("/tmp/raydocs") 6 | ROOT_DIR = Path(__file__).parent.parent.absolute() 7 | 8 | # Mappings 9 | EMBEDDING_DIMENSIONS = { 10 | "thenlper/gte-base": 768, 11 | "thenlper/gte-large": 1024, 12 | "BAAI/bge-large-en": 1024, 13 | "text-embedding-ada-002": 1536, 14 | } 15 | MAX_CONTEXT_LENGTHS = { 16 | "gpt-4": 8192, 17 | "gpt-3.5-turbo": 4096, 18 | "gpt-3.5-turbo-16k": 16384, 19 | "meta-llama/Llama-2-7b-chat-hf": 4096, 20 | "meta-llama/Llama-2-13b-chat-hf": 4096, 21 | "meta-llama/Llama-2-70b-chat-hf": 4096, 22 | } 23 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-notebook-controller/apps/jupyter/notebook-controller/upstream/default/manager_prometheus_metrics_patch.yaml: -------------------------------------------------------------------------------- 1 | # This patch enables Prometheus scraping for the manager pod. 2 | apiVersion: apps/v1 3 | kind: Deployment 4 | metadata: 5 | name: controller-manager 6 | namespace: system 7 | spec: 8 | template: 9 | metadata: 10 | annotations: 11 | prometheus.io/scrape: 'true' 12 | spec: 13 | containers: 14 | # Expose the prometheus metrics on default port 15 | - name: manager 16 | ports: 17 | - containerPort: 8080 18 | name: metrics 19 | protocol: TCP 20 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/pipeline/ml-pipeline-viewer-crd-role.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: Role 3 | metadata: 4 | name: ml-pipeline-viewer-controller-role 5 | rules: 6 | - apiGroups: 7 | - '*' 8 | resources: 9 | - deployments 10 | - services 11 | verbs: 12 | - create 13 | - get 14 | - list 15 | - watch 16 | - update 17 | - patch 18 | - delete 19 | - apiGroups: 20 | - kubeflow.org 21 | resources: 22 | - viewers 23 | - viewers/finalizers 24 | verbs: 25 | - create 26 | - get 27 | - list 28 | - watch 29 | - update 30 | - patch 31 | - delete 32 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-notebook-controller/apps/jupyter/notebook-controller/upstream/crd/kustomizeconfig.yaml: -------------------------------------------------------------------------------- 1 | # This file is for teaching kustomize how to substitute name and namespace reference in CRD 2 | nameReference: 3 | - kind: Service 4 | version: v1 5 | fieldSpecs: 6 | - kind: CustomResourceDefinition 7 | group: apiextensions.k8s.io 8 | path: spec/conversion/webhookClientConfig/service/name 9 | 10 | namespace: 11 | - kind: CustomResourceDefinition 12 | group: apiextensions.k8s.io 13 | path: spec/conversion/webhookClientConfig/service/namespace 14 | create: false 15 | 16 | varReference: 17 | - path: metadata/annotations 18 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/installs/multi-user/metadata-writer/cluster-role.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: ClusterRole 3 | metadata: 4 | name: kubeflow-pipelines-metadata-writer-role 5 | rules: 6 | - apiGroups: 7 | - "" 8 | resources: 9 | - pods 10 | verbs: 11 | - get 12 | - list 13 | - watch 14 | - update 15 | - patch 16 | - apiGroups: 17 | - "" 18 | resources: 19 | - configmaps 20 | verbs: 21 | - get 22 | - apiGroups: 23 | - argoproj.io 24 | resources: 25 | - workflows 26 | verbs: 27 | - get 28 | - list 29 | - watch 30 | - update 31 | - patch 32 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/cache/cache-role.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: Role 3 | metadata: 4 | labels: 5 | app: kubeflow-pipelines-cache-role 6 | name: kubeflow-pipelines-cache-role 7 | rules: 8 | - apiGroups: 9 | - "" 10 | resources: 11 | - pods 12 | verbs: 13 | - get 14 | - list 15 | - watch 16 | - update 17 | - patch 18 | - apiGroups: 19 | - "" 20 | resources: 21 | - configmaps 22 | verbs: 23 | - get 24 | - apiGroups: 25 | - argoproj.io 26 | resources: 27 | - workflows 28 | verbs: 29 | - get 30 | - list 31 | - watch 32 | - update 33 | - patch 34 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/base/executor/docker/executor-role.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: Role 3 | metadata: # kpt-merge: /executor 4 | name: executor 5 | annotations: 6 | workflows.argoproj.io/description: | 7 | Recommended minimum permissions for the `docker` executor. 8 | 9 | This executor is superseded by the `emmisary` executor, so we do not recommend you use it anymore. 10 | rules: 11 | - apiGroups: 12 | - argoproj.io 13 | resources: 14 | - workflowtaskresults 15 | verbs: 16 | - create 17 | - patch 18 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/base/executor/kubelet/executor-role.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: Role 3 | metadata: # kpt-merge: /executor 4 | name: executor 5 | annotations: 6 | workflows.argoproj.io/description: | 7 | Recommended minimum permissions for `kubelet` executor. 8 | 9 | This executor is superseded by the `emmisary` executor, so we do not recommend you use it anymore. 10 | rules: 11 | - apiGroups: 12 | - argoproj.io 13 | resources: 14 | - workflowtaskresults 15 | verbs: 16 | - create 17 | - patch 18 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/installs/multi-user/viewer-controller/cluster-role.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: ClusterRole 3 | metadata: 4 | name: ml-pipeline-viewer-controller-role 5 | rules: 6 | - apiGroups: 7 | - '*' 8 | resources: 9 | - deployments 10 | - services 11 | verbs: 12 | - create 13 | - get 14 | - list 15 | - watch 16 | - update 17 | - patch 18 | - delete 19 | - apiGroups: 20 | - kubeflow.org 21 | resources: 22 | - viewers 23 | - viewers/finalizers 24 | verbs: 25 | - create 26 | - get 27 | - list 28 | - watch 29 | - update 30 | - patch 31 | - delete 32 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/Makefile: -------------------------------------------------------------------------------- 1 | REPO_ROOT=../../../.. 2 | 3 | update: 4 | rm -rf upstream 5 | mkdir upstream 6 | kpt pkg get "https://github.com/argoproj/argo-workflows.git/manifests@$$(cat $(REPO_ROOT)/third_party/argo/VERSION)" upstream/ 7 | # Remove the pre-hydrated manifests which we do not use. 8 | rm upstream/manifests/*.yaml 9 | # Remove README.md which might be confusing here. 10 | rm upstream/manifests/README.md 11 | # Include argo license file 12 | curl -Lo upstream/manifests/LICENSE "https://raw.githubusercontent.com/argoproj/argo-workflows/$$(cat $(REPO_ROOT)/third_party/argo/VERSION)/LICENSE" 13 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/namespace-install/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | resources: 4 | - ../base 5 | - ./argo-server-rbac 6 | - ./workflow-controller-rbac 7 | patchesJson6902: 8 | - target: 9 | version: v1 10 | group: apps 11 | kind: Deployment 12 | name: workflow-controller 13 | path: ./overlays/workflow-controller-deployment.yaml 14 | - target: 15 | version: v1 16 | group: apps 17 | kind: Deployment 18 | name: argo-server 19 | path: ./overlays/argo-server-deployment.yaml 20 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-notebook-controller/apps/jupyter/notebook-controller/upstream/rbac/leader_election_role.yaml: -------------------------------------------------------------------------------- 1 | # permissions to do leader election. 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | kind: Role 4 | metadata: 5 | name: leader-election-role 6 | rules: 7 | - apiGroups: 8 | - "" 9 | resources: 10 | - configmaps 11 | verbs: 12 | - get 13 | - list 14 | - watch 15 | - create 16 | - update 17 | - patch 18 | - delete 19 | - apiGroups: 20 | - "" 21 | resources: 22 | - configmaps/status 23 | verbs: 24 | - get 25 | - update 26 | - patch 27 | - apiGroups: 28 | - "" 29 | resources: 30 | - events 31 | verbs: 32 | - create 33 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/base/pod-manager-role.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: Role 3 | metadata: # kpt-merge: /pod-manager 4 | name: pod-manager 5 | annotations: 6 | workflows.argoproj.io/description: | 7 | This is an example of the permissions you would need if you wanted to use a resource template to create and manage 8 | other pods. The same pattern would be suitable for other resurces, e.g. a service 9 | rules: 10 | - apiGroups: 11 | - "" 12 | resources: 13 | - pods 14 | verbs: 15 | - create 16 | - get 17 | - patch 18 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/base/workflow-manager-role.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: Role 3 | metadata: # kpt-merge: /workflow-manager 4 | name: workflow-manager 5 | annotations: 6 | workflows.argoproj.io/description: | 7 | This is an example of the permissions you would need if you wanted to use a resource template to create and manage 8 | other workflows. The same pattern would be suitable for other resurces, e.g. a service 9 | rules: 10 | - apiGroups: 11 | - argoproj.io 12 | resources: 13 | - workflows 14 | verbs: 15 | - create 16 | - get 17 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/base/workflow-controller/workflow-controller-metrics-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: # kpt-merge: /workflow-controller-metrics 4 | name: workflow-controller-metrics 5 | labels: 6 | app: workflow-controller 7 | annotations: 8 | workflows.argoproj.io/description: | 9 | This service is deprecated. It will be removed in v3.4. 10 | 11 | https://github.com/argoproj/argo-workflows/issues/8441 12 | spec: 13 | selector: 14 | app: workflow-controller 15 | ports: 16 | - name: metrics 17 | port: 9090 18 | targetPort: 9090 19 | protocol: TCP 20 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/pipeline/metadata-writer/metadata-writer-role.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: Role 3 | metadata: 4 | labels: 5 | app: kubeflow-pipelines-metadata-writer-role 6 | name: kubeflow-pipelines-metadata-writer-role 7 | rules: 8 | - apiGroups: 9 | - "" 10 | resources: 11 | - pods 12 | verbs: 13 | - get 14 | - list 15 | - watch 16 | - update 17 | - patch 18 | - apiGroups: 19 | - "" 20 | resources: 21 | - configmaps 22 | verbs: 23 | - get 24 | - apiGroups: 25 | - argoproj.io 26 | resources: 27 | - workflows 28 | verbs: 29 | - get 30 | - list 31 | - watch 32 | - update 33 | - patch 34 | -------------------------------------------------------------------------------- /llms/llm-0001/llm_agent/ray-serve-test.py: -------------------------------------------------------------------------------- 1 | import requests 2 | from starlette.requests import Request 3 | from typing import Dict 4 | import ray 5 | from ray import serve 6 | 7 | 8 | # 1: Define a Ray Serve application. 9 | @serve.deployment(route_prefix="/") 10 | class MyModelDeployment: 11 | def __init__(self, msg: str): 12 | # Initialize model state: could be very large neural net weights. 13 | self._msg = msg 14 | 15 | def __call__(self, request: Request) -> Dict: 16 | return {"result": self._msg} 17 | 18 | ray.init(address="auto") 19 | 20 | app = MyModelDeployment.bind(msg="Hello world!") 21 | 22 | serve.run(app) 23 | 24 | print(requests.get("http://localhost:8000/").json()) 25 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/base/workflow-controller-deployment-patch.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: workflow-controller 5 | spec: 6 | template: 7 | spec: 8 | containers: 9 | - name: workflow-controller 10 | image: gcr.io/ml-pipeline/workflow-controller:v3.3.8-license-compliance 11 | args: 12 | - --configmap 13 | - workflow-controller-configmap 14 | - --executor-image 15 | - gcr.io/ml-pipeline/argoexec:v3.3.8-license-compliance 16 | resources: 17 | requests: 18 | cpu: 100m 19 | memory: 500Mi 20 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/sso/overlays/workflow-controller-configmap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | data: 3 | sso: | 4 | issuer: http://dex:5556/dex 5 | issuerAlias: http://dex:5556/dex 6 | clientId: 7 | name: argo-server-sso 8 | key: clientID 9 | clientSecret: 10 | name: argo-server-sso 11 | key: clientSecret 12 | redirectUrl: http://localhost:8080/oauth2/callback 13 | scopes: 14 | - groups 15 | - email 16 | - profile 17 | rbac: 18 | enabled: true 19 | kind: ConfigMap 20 | metadata: # kpt-merge: /workflow-controller-configmap 21 | name: workflow-controller-configmap 22 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-notebook-controller/apps/jupyter/notebook-controller/upstream/default/manager_webhook_patch.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: controller-manager 5 | namespace: system 6 | spec: 7 | template: 8 | spec: 9 | containers: 10 | - name: manager 11 | ports: 12 | - containerPort: 443 13 | name: webhook-server 14 | protocol: TCP 15 | volumeMounts: 16 | - mountPath: /tmp/k8s-webhook-server/serving-certs 17 | name: cert 18 | readOnly: true 19 | volumes: 20 | - name: cert 21 | secret: 22 | defaultMode: 420 23 | secretName: webhook-server-cert 24 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/installs/namespace/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | 4 | # This kustomization.yaml is built mirroring ../../upstream/manifests/namespace-install/kustomization.yaml. 5 | # The differences: 6 | # * this does not include argo server. 7 | # * this separates cluster-scoped resources to its own folder. 8 | 9 | bases: 10 | - ../../base 11 | - ../../upstream/manifests/namespace-install/workflow-controller-rbac 12 | 13 | patchesJson6902: 14 | - target: 15 | version: v1 16 | group: apps 17 | kind: Deployment 18 | name: workflow-controller 19 | path: workflow-controller-deployment-patch.json 20 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/installs/cluster/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | 4 | bases: 5 | # Note, we do not explicitly separate cluster-scoped resources for cluster installation, 6 | # because people who deploy cluster-scoped resources should be the same as who deploys 7 | # namespaced resources. 8 | - ../../upstream/manifests/base/crds 9 | - ../../upstream/manifests/cluster-install/workflow-controller-rbac 10 | - ../../base 11 | 12 | patchesJson6902: 13 | - target: 14 | group: rbac.authorization.k8s.io 15 | version: v1 16 | kind: ClusterRoleBinding 17 | name: argo-binding 18 | path: workflow-controller-clusterrolebinding-patch.json -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/base/executor/pns/executor-role.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: Role 3 | metadata: # kpt-merge: /executor 4 | name: executor 5 | annotations: 6 | workflows.argoproj.io/description: | 7 | Recomended minimum permissions for `pns` executor. 8 | rules: 9 | - apiGroups: 10 | - argoproj.io 11 | resources: 12 | - workflowtaskresults 13 | verbs: 14 | - create 15 | - patch 16 | - apiGroups: 17 | - "" 18 | resources: 19 | - pods 20 | verbs: 21 | - watch 22 | - apiGroups: 23 | - "" 24 | resources: 25 | - pods/log 26 | verbs: 27 | - get 28 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/pipeline/metadata-writer/metadata-writer-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: metadata-writer 5 | labels: 6 | app: metadata-writer 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: metadata-writer 12 | template: 13 | metadata: 14 | labels: 15 | app: metadata-writer 16 | spec: 17 | containers: 18 | - name: main 19 | image: gcr.io/ml-pipeline/metadata-writer:dummy 20 | env: 21 | - name: NAMESPACE_TO_WATCH 22 | valueFrom: 23 | fieldRef: 24 | fieldPath: metadata.namespace 25 | serviceAccountName: kubeflow-pipelines-metadata-writer 26 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/installs/multi-user/scheduled-workflow/cluster-role.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: ClusterRole 3 | metadata: 4 | name: ml-pipeline-scheduledworkflow-role 5 | rules: 6 | - apiGroups: 7 | - argoproj.io 8 | resources: 9 | - workflows 10 | verbs: 11 | - create 12 | - get 13 | - list 14 | - watch 15 | - update 16 | - patch 17 | - delete 18 | - apiGroups: 19 | - kubeflow.org 20 | resources: 21 | - scheduledworkflows 22 | - scheduledworkflows/finalizers 23 | verbs: 24 | - create 25 | - get 26 | - list 27 | - watch 28 | - update 29 | - patch 30 | - delete 31 | - apiGroups: 32 | - '' 33 | resources: 34 | - events 35 | verbs: 36 | - create 37 | - patch 38 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/metadata/base/metadata-envoy-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: metadata-envoy-deployment 5 | labels: 6 | component: metadata-envoy 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | component: metadata-envoy 12 | template: 13 | metadata: 14 | labels: 15 | component: metadata-envoy 16 | annotations: 17 | sidecar.istio.io/inject: "false" 18 | spec: 19 | containers: 20 | - name: container 21 | image: gcr.io/ml-pipeline/metadata-envoy:dummy 22 | ports: 23 | - name: md-envoy 24 | containerPort: 9090 25 | - name: envoy-admin 26 | containerPort: 9901 27 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-notebook-controller/apps/jupyter/notebook-controller/upstream/crd/patches/webhook_in_notebooks.yaml: -------------------------------------------------------------------------------- 1 | # The following patch enables conversion webhook for CRD 2 | # CRD conversion requires k8s 1.13 or later. 3 | apiVersion: apiextensions.k8s.io/v1 4 | kind: CustomResourceDefinition 5 | metadata: 6 | name: notebooks.kubeflow.org 7 | spec: 8 | conversion: 9 | strategy: Webhook 10 | webhookClientConfig: 11 | # this is "\n" used as a placeholder, otherwise it will be rejected by the apiserver for being blank, 12 | # but we're going to set it later using the cert-manager (or potentially a patch if not using cert-manager) 13 | caBundle: Cg== 14 | service: 15 | namespace: system 16 | name: webhook-service 17 | path: /convert 18 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/installs/multi-user/pipelines-ui/cluster-role.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: ClusterRole 3 | metadata: 4 | name: ml-pipeline-ui 5 | rules: 6 | - apiGroups: 7 | - "" 8 | resources: 9 | - pods 10 | - pods/log 11 | verbs: 12 | - get 13 | - apiGroups: 14 | - "" 15 | resources: 16 | - events 17 | verbs: 18 | - list 19 | - apiGroups: 20 | - "" 21 | resources: 22 | - secrets 23 | verbs: 24 | - get 25 | - list 26 | - apiGroups: 27 | - "kubeflow.org" 28 | resources: 29 | - viewers 30 | verbs: 31 | - create 32 | - get 33 | - list 34 | - watch 35 | - delete 36 | - apiGroups: 37 | - "argoproj.io" 38 | resources: 39 | - workflows 40 | verbs: 41 | - get 42 | - list 43 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-notebook-controller/apps/jupyter/notebook-controller/upstream/default/webhookcainjection_patch.yaml: -------------------------------------------------------------------------------- 1 | # This patch add annotation to admission webhook config and 2 | # the variables $(CERTIFICATE_NAMESPACE) and $(CERTIFICATE_NAME) will be substituted by kustomize. 3 | apiVersion: admissionregistration.k8s.io/v1beta1 4 | kind: MutatingWebhookConfiguration 5 | metadata: 6 | name: mutating-webhook-configuration 7 | annotations: 8 | certmanager.k8s.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) 9 | --- 10 | apiVersion: admissionregistration.k8s.io/v1beta1 11 | kind: ValidatingWebhookConfiguration 12 | metadata: 13 | name: validating-webhook-configuration 14 | annotations: 15 | certmanager.k8s.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) 16 | -------------------------------------------------------------------------------- /docker-images/llm-runner/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: '3.5' 2 | 3 | services: 4 | datascience-notebook: 5 | environment: 6 | - DOCKER_DEFAULT_PLATFORM=linux/aarch64 7 | build: 8 | context: . 9 | shm_size: '10gb' 10 | shm_size: '6gb' 11 | image: halilagin/jupyter-rag-langchain:0.0.1 12 | volumes: 13 | - ${LOCAL_WORKING_DIR}:/home/jovyan/work 14 | - ${LOCAL_DATASETS}:/home/jovyan/work/datasets 15 | - ${LOCAL_MODULES}:/home/jovyan/work/modules 16 | #- ${LOCAL_SSL_CERTS}:/etc/ssl/notebook 17 | ports: 18 | - 8888:8888 19 | - 8080:8080 20 | - 8265:8265 21 | container_name: jupyter_notebook 22 | #command: "start-notebook.sh --NotebookApp.password=meddash --NotebookApp.certfile=/etc/ssl/notebook/jupyter.pem" 23 | 24 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/pipeline/ml-pipeline-ui-role.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: Role 3 | metadata: 4 | labels: 5 | app: ml-pipeline-ui 6 | name: ml-pipeline-ui 7 | rules: 8 | - apiGroups: 9 | - "" 10 | resources: 11 | - pods 12 | - pods/log 13 | verbs: 14 | - get 15 | - apiGroups: 16 | - "" 17 | resources: 18 | - events 19 | verbs: 20 | - list 21 | - apiGroups: 22 | - "" 23 | resources: 24 | - secrets 25 | verbs: 26 | - get 27 | - list 28 | - apiGroups: 29 | - "kubeflow.org" 30 | resources: 31 | - viewers 32 | verbs: 33 | - create 34 | - get 35 | - list 36 | - watch 37 | - delete 38 | - apiGroups: 39 | - "argoproj.io" 40 | resources: 41 | - workflows 42 | verbs: 43 | - get 44 | - list 45 | -------------------------------------------------------------------------------- /docker-images/cuda-llm-runner/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: '3.5' 2 | 3 | services: 4 | datascience-notebook: 5 | environment: 6 | - DOCKER_DEFAULT_PLATFORM=linux/aarch64 7 | build: 8 | context: . 9 | shm_size: '10gb' 10 | shm_size: '6gb' 11 | image: halilagin/jupyter-rag-langchain:0.0.1 12 | volumes: 13 | - ${LOCAL_WORKING_DIR}:/home/jovyan/work 14 | - ${LOCAL_DATASETS}:/home/jovyan/work/datasets 15 | - ${LOCAL_MODULES}:/home/jovyan/work/modules 16 | #- ${LOCAL_SSL_CERTS}:/etc/ssl/notebook 17 | ports: 18 | - 8888:8888 19 | - 8080:8080 20 | - 8265:8265 21 | container_name: jupyter_notebook 22 | #command: "start-notebook.sh --NotebookApp.password=meddash --NotebookApp.certfile=/etc/ssl/notebook/jupyter.pem" 23 | 24 | -------------------------------------------------------------------------------- /llms/llm-0001/llm_agent/env-sample: -------------------------------------------------------------------------------- 1 | OPENAI_API_KEY= 2 | ANYSCALE_API_KEY= 3 | OPENAI_API_BASE="https://api.endpoints.anyscale.com/v1" 4 | ANYSCALE_API_BASE="https://api.endpoints.anyscale.com/v1" 5 | DB_CONNECTION_STRING="postgresql://testUser:testPassword@localhost:15432/testDB" 6 | EMBEDDING_INDEX_DIR=/tmp/embedding_index_sql 7 | VECTOR_TABLE_NAME=document 8 | VECTOR_TABLE_DUMP_OUTPUT_PATH=/tmp/vector.document.dump.sql 9 | RAYDOCS_ROOT=/tmp/raydocs 10 | NUM_CPUS=14 11 | NUM_GPUS=1 12 | NUM_CHUNKS=5 13 | CHUNK_SIZE=500 14 | CHUNK_OVERLAP=50 15 | EMBEDDING_MODEL_NAME="thenlper/gte-base" 16 | LLM_MODEL_NAME=meta-llama/Llama-2-70b-chat-hf 17 | 18 | #How much data should be fed for fine tuning 19 | #give a floating number between >0.001 and 1 (1 included, which means use all the data for fine tuning) 20 | USE_THIS_PORTION_OF_DATA=0.05 21 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/pipeline/ml-pipeline-scheduledworkflow-role.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: Role 3 | metadata: 4 | labels: 5 | app: ml-pipeline-scheduledworkflow-role 6 | name: ml-pipeline-scheduledworkflow-role 7 | rules: 8 | - apiGroups: 9 | - argoproj.io 10 | resources: 11 | - workflows 12 | verbs: 13 | - create 14 | - get 15 | - list 16 | - watch 17 | - update 18 | - patch 19 | - delete 20 | - apiGroups: 21 | - kubeflow.org 22 | resources: 23 | - scheduledworkflows 24 | - scheduledworkflows/finalizers 25 | verbs: 26 | - create 27 | - get 28 | - list 29 | - watch 30 | - update 31 | - patch 32 | - delete 33 | - apiGroups: 34 | - '' 35 | resources: 36 | - events 37 | verbs: 38 | - create 39 | - patch 40 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/base/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | resources: 4 | - ../../namespace-install 5 | - minio 6 | - webhooks 7 | - argo-server-sso-secret.yaml 8 | - executor/emissary/executor-role.yaml 9 | - executor-default-rolebinding.yaml 10 | - pod-manager-role.yaml 11 | - pod-manager-default-rolebinding.yaml 12 | - workflow-manager-role.yaml 13 | - workflow-manager-default-rolebinding.yaml 14 | - agent-role.yaml 15 | - agent-default-rolebinding.yaml 16 | - cluster-workflow-template-rbac.yaml 17 | - artifact-repositories-configmap.yaml 18 | patchesStrategicMerge: 19 | - overlays/workflow-controller-configmap.yaml 20 | - overlays/argo-server-deployment.yaml 21 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/base/webhooks/submit-workflow-template-role.yaml: -------------------------------------------------------------------------------- 1 | # Just enough permissions to submit a workflow template. 2 | # You could tighten this further (but perhaps impractically) by using `resourceNames` 3 | apiVersion: rbac.authorization.k8s.io/v1 4 | kind: Role 5 | metadata: # kpt-merge: /submit-workflow-template 6 | name: submit-workflow-template 7 | rules: 8 | - apiGroups: 9 | - argoproj.io 10 | resources: 11 | - workfloweventbindings 12 | verbs: 13 | - list 14 | - apiGroups: 15 | - argoproj.io 16 | resources: 17 | - workflowtemplates 18 | verbs: 19 | - get 20 | - apiGroups: 21 | - argoproj.io 22 | resources: 23 | - workflows 24 | verbs: 25 | - create 26 | -------------------------------------------------------------------------------- /docker-images/llm-runner/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:22.04 2 | 3 | USER root 4 | RUN apt-get update && \ 5 | apt-get install -y wget ca-certificates software-properties-common curl git python3.10 python3-pip 6 | #RUN add-apt-repository "deb http://apt.postgresql.org/pub/repos/apt/ lsb_release -cs-pgdg main" 7 | RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - 8 | RUN add-apt-repository "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" 9 | #sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ lsb_release -cs-pgdg main" >> /etc/apt/sources.list.d/pgdg.list' 10 | 11 | RUN apt-get update 12 | RUN apt-get -y install libpq-dev postgresql-client 13 | RUN pip install --quiet python-dotenv pipenv 14 | COPY Pipfile / 15 | COPY Pipfile.lock / 16 | RUN cd / && pipenv install --system --verbose 17 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/base/agent-role.yaml: -------------------------------------------------------------------------------- 1 | # https://argoproj.github.io/argo-workflows/workflow-rbac/ 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | kind: Role 4 | metadata: # kpt-merge: /agent 5 | name: agent 6 | annotations: 7 | workflows.argoproj.io/description: | 8 | This is the minimum recommended permissions needed if you want to use the agent, e.g. for HTTP or plugin templates. 9 | 10 | If <= v3.2 you must replace `workflowtasksets/status` with `patch workflowtasksets`. 11 | rules: 12 | - apiGroups: 13 | - argoproj.io 14 | resources: 15 | - workflowtasksets 16 | verbs: 17 | - list 18 | - watch 19 | - apiGroups: 20 | - argoproj.io 21 | resources: 22 | - workflowtasksets/status 23 | verbs: 24 | - patch 25 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/cache-deployer/cache-deployer-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: cache-deployer-deployment 5 | labels: 6 | app: cache-deployer 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: cache-deployer 12 | strategy: 13 | type: Recreate 14 | template: 15 | metadata: 16 | labels: 17 | app: cache-deployer 18 | spec: 19 | containers: 20 | - name: main 21 | image: gcr.io/ml-pipeline/cache-deployer:dummy 22 | imagePullPolicy: Always 23 | env: 24 | - name: NAMESPACE_TO_WATCH 25 | valueFrom: 26 | fieldRef: 27 | fieldPath: metadata.namespace 28 | serviceAccountName: kubeflow-pipelines-cache-deployer-sa 29 | restartPolicy: Always 30 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/mysql/overlays/workflow-controller-configmap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | data: 3 | persistence: | 4 | connectionPool: 5 | maxIdleConns: 100 6 | maxOpenConns: 0 7 | connMaxLifetime: 0s 8 | nodeStatusOffLoad: true 9 | archive: true 10 | archiveTTL: 7d 11 | mysql: 12 | host: mysql 13 | port: 3306 14 | database: argo 15 | tableName: argo_workflows 16 | userNameSecret: 17 | name: argo-mysql-config 18 | key: username 19 | passwordSecret: 20 | name: argo-mysql-config 21 | key: password 22 | retentionPolicy: | 23 | completed: 10 24 | failed: 3 25 | errored: 3 26 | kind: ConfigMap 27 | metadata: # kpt-merge: /workflow-controller-configmap 28 | name: workflow-controller-configmap 29 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/sso/dex/dex-deploy.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: # kpt-merge: /dex 4 | labels: 5 | app: dex 6 | name: dex 7 | spec: 8 | selector: 9 | matchLabels: 10 | app: dex 11 | template: 12 | metadata: 13 | labels: 14 | app: dex 15 | spec: 16 | serviceAccountName: dex 17 | containers: 18 | - name: dex 19 | image: quay.io/dexidp/dex:v2.23.0 20 | args: 21 | - serve 22 | - /data/config.yaml 23 | ports: 24 | - name: http 25 | containerPort: 5556 26 | volumeMounts: 27 | - mountPath: /data 28 | name: config 29 | volumes: 30 | - name: config 31 | configMap: 32 | name: dex 33 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/minio/options/istio/istio-authorization-policy.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: security.istio.io/v1beta1 2 | kind: AuthorizationPolicy 3 | metadata: 4 | name: minio-service 5 | spec: 6 | action: ALLOW 7 | selector: 8 | matchLabels: 9 | app: minio 10 | rules: 11 | - from: 12 | - source: 13 | principals: 14 | - cluster.local/ns/kubeflow/sa/ml-pipeline 15 | - from: 16 | - source: 17 | principals: 18 | - cluster.local/ns/kubeflow/sa/ml-pipeline-ui 19 | # Allow traffic from User Pipeline Pods, which don't have a sidecar. 20 | - {} 21 | --- 22 | apiVersion: "networking.istio.io/v1alpha3" 23 | kind: DestinationRule 24 | metadata: 25 | name: ml-pipeline-minio 26 | spec: 27 | host: minio-service.kubeflow.svc.cluster.local 28 | trafficPolicy: 29 | tls: 30 | mode: ISTIO_MUTUAL 31 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/cache-deployer/cluster-scoped/cache-deployer-clusterrole.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: ClusterRole 3 | metadata: 4 | labels: 5 | app: kubeflow-pipelines-cache-deployer-clusterrole 6 | name: kubeflow-pipelines-cache-deployer-clusterrole 7 | rules: 8 | - apiGroups: 9 | - certificates.k8s.io 10 | resources: 11 | - certificatesigningrequests 12 | - certificatesigningrequests/approval 13 | verbs: 14 | - create 15 | - delete 16 | - get 17 | - update 18 | - apiGroups: 19 | - admissionregistration.k8s.io 20 | resources: 21 | - mutatingwebhookconfigurations 22 | verbs: 23 | - create 24 | - delete 25 | - get 26 | - list 27 | - patch 28 | - apiGroups: 29 | - certificates.k8s.io 30 | resources: 31 | - signers 32 | resourceNames: 33 | - kubernetes.io/* 34 | verbs: 35 | - approve 36 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/postgres/overlays/workflow-controller-configmap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | data: 3 | persistence: | 4 | connectionPool: 5 | maxIdleConns: 100 6 | maxOpenConns: 0 7 | connMaxLifetime: 0s 8 | nodeStatusOffLoad: true 9 | archive: true 10 | archiveTTL: 7d 11 | postgresql: 12 | host: postgres 13 | port: 5432 14 | database: postgres 15 | tableName: argo_workflows 16 | userNameSecret: 17 | name: argo-postgres-config 18 | key: username 19 | passwordSecret: 20 | name: argo-postgres-config 21 | key: password 22 | retentionPolicy: | 23 | completed: 10 24 | failed: 3 25 | errored: 3 26 | kind: ConfigMap 27 | metadata: # kpt-merge: /workflow-controller-configmap 28 | name: workflow-controller-configmap 29 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/metadata/overlays/db/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | namespace: kubeflow 4 | 5 | bases: 6 | - ../../base 7 | resources: 8 | - metadata-db-pvc.yaml 9 | - metadata-db-deployment.yaml 10 | - metadata-db-service.yaml 11 | 12 | patchesStrategicMerge: 13 | - patches/metadata-grpc-deployment.yaml 14 | 15 | configMapGenerator: 16 | - name: metadata-db-parameters 17 | envs: 18 | - params.env 19 | secretGenerator: 20 | - name: metadata-db-secrets 21 | envs: 22 | - secrets.env 23 | generatorOptions: 24 | disableNameSuffixHash: true 25 | 26 | 27 | images: 28 | - name: mysql 29 | newName: mysql 30 | newTag: 8.0.3 31 | 32 | vars: 33 | - name: MLMD_DB_HOST 34 | objref: 35 | kind: Service 36 | name: metadata-db 37 | apiVersion: v1 38 | fieldref: 39 | fieldpath: metadata.name 40 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/pipeline/cluster-scoped/viewer-crd.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apiextensions.k8s.io/v1 2 | kind: CustomResourceDefinition 3 | metadata: 4 | name: viewers.kubeflow.org 5 | spec: 6 | group: kubeflow.org 7 | names: 8 | kind: Viewer 9 | listKind: ViewerList 10 | plural: viewers 11 | singular: viewer 12 | shortNames: 13 | - vi 14 | scope: Namespaced 15 | versions: 16 | - name: v1beta1 17 | schema: 18 | openAPIV3Schema: 19 | properties: 20 | apiVersion: 21 | type: string 22 | kind: 23 | type: string 24 | metadata: 25 | type: object 26 | spec: 27 | type: object 28 | x-kubernetes-preserve-unknown-fields: true 29 | x-kubernetes-map-type: atomic 30 | required: 31 | - spec 32 | type: object 33 | served: true 34 | storage: true 35 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-notebook-controller/apps/jupyter/notebook-controller/upstream/rbac/role.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | kind: ClusterRole 4 | metadata: 5 | creationTimestamp: null 6 | name: role 7 | rules: 8 | - apiGroups: 9 | - apps 10 | resources: 11 | - statefulsets 12 | verbs: 13 | - '*' 14 | - apiGroups: 15 | - "" 16 | resources: 17 | - events 18 | verbs: 19 | - create 20 | - get 21 | - list 22 | - patch 23 | - watch 24 | - apiGroups: 25 | - "" 26 | resources: 27 | - pods 28 | verbs: 29 | - get 30 | - list 31 | - watch 32 | - apiGroups: 33 | - "" 34 | resources: 35 | - services 36 | verbs: 37 | - '*' 38 | - apiGroups: 39 | - kubeflow.org 40 | resources: 41 | - notebooks 42 | - notebooks/finalizers 43 | - notebooks/status 44 | verbs: 45 | - '*' 46 | - apiGroups: 47 | - networking.istio.io 48 | resources: 49 | - virtualservices 50 | verbs: 51 | - '*' 52 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/base/webhooks/argo-workflows-webhook-clients-secret.yaml: -------------------------------------------------------------------------------- 1 | kind: Secret 2 | apiVersion: v1 3 | metadata: # kpt-merge: /argo-workflows-webhook-clients 4 | name: argo-workflows-webhook-clients 5 | # The data keys must be the name of a service account. 6 | stringData: 7 | # https://support.atlassian.com/bitbucket-cloud/docs/manage-webhooks/ 8 | bitbucket.org: | 9 | type: bitbucket 10 | secret: "my-uuid" 11 | # https://confluence.atlassian.com/bitbucketserver/managing-webhooks-in-bitbucket-server-938025878.html 12 | bitbucketserver: | 13 | type: bitbucketserver 14 | secret: "shh!" 15 | # https://developer.github.com/webhooks/securing/ 16 | github.com: | 17 | type: github 18 | secret: "shh!" 19 | # https://docs.gitlab.com/ee/user/project/integrations/webhooks.html 20 | gitlab.com: |- 21 | type: gitlab 22 | secret: "shh!" 23 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/postgres/postgres-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: # kpt-merge: /postgres 4 | name: postgres 5 | labels: 6 | app: postgres 7 | spec: 8 | selector: 9 | matchLabels: 10 | app: postgres 11 | template: 12 | metadata: 13 | name: postgres 14 | labels: 15 | app: postgres 16 | spec: 17 | containers: 18 | - name: main 19 | image: postgres:12-alpine 20 | env: 21 | - name: POSTGRES_PASSWORD 22 | value: password 23 | ports: 24 | - containerPort: 5432 25 | readinessProbe: 26 | exec: 27 | command: ["psql", "-U", "postgres", "-c", "SELECT 1"] 28 | initialDelaySeconds: 15 29 | timeoutSeconds: 2 30 | nodeSelector: 31 | kubernetes.io/os: linux 32 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-notebook-controller/apps/jupyter/notebook-controller/upstream/default/manager_auth_proxy_patch.yaml: -------------------------------------------------------------------------------- 1 | # This patch inject a sidecar container which is a HTTP proxy for the controller manager, 2 | # it performs RBAC authorization against the Kubernetes API using SubjectAccessReviews. 3 | apiVersion: apps/v1 4 | kind: Deployment 5 | metadata: 6 | name: controller-manager 7 | namespace: system 8 | spec: 9 | template: 10 | spec: 11 | containers: 12 | - name: kube-rbac-proxy 13 | image: gcr.io/kubebuilder/kube-rbac-proxy:v0.4.0 14 | args: 15 | - "--secure-listen-address=0.0.0.0:8443" 16 | - "--upstream=http://127.0.0.1:8080/" 17 | - "--logtostderr=true" 18 | - "--v=10" 19 | ports: 20 | - containerPort: 8443 21 | name: https 22 | - name: manager 23 | args: 24 | - "--metrics-addr=127.0.0.1:8080" 25 | - "--enable-leader-election" 26 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/installs/multi-user/api-service/cluster-role.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: ClusterRole 3 | metadata: 4 | name: ml-pipeline 5 | rules: 6 | - apiGroups: 7 | - "" 8 | resources: 9 | - pods 10 | - pods/log 11 | verbs: 12 | - get 13 | - list 14 | - delete 15 | - apiGroups: 16 | - argoproj.io 17 | resources: 18 | - workflows 19 | verbs: 20 | - create 21 | - get 22 | - list 23 | - watch 24 | - update 25 | - patch 26 | - delete 27 | - apiGroups: 28 | - kubeflow.org 29 | resources: 30 | - scheduledworkflows 31 | verbs: 32 | - create 33 | - get 34 | - list 35 | - update 36 | - patch 37 | - delete 38 | - apiGroups: 39 | - authorization.k8s.io 40 | resources: 41 | - subjectaccessreviews 42 | verbs: 43 | - create 44 | - apiGroups: 45 | - authentication.k8s.io 46 | resources: 47 | - tokenreviews 48 | verbs: 49 | - create 50 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/pipeline/ml-pipeline-viewer-crd-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | labels: 5 | app: ml-pipeline-viewer-crd 6 | name: ml-pipeline-viewer-crd 7 | spec: 8 | selector: 9 | matchLabels: 10 | app: ml-pipeline-viewer-crd 11 | template: 12 | metadata: 13 | labels: 14 | app: ml-pipeline-viewer-crd 15 | annotations: 16 | cluster-autoscaler.kubernetes.io/safe-to-evict: "true" 17 | spec: 18 | containers: 19 | - image: gcr.io/ml-pipeline/viewer-crd-controller:dummy 20 | imagePullPolicy: Always 21 | name: ml-pipeline-viewer-crd 22 | env: 23 | - name: MAX_NUM_VIEWERS 24 | value: "50" 25 | - name: MINIO_NAMESPACE 26 | valueFrom: 27 | fieldRef: 28 | fieldPath: metadata.namespace 29 | serviceAccountName: ml-pipeline-viewer-crd-service-account 30 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/pipeline/ml-pipeline-apiserver-role.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: Role 3 | metadata: 4 | labels: 5 | app: ml-pipeline 6 | name: ml-pipeline 7 | rules: 8 | - apiGroups: 9 | - "" 10 | resources: 11 | - pods 12 | - pods/log 13 | verbs: 14 | - get 15 | - list 16 | - delete 17 | - apiGroups: 18 | - argoproj.io 19 | resources: 20 | - workflows 21 | verbs: 22 | - create 23 | - get 24 | - list 25 | - watch 26 | - update 27 | - patch 28 | - delete 29 | - apiGroups: 30 | - kubeflow.org 31 | resources: 32 | - scheduledworkflows 33 | verbs: 34 | - create 35 | - get 36 | - list 37 | - update 38 | - patch 39 | - delete 40 | - apiGroups: 41 | - authorization.k8s.io 42 | resources: 43 | - subjectaccessreviews 44 | verbs: 45 | - create 46 | - apiGroups: 47 | - authentication.k8s.io 48 | resources: 49 | - tokenreviews 50 | verbs: 51 | - create 52 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/base/executor/k8sapi/executor-role.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: Role 3 | metadata: # kpt-merge: /executor 4 | name: executor 5 | annotations: 6 | workflows.argoproj.io/description: | 7 | Recommended minimum permissions for `k8siapi` executor. 8 | 9 | This executor is superseded by the `emmisary` executor, so we do not recommend you use it anymore. 10 | rules: 11 | - apiGroups: 12 | - argoproj.io 13 | resources: 14 | - workflowtaskresults 15 | verbs: 16 | - create 17 | - patch 18 | - apiGroups: 19 | - "" 20 | resources: 21 | - pods 22 | verbs: 23 | - get 24 | - watch 25 | - apiGroups: 26 | - "" 27 | resources: 28 | - pods/exec 29 | verbs: 30 | - create 31 | - apiGroups: 32 | - "" 33 | resources: 34 | - pods/log 35 | verbs: 36 | - get 37 | -------------------------------------------------------------------------------- /llms/llm-0001/yamls/010-pgsql-05-setup-db.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: batch/v1 2 | kind: Job 3 | metadata: 4 | name: postgres-setup 5 | namespace: llm-0001 6 | annotations: 7 | argocd.argoproj.io/sync-wave: "4" 8 | spec: 9 | template: 10 | spec: 11 | restartPolicy: Never 12 | containers: 13 | - name: postgres-setup 14 | #image: postgres 15 | image: ankane/pgvector 16 | envFrom: 17 | - configMapRef: 18 | name: llm-0001 19 | command: 20 | - sh 21 | - -c 22 | - | 23 | cat <<'EOF' > /tmp/create-embedding-vector-table.sql 24 | CREATE EXTENSION IF NOT EXISTS vector; 25 | CREATE TABLE IF NOT EXISTS document ( 26 | id serial primary key, 27 | "text" text not null, 28 | source text not null, 29 | embedding vector(768) 30 | ); 31 | EOF 32 | psql $DB_CONNECTION_STRING -f /tmp/create-embedding-vector-table.sql 33 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/metadata/overlays/db/patches/metadata-grpc-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: metadata-grpc-deployment 5 | spec: 6 | template: 7 | spec: 8 | containers: 9 | - name: container 10 | # Remove existing environment variables 11 | env: 12 | - $patch: replace 13 | envFrom: 14 | - configMapRef: 15 | name: metadata-db-parameters 16 | - secretRef: 17 | name: metadata-db-secrets 18 | - configMapRef: 19 | name: metadata-grpc-configmap 20 | args: ["--grpc_port=$(METADATA_GRPC_SERVICE_PORT)", 21 | "--mysql_config_host=$(MLMD_DB_HOST)", 22 | "--mysql_config_database=$(MYSQL_DATABASE)", 23 | "--mysql_config_port=$(MYSQL_PORT)", 24 | "--mysql_config_user=$(MYSQL_USER_NAME)", 25 | "--mysql_config_password=$(MYSQL_ROOT_PASSWORD)"] 26 | -------------------------------------------------------------------------------- /deploy.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | root_dir=llms 4 | llm_package=$1 5 | llm_package_root=$root_dir/$llm_package 6 | global_env_path=.env.kube.global 7 | llm_package_env_path=$llm_package_root/llm_agent/.env.kube 8 | llm_package_argocd_app_path=$llm_package_root/argocd/020-argocd-application.yaml 9 | llm_package_yamls_path=$llm_package_root/yamls 10 | 11 | 12 | 13 | 14 | init_config(){ 15 | kubectl create ns $llm_package 16 | kubectl create configmap -n $llm_package llm-0001 --from-env-file=$llm_package_env_path 17 | 18 | global_config_yaml_path=/tmp/$(openssl rand -base64 12).yaml 19 | kubectl create configmap -n $llm_package llm-global-config --from-env-file=$global_env_path --dry-run=client -o yaml >$global_config_yaml_path 20 | kubectl apply -f $global_config_yaml_path 21 | #kubectl create -f $llm_package_yamls_path 22 | } 23 | 24 | 25 | local_deploy(){ 26 | init_config 27 | kubectl create -f $llm_package_yamls_path 28 | } 29 | 30 | argocd_deploy(){ 31 | init_config 32 | kubectl create -f $llm_package_argocd_app_path 33 | } 34 | 35 | 36 | #local_deploy 37 | argocd_deploy 38 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/installs/multi-user/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | namespace: kubeflow 4 | commonLabels: 5 | app.kubernetes.io/name: kubeflow-pipelines 6 | app.kubernetes.io/component: ml-pipeline 7 | resources: 8 | - ../../pipeline/cluster-scoped 9 | - ../../cache-deployer/cluster-scoped 10 | - ../generic 11 | - view-edit-cluster-roles.yaml 12 | - api-service 13 | - pipelines-ui 14 | - pipelines-profile-controller 15 | - scheduled-workflow 16 | - viewer-controller 17 | - persistence-agent 18 | - cache 19 | - metadata-writer 20 | - istio-authorization-config.yaml 21 | - virtual-service.yaml 22 | patchesStrategicMerge: 23 | - api-service/deployment-patch.yaml 24 | - pipelines-ui/deployment-patch.yaml 25 | - pipelines-ui/configmap-patch.yaml 26 | - scheduled-workflow/deployment-patch.yaml 27 | - viewer-controller/deployment-patch.yaml 28 | - persistence-agent/deployment-patch.yaml 29 | - metadata-writer/deployment-patch.yaml 30 | - cache/deployment-patch.yaml 31 | 32 | configurations: 33 | - params.yaml 34 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/cluster-scoped-resources/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | 4 | namespace: kubeflow 5 | 6 | resources: 7 | - namespace.yaml 8 | bases: 9 | - ../third-party/application/cluster-scoped 10 | - ../third-party/argo/installs/namespace/cluster-scoped 11 | - ../base/pipeline/cluster-scoped 12 | - ../base/cache-deployer/cluster-scoped 13 | vars: 14 | # NOTE: var name must be unique globally to allow composition of multiple kustomize 15 | # packages. Therefore, we added prefix `kfp-cluster-scoped-` to distinguish it from 16 | # others. 17 | - name: kfp-cluster-scoped-namespace 18 | objref: 19 | # cache deployer sa's metadata.namespace will be first transformed by namespace field in kustomization.yaml 20 | # so that we only need to change kustomization.yaml's namespace field for namespace customization. 21 | kind: ServiceAccount 22 | name: kubeflow-pipelines-cache-deployer-sa 23 | apiVersion: v1 24 | fieldref: 25 | fieldpath: metadata.namespace 26 | configurations: 27 | - params.yaml 28 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/mysql/options/istio/istio-authorization-policy.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: security.istio.io/v1beta1 2 | kind: AuthorizationPolicy 3 | metadata: 4 | name: mysql 5 | namespace: kubeflow 6 | spec: 7 | selector: 8 | matchLabels: 9 | app: mysql 10 | rules: 11 | - from: 12 | - source: 13 | principals: 14 | - cluster.local/ns/kubeflow/sa/ml-pipeline 15 | - cluster.local/ns/kubeflow/sa/ml-pipeline-ui 16 | - cluster.local/ns/kubeflow/sa/ml-pipeline-persistenceagent 17 | - cluster.local/ns/kubeflow/sa/ml-pipeline-scheduledworkflow 18 | - cluster.local/ns/kubeflow/sa/ml-pipeline-viewer-crd-service-account 19 | - cluster.local/ns/kubeflow/sa/kubeflow-pipelines-cache 20 | - cluster.local/ns/kubeflow/sa/metadata-grpc-server 21 | 22 | --- 23 | 24 | apiVersion: "networking.istio.io/v1alpha3" 25 | kind: DestinationRule 26 | metadata: 27 | name: ml-pipeline-mysql 28 | spec: 29 | host: mysql.kubeflow.svc.cluster.local 30 | trafficPolicy: 31 | tls: 32 | mode: ISTIO_MUTUAL 33 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/prometheus/prometheus-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: prometheus 5 | labels: 6 | app: prometheus 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: prometheus 12 | template: 13 | metadata: 14 | labels: 15 | app: prometheus 16 | spec: 17 | containers: 18 | - name: prometheus 19 | image: prom/prometheus 20 | volumeMounts: 21 | - name: config-volume 22 | mountPath: /etc/prometheus/prometheus.yml 23 | subPath: prometheus.yml 24 | args: ["--storage.tsdb.retention.time=7d", # Adjust retention policy if necessary 25 | "--storage.tsdb.retention.size=1GB", 26 | "--config.file=/etc/prometheus/prometheus.yml", 27 | ] 28 | ports: 29 | - containerPort: 9090 30 | volumes: 31 | - name: config-volume 32 | configMap: 33 | name: prometheus-configmap 34 | serviceAccountName: prometheus 35 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/base/crds/minimal/argoproj.io_workflowtemplates.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apiextensions.k8s.io/v1 2 | kind: CustomResourceDefinition 3 | metadata: # kpt-merge: /workflowtemplates.argoproj.io 4 | name: workflowtemplates.argoproj.io 5 | spec: 6 | group: argoproj.io 7 | names: 8 | kind: WorkflowTemplate 9 | listKind: WorkflowTemplateList 10 | plural: workflowtemplates 11 | shortNames: 12 | - wftmpl 13 | singular: workflowtemplate 14 | scope: Namespaced 15 | versions: 16 | - name: v1alpha1 17 | schema: 18 | openAPIV3Schema: 19 | properties: 20 | apiVersion: 21 | type: string 22 | kind: 23 | type: string 24 | metadata: 25 | type: object 26 | spec: 27 | type: object 28 | x-kubernetes-map-type: atomic 29 | x-kubernetes-preserve-unknown-fields: true 30 | required: 31 | - metadata 32 | - spec 33 | type: object 34 | served: true 35 | storage: true 36 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-notebook-controller/apps/jupyter/notebook-controller/upstream/crd/kustomization.yaml: -------------------------------------------------------------------------------- 1 | # This kustomization.yaml is not intended to be run by itself, 2 | # since it depends on service name and namespace that are out of this kustomize package. 3 | # It should be run by config/default 4 | resources: 5 | - bases/kubeflow.org_notebooks.yaml 6 | # +kubebuilder:scaffold:crdkustomizeresource 7 | 8 | patchesStrategicMerge: 9 | - patches/trivial_conversion_patch.yaml 10 | 11 | # [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix. 12 | # patches here are for enabling the conversion webhook for each CRD 13 | #- patches/webhook_in_notebooks.yaml 14 | # +kubebuilder:scaffold:crdkustomizewebhookpatch 15 | 16 | # [CERTMANAGER] To enable webhook, uncomment all the sections with [CERTMANAGER] prefix. 17 | # patches here are for enabling the CA injection for each CRD 18 | #- patches/cainjection_in_notebooks.yaml 19 | # +kubebuilder:scaffold:crdkustomizecainjectionpatch 20 | 21 | # the following config is for teaching kustomize how to do kustomization for CRDs. 22 | configurations: 23 | - kustomizeconfig.yaml 24 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/base/crds/minimal/argoproj.io_workfloweventbindings.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apiextensions.k8s.io/v1 2 | kind: CustomResourceDefinition 3 | metadata: # kpt-merge: /workfloweventbindings.argoproj.io 4 | name: workfloweventbindings.argoproj.io 5 | spec: 6 | group: argoproj.io 7 | names: 8 | kind: WorkflowEventBinding 9 | listKind: WorkflowEventBindingList 10 | plural: workfloweventbindings 11 | shortNames: 12 | - wfeb 13 | singular: workfloweventbinding 14 | scope: Namespaced 15 | versions: 16 | - name: v1alpha1 17 | schema: 18 | openAPIV3Schema: 19 | properties: 20 | apiVersion: 21 | type: string 22 | kind: 23 | type: string 24 | metadata: 25 | type: object 26 | spec: 27 | type: object 28 | x-kubernetes-map-type: atomic 29 | x-kubernetes-preserve-unknown-fields: true 30 | required: 31 | - metadata 32 | - spec 33 | type: object 34 | served: true 35 | storage: true 36 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/pipeline/ml-pipeline-scheduledworkflow-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | labels: 5 | app: ml-pipeline-scheduledworkflow 6 | name: ml-pipeline-scheduledworkflow 7 | spec: 8 | selector: 9 | matchLabels: 10 | app: ml-pipeline-scheduledworkflow 11 | template: 12 | metadata: 13 | labels: 14 | app: ml-pipeline-scheduledworkflow 15 | annotations: 16 | cluster-autoscaler.kubernetes.io/safe-to-evict: "true" 17 | spec: 18 | containers: 19 | - image: gcr.io/ml-pipeline/scheduledworkflow:dummy 20 | imagePullPolicy: IfNotPresent 21 | name: ml-pipeline-scheduledworkflow 22 | env: 23 | - name: NAMESPACE 24 | valueFrom: 25 | fieldRef: 26 | fieldPath: metadata.namespace 27 | - name: CRON_SCHEDULE_TIMEZONE 28 | valueFrom: 29 | configMapKeyRef: 30 | name: pipeline-install-config 31 | key: cronScheduleTimezone 32 | serviceAccountName: ml-pipeline-scheduledworkflow 33 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/mysql/mysql-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: # kpt-merge: /mysql 4 | name: mysql 5 | labels: 6 | app: mysql 7 | spec: 8 | selector: 9 | matchLabels: 10 | app: mysql 11 | template: 12 | metadata: 13 | name: mysql 14 | labels: 15 | app: mysql 16 | spec: 17 | containers: 18 | - name: main 19 | image: mysql:8 20 | env: 21 | - name: MYSQL_USER 22 | value: mysql 23 | - name: MYSQL_PASSWORD 24 | value: password 25 | - name: MYSQL_DATABASE 26 | value: argo 27 | - name: MYSQL_RANDOM_ROOT_PASSWORD 28 | value: "yes" 29 | ports: 30 | - containerPort: 3306 31 | readinessProbe: 32 | exec: 33 | command: ["mysql", "-u", "mysql", "-ppassword", "argo", "-e", "SELECT 1"] 34 | initialDelaySeconds: 15 35 | timeoutSeconds: 2 36 | nodeSelector: 37 | kubernetes.io/os: linux 38 | -------------------------------------------------------------------------------- /docker-images/llm-runner/Makefile: -------------------------------------------------------------------------------- 1 | 2 | create_builder: 3 | docker buildx create --name mybuilder 4 | use_builder: 5 | docker buildx use mybuilder 6 | 7 | inspect_builder: 8 | docker buildx inspect --bootstrap 9 | 10 | 11 | buildx64: 12 | #export DOCKER_DEFAULT_PLATFORM=linux/amd64 13 | export DOCKER_DEFAULT_PLATFORM=linux/aarch64 14 | #docker build -t halilagin/jupyter-rag-langchain:0.0.1 . --platform linux/arm64 15 | docker-compose build 16 | 17 | buildx86: 18 | docker build -t halilagin/llm-runner:0.0.1 . 19 | 20 | build: 21 | echo ===================== 22 | echo building for arm64. try 'make buildx86' for intel arch. 23 | echo ===================== 24 | #docker buildx build --platform linux/amd64,linux/arm64 . 25 | #docker buildx create --name=llm-runner --platform linux/amd64,linux/arm64 26 | docker buildx build --platform linux/amd64,linux/arm64 -t halilagin/llm-runner:0.0.1 --push . 27 | 28 | push: 29 | docker push halilagin/llm-runner:0.0.1 30 | run: 31 | docker-compose up -d 32 | term: 33 | docker exec -it jupyter_notebook bash 34 | dup: 35 | export DOCKER_DEFAULT_PLATFORM=linux/amd64 36 | docker-compose up -d 37 | down: 38 | docker-compose down 39 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/base/crds/minimal/argoproj.io_clusterworkflowtemplates.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apiextensions.k8s.io/v1 2 | kind: CustomResourceDefinition 3 | metadata: # kpt-merge: /clusterworkflowtemplates.argoproj.io 4 | name: clusterworkflowtemplates.argoproj.io 5 | spec: 6 | group: argoproj.io 7 | names: 8 | kind: ClusterWorkflowTemplate 9 | listKind: ClusterWorkflowTemplateList 10 | plural: clusterworkflowtemplates 11 | shortNames: 12 | - clusterwftmpl 13 | - cwft 14 | singular: clusterworkflowtemplate 15 | scope: Cluster 16 | versions: 17 | - name: v1alpha1 18 | schema: 19 | openAPIV3Schema: 20 | properties: 21 | apiVersion: 22 | type: string 23 | kind: 24 | type: string 25 | metadata: 26 | type: object 27 | spec: 28 | type: object 29 | x-kubernetes-map-type: atomic 30 | x-kubernetes-preserve-unknown-fields: true 31 | required: 32 | - metadata 33 | - spec 34 | type: object 35 | served: true 36 | storage: true 37 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/base/artifact-repositories-configmap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: # kpt-merge: /artifact-repositories 4 | name: artifact-repositories 5 | annotations: 6 | # you'll want to change the default over time, e.g. when you move to new storage solution, 7 | # so we recommend you version them from the outset by suffixing the version 8 | workflows.argoproj.io/default-artifact-repository: default-v1 9 | data: 10 | default-v1: | 11 | archiveLogs: true 12 | s3: 13 | bucket: my-bucket 14 | endpoint: minio:9000 15 | insecure: true 16 | accessKeySecret: 17 | name: my-minio-cred 18 | key: accesskey 19 | secretKeySecret: 20 | name: my-minio-cred 21 | key: secretkey 22 | my-key: | 23 | archiveLogs: true 24 | s3: 25 | bucket: my-bucket 26 | endpoint: minio:9000 27 | insecure: true 28 | accessKeySecret: 29 | name: my-minio-cred 30 | key: accesskey 31 | secretKeySecret: 32 | name: my-minio-cred 33 | key: secretkey 34 | empty: "" 35 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/installs/multi-user/pipelines-ui/deployment-patch.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: ml-pipeline-ui 5 | spec: 6 | template: 7 | spec: 8 | volumes: 9 | - name: config-volume 10 | configMap: 11 | name: ml-pipeline-ui-configmap 12 | containers: 13 | - name: ml-pipeline-ui 14 | env: 15 | - name: VIEWER_TENSORBOARD_POD_TEMPLATE_SPEC_PATH 16 | value: /etc/config/viewer-pod-template.json 17 | - name: DEPLOYMENT 18 | value: KUBEFLOW 19 | - name: ARTIFACTS_SERVICE_PROXY_NAME 20 | value: ml-pipeline-ui-artifact 21 | - name: ARTIFACTS_SERVICE_PROXY_PORT 22 | value: '80' 23 | - name: ARTIFACTS_SERVICE_PROXY_ENABLED 24 | value: 'true' 25 | - name: ENABLE_AUTHZ 26 | value: 'true' 27 | - name: KUBEFLOW_USERID_HEADER 28 | value: kubeflow-userid 29 | - name: KUBEFLOW_USERID_PREFIX 30 | value: "" 31 | volumeMounts: 32 | - name: config-volume 33 | mountPath: /etc/config 34 | readOnly: true 35 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/pipeline/ml-pipeline-persistenceagent-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | labels: 5 | app: ml-pipeline-persistenceagent 6 | name: ml-pipeline-persistenceagent 7 | spec: 8 | selector: 9 | matchLabels: 10 | app: ml-pipeline-persistenceagent 11 | template: 12 | metadata: 13 | labels: 14 | app: ml-pipeline-persistenceagent 15 | annotations: 16 | cluster-autoscaler.kubernetes.io/safe-to-evict: "true" 17 | spec: 18 | containers: 19 | - env: 20 | - name: NAMESPACE 21 | valueFrom: 22 | fieldRef: 23 | fieldPath: metadata.namespace 24 | - name: TTL_SECONDS_AFTER_WORKFLOW_FINISH 25 | value: "86400" 26 | - name: NUM_WORKERS 27 | value: "2" 28 | image: gcr.io/ml-pipeline/persistenceagent:dummy 29 | imagePullPolicy: IfNotPresent 30 | name: ml-pipeline-persistenceagent 31 | resources: 32 | requests: 33 | cpu: 120m 34 | memory: 500Mi 35 | serviceAccountName: ml-pipeline-persistenceagent 36 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/sso/dex/dex-cm.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | # this contain secret data, so do not use in production 3 | data: 4 | # https://github.com/dexidp/dex/blob/master/examples/config-dev.yaml 5 | config.yaml: | 6 | issuer: http://dex:5556/dex 7 | storage: 8 | type: sqlite3 9 | config: 10 | file: ":memory:" 11 | web: 12 | http: 0.0.0.0:5556 13 | logger: 14 | level: debug 15 | staticClients: 16 | - id: argo-server 17 | redirectURIs: 18 | - http://localhost:2746/oauth2/callback 19 | - http://localhost:8080/oauth2/callback 20 | name: Argo Server 21 | secret: ZXhhbXBsZS1hcHAtc2VjcmV0 22 | connectors: 23 | - type: mockCallback 24 | id: mock 25 | name: Example 26 | enablePasswordDB: true 27 | staticPasswords: 28 | - email: admin@example.com 29 | hash: $2a$10$2b2cU8CPhOTaGrs1HRQuAueS7JTT5ZHsHSzYiFPm1leZck7Mc8T4W 30 | username: admin 31 | userID: 08a8684b-db88-4b73-90a9-3cd1661f5466 32 | kind: ConfigMap 33 | metadata: # kpt-merge: /dex 34 | name: dex 35 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/pipeline/cluster-scoped/scheduled-workflow-crd.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apiextensions.k8s.io/v1 2 | kind: CustomResourceDefinition 3 | metadata: 4 | name: scheduledworkflows.kubeflow.org 5 | spec: 6 | group: kubeflow.org 7 | names: 8 | kind: ScheduledWorkflow 9 | listKind: ScheduledWorkflowList 10 | plural: scheduledworkflows 11 | singular: scheduledworkflow 12 | shortNames: 13 | - swf 14 | scope: Namespaced 15 | versions: 16 | - name: v1beta1 17 | schema: 18 | openAPIV3Schema: 19 | properties: 20 | apiVersion: 21 | type: string 22 | kind: 23 | type: string 24 | metadata: 25 | type: object 26 | spec: 27 | type: object 28 | x-kubernetes-preserve-unknown-fields: true 29 | x-kubernetes-map-type: atomic 30 | status: 31 | type: object 32 | x-kubernetes-preserve-unknown-fields: true 33 | x-kubernetes-map-type: atomic 34 | required: 35 | - spec 36 | - status 37 | type: object 38 | served: true 39 | storage: true 40 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/base/crds/minimal/argoproj.io_cronworkflows.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apiextensions.k8s.io/v1 2 | kind: CustomResourceDefinition 3 | metadata: # kpt-merge: /cronworkflows.argoproj.io 4 | name: cronworkflows.argoproj.io 5 | spec: 6 | group: argoproj.io 7 | names: 8 | kind: CronWorkflow 9 | listKind: CronWorkflowList 10 | plural: cronworkflows 11 | shortNames: 12 | - cwf 13 | - cronwf 14 | singular: cronworkflow 15 | scope: Namespaced 16 | versions: 17 | - name: v1alpha1 18 | schema: 19 | openAPIV3Schema: 20 | properties: 21 | apiVersion: 22 | type: string 23 | kind: 24 | type: string 25 | metadata: 26 | type: object 27 | spec: 28 | type: object 29 | x-kubernetes-map-type: atomic 30 | x-kubernetes-preserve-unknown-fields: true 31 | status: 32 | type: object 33 | x-kubernetes-map-type: atomic 34 | x-kubernetes-preserve-unknown-fields: true 35 | required: 36 | - metadata 37 | - spec 38 | type: object 39 | served: true 40 | storage: true 41 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/prometheus/prometheus-configmap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | data: 3 | prometheus.yml: | 4 | global: 5 | scrape_interval: 15s # By default, scrape targets every 15 seconds. 6 | 7 | # Attach these labels to any time series or alerts when communicating with 8 | # external systems (federation, remote storage, Alertmanager). 9 | external_labels: 10 | monitor: 'kubeflow-pipelines-monitor' 11 | 12 | # A scrape configuration containing exactly one endpoint to scrape: 13 | # Here it's Prometheus itself. 14 | scrape_configs: 15 | # The job name is added as a label `job=` to any timeseries scraped from this config. 16 | - job_name: 'prometheus' 17 | 18 | # Override the global default and scrape targets from this job every 5 seconds. 19 | scrape_interval: 5s 20 | 21 | static_configs: 22 | - targets: ['localhost:9090'] 23 | 24 | # Monitoring ml-pipeline (aka Kubeflow Pipelines API server) 25 | - job_name: 'ml-pipeline' 26 | scrape_interval: 60s 27 | static_configs: 28 | - targets: ['ml-pipeline:8888'] 29 | kind: ConfigMap 30 | metadata: 31 | name: prometheus-configmap -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/base/prometheus/prometheus-deployment.yaml: -------------------------------------------------------------------------------- 1 | # This manifests creates a minimal Prometheus server to scrape and display the metrics emitted by the workflow 2 | # controller. To open this server, create an external IP for the prometheus service or use kubectl port-forward, 3 | # then open: 4 | # 5 | # localhost:9091/graph 6 | # 7 | # Note: this assumes the workflow-controller is emitting metrics in the default port (9090). This will need to 8 | # be modified if the default is overriden. 9 | apiVersion: apps/v1 10 | kind: Deployment 11 | metadata: # kpt-merge: /prometheus 12 | name: prometheus 13 | spec: 14 | replicas: 1 15 | selector: 16 | matchLabels: 17 | app: prometheus 18 | template: 19 | metadata: 20 | labels: 21 | app: prometheus 22 | name: prometheus 23 | spec: 24 | containers: 25 | - name: prometheus 26 | image: prom/prometheus 27 | args: 28 | - --config.file=/config/prometheus.yaml 29 | volumeMounts: 30 | - name: config 31 | mountPath: /config 32 | volumes: 33 | - name: config 34 | configMap: 35 | name: prometheus-config 36 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/installs/generic/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | namespace: kubeflow 4 | bases: 5 | - ../../pipeline 6 | - ../../cache 7 | - ../../cache-deployer 8 | resources: 9 | - pipeline-install-config.yaml 10 | - mysql-secret.yaml 11 | vars: 12 | - name: kfp-namespace 13 | objref: 14 | kind: Deployment 15 | apiVersion: apps/v1 16 | name: ml-pipeline 17 | fieldref: 18 | fieldpath: metadata.namespace 19 | - name: kfp-app-name 20 | objref: 21 | kind: ConfigMap 22 | name: pipeline-install-config 23 | apiVersion: v1 24 | fieldref: 25 | fieldpath: data.appName 26 | - name: kfp-app-version 27 | objref: 28 | kind: ConfigMap 29 | name: pipeline-install-config 30 | apiVersion: v1 31 | fieldref: 32 | fieldpath: data.appVersion 33 | - name: kfp-artifact-bucket-name 34 | objref: 35 | kind: ConfigMap 36 | name: pipeline-install-config 37 | apiVersion: v1 38 | fieldref: 39 | fieldpath: data.bucketName 40 | - name: kfp-default-pipeline-root 41 | objref: 42 | kind: ConfigMap 43 | name: pipeline-install-config 44 | apiVersion: v1 45 | fieldref: 46 | fieldpath: data.defaultPipelineRoot 47 | configurations: 48 | - params.yaml 49 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/base/crds/minimal/argoproj.io_workflowtasksets.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apiextensions.k8s.io/v1 2 | kind: CustomResourceDefinition 3 | metadata: # kpt-merge: /workflowtasksets.argoproj.io 4 | name: workflowtasksets.argoproj.io 5 | spec: 6 | group: argoproj.io 7 | names: 8 | kind: WorkflowTaskSet 9 | listKind: WorkflowTaskSetList 10 | plural: workflowtasksets 11 | shortNames: 12 | - wfts 13 | singular: workflowtaskset 14 | scope: Namespaced 15 | versions: 16 | - name: v1alpha1 17 | schema: 18 | openAPIV3Schema: 19 | properties: 20 | apiVersion: 21 | type: string 22 | kind: 23 | type: string 24 | metadata: 25 | type: object 26 | spec: 27 | type: object 28 | x-kubernetes-map-type: atomic 29 | x-kubernetes-preserve-unknown-fields: true 30 | status: 31 | type: object 32 | x-kubernetes-map-type: atomic 33 | x-kubernetes-preserve-unknown-fields: true 34 | required: 35 | - metadata 36 | - spec 37 | type: object 38 | served: true 39 | storage: true 40 | subresources: 41 | status: {} 42 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/quick-start/base/minio/minio-deploy.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: # kpt-merge: /minio 4 | name: minio 5 | labels: 6 | app: minio 7 | spec: 8 | selector: 9 | matchLabels: 10 | app: minio 11 | template: 12 | metadata: 13 | labels: 14 | app: minio 15 | spec: 16 | containers: 17 | - name: main 18 | image: minio/minio 19 | env: 20 | - name: MINIO_ACCESS_KEY 21 | value: admin 22 | - name: MINIO_SECRET_KEY 23 | value: password 24 | ports: 25 | - containerPort: 9000 26 | command: [minio, server, /data] 27 | lifecycle: 28 | postStart: 29 | exec: 30 | command: [mkdir, -p, /data/my-bucket] 31 | readinessProbe: 32 | httpGet: 33 | path: /minio/health/ready 34 | port: 9000 35 | initialDelaySeconds: 5 36 | periodSeconds: 10 37 | livenessProbe: 38 | httpGet: 39 | path: /minio/health/live 40 | port: 9000 41 | initialDelaySeconds: 5 42 | periodSeconds: 10 43 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/minio/base/minio-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: minio 5 | labels: 6 | app: minio 7 | spec: 8 | selector: 9 | matchLabels: 10 | app: minio 11 | strategy: 12 | type: Recreate 13 | template: 14 | metadata: 15 | labels: 16 | app: minio 17 | spec: 18 | containers: 19 | - args: 20 | - server 21 | - /data 22 | env: 23 | - name: MINIO_ACCESS_KEY 24 | valueFrom: 25 | secretKeyRef: 26 | name: mlpipeline-minio-artifact 27 | key: accesskey 28 | - name: MINIO_SECRET_KEY 29 | valueFrom: 30 | secretKeyRef: 31 | name: mlpipeline-minio-artifact 32 | key: secretkey 33 | image: gcr.io/ml-pipeline/minio:RELEASE.2019-08-14T20-37-41Z-license-compliance 34 | name: minio 35 | ports: 36 | - containerPort: 9000 37 | volumeMounts: 38 | - mountPath: /data 39 | name: data 40 | subPath: minio 41 | resources: 42 | requests: 43 | cpu: 20m 44 | memory: 100Mi 45 | volumes: 46 | - name: data 47 | persistentVolumeClaim: 48 | claimName: minio-pvc 49 | -------------------------------------------------------------------------------- /llms/llm-0001/llm_agent/rag/embed.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from langchain.embeddings import OpenAIEmbeddings 4 | from langchain.embeddings.huggingface import HuggingFaceEmbeddings 5 | 6 | 7 | def get_embedding_model(embedding_model_name, model_kwargs, encode_kwargs): 8 | if embedding_model_name == "text-embedding-ada-002": 9 | embedding_model = OpenAIEmbeddings( 10 | model=embedding_model_name, 11 | openai_api_base=os.environ["OPENAI_API_BASE"], 12 | openai_api_key=os.environ["OPENAI_API_KEY"], 13 | ) 14 | else: 15 | embedding_model = HuggingFaceEmbeddings( 16 | model_name=embedding_model_name, 17 | model_kwargs={"device": "cuda"}, 18 | encode_kwargs={"device": "cuda", "batch_size": 100}, 19 | ) 20 | return embedding_model 21 | 22 | 23 | class EmbedChunks: 24 | def __init__(self, model_name): 25 | # Embedding model 26 | self.embedding_model = get_embedding_model( 27 | embedding_model_name=model_name, 28 | model_kwargs={"device": "cuda"}, 29 | encode_kwargs={"device": "cuda", "batch_size": 100}, 30 | ) 31 | 32 | def __call__(self, batch): 33 | embeddings = self.embedding_model.embed_documents(batch["text"]) 34 | return {"text": batch["text"], "source": batch["source"], "embeddings": embeddings} 35 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/installs/multi-user/pipelines-profile-controller/composite-controller.yaml: -------------------------------------------------------------------------------- 1 | # Change resyncPeriodSeconds to 1 hour from insane 20 seconds 2 | # Only sync namespaces with pipelines.kubeflow.org/enabled = "true" 3 | apiVersion: metacontroller.k8s.io/v1alpha1 4 | kind: CompositeController 5 | metadata: 6 | name: kubeflow-pipelines-profile-controller 7 | spec: 8 | generateSelector: true 9 | resyncPeriodSeconds: 3600 10 | parentResource: 11 | apiVersion: v1 12 | resource: namespaces 13 | childResources: 14 | - apiVersion: v1 15 | resource: secrets 16 | updateStrategy: 17 | method: OnDelete 18 | - apiVersion: v1 19 | resource: configmaps 20 | updateStrategy: 21 | method: OnDelete 22 | - apiVersion: apps/v1 23 | resource: deployments 24 | updateStrategy: 25 | method: InPlace 26 | - apiVersion: v1 27 | resource: services 28 | updateStrategy: 29 | method: InPlace 30 | - apiVersion: networking.istio.io/v1alpha3 31 | resource: destinationrules 32 | updateStrategy: 33 | method: InPlace 34 | - apiVersion: security.istio.io/v1beta1 35 | resource: authorizationpolicies 36 | updateStrategy: 37 | method: InPlace 38 | hooks: 39 | sync: 40 | webhook: 41 | url: http://kubeflow-pipelines-profile-controller/sync 42 | -------------------------------------------------------------------------------- /docker-images/cuda-llm-runner/Makefile: -------------------------------------------------------------------------------- 1 | 2 | create_builder: 3 | docker buildx create --name mybuilder 4 | use_builder: 5 | docker buildx use mybuilder 6 | 7 | inspect_builder: 8 | docker buildx inspect --bootstrap 9 | 10 | 11 | buildx64: 12 | #export DOCKER_DEFAULT_PLATFORM=linux/amd64 13 | export DOCKER_DEFAULT_PLATFORM=linux/aarch64 14 | #docker build -t halilagin/jupyter-rag-langchain:0.0.1 . --platform linux/arm64 15 | docker-compose build 16 | 17 | buildx86: 18 | docker build -t halilagin/cuda-llm-runner:0.0.1 . 19 | 20 | build: 21 | echo ===================== 22 | echo building for arm64. try 'make buildx86' for intel arch. 23 | echo ===================== 24 | #docker buildx build --platform linux/amd64,linux/arm64 . 25 | #docker buildx create --name=cuda-llm-runner --platform linux/amd64,linux/arm64 26 | docker buildx build --platform linux/amd64,linux/arm64 -t halilagin/cuda-llm-runner:0.0.1 --push . 27 | 28 | push: 29 | docker push halilagin/cuda-llm-runner:0.0.1 30 | run: 31 | docker-compose up -d 32 | term: 33 | docker exec -it jupyter_notebook bash 34 | dup: 35 | export DOCKER_DEFAULT_PLATFORM=linux/amd64 36 | docker-compose up -d 37 | down: 38 | docker-compose down 39 | push_to_local: 40 | docker tag halilagin/cuda-llm-runner:0.0.1 localhost:32000/halilagin/cuda-llm-runner:0.0.1 41 | docker push localhost:32000/halilagin/cuda-llm-runner:0.0.1 42 | : 43 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/mysql/base/mysql-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: mysql 5 | labels: 6 | app: mysql 7 | spec: 8 | selector: 9 | matchLabels: 10 | app: mysql 11 | strategy: 12 | type: Recreate 13 | template: 14 | metadata: 15 | labels: 16 | app: mysql 17 | spec: 18 | serviceAccountName: mysql 19 | containers: 20 | # https://dev.mysql.com/doc/refman/5.7/en/server-options.html#option_mysqld_ignore-db-dir 21 | # Ext4, Btrfs etc. volumes root directories have a lost+found directory that should not be treated as a database. 22 | - args: 23 | - --ignore-db-dir=lost+found 24 | - --datadir 25 | - /var/lib/mysql 26 | env: 27 | - name: MYSQL_ALLOW_EMPTY_PASSWORD 28 | value: "true" 29 | image: gcr.io/ml-pipeline/mysql:5.7-debian 30 | name: mysql 31 | ports: 32 | - containerPort: 3306 33 | name: mysql 34 | volumeMounts: 35 | - mountPath: /var/lib/mysql 36 | name: mysql-persistent-storage 37 | resources: 38 | requests: 39 | cpu: 100m 40 | memory: 800Mi 41 | volumes: 42 | - name: mysql-persistent-storage 43 | persistentVolumeClaim: 44 | claimName: mysql-pv-claim 45 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/base/argo-server/argo-server-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: # kpt-merge: /argo-server 4 | name: argo-server 5 | spec: 6 | selector: 7 | matchLabels: 8 | app: argo-server 9 | template: 10 | metadata: 11 | labels: 12 | app: argo-server 13 | spec: 14 | serviceAccountName: argo-server 15 | containers: 16 | - name: argo-server 17 | image: quay.io/argoproj/argocli:latest 18 | securityContext: 19 | readOnlyRootFilesystem: true 20 | runAsNonRoot: true 21 | allowPrivilegeEscalation: false 22 | capabilities: 23 | drop: 24 | - ALL 25 | args: [server] 26 | env: [] 27 | ports: 28 | - name: web 29 | containerPort: 2746 30 | readinessProbe: 31 | httpGet: 32 | port: 2746 33 | scheme: HTTPS 34 | path: / 35 | initialDelaySeconds: 10 36 | periodSeconds: 20 37 | volumeMounts: 38 | - mountPath: /tmp 39 | name: tmp 40 | volumes: 41 | - name: tmp 42 | emptyDir: {} 43 | securityContext: 44 | runAsNonRoot: true 45 | nodeSelector: 46 | kubernetes.io/os: linux 47 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/pipeline/pipeline-runner-role.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: Role 3 | metadata: 4 | name: pipeline-runner 5 | rules: 6 | - apiGroups: 7 | - "" 8 | resources: 9 | - secrets 10 | verbs: 11 | - get 12 | - apiGroups: 13 | - "" 14 | resources: 15 | - configmaps 16 | verbs: 17 | - get 18 | - watch 19 | - list 20 | - apiGroups: 21 | - "" 22 | resources: 23 | - persistentvolumes 24 | - persistentvolumeclaims 25 | verbs: 26 | - '*' 27 | - apiGroups: 28 | - snapshot.storage.k8s.io 29 | resources: 30 | - volumesnapshots 31 | verbs: 32 | - create 33 | - delete 34 | - get 35 | - apiGroups: 36 | - argoproj.io 37 | resources: 38 | - workflows 39 | verbs: 40 | - get 41 | - list 42 | - watch 43 | - update 44 | - patch 45 | - apiGroups: 46 | - "" 47 | resources: 48 | - pods 49 | - pods/exec 50 | - pods/log 51 | - services 52 | verbs: 53 | - '*' 54 | - apiGroups: 55 | - "" 56 | - apps 57 | - extensions 58 | resources: 59 | - deployments 60 | - replicasets 61 | verbs: 62 | - '*' 63 | - apiGroups: 64 | - kubeflow.org 65 | resources: 66 | - '*' 67 | verbs: 68 | - '*' 69 | - apiGroups: 70 | - batch 71 | resources: 72 | - jobs 73 | verbs: 74 | - '*' 75 | - apiGroups: 76 | - machinelearning.seldon.io 77 | resources: 78 | - seldondeployments 79 | verbs: 80 | - '*' 81 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-notebook-controller/apps/jupyter/notebook-controller/upstream/rbac/user_cluster_roles.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: ClusterRole 3 | metadata: 4 | name: kubeflow-notebooks-admin 5 | labels: 6 | rbac.authorization.kubeflow.org/aggregate-to-kubeflow-admin: "true" 7 | aggregationRule: 8 | clusterRoleSelectors: 9 | - matchLabels: 10 | rbac.authorization.kubeflow.org/aggregate-to-kubeflow-notebooks-admin: "true" 11 | rules: [] 12 | 13 | --- 14 | 15 | apiVersion: rbac.authorization.k8s.io/v1 16 | kind: ClusterRole 17 | metadata: 18 | name: kubeflow-notebooks-edit 19 | labels: 20 | rbac.authorization.kubeflow.org/aggregate-to-kubeflow-edit: "true" 21 | rbac.authorization.kubeflow.org/aggregate-to-kubeflow-notebooks-admin: "true" 22 | rules: 23 | - apiGroups: 24 | - kubeflow.org 25 | resources: 26 | - notebooks 27 | - notebooks/status 28 | verbs: 29 | - get 30 | - list 31 | - watch 32 | - create 33 | - delete 34 | - deletecollection 35 | - patch 36 | - update 37 | 38 | --- 39 | 40 | apiVersion: rbac.authorization.k8s.io/v1 41 | kind: ClusterRole 42 | metadata: 43 | name: kubeflow-notebooks-view 44 | labels: 45 | rbac.authorization.kubeflow.org/aggregate-to-kubeflow-view: "true" 46 | rules: 47 | - apiGroups: 48 | - kubeflow.org 49 | resources: 50 | - notebooks 51 | - notebooks/status 52 | verbs: 53 | - get 54 | - list 55 | - watch 56 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/metacontroller/base/stateful-set.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: StatefulSet 3 | metadata: 4 | labels: 5 | app: metacontroller 6 | name: metacontroller 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: metacontroller 12 | serviceName: "" 13 | template: 14 | metadata: 15 | labels: 16 | app: metacontroller 17 | annotations: 18 | sidecar.istio.io/inject: "false" 19 | spec: 20 | containers: 21 | - resources: 22 | limits: 23 | cpu: '1' 24 | memory: 1Gi 25 | requests: 26 | cpu: 100m 27 | memory: 256Mi 28 | command: 29 | - /usr/bin/metacontroller 30 | - --zap-log-level=4 31 | - '--discovery-interval=3600s' # less insane than 10 seconds 32 | securityContext: 33 | capabilities: 34 | drop: 35 | - ALL 36 | readOnlyRootFilesystem: true 37 | runAsNonRoot: true 38 | runAsUser: 1000 39 | privileged: false 40 | allowPrivilegeEscalation: false 41 | name: metacontroller 42 | image: 'docker.io/metacontrollerio/metacontroller:v2.0.4' 43 | serviceAccountName: meta-controller-service 44 | # Workaround for https://github.com/kubernetes-sigs/kustomize/issues/677 45 | volumeClaimTemplates: [] 46 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/base/metadata/overlays/db/metadata-db-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: metadata-db 5 | labels: 6 | component: db 7 | spec: 8 | selector: 9 | matchLabels: 10 | component: db 11 | replicas: 1 12 | strategy: 13 | type: Recreate 14 | template: 15 | metadata: 16 | name: db 17 | labels: 18 | component: db 19 | annotations: 20 | sidecar.istio.io/inject: "false" 21 | spec: 22 | containers: 23 | - name: db-container 24 | image: mysql:8.0.3 25 | args: 26 | - --datadir 27 | - /var/lib/mysql/datadir 28 | envFrom: 29 | - configMapRef: 30 | name: metadata-db-parameters 31 | - secretRef: 32 | name: metadata-db-secrets 33 | ports: 34 | - name: dbapi 35 | containerPort: 3306 36 | readinessProbe: 37 | exec: 38 | command: 39 | - "/bin/bash" 40 | - "-c" 41 | - "mysql -D $$MYSQL_DATABASE -p$$MYSQL_ROOT_PASSWORD -e 'SELECT 1'" 42 | initialDelaySeconds: 5 43 | periodSeconds: 2 44 | timeoutSeconds: 1 45 | volumeMounts: 46 | - name: metadata-mysql 47 | mountPath: /var/lib/mysql 48 | volumes: 49 | - name: metadata-mysql 50 | persistentVolumeClaim: 51 | claimName: metadata-mysql 52 | 53 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/README.md: -------------------------------------------------------------------------------- 1 | # Manifests for Argo workflows 2 | 3 | Kubeflow Pipelines uses [Argo Workflows](https://argoproj.github.io/argo-workflows/) as the underlying workflow execution engine. 4 | 5 | This folder contains: 6 | 7 | * `upstream/manifests` a mirror of argo workflows manifests upstream. It should never be edited here. Run `make update` to update it. 8 | * `installs` a folder with preconfigured argo workflows installations used in Kubeflow Pipelines distributions. 9 | 10 | Major differences from upstream argo manifests: 11 | 12 | * Argo server is not included. 13 | * Argo workflow controller configmap is preconfigured to integrate with KFP. 14 | * Images are configured to use KFP redistributed ones which comply with open source licenses. 15 | * A default artifact repository config is added for in-cluster minio service. 16 | 17 | ## Upgrade argo 18 | 19 | Refer to [third_party/argo/README.md](../../../../third_party/argo/README.md). 20 | 21 | ### Upgrade argo manifests 22 | 23 | Requirement: 24 | 25 | Use kpt version above 1.0.0-beta.6, refer to [kpt installation](https://kpt.dev/installation/) for downloading kpt. 26 | 27 | As one step of above, we need to upgrade argo manifests in this folder. 28 | 29 | 1. Run: 30 | 31 | ```bash 32 | make update 33 | ``` 34 | 35 | Note, argo version is pulled from [third_party/argo/VERSION](../../../../third_party/argo/VERSION). Edit the VERSION file first. 36 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/namespace-install/argo-server-rbac/argo-server-role.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: Role 3 | metadata: # kpt-merge: /argo-server-role 4 | name: argo-server-role 5 | rules: 6 | - apiGroups: 7 | - "" 8 | resources: 9 | - configmaps 10 | verbs: 11 | - get 12 | - watch 13 | - list 14 | - apiGroups: 15 | - "" 16 | resources: 17 | - secrets 18 | verbs: 19 | - get 20 | - create 21 | - list 22 | - watch 23 | - apiGroups: 24 | - "" 25 | resources: 26 | - pods 27 | - pods/exec 28 | - pods/log 29 | verbs: 30 | - get 31 | - list 32 | - watch 33 | - delete 34 | - apiGroups: 35 | - "" 36 | resources: 37 | - events 38 | verbs: 39 | - watch 40 | - create 41 | - patch 42 | - apiGroups: 43 | - "" 44 | resources: 45 | - serviceaccounts 46 | verbs: 47 | - get 48 | - list 49 | - watch 50 | - apiGroups: 51 | - argoproj.io 52 | resources: 53 | - eventsources 54 | - sensors 55 | - workflows 56 | - workfloweventbindings 57 | - workflowtemplates 58 | - cronworkflows 59 | - cronworkflows/finalizers 60 | verbs: 61 | - create 62 | - get 63 | - list 64 | - watch 65 | - update 66 | - patch 67 | - delete 68 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/argo/upstream/manifests/cluster-install/argo-server-rbac/argo-server-clusterole.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: ClusterRole 3 | metadata: # kpt-merge: /argo-server-cluster-role 4 | name: argo-server-cluster-role 5 | rules: 6 | - apiGroups: 7 | - "" 8 | resources: 9 | - configmaps 10 | verbs: 11 | - get 12 | - watch 13 | - list 14 | - apiGroups: 15 | - "" 16 | resources: 17 | - secrets 18 | verbs: 19 | - get 20 | - create 21 | - list 22 | - watch 23 | - apiGroups: 24 | - "" 25 | resources: 26 | - pods 27 | - pods/exec 28 | - pods/log 29 | verbs: 30 | - get 31 | - list 32 | - watch 33 | - delete 34 | - apiGroups: 35 | - "" 36 | resources: 37 | - events 38 | verbs: 39 | - watch 40 | - create 41 | - patch 42 | - apiGroups: 43 | - "" 44 | resources: 45 | - serviceaccounts 46 | verbs: 47 | - get 48 | - list 49 | - watch 50 | - apiGroups: 51 | - argoproj.io 52 | resources: 53 | - eventsources 54 | - sensors 55 | - workflows 56 | - workfloweventbindings 57 | - workflowtemplates 58 | - cronworkflows 59 | - clusterworkflowtemplates 60 | verbs: 61 | - create 62 | - get 63 | - list 64 | - watch 65 | - update 66 | - patch 67 | - delete 68 | -------------------------------------------------------------------------------- /microk8s-setup/core-apps/kubeflow-pipelines/manifests/kustomize/third-party/application/application-controller-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: controller-manager 5 | labels: 6 | control-plane: controller-manager 7 | controller-tools.k8s.io: "1.0" 8 | spec: 9 | selector: 10 | matchLabels: 11 | control-plane: controller-manager 12 | controller-tools.k8s.io: "1.0" 13 | template: 14 | metadata: 15 | labels: 16 | control-plane: controller-manager 17 | controller-tools.k8s.io: "1.0" 18 | spec: 19 | containers: 20 | - command: 21 | - /bin/sh 22 | - -c 23 | # See https://github.com/kubeflow/gcp-blueprints/issues/184. 24 | - | 25 | echo "logs are hidden because volume is too excessive" && 26 | /root/manager 2> /dev/null 27 | # A customized image with https://github.com/kubernetes-sigs/application/pull/127 28 | image: gcr.io/ml-pipeline/application-crd-controller:1.0-beta-non-cluster-role 29 | imagePullPolicy: IfNotPresent 30 | name: manager 31 | env: 32 | - name: NAMESPACE 33 | valueFrom: 34 | fieldRef: 35 | fieldPath: metadata.namespace 36 | resources: 37 | limits: 38 | cpu: 100m 39 | memory: 30Mi 40 | requests: 41 | cpu: 100m 42 | memory: 20Mi 43 | serviceAccountName: application 44 | -------------------------------------------------------------------------------- /docker-images/cuda-llm-runner/Dockerfile: -------------------------------------------------------------------------------- 1 | #FROM ubuntu:22.04 2 | FROM nvidia/cuda:12.2.0-runtime-ubuntu22.04 3 | FROM nvcr.io/nvidia/pytorch:22.08-py3 4 | ENV TZ=Europe/London \ 5 | DEBIAN_FRONTEND=noninteractive 6 | 7 | 8 | USER root 9 | RUN apt-get update 10 | RUN apt-get install -y wget ca-certificates software-properties-common curl git python3.10 python3-pip 11 | #RUN add-apt-repository "deb http://apt.postgresql.org/pub/repos/apt/ lsb_release -cs-pgdg main" 12 | RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - 13 | #RUN add-apt-repository ppa:deadsnakes/ppa 14 | RUN add-apt-repository "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" 15 | #sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ lsb_release -cs-pgdg main" >> /etc/apt/sources.list.d/pgdg.list' 16 | 17 | RUN apt-get update && \ 18 | apt-get install -y libpq-dev postgresql-client 19 | RUN pip install --quiet python-dotenv pipenv 20 | 21 | RUN useradd --create-home appuser 22 | USER appuser 23 | WORKDIR /home/appuser 24 | COPY Pipfile /home/appuser 25 | RUN pipenv lock 26 | RUN pipenv requirements --dev > dev-requirments.txt 27 | RUN pipenv requirements > requirments.txt 28 | RUN pip install --upgrade pip && \ 29 | pip install -r dev-requirments.txt && \ 30 | pip install -r requirments.txt 31 | 32 | #RUN pipenv --python /opt/conda/bin/python3 && \ 33 | #pipenv lock && pipenv --clear && pipenv --rm && \ 34 | #pipenv install --system --deploy 35 | #COPY Pipfile.lock / 36 | #RUN cd / && pipenv install --system --verbose 37 | --------------------------------------------------------------------------------