-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Overwriting of cached task outputs for a single execution #minor (#616)
* Added direnv .envrc to gitignore Signed-off-by: Nick Müller <[email protected]> * Added cache skip override to launch forms Signed-off-by: Nick Müller <[email protected]> * Adapted protobuf timestamp helpers to support number and Long values Signed-off-by: Nick Müller <[email protected]> * Added SIGINT handling for server shutdown Allows for stopping docker run via CTRL+C Signed-off-by: Nick Müller <[email protected]> * Renamed skipCache flag to overwriteCache Signed-off-by: Nick Müller <[email protected]> Signed-off-by: Nick Müller <[email protected]>
- Loading branch information
Nick Müller
authored
Jan 6, 2023
1 parent
385eb69
commit 88bcfba
Showing
21 changed files
with
484 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
.env | ||
*.swp | ||
# direnv | ||
.envrc | ||
|
||
# C extensions | ||
*.so | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
packages/zapp/console/src/components/Launch/LaunchForm/LaunchOverwriteCacheInput.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import { Typography } from '@material-ui/core'; | ||
import FormControlLabel from '@material-ui/core/FormControlLabel'; | ||
import Checkbox from '@material-ui/core/Checkbox'; | ||
import * as React from 'react'; | ||
import { useStyles } from './styles'; | ||
import { LaunchOverwriteCacheInputRef } from './types'; | ||
import t from './strings'; | ||
|
||
const isValueValid = (value: any) => { | ||
return value !== undefined && value !== null; | ||
}; | ||
|
||
interface LaunchOverwriteCacheInputProps { | ||
initialValue?: boolean | null; | ||
} | ||
|
||
export const LaunchOverwriteCacheInputImpl: React.ForwardRefRenderFunction< | ||
LaunchOverwriteCacheInputRef, | ||
LaunchOverwriteCacheInputProps | ||
> = (props, ref) => { | ||
// overwriteCache stores the override to enable/disable the setting for an execution | ||
const [overwriteCache, setOverwriteCache] = React.useState(false); | ||
|
||
React.useEffect(() => { | ||
if (isValueValid(props.initialValue)) { | ||
setOverwriteCache(() => props.initialValue!); | ||
} | ||
}, [props.initialValue]); | ||
|
||
const handleInputChange = React.useCallback(() => { | ||
setOverwriteCache((prevState) => !prevState); | ||
}, [overwriteCache]); | ||
|
||
React.useImperativeHandle( | ||
ref, | ||
() => ({ | ||
getValue: () => { | ||
return overwriteCache; | ||
}, | ||
validate: () => true, | ||
}), | ||
[overwriteCache], | ||
); | ||
|
||
const styles = useStyles(); | ||
|
||
return ( | ||
<section> | ||
<header className={styles.sectionHeader}> | ||
<Typography variant="h6">Caching</Typography> | ||
<Typography variant="body2"> | ||
Enabling the cache overwrite causes Flyte to ignore all previously computed and stored | ||
outputs for a single execution and run all calculations again, overwriting any cached data | ||
after a successful execution. | ||
</Typography> | ||
</header> | ||
<section title={t('overwriteCache')}> | ||
<FormControlLabel | ||
control={<Checkbox checked={overwriteCache} onChange={handleInputChange} />} | ||
label={t('overwriteCache')} | ||
/> | ||
</section> | ||
</section> | ||
); | ||
}; | ||
|
||
export const LaunchOverwriteCacheInput = React.forwardRef(LaunchOverwriteCacheInputImpl); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.