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

[PCUI] Support On-Demand Capacity Reservations and Capacity Blocks for PCUI #347

Merged
merged 5 commits into from
Aug 26, 2024

Conversation

hehe7318
Copy link
Contributor

@hehe7318 hehe7318 commented Aug 23, 2024

Description

feat: Support ODCR(On-Demand Capacity Reservations) and CB(Capacity Blocks) for PCUI

Changes

  • Added CapacityReservationTarget select component at the compute resource level, allowing users to choose between CapacityReservationId, CapacityReservationResourceGroupArn, or none.
  • Implemented dynamic placeholders to guide users on the required inputs for CapacityReservationId and CapacityReservationResourceGroupArn.
  • Introduced CAPACITY_BLOCK as a new purchase type option in the UI.
  • Automatically hide the Allocation Strategy selection when CAPACITY_BLOCK is selected, following the expected behavior in ParallelCluster.
  • Implemented logic to automatically hide the instance type selection and exclude the Instances section in the YAML when CapacityReservationId is selected.
  • Made the Instances property of MultiInstanceComputeResource optional.
  • Updated the mechanism in queues.mapper.ts to resolve the conversion conflict.
  • Added CapacityReservationTarget in queue types.
  • Updated validateComputeResources to adapt to the new changes, allowing Instances to be empty if CapacityReservationId is selected.
  • Added info panel for Capacity Reservation and Capacity Block, included documentation links and note on instance type usage.

Note:

ParallelCluster supports CapacityReservationTarget at both the queue and compute resource levels. However, the official documentation (Launch Instances into On-Demand Capacity Reservations (ODCR) - ParallelCluster, Launch Instances Using Capacity Blocks - ParallelCluster) recommends managing CapacityReservationTarget at the compute resource level. If CapacityReservationTarget is specified at both the queue and compute resource levels, the compute resource level option overrides the queue level option.

Implementing CapacityReservationTarget at the queue level is unnecessary, as it adds complexity and requires significant refactoring due to internal PCUI mechanisms that conflict with this implementation. The decision not to implement CapacityReservationTarget at the queue level does not impact customers, given that control at the compute resource level aligns with best practices and recommendations.

How Has This Been Tested?

Manually test passed, and worked as expected.

References

Launch Instances into On-Demand Capacity Reservations (ODCR) - ParallelCluster
Launch Instances Using Capacity Blocks - ParallelCluster
aws parallelcluster Scheduling section

PR Quality Checklist

  • I added tests to new or existing code
  • I removed hardcoded strings and used react-i18next library (useTranslation hook and/or Trans component), see an example here
  • I made sure no sensitive info gets logged at any time in the codebase (see here) (e.g. no user info or details, no stacktraces, etc.)
  • I made sure that any GitHub issue solved by this PR is correctly linked
  • I checked that infrastructure/update_infrastructure.sh runs without any error
  • I checked that npm run build builds without any error
  • I checked that clusters are listed correctly
  • I checked that a new cluster can be created (config is produced and dry run passes)
  • I checked that login and logout work as expected

In order to increase the likelihood of your contribution being accepted, please make sure you have read both the Contributing Guidelines and the Project Guidelines

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

…locks) for PCUI

- Added CapacityReservationTarget select component allowing users to choose between CapacityReservationId, CapacityReservationResourceGroupArn, or none at both queue and compute resource levels.
- Implemented dynamic placeholders to guide users on the required inputs for CapacityReservationId and CapacityReservationResourceGroupArn.
- Introduced CAPACITY_BLOCK as a new purchase type option in the UI.
- Automatically hide the Allocation Strategy selection when CAPACITY_BLOCK is selected as the purchase type, adhering to the expected behavior in ParallelCluster.
- Applied CapacityReservationTarget select component in queue and compute resource levels, maintaining consistency with ParallelCluster's behavior.
…locks) for PCUI

- Removed the usage of the odcrCbSelection component at the queue level due to conflicts in queues.mapper.ts when converting SingleInstanceComputeResource to MultiInstanceComputeResource.
- Implemented logic to automatically hide the instance type selection and exclude the Instances section in the YAML when CapacityReservationId is selected.
- Made the Instances property of MultiInstanceComputeResource optional.
- Updated the mechanism in queues.mapper.ts to resolve the conversion conflict.
…ources to adapt the new changes. Now if CapacityReservationId is selected, Instances can be empty.
…documentation links and note on instance type usage. Move related string correctly under compute resources instead of advanced options. Tiny changes on format and comments.
"label": "CapacityReservationTarget",
"help": {
"title": "Capacity Reservations and Capacity Blocks",
"description": "Learn how to configure Capacity Reservations and Capacity Blocks in ParallelCluster.",

Choose a reason for hiding this comment

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

I dont think this should be the description! This should tell them what to do rather than ask them to Learn

Other wise the whole CR LGTM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@hehe7318 hehe7318 merged commit 81cffc4 into aws:main Aug 26, 2024
2 checks passed
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.

2 participants