From 3c4e619c86afd8502eea5d8cf335be9f414dd11c Mon Sep 17 00:00:00 2001 From: Yee Hing Tong Date: Sun, 12 Apr 2020 13:36:09 -0700 Subject: [PATCH 01/10] adding text --- .../managing_customizable_resources.rst | 48 +++++++++++++------ rsts/contributor/components/admin_service.rst | 23 ++++----- 2 files changed, 45 insertions(+), 26 deletions(-) diff --git a/rsts/administrator/install/managing_customizable_resources.rst b/rsts/administrator/install/managing_customizable_resources.rst index a9f4ad3823..d8337cd53c 100644 --- a/rsts/administrator/install/managing_customizable_resources.rst +++ b/rsts/administrator/install/managing_customizable_resources.rst @@ -4,20 +4,32 @@ Configuring customizable resources ################################## -As the complexity of your user-base grows, you may find yourself tweaking resource assignments based on specific projects, domains and workflows. -This document walks through how to use MatchableResource attributes to customize your workflow execution environment. +As the complexity of your user base grows, you may find yourself tweaking resource assignments based on specific projects, domains and workflows. This document walks through how and in what ways you can configure your Flyte deployment. -Flyteadmin allows for overrides of task resource request and limit defaults, kubernetes cluster resource configuration, -dynamic task execution queues and specifying executions on specific kubernetes clusters. These can all be overriden for specific combinations -of domain; domain and project; domain, project and workflow (name); and domain, project, workflow (name), and launch plan. *************************** Configurable Resource Types *************************** -The proto definition is the definitive source of +Flyte allows these custom settings along the following combination of dimensions + +- domain +- project and domain +- project, domain, and name (must be either a workflow name or a launch plan name) + +Please see the :ref:`concepts` document for more information on projects and domains. Along these dimensions, the following settings are configurable. Note that not all three of the combinations above are valid for each of these settings. + +- Defaults for task resource requests and limits (when not specified by the author of the task). +- Settings for the cluster resource configuration that feeds into Admin's cluster resource manager. +- Execution queues that are used for Dynamic Tasks. Read more about execution queues here, but effectively they're meant to be used with constructs like AWS Batch. +- Determining how workflow executions get assigned to clusters in a multi=cluster Flyte deployment. + +The proto definition is the definitive source of which `matchable attributes `_ -which can be customized. See below for a detailed explanation +can be customized. + +Each of the four above settings are discussed below. Also, since the flyte-cli tool does not yet hit these endpoints, we are including some sample ``curl`` commands for administrators to reference. + Task Resources ============== @@ -25,15 +37,12 @@ Task Resources This includes setting default value for task resource requests and limits for the following resources: - cpu - - gpu - - memory - - storage In the absence of an override the global -`default values `_ +`default values `__ in the flyteadmin config are used. The override values from the database are assigned at execution time. @@ -42,11 +51,20 @@ The override values from the database are assigned at execution time. Cluster Resources ================= -These are free-form key-value pairs which are used when creating project-domain based resources on Flyte kubernetes clusters. +These are free-form key-value pairs which are used when filling in the templates that Admin feeds into its cluster manager. The keys represent templatized variables in `clusterresource template yaml `__ and the values are what you want to see filled in. + +In the absence of custom override values, templateData from the `flyteadmin config `__ is used as a default. + +Note that these settings can only take on domain, or a project and domain specificity. Project & domain together in Flyte form Kubernetes namespaces. Since Flyte has not tied in the notion of a workflow or a launch plan to any Kubernetes constructs, specifying a workflow or launch plan name doesn't make any sense. + + +Command +------- +Running the following, will make it so that when Admin fills in cluster resource templates, the K8s namespace ``projectname-staging`` will have a resource quota of 1000 CPU cores and 5TB of memory. -The keys represent templatized variables in `clusterresource template yaml `_ +.. code-block:: console -In the absence of custom override values, templateData from the `flyteadmin config `_ is used as a default. + curl --request PUT 'https://flyte.company.net/api/v1/project_domain_attributes/projectname/staging' --header 'Content-Type: application/json' --data-raw '{"attributes":{"matchingAttributes":{"clusterResourceAttributes":{"attributes":{"projectQuotaCpu": "1000", "projectQuotaMemory": "5000Gi"}}}}}' Execution Queues @@ -55,7 +73,7 @@ Execution Queues Execution queues are use to determine where dynamic tasks run. Execution queues themselves are currently defined in the -`flyteadmin config `_. +`flyteadmin config `__. The **attributes** associated with an execution queue must match the **tags** for workflow executions. The tags are associated with configurable resources stored in the admin database. diff --git a/rsts/contributor/components/admin_service.rst b/rsts/contributor/components/admin_service.rst index 300459e629..d9e7a27e08 100644 --- a/rsts/contributor/components/admin_service.rst +++ b/rsts/contributor/components/admin_service.rst @@ -6,7 +6,7 @@ FlyteAdmin Service Background Entities ======== -The `admin service definition `_ defines REST operations for the entities +The `admin service definition `__ defines REST operations for the entities flyteadmin administers. As a refresher, the primary :ref:`entities ` across Flyte map similarly to FlyteAdmin entities. @@ -37,9 +37,9 @@ An inactive launch plan can still be used to launch individual executions. Howev Static entities metadata (Named Entities +++++++++++++++++++++++++++++++++++++++++ -A `named entity `_ includes metadata for one of the above entities +A `named entity `__ includes metadata for one of the above entities (workflow, task or launch plan) across versions. A named entity includes a resource type (workflow, task or launch plan) and an -`id `_ which is composed of project, domain and name. +`id `__ which is composed of project, domain and name. A named entity also includes metadata, which are mutable attributes about the referenced entity. This metadata includes: @@ -176,6 +176,7 @@ Filterable fields vary based on entity types: - state (you must use the integer enum e.g. 1) - States are defined in `launch_plan.proto `_. - Named Entity Metadata + - state (you must use the integer enum e.g. 1) - States are defined in `common.proto `_. - Executions (Workflow executions) @@ -186,19 +187,19 @@ Filterable fields vary based on entity types: - workflow.{any workflow field above} (for example: workflow.domain) - launch_plan.{any launch plan field above} (for example: launch_plan.name) - phase (you must use the upper-cased string name e.g. RUNNING) - - Phases are defined in `execution.proto `_. + - Phases are defined in `execution.proto `__. - execution_created_at - execution_updated_at - duration (in seconds) - mode (you must use the integer enum e.g. 1) - - Modes are defined in `execution.proto `_. + - Modes are defined in `execution.proto `__. - Node Executions - node_id - execution.{any execution field above} (for example: execution.domain) - phase (you must use the upper-cased string name e.g. QUEUED) - - Phases are defined in `execution.proto `_. + - Phases are defined in `execution.proto `__. - started_at - node_execution_created_at - node_execution_updated_at @@ -210,7 +211,7 @@ Filterable fields vary based on entity types: - execution.{any execution field above} (for example: execution.domain) - node_execution.{any node execution field above} (for example: node_execution.phase) - phase (you must use the upper-cased string name e.g. SUCCEEDED) - - Phases are defined in `execution.proto `_. + - Phases are defined in `execution.proto `__. - started_at - task_execution_created_at - task_execution_updated_at @@ -277,18 +278,18 @@ Only a subset of fields are supported for sorting list queries. The explicit lis - domain - name - phase (you must use the upper-cased string name e.g. RUNNING) - - Phases are defined in `execution.proto `_. + - Phases are defined in `execution.proto `__. - execution_created_at - execution_updated_at - duration (in seconds) - mode (you must use the integer enum e.g. 1) - - Modes are defined `execution.proto `_. + - Modes are defined `execution.proto `__. - ListNodeExecutions - node_id - retry_attempt - phase (you must use the upper-cased string name e.g. QUEUED) - - Phases are defined in `execution.proto `_. + - Phases are defined in `execution.proto `__. - started_at - node_execution_created_at - node_execution_updated_at @@ -297,7 +298,7 @@ Only a subset of fields are supported for sorting list queries. The explicit lis - retry_attempt - phase (you must use the upper-cased string name e.g. SUCCEEDED) - - Phases are defined in `execution.proto `_. + - Phases are defined in `execution.proto `__. - started_at - task_execution_created_at - task_execution_updated_at From 1318c0cbff3d44a31dce8babbf8a533fc2a22b64 Mon Sep 17 00:00:00 2001 From: Yee Hing Tong Date: Sun, 12 Apr 2020 14:54:58 -0700 Subject: [PATCH 02/10] formatting nits in other files --- rsts/user/concepts/tasks.rst | 2 +- rsts/user/tasktypes/sidecar.rst | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/rsts/user/concepts/tasks.rst b/rsts/user/concepts/tasks.rst index b6365c4398..bb3e7befc2 100644 --- a/rsts/user/concepts/tasks.rst +++ b/rsts/user/concepts/tasks.rst @@ -56,7 +56,7 @@ When deciding whether a unit of execution conistitutes a Flyte Task or not. Cons but opt to using a system-provided clock as the seed. - Is it a pure function? i.e. does it have side effects that are not known to the system (e.g. calls a web-service). It's strongly - advisable to avoid side-effects in tasks. When side-effects are required, ensure that those operations are idempotent_. + advisable to avoid side-effects in tasks. When side-effects are required, ensure that those operations are idempotent. Types ----- diff --git a/rsts/user/tasktypes/sidecar.rst b/rsts/user/tasktypes/sidecar.rst index 9dc439e3b3..075f49d894 100644 --- a/rsts/user/tasktypes/sidecar.rst +++ b/rsts/user/tasktypes/sidecar.rst @@ -1,10 +1,12 @@ .. _sidecar-task-type: +############# Sidecar Tasks -============= +############# Sidecar tasks can be used to bring up multiple containers within a single task. Sidecar tasks are defined using a Kubernetes `pod spec `_ but differ slightly in that the plugin task executor solely monitors the status of a user-specified primary container over the task lifecycle. +************ Installation ************ If you haven't already, install the sidecar extra from flytekit like so: @@ -21,19 +23,20 @@ And assert that you have a dependency in your project on k8s-proto>=0.0.2 +***** Usage -##### +***** Sidecar accept all arguments that ordinary :ref:`container tasks ` accept. However, sidecar tasks require two additional arguments, ``pod_spec`` and ``primary_container_name`` Pod Spec -******** +======== Using the `generated python protobuf code in flyteproto `_, a task can define a completely kubernetes-native pod spec that will be deployed as part of the sidecar task execution. Primary container -***************** +======== This is a required name you use to distinguish your primary container. The code in the body of the task definition will be injected in the primary container. The pod spec you pass to the task definition does not necessarily need to include a container definition with the primary container, but if you'd like to modify the primary container by setting a shared volume mount for example, you can do so in the pod spec. From 7c113cd0ffe74078b6a699da38ba9b61b4ad40d9 Mon Sep 17 00:00:00 2001 From: Yee Hing Tong Date: Wed, 15 Apr 2020 17:58:29 -0700 Subject: [PATCH 03/10] add an example resource quota --- .../clusterresource-templates/ab_resource_quotas.yaml | 10 ++++++++++ .../sandbox/admindeployment/kustomization.yaml | 1 + 2 files changed, 11 insertions(+) create mode 100644 kustomize/overlays/sandbox/admindeployment/clusterresource-templates/ab_resource_quotas.yaml diff --git a/kustomize/overlays/sandbox/admindeployment/clusterresource-templates/ab_resource_quotas.yaml b/kustomize/overlays/sandbox/admindeployment/clusterresource-templates/ab_resource_quotas.yaml new file mode 100644 index 0000000000..ddfade3c29 --- /dev/null +++ b/kustomize/overlays/sandbox/admindeployment/clusterresource-templates/ab_resource_quotas.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: ResourceQuota +metadata: + name: project-quota + namespace: {{ namespace }} +spec: + hard: + limits.cpu: {{ projectQuotaCpu }} + limits.memory: {{ projectQuotaMemory }} + diff --git a/kustomize/overlays/sandbox/admindeployment/kustomization.yaml b/kustomize/overlays/sandbox/admindeployment/kustomization.yaml index 55186e329c..3b326e4582 100644 --- a/kustomize/overlays/sandbox/admindeployment/kustomization.yaml +++ b/kustomize/overlays/sandbox/admindeployment/kustomization.yaml @@ -16,6 +16,7 @@ configMapGenerator: files: # Files are read in alphabetical order. To ensure that we create the namespace first, prefix the file name with "aa". - clusterresource-templates/aa_namespace.yaml + - clusterresource-templates/ab_resource_quotas.yaml patches: - admindeployment.yaml From cbe3568bd5c3bebb281152b8aa9ae5664942e245 Mon Sep 17 00:00:00 2001 From: Yee Hing Tong Date: Wed, 15 Apr 2020 18:33:59 -0700 Subject: [PATCH 04/10] attempting to add config for local sandbox resource quota as an example --- deployment/sandbox/flyte_generated.yaml | 31 +++++++++++++++---- deployment/test/flyte_generated.yaml | 31 +++++++++++++++---- .../admindeployment/flyteadmin_config.yaml | 16 ++++++++++ 3 files changed, 66 insertions(+), 12 deletions(-) diff --git a/deployment/sandbox/flyte_generated.yaml b/deployment/sandbox/flyte_generated.yaml index 31b1dc605d..58c902ff03 100644 --- a/deployment/sandbox/flyte_generated.yaml +++ b/deployment/sandbox/flyte_generated.yaml @@ -492,9 +492,12 @@ data: spec: finalizers: - kubernetes + ab_resource_quotas.yaml: "apiVersion: v1\nkind: ResourceQuota\nmetadata:\n name: + project-quota\n namespace: {{ namespace }} \nspec:\n hard:\n limits.cpu: + {{ projectQuotaCpu }} \n limits.memory: {{ projectQuotaMemory }}\n\n" kind: ConfigMap metadata: - name: clusterresource-template-dgc9fcm2kh + name: clusterresource-template-gfd5k8mdh9 namespace: flyte --- apiVersion: v1 @@ -600,10 +603,26 @@ data: name: domain cluster_resources: templatePath: "/etc/flyte/clusterresource/templates" + customData: + production: + - projectQuotaCpu: + value: "5" + - projectQuotaMemory: + value: "4000Mi" + staging: + - projectQuotaCpu: + value: "1" + - projectQuotaMemory: + value: "2000Mi" + development: + - projectQuotaCpu: + value: "1" + - projectQuotaMemory: + value: "2000Mi" refresh: 5m kind: ConfigMap metadata: - name: flyte-admin-config-4k466cfctf + name: flyte-admin-config-htgtk9k78c namespace: flyte --- apiVersion: v1 @@ -1060,12 +1079,12 @@ spec: serviceAccountName: flyteadmin volumes: - configMap: - name: clusterresource-template-dgc9fcm2kh + name: clusterresource-template-gfd5k8mdh9 name: resource-templates - emptyDir: {} name: shared-data - configMap: - name: flyte-admin-config-4k466cfctf + name: flyte-admin-config-htgtk9k78c name: config-volume --- apiVersion: apps/v1 @@ -1459,10 +1478,10 @@ spec: serviceAccountName: flyteadmin volumes: - configMap: - name: clusterresource-template-dgc9fcm2kh + name: clusterresource-template-gfd5k8mdh9 name: resource-templates - configMap: - name: flyte-admin-config-4k466cfctf + name: flyte-admin-config-htgtk9k78c name: config-volume schedule: '*/1 * * * *' --- diff --git a/deployment/test/flyte_generated.yaml b/deployment/test/flyte_generated.yaml index 56cfba3042..8e4c822e8c 100644 --- a/deployment/test/flyte_generated.yaml +++ b/deployment/test/flyte_generated.yaml @@ -367,9 +367,12 @@ data: spec: finalizers: - kubernetes + ab_resource_quotas.yaml: "apiVersion: v1\nkind: ResourceQuota\nmetadata:\n name: + project-quota\n namespace: {{ namespace }} \nspec:\n hard:\n limits.cpu: + {{ projectQuotaCpu }} \n limits.memory: {{ projectQuotaMemory }}\n\n" kind: ConfigMap metadata: - name: clusterresource-template-dgc9fcm2kh + name: clusterresource-template-gfd5k8mdh9 namespace: flyte --- apiVersion: v1 @@ -439,10 +442,26 @@ data: name: domain cluster_resources: templatePath: "/etc/flyte/clusterresource/templates" + customData: + production: + - projectQuotaCpu: + value: "5" + - projectQuotaMemory: + value: "4000Mi" + staging: + - projectQuotaCpu: + value: "1" + - projectQuotaMemory: + value: "2000Mi" + development: + - projectQuotaCpu: + value: "1" + - projectQuotaMemory: + value: "2000Mi" refresh: 5m kind: ConfigMap metadata: - name: flyte-admin-config-4k466cfctf + name: flyte-admin-config-htgtk9k78c namespace: flyte --- apiVersion: v1 @@ -727,12 +746,12 @@ spec: serviceAccountName: flyteadmin volumes: - configMap: - name: clusterresource-template-dgc9fcm2kh + name: clusterresource-template-gfd5k8mdh9 name: resource-templates - emptyDir: {} name: shared-data - configMap: - name: flyte-admin-config-4k466cfctf + name: flyte-admin-config-htgtk9k78c name: config-volume --- apiVersion: apps/v1 @@ -1026,10 +1045,10 @@ spec: serviceAccountName: flyteadmin volumes: - configMap: - name: clusterresource-template-dgc9fcm2kh + name: clusterresource-template-gfd5k8mdh9 name: resource-templates - configMap: - name: flyte-admin-config-4k466cfctf + name: flyte-admin-config-htgtk9k78c name: config-volume schedule: '*/1 * * * *' --- diff --git a/kustomize/overlays/sandbox/admindeployment/flyteadmin_config.yaml b/kustomize/overlays/sandbox/admindeployment/flyteadmin_config.yaml index b54c3cd52a..60b155f398 100644 --- a/kustomize/overlays/sandbox/admindeployment/flyteadmin_config.yaml +++ b/kustomize/overlays/sandbox/admindeployment/flyteadmin_config.yaml @@ -62,4 +62,20 @@ domains: name: domain cluster_resources: templatePath: "/etc/flyte/clusterresource/templates" + customData: + production: + - projectQuotaCpu: + value: "5" + - projectQuotaMemory: + value: "4000Mi" + staging: + - projectQuotaCpu: + value: "1" + - projectQuotaMemory: + value: "2000Mi" + development: + - projectQuotaCpu: + value: "1" + - projectQuotaMemory: + value: "2000Mi" refresh: 5m From e81c76013064ec5bf102938bed08053b8b06e900 Mon Sep 17 00:00:00 2001 From: Yee Hing Tong Date: Wed, 15 Apr 2020 20:26:40 -0700 Subject: [PATCH 05/10] more doc changes --- .../managing_customizable_resources.rst | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/rsts/administrator/install/managing_customizable_resources.rst b/rsts/administrator/install/managing_customizable_resources.rst index d8337cd53c..e58990a9cb 100644 --- a/rsts/administrator/install/managing_customizable_resources.rst +++ b/rsts/administrator/install/managing_customizable_resources.rst @@ -76,7 +76,14 @@ Execution queues themselves are currently defined in the `flyteadmin config `__. The **attributes** associated with an execution queue must match the **tags** for workflow executions. The tags are associated with configurable resources -stored in the admin database. +stored in the Admin database. + +Command +------- + +.. code-block:: console + + curl --request PUT 'https://flyte.lyft.net/api/v1/workflow_attributes/project/domain/YourWorkflowName' --header 'Content-Type: application/json' --data-raw '{"attributes":{"matchingAttributes":{"executionQueueAttributes":{"tags":["my_queue"]}}}}' Execution Cluster Label @@ -117,7 +124,7 @@ Let's say that our database includes the following +------------+--------------+----------+-------------+-----------+ Any inbound CreateExecution requests with **[Domain: Production, Project: widgetmodels, Workflow: Demand]** for any launch plan would have a tag value of "supply". -Any inbound CreateExecution requests with **[Domain: Production, Project: widgetmodels]** for any workflow other than Deman and for any launch plan would have a tag value of "critical". +Any inbound CreateExecution requests with **[Domain: Production, Project: widgetmodels]** for any workflow other than Demand and for any launch plan would have a tag value of "critical". All other inbound CreateExecution requests would use the default values specified in the flyteadmin config (if any). @@ -125,11 +132,11 @@ All other inbound CreateExecution requests would use the default values specifie Debugging ********* -Use the `get `_ endpoint +Use the `get `__ endpoint to see if overrides exist for a specific resource. -E.g. `https://example.com/api/v1/project_domain_attributes/widgetmodels/production?resource_type=2 `_ +E.g. `https://example.com/api/v1/project_domain_attributes/widgetmodels/production?resource_type=2 `__ -To get the global state of the world, use the list all endpoint, e.g. `https://example.com/api/v1/matchable_attributes?resource_type=2 `_. +To get the global state of the world, use the list all endpoint, e.g. `https://example.com/api/v1/matchable_attributes?resource_type=2 `__. -The resource type enum (int) is defined in the `proto `_. +The resource type enum (int) is defined in the `proto `__. From 563fb434b7c8728f2388e89bf31eeb2e95c2de5c Mon Sep 17 00:00:00 2001 From: Yee Hing Tong Date: Wed, 15 Apr 2020 20:28:30 -0700 Subject: [PATCH 06/10] rename file --- deployment/sandbox/flyte_generated.yaml | 10 +++++----- deployment/test/flyte_generated.yaml | 10 +++++----- ...urce_quotas.yaml => ab_project-resource-quota.yaml} | 0 .../sandbox/admindeployment/kustomization.yaml | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) rename kustomize/overlays/sandbox/admindeployment/clusterresource-templates/{ab_resource_quotas.yaml => ab_project-resource-quota.yaml} (100%) diff --git a/deployment/sandbox/flyte_generated.yaml b/deployment/sandbox/flyte_generated.yaml index 58c902ff03..ae57de04e5 100644 --- a/deployment/sandbox/flyte_generated.yaml +++ b/deployment/sandbox/flyte_generated.yaml @@ -492,12 +492,12 @@ data: spec: finalizers: - kubernetes - ab_resource_quotas.yaml: "apiVersion: v1\nkind: ResourceQuota\nmetadata:\n name: - project-quota\n namespace: {{ namespace }} \nspec:\n hard:\n limits.cpu: + ab_project-resource-quota.yaml: "apiVersion: v1\nkind: ResourceQuota\nmetadata:\n + \ name: project-quota\n namespace: {{ namespace }} \nspec:\n hard:\n limits.cpu: {{ projectQuotaCpu }} \n limits.memory: {{ projectQuotaMemory }}\n\n" kind: ConfigMap metadata: - name: clusterresource-template-gfd5k8mdh9 + name: clusterresource-template-m2kccc465f namespace: flyte --- apiVersion: v1 @@ -1079,7 +1079,7 @@ spec: serviceAccountName: flyteadmin volumes: - configMap: - name: clusterresource-template-gfd5k8mdh9 + name: clusterresource-template-m2kccc465f name: resource-templates - emptyDir: {} name: shared-data @@ -1478,7 +1478,7 @@ spec: serviceAccountName: flyteadmin volumes: - configMap: - name: clusterresource-template-gfd5k8mdh9 + name: clusterresource-template-m2kccc465f name: resource-templates - configMap: name: flyte-admin-config-htgtk9k78c diff --git a/deployment/test/flyte_generated.yaml b/deployment/test/flyte_generated.yaml index 8e4c822e8c..9d912189c9 100644 --- a/deployment/test/flyte_generated.yaml +++ b/deployment/test/flyte_generated.yaml @@ -367,12 +367,12 @@ data: spec: finalizers: - kubernetes - ab_resource_quotas.yaml: "apiVersion: v1\nkind: ResourceQuota\nmetadata:\n name: - project-quota\n namespace: {{ namespace }} \nspec:\n hard:\n limits.cpu: + ab_project-resource-quota.yaml: "apiVersion: v1\nkind: ResourceQuota\nmetadata:\n + \ name: project-quota\n namespace: {{ namespace }} \nspec:\n hard:\n limits.cpu: {{ projectQuotaCpu }} \n limits.memory: {{ projectQuotaMemory }}\n\n" kind: ConfigMap metadata: - name: clusterresource-template-gfd5k8mdh9 + name: clusterresource-template-m2kccc465f namespace: flyte --- apiVersion: v1 @@ -746,7 +746,7 @@ spec: serviceAccountName: flyteadmin volumes: - configMap: - name: clusterresource-template-gfd5k8mdh9 + name: clusterresource-template-m2kccc465f name: resource-templates - emptyDir: {} name: shared-data @@ -1045,7 +1045,7 @@ spec: serviceAccountName: flyteadmin volumes: - configMap: - name: clusterresource-template-gfd5k8mdh9 + name: clusterresource-template-m2kccc465f name: resource-templates - configMap: name: flyte-admin-config-htgtk9k78c diff --git a/kustomize/overlays/sandbox/admindeployment/clusterresource-templates/ab_resource_quotas.yaml b/kustomize/overlays/sandbox/admindeployment/clusterresource-templates/ab_project-resource-quota.yaml similarity index 100% rename from kustomize/overlays/sandbox/admindeployment/clusterresource-templates/ab_resource_quotas.yaml rename to kustomize/overlays/sandbox/admindeployment/clusterresource-templates/ab_project-resource-quota.yaml diff --git a/kustomize/overlays/sandbox/admindeployment/kustomization.yaml b/kustomize/overlays/sandbox/admindeployment/kustomization.yaml index 3b326e4582..6f612c126a 100644 --- a/kustomize/overlays/sandbox/admindeployment/kustomization.yaml +++ b/kustomize/overlays/sandbox/admindeployment/kustomization.yaml @@ -16,7 +16,7 @@ configMapGenerator: files: # Files are read in alphabetical order. To ensure that we create the namespace first, prefix the file name with "aa". - clusterresource-templates/aa_namespace.yaml - - clusterresource-templates/ab_resource_quotas.yaml + - clusterresource-templates/ab_project-resource-quota.yaml patches: - admindeployment.yaml From 70bdb44c6503e0c9dac4363ad55784399283727f Mon Sep 17 00:00:00 2001 From: Yee Hing Tong Date: Wed, 15 Apr 2020 20:36:11 -0700 Subject: [PATCH 07/10] nits --- .../administrator/install/managing_customizable_resources.rst | 4 ++-- rsts/contributor/components/admin_service.rst | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rsts/administrator/install/managing_customizable_resources.rst b/rsts/administrator/install/managing_customizable_resources.rst index e58990a9cb..b1c6d38334 100644 --- a/rsts/administrator/install/managing_customizable_resources.rst +++ b/rsts/administrator/install/managing_customizable_resources.rst @@ -22,7 +22,7 @@ Please see the :ref:`concepts` document for more information on projects and dom - Defaults for task resource requests and limits (when not specified by the author of the task). - Settings for the cluster resource configuration that feeds into Admin's cluster resource manager. - Execution queues that are used for Dynamic Tasks. Read more about execution queues here, but effectively they're meant to be used with constructs like AWS Batch. -- Determining how workflow executions get assigned to clusters in a multi=cluster Flyte deployment. +- Determining how workflow executions get assigned to clusters in a multi-cluster Flyte deployment. The proto definition is the definitive source of which `matchable attributes `_ @@ -83,7 +83,7 @@ Command .. code-block:: console - curl --request PUT 'https://flyte.lyft.net/api/v1/workflow_attributes/project/domain/YourWorkflowName' --header 'Content-Type: application/json' --data-raw '{"attributes":{"matchingAttributes":{"executionQueueAttributes":{"tags":["my_queue"]}}}}' + curl --request PUT 'https://flyte.company.net/api/v1/workflow_attributes/project/domain/YourWorkflowName' --header 'Content-Type: application/json' --data-raw '{"attributes":{"matchingAttributes":{"executionQueueAttributes":{"tags":["my_queue"]}}}}' Execution Cluster Label diff --git a/rsts/contributor/components/admin_service.rst b/rsts/contributor/components/admin_service.rst index d9e7a27e08..3427ffd820 100644 --- a/rsts/contributor/components/admin_service.rst +++ b/rsts/contributor/components/admin_service.rst @@ -35,7 +35,7 @@ At most one launch plan version across a shared project, domain and name specifi An inactive launch plan can still be used to launch individual executions. However, only an active launch plan runs on a schedule (if it has a schedule defined). -Static entities metadata (Named Entities +Static entities metadata (Named Entities) +++++++++++++++++++++++++++++++++++++++++ A `named entity `__ includes metadata for one of the above entities (workflow, task or launch plan) across versions. A named entity includes a resource type (workflow, task or launch plan) and an From c0245059076e6e5c4bf7f36e502c435e1cf85bbd Mon Sep 17 00:00:00 2001 From: Yee Hing Tong Date: Wed, 15 Apr 2020 20:40:33 -0700 Subject: [PATCH 08/10] remove domain domain --- deployment/sandbox/flyte_generated.yaml | 8 +++----- deployment/test/flyte_generated.yaml | 8 +++----- .../sandbox/admindeployment/flyteadmin_config.yaml | 2 -- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/deployment/sandbox/flyte_generated.yaml b/deployment/sandbox/flyte_generated.yaml index ae57de04e5..616ff1bca8 100644 --- a/deployment/sandbox/flyte_generated.yaml +++ b/deployment/sandbox/flyte_generated.yaml @@ -599,8 +599,6 @@ data: name: staging - id: production name: production - - id: domain - name: domain cluster_resources: templatePath: "/etc/flyte/clusterresource/templates" customData: @@ -622,7 +620,7 @@ data: refresh: 5m kind: ConfigMap metadata: - name: flyte-admin-config-htgtk9k78c + name: flyte-admin-config-dtcg25hb22 namespace: flyte --- apiVersion: v1 @@ -1084,7 +1082,7 @@ spec: - emptyDir: {} name: shared-data - configMap: - name: flyte-admin-config-htgtk9k78c + name: flyte-admin-config-dtcg25hb22 name: config-volume --- apiVersion: apps/v1 @@ -1481,7 +1479,7 @@ spec: name: clusterresource-template-m2kccc465f name: resource-templates - configMap: - name: flyte-admin-config-htgtk9k78c + name: flyte-admin-config-dtcg25hb22 name: config-volume schedule: '*/1 * * * *' --- diff --git a/deployment/test/flyte_generated.yaml b/deployment/test/flyte_generated.yaml index 9d912189c9..9a19aae3f6 100644 --- a/deployment/test/flyte_generated.yaml +++ b/deployment/test/flyte_generated.yaml @@ -438,8 +438,6 @@ data: name: staging - id: production name: production - - id: domain - name: domain cluster_resources: templatePath: "/etc/flyte/clusterresource/templates" customData: @@ -461,7 +459,7 @@ data: refresh: 5m kind: ConfigMap metadata: - name: flyte-admin-config-htgtk9k78c + name: flyte-admin-config-dtcg25hb22 namespace: flyte --- apiVersion: v1 @@ -751,7 +749,7 @@ spec: - emptyDir: {} name: shared-data - configMap: - name: flyte-admin-config-htgtk9k78c + name: flyte-admin-config-dtcg25hb22 name: config-volume --- apiVersion: apps/v1 @@ -1048,7 +1046,7 @@ spec: name: clusterresource-template-m2kccc465f name: resource-templates - configMap: - name: flyte-admin-config-htgtk9k78c + name: flyte-admin-config-dtcg25hb22 name: config-volume schedule: '*/1 * * * *' --- diff --git a/kustomize/overlays/sandbox/admindeployment/flyteadmin_config.yaml b/kustomize/overlays/sandbox/admindeployment/flyteadmin_config.yaml index 60b155f398..655573b71e 100644 --- a/kustomize/overlays/sandbox/admindeployment/flyteadmin_config.yaml +++ b/kustomize/overlays/sandbox/admindeployment/flyteadmin_config.yaml @@ -58,8 +58,6 @@ domains: name: staging - id: production name: production - - id: domain - name: domain cluster_resources: templatePath: "/etc/flyte/clusterresource/templates" customData: From db31dc489a2ce84076cc090d8adfe55c677bc6b3 Mon Sep 17 00:00:00 2001 From: Yee Hing Tong Date: Wed, 15 Apr 2020 20:48:25 -0700 Subject: [PATCH 09/10] more text --- rsts/administrator/install/managing_customizable_resources.rst | 2 ++ rsts/user/tasktypes/sidecar.rst | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/rsts/administrator/install/managing_customizable_resources.rst b/rsts/administrator/install/managing_customizable_resources.rst index b1c6d38334..17cf5aab5a 100644 --- a/rsts/administrator/install/managing_customizable_resources.rst +++ b/rsts/administrator/install/managing_customizable_resources.rst @@ -66,6 +66,8 @@ Running the following, will make it so that when Admin fills in cluster resource curl --request PUT 'https://flyte.company.net/api/v1/project_domain_attributes/projectname/staging' --header 'Content-Type: application/json' --data-raw '{"attributes":{"matchingAttributes":{"clusterResourceAttributes":{"attributes":{"projectQuotaCpu": "1000", "projectQuotaMemory": "5000Gi"}}}}}' +These values will in turn be used to fill in the template fields in the file at ``kustomize/overlays/sandbox/admindeployment/clusterresource-templates/ab_project-resource-quota.yaml`` from the base of this repository for the ``projectname-staging`` namespace and that namespace only. For other namespaces, the defaults at the bottom of `this file `__ would still be applied. + Execution Queues ================ diff --git a/rsts/user/tasktypes/sidecar.rst b/rsts/user/tasktypes/sidecar.rst index 075f49d894..66d81e8fdd 100644 --- a/rsts/user/tasktypes/sidecar.rst +++ b/rsts/user/tasktypes/sidecar.rst @@ -36,7 +36,7 @@ Using the `generated python protobuf code in flyteproto Date: Thu, 16 Apr 2020 14:06:58 -0700 Subject: [PATCH 10/10] pr comment --- rsts/administrator/install/managing_customizable_resources.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rsts/administrator/install/managing_customizable_resources.rst b/rsts/administrator/install/managing_customizable_resources.rst index 17cf5aab5a..f22e3b0c02 100644 --- a/rsts/administrator/install/managing_customizable_resources.rst +++ b/rsts/administrator/install/managing_customizable_resources.rst @@ -55,7 +55,7 @@ These are free-form key-value pairs which are used when filling in the templates In the absence of custom override values, templateData from the `flyteadmin config `__ is used as a default. -Note that these settings can only take on domain, or a project and domain specificity. Project & domain together in Flyte form Kubernetes namespaces. Since Flyte has not tied in the notion of a workflow or a launch plan to any Kubernetes constructs, specifying a workflow or launch plan name doesn't make any sense. +Note that these settings can only take on domain, or a project and domain specificity. Since Flyte has not tied in the notion of a workflow or a launch plan to any Kubernetes constructs, specifying a workflow or launch plan name doesn't make any sense. Command