Skip to content

Commit

Permalink
Merge pull request #1070 from cdapio/bugfix-ui/CDAP-20639-v2
Browse files Browse the repository at this point in the history
[CDAP-20639] fix Driver/Executor out of sync and fix failing cypress test
  • Loading branch information
sumengwang authored Jul 21, 2023
2 parents bae3897 + fa89877 commit 65f06e3
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,15 @@ const mapDispatchToProps = (dispatch) => {
);
return {
onVirtualCoresChange: (e) => {
const { runtimeArgs, pipelineVisualConfiguration } = PipelineConfigurationsStore.getState();
if (!pipelineVisualConfiguration.isDetailView) {
// in studio, we need to set state for correct deploy and export
dispatch({
type: PipelineConfigurationsActions.SET_DRIVER_VIRTUAL_CORES,
payload: { virtualCores: e.target.value },
});
}
if (lifecycleManagementEditEnabled) {
const { runtimeArgs } = PipelineConfigurationsStore.getState();
const newRunTimePairs = getUpdatedRuntimeArgsPair(
runtimeArgs,
GENERATED_RUNTIMEARGS.SYSTEM_DRIVER_RESOURCES_CORES,
Expand All @@ -61,17 +68,18 @@ const mapDispatchToProps = (dispatch) => {
type: PipelineConfigurationsActions.SET_RUNTIME_ARGS,
payload: { runtimeArgs: { pairs: newRunTimePairs } },
});
} else {
// modify the default state if LCM is not enabled
dispatch({
type: PipelineConfigurationsActions.SET_DRIVER_VIRTUAL_CORES,
payload: { virtualCores: e.target.value },
});
}
},
onMemoryMBChange: (e) => {
const { runtimeArgs, pipelineVisualConfiguration } = PipelineConfigurationsStore.getState();
if (!pipelineVisualConfiguration.isDetailView) {
// in studio, we need to set state for correct deploy and export
dispatch({
type: PipelineConfigurationsActions.SET_DRIVER_MEMORY_MB,
payload: { memoryMB: e.target.value },
});
}
if (lifecycleManagementEditEnabled) {
const { runtimeArgs } = PipelineConfigurationsStore.getState();
const newRunTimePairs = getUpdatedRuntimeArgsPair(
runtimeArgs,
GENERATED_RUNTIMEARGS.SYSTEM_DRIVER_RESOURCES_MEMORY,
Expand All @@ -81,12 +89,6 @@ const mapDispatchToProps = (dispatch) => {
type: PipelineConfigurationsActions.SET_RUNTIME_ARGS,
payload: { runtimeArgs: { pairs: newRunTimePairs } },
});
} else {
// modify the default state if LCM is not enabled
dispatch({
type: PipelineConfigurationsActions.SET_DRIVER_MEMORY_MB,
payload: { memoryMB: e.target.value },
});
}
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,15 @@ const mapDispatchToProps = (dispatch) => {
);
return {
onVirtualCoresChange: (e) => {
const { runtimeArgs, pipelineVisualConfiguration } = PipelineConfigurationsStore.getState();
if (!pipelineVisualConfiguration.isDetailView) {
// in studio, we need to set state for correct deploy and export
dispatch({
type: PipelineConfigurationsActions.SET_MEMORY_VIRTUAL_CORES,
payload: { virtualCores: e.target.value },
});
}
if (lifecycleManagementEditEnabled) {
const { runtimeArgs } = PipelineConfigurationsStore.getState();
const newRunTimePairs = getUpdatedRuntimeArgsPair(
runtimeArgs,
GENERATED_RUNTIMEARGS.SYSTEM_EXECUTOR_RESOURCES_CORES,
Expand All @@ -64,17 +71,18 @@ const mapDispatchToProps = (dispatch) => {
type: PipelineConfigurationsActions.SET_RUNTIME_ARGS,
payload: { runtimeArgs: { pairs: newRunTimePairs } },
});
} else {
// modify the default state if LCM is not enabled
dispatch({
type: PipelineConfigurationsActions.SET_MEMORY_VIRTUAL_CORES,
payload: { virtualCores: e.target.value },
});
}
},
onMemoryMBChange: (e) => {
const { runtimeArgs, pipelineVisualConfiguration } = PipelineConfigurationsStore.getState();
if (!pipelineVisualConfiguration.isDetailView) {
// in studio, we need to set state for correct deploy and export
dispatch({
type: PipelineConfigurationsActions.SET_MEMORY_MB,
payload: { memoryMB: e.target.value },
});
}
if (lifecycleManagementEditEnabled) {
const { runtimeArgs } = PipelineConfigurationsStore.getState();
const newRunTimePairs = getUpdatedRuntimeArgsPair(
runtimeArgs,
GENERATED_RUNTIMEARGS.SYSTEM_EXECUTOR_RESOURCES_MEMORY,
Expand All @@ -84,12 +92,6 @@ const mapDispatchToProps = (dispatch) => {
type: PipelineConfigurationsActions.SET_RUNTIME_ARGS,
payload: { runtimeArgs: { pairs: newRunTimePairs } },
});
} else {
// modify the default state if LCM is not enabled
dispatch({
type: PipelineConfigurationsActions.SET_MEMORY_MB,
payload: { memoryMB: e.target.value },
});
}
},
};
Expand Down

0 comments on commit 65f06e3

Please sign in to comment.