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
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 18 additions & 14 deletions frontend/locales/en/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -1082,7 +1082,24 @@
"description": "Prevent multiple threads from running on an EC2 instance core."
}
},
"enableEfa": "Use EFA"
"enableEfa": "Use EFA",
"capacityReservationTarget": {
"title": "Capacity reservations",
"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.

"odcrLink": "Launch instances using On-Demand Capacity Reservations (ODCR)",
"capacityBlocksLink": "Launch instances using Capacity Blocks",
"note": "When selecting CapacityReservationId, the specified instance type will automatically apply."
}
},
"capacityReservationResourceGroupArn": {
"label": "CapacityReservationResourceGroupArn"
},
"capacityReservationId": {
"label": "CapacityReservationId"
}
},
"advancedOptions": {
"label": "Advanced options",
Expand All @@ -1094,19 +1111,6 @@
},
"rootVolume": {
"title": "Root volume"
},
"capacityType":{
"label": "CapacityType"
},
"capacityReservationTarget": {
"title": "Capacity reservations",
"label": "CapacityReservationTarget"
},
"capacityReservationResourceGroupArn": {
"label": "CapacityReservationResourceGroupArn"
},
"capacityReservationId": {
"label": "CapacityReservationId"
}
},
"addQueueButton": {
Expand Down
37 changes: 33 additions & 4 deletions frontend/src/old-pages/Configure/Components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -692,8 +692,8 @@ function OdcrCbSelect({

const options = [
{ label: 'none', value: 'none' },
{ label: t('wizard.queues.advancedOptions.capacityReservationId.label'), value: 'capacityReservationId' },
{ label: t('wizard.queues.advancedOptions.capacityReservationResourceGroupArn.label'), value: 'capacityReservationResourceGroupArn' },
{ label: t('wizard.queues.computeResource.capacityReservationId.label'), value: 'capacityReservationId' },
{ label: t('wizard.queues.computeResource.capacityReservationResourceGroupArn.label'), value: 'capacityReservationResourceGroupArn' },
]

const getPlaceholder = () => {
Expand All @@ -708,7 +708,36 @@ function OdcrCbSelect({

return (
<SpaceBetween direction="vertical" size="xs">
<FormField label={t('wizard.queues.advancedOptions.capacityReservationTarget.label')}>
<FormField
label={t('wizard.queues.computeResource.capacityReservationTarget.label')}
info={
<InfoLink
helpPanel={
<TitleDescriptionHelpPanel
title={t('wizard.queues.computeResource.capacityReservationTarget.help.title')}
description={
<>
<p>{t('wizard.queues.computeResource.capacityReservationTarget.help.description')}</p>
<ul>
<li>
<a href="https://docs.aws.amazon.com/parallelcluster/latest/ug/launch-instances-odcr-v3.html" target="_blank" rel="noopener noreferrer">
{t('wizard.queues.computeResource.capacityReservationTarget.help.odcrLink')}
</a>
</li>
<li>
<a href="https://docs.aws.amazon.com/parallelcluster/latest/ug/launch-instances-capacity-blocks.html" target="_blank" rel="noopener noreferrer">
{t('wizard.queues.computeResource.capacityReservationTarget.help.capacityBlocksLink')}
</a>
</li>
</ul>
<p>{t('wizard.queues.computeResource.capacityReservationTarget.help.note')}</p>
</>
}
/>
}
/>
}
>
<Select
selectedOption={
options.find(option => option.value === selectedOption) || {
Expand All @@ -721,7 +750,7 @@ function OdcrCbSelect({
/>
</FormField>
{(selectedOption === 'capacityReservationId' || selectedOption === 'capacityReservationResourceGroupArn') && (
<FormField label={`${t(`wizard.queues.advancedOptions.${selectedOption}.label`)}`}>
<FormField label={`${t(`wizard.queues.computeResource.${selectedOption}.label`)}`}>
<Input
placeholder={getPlaceholder()}
value={inputValue}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ export function ComputeResource({
/>
</FormField>
</SpaceBetween>
{/* Render the instance type selection field only when 'capacityReservationId' is not selected */}
{odcrCbOption !== 'capacityReservationId' && (
<FormField
label={t('wizard.queues.computeResource.instanceType.label')}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/old-pages/Configure/Queues/queues.mapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
} from './queues.types'

function mapComputeResource(
computeResource: SingleInstanceComputeResource | MultiInstanceComputeResource,
computeResource: SingleInstanceComputeResource | MultiInstanceComputeResource,
): MultiInstanceComputeResource {
// If it's already a MultiInstanceComputeResource and Instances exist, return it directly
if ('Instances' in computeResource && computeResource.Instances?.length) {
Expand Down
Loading