-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fetch Migration] Usability updates and bugfixes (#451)
This change includes a few usability improvements and some bugfixes: * (Bugfix) fetch_orchestrator.py skips the check for a Data Prepper pipeline file if an INLINE_PIPELINE value is present * The Fetch Migration Dockerfile entrypoint has been updated to use the exec form. This allows command line arguments (such as flags) to be passed to it * A wrapper script (showFetchMigrationCommand.sh) has been added which provides an easy way to supply flags (such as --create-only or --dryrun) to the ECS task. The script does not run the AWS command - it only prints it for the user to copy and run themselves * The messaging in the metadata migration report has been tweaked to decrease confusion when performing a run where data isn't migrated * Added handling for scenarios where the target document count is zero --------- Signed-off-by: Kartik Ganesh <[email protected]>
- Loading branch information
Showing
6 changed files
with
73 additions
and
9 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
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
53 changes: 53 additions & 0 deletions
53
TrafficCapture/dockerSolution/src/main/docker/migrationConsole/showFetchMigrationCommand.sh
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,53 @@ | ||
#!/bin/bash | ||
|
||
# Ensure Fetch Migration command is available before proceeding | ||
if [ -z "$FETCH_MIGRATION_COMMAND" ]; then | ||
echo "Fetch Migration unavailable or not deployed, exiting..." | ||
exit 1 | ||
fi | ||
|
||
# ECS command overrides argument with placeholder for flags | ||
OVERRIDES_ARG="--overrides '{ \"containerOverrides\": [ { \"name\": \"fetch-migration\", \"command\": <FLAGS> }]}'" | ||
|
||
# Default values | ||
create_only=false | ||
dry_run=false | ||
|
||
while [[ $# -gt 0 ]]; do | ||
key="$1" | ||
case $key in | ||
--create-only) | ||
create_only=true | ||
shift | ||
;; | ||
--dryrun) | ||
dry_run=true | ||
shift | ||
;; | ||
*) | ||
shift | ||
;; | ||
esac | ||
done | ||
|
||
# Build flags string | ||
flags="" | ||
if [ "$dry_run" = true ]; then | ||
flags="--dryrun,${flags}" | ||
fi | ||
if [ "$create_only" = true ]; then | ||
flags="--createonly,${flags}" | ||
fi | ||
|
||
command_to_run="$FETCH_MIGRATION_COMMAND" | ||
# Only add overrides suffix if any flags were specified | ||
if [ -n "$flags" ]; then | ||
# Remove trailing , | ||
flags=${flags%?} | ||
# Convert to JSON array string | ||
flags=$(echo -n $flags | jq -cRs 'split("\n")') | ||
# Replace placeholder value in overrides string with actual flags | ||
command_to_run="$command_to_run ${OVERRIDES_ARG/<FLAGS>/$flags}" | ||
fi | ||
|
||
echo $command_to_run |