Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Housekeeping] Remove storage as a task resource option #4116

Closed
wants to merge 2 commits into from
Closed

[Housekeeping] Remove storage as a task resource option #4116

wants to merge 2 commits into from

Conversation

Kota-Karthik
Copy link

@Kota-Karthik Kota-Karthik commented Oct 2, 2023

Tracking issue

closes #3955

Describe your changes

I made changes to the ApplyResourceOverrides function to ensure that user-specified resource requests and limits are respected without being overridden by default values, except when explicitly requested. Here are the key changes I made:

  1. Introduced a new flag assignIfUnset to control whether default values should be assigned. This flag is used to determine whether the code should apply default values for resources.

  2. Modified the behavior inside the function to check the assignIfUnset flag before applying default values. When assignIfUnset is set to true, default values will be assigned only if the user hasn't already specified resource requests and limits.

  3. Added conditional checks for each resource type (e.g., CPU, memory, ephemeral storage, GPU) to ensure that the default values are applied only if the user has not already set resource requirements.

  4. Removed the assignment of default values for storage resources (v1.ResourceStorage) based on the flag assignIfUnset. This allows users to set their own storage requirements without being overridden by defaults.

  5. Introduced the shouldAdjustGPU flag to determine whether GPU resource adjustments are necessary. GPU resources are now adjusted based on user-specified values, and the gpuResourceName is used for customization.

  6. Updated the comments to reflect the changes made and provide context for the assignIfUnset flag and resource adjustments.

These changes ensure that users can set their desired resource requirements, and the code will respect their choices without applying default values unless explicitly requested by setting assignIfUnset to true. This provides greater flexibility and control to users when specifying resource requirements for their tasks.

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Note to reviewers

@samhita-alla
As per your instruction, I have created the Pull Request.
I kindly request you to review it at your earliest convenience.

@welcome
Copy link

welcome bot commented Oct 2, 2023

Thank you for opening this pull request! 🙌

These tips will help get your PR across the finish line:

  • Most of the repos have a PR template; if not, fill it out to the best of your knowledge.
  • Sign off your commits (Reference: DCO Guide).

@Kota-Karthik Kota-Karthik changed the title [Housekeeping] Remove storage as a task resource option [Housekeeping] Remove storage as a task resource option Signed-off-by: [karthik] <[[email protected]]> Oct 2, 2023
@Kota-Karthik Kota-Karthik changed the title [Housekeeping] Remove storage as a task resource option Signed-off-by: [karthik] <[[email protected]]> [Housekeeping] Remove storage as a task resource option Oct 2, 2023
@codecov
Copy link

codecov bot commented Oct 2, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (b35cc95) 58.98% compared to head (40c580c) 57.50%.

❗ Current head 40c580c differs from pull request most recent head 874d61b. Consider uploading reports for the commit 874d61b to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4116      +/-   ##
==========================================
- Coverage   58.98%   57.50%   -1.48%     
==========================================
  Files         618      393     -225     
  Lines       52708    28904   -23804     
==========================================
- Hits        31088    16621   -14467     
+ Misses      19140    10598    -8542     
+ Partials     2480     1685     -795     
Flag Coverage Δ
unittests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

see 574 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -61,7 +61,7 @@ helm install gateway bitnami/contour -n flyte
| cloud_events.eventsPublisher.topicName | string | `"arn:aws:sns:us-east-2:123456:123-my-topic"` | |
| cloud_events.type | string | `"aws"` | |
| cluster_resource_manager | object | `{"config":{"cluster_resources":{"customData":[{"production":[{"projectQuotaCpu":{"value":"5"}},{"projectQuotaMemory":{"value":"4000Mi"}}]},{"staging":[{"projectQuotaCpu":{"value":"2"}},{"projectQuotaMemory":{"value":"3000Mi"}}]},{"development":[{"projectQuotaCpu":{"value":"4"}},{"projectQuotaMemory":{"value":"3000Mi"}}]}],"refreshInterval":"5m","standaloneDeployment":false,"templatePath":"/etc/flyte/clusterresource/templates"}},"enabled":true,"podAnnotations":{},"service_account_name":"flyteadmin","standaloneDeployment":false,"templates":[{"key":"aa_namespace","value":"apiVersion: v1\nkind: Namespace\nmetadata:\n name: {{ namespace }}\nspec:\n finalizers:\n - kubernetes\n"},{"key":"ab_project_resource_quota","value":"apiVersion: v1\nkind: ResourceQuota\nmetadata:\n name: project-quota\n namespace: {{ namespace }}\nspec:\n hard:\n limits.cpu: {{ projectQuotaCpu }}\n limits.memory: {{ projectQuotaMemory }}\n"}]}` | Configuration for the Cluster resource manager component. This is an optional component, that enables automatic cluster configuration. This is useful to set default quotas, manage namespaces etc that map to a project/domain |
| cluster_resource_manager.config | object | `{"cluster_resources":{"customData":[{"production":[{"projectQuotaCpu":{"value":"5"}},{"projectQuotaMemory":{"value":"4000Mi"}}]},{"staging":[{"projectQuotaCpu":{"value":"2"}},{"projectQuotaMemory":{"value":"3000Mi"}}]},{"development":[{"projectQuotaCpu":{"value":"4"}},{"projectQuotaMemory":{"value":"3000Mi"}}]}],"refreshInterval":"5m","standaloneDeployment":false,"templatePath":"/etc/flyte/clusterresource/templates"}}` | Configmap for ClusterResource parameters |
| cluster_resource_manager.config | object | `{"cluster_":{"customData":[{"production":[{"projectQuotaCpu":{"value":"5"}},{"projectQuotaMemory":{"value":"4000Mi"}}]},{"staging":[{"projectQuotaCpu":{"value":"2"}},{"projectQuotaMemory":{"value":"3000Mi"}}]},{"development":[{"projectQuotaCpu":{"value":"4"}},{"projectQuotaMemory":{"value":"3000Mi"}}]}],"refreshInterval":"5m","standaloneDeployment":false,"templatePath":"/etc/flyte/clusterresource/templates"}}` | Configmap for ClusterResource parameters |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this file modified?

@samhita-alla
Copy link
Contributor

@Kota-Karthik, thanks for creating the PR! Could you modify the PR description to specify the changes you made? I don't think you added all those flags you mentioned, correct? They are already present in the code. Could you just describe the changes you introduced?

@samhita-alla
Copy link
Contributor

@Kota-Karthik, could you review my comments? Let me know if you aren't able to resolve them within the next two days 'cause a couple of others are also interested in resolving this issue.

@samhita-alla
Copy link
Contributor

@Kota-Karthik, please let me know if you're currently working on incorporating my suggestions. If not, I'll plan to close the issue within a week. Thank you for creating the PR, though.

@Kota-Karthik Kota-Karthik closed this by deleting the head repository Oct 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Housekeeping] Remove storage as a task resource option
2 participants