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

Dell ECS cleanup now on partition #2215

Merged
merged 2 commits into from
Apr 9, 2024
Merged
Changes from all commits
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
17 changes: 15 additions & 2 deletions scripts/bash/s3a_wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ shift
hdfsPublishPath=""
hdfsPath=""
jceks_flag=""
std_path="$STD_HDFS_PATH"

# Function to print error message and exit
function error_exit() {
Expand Down Expand Up @@ -105,6 +106,18 @@ function cleanup_versions() {
return 0
}

# Function to get evaluated tmp path for standardization
# Replace placeholders if present
function replace_std_path_placeholders() {
std_path=$(echo "$std_path" | sed "s/{0}/$dataset_name/")
std_path=$(echo "$std_path" | sed "s/{1}/$dataset_version/")
std_path=$(echo "$std_path" | sed "s/{2}/$report_date/")
std_path=$(echo "$std_path" | sed "s/{3}/$report_version/")

return 0
}


# Parse command line arguments
while [[ $# -gt 0 ]]; do
case "$1" in
Expand Down Expand Up @@ -152,7 +165,7 @@ echo "$original_script" "${other_args[@]}" \
exit_code=$?

# Clean up versions if necessary
[[ $hdfsPublishPath == s3a://* ]] && cleanup_versions "$hdfsPublishPath" "$ECS_API_KK"
[[ $STD_HDFS_PATH == s3a://* ]] && cleanup_versions "$STD_HDFS_PATH" "$ECS_API_KK"
[[ $hdfsPublishPath == s3a://* ]] && cleanup_versions "$hdfsPublishPath/enceladus_info_date=$report_date" "$ECS_API_KK"
[[ $std_path == s3a://* ]] && replace_std_path_placeholders && cleanup_versions "$std_path"

exit $exit_code
Loading