fix: validator can run in any direcotry - #78
Open
nanjiangshu wants to merge 4 commits into
Open
Conversation
…ecks - Add dependency check for `bpctl` to ensure CLI availability - Prefix temporary directories and file targets with `$WORKDIR` for isolated path resolution - Update k8s job setup to read config/data relative to `$WORKDIR` and `$SCRIPT_DIR` - Invoke pre-built `bpctl` directly from PATH instead of building locally with `go build`
- Highlight recommended standard workflow: run with --dry-run first to check validation, followed by a second run without --dry-run for ingestion - Add recommendation to create and use a dedicated dataset folder (e.g. `DATASET_aaaaaaa`) as WORKDIR - Document the dependency on `bpctl` being present in PATH
pahatz
reviewed
Sep 11, 2026
| <(printf '%s\n' "$extra_inbox_relative") \ | ||
| <(paste \ | ||
| <(echo "$all_thumbnail_files") \ | ||
| <(echo "$all_thumbnail_relative" | sed 's|LANDING_PAGE/THUMBNAILS/||'))) |
Contributor
There was a problem hiding this comment.
Have you tried this? I think you need that sed for the 'relative' list
Comment on lines
-699
to
-706
| # Function for checking the metadata and inbox files. | ||
| # - Gets a list of all the dataset filepaths in the inbox | ||
| # - Counts only the files in the IMAGES folder | ||
| # - Parses the filenames from metadata and counts them | ||
| # - Checks if the metadata list is empty and if it is, then exits | ||
| # - Checks if the number of files in the inbox and in the metadata are equal | ||
| # - If there are equal number of files, then it checks if the filenames from metadata exist in the inbox | ||
| # - If they are not equal, it prints the extra or missing files and exits |
Contributor
There was a problem hiding this comment.
I find the function summaries useful, was there a reason to completely remove them?
Comment on lines
491
to
526
| @@ -510,63 +545,56 @@ function validate_structure { | |||
|
|
|||
| # Function for downloading the xml metadata files from the inbox | |||
| function get_xml_files { | |||
| mkdir -p xml-files | |||
| mkdir -p "$WORKDIR/xml-files" | |||
| cecho yellow "Getting xml files ..." | |||
| for bucket in "${INBOX_BUCKETS[@]}"; do | |||
| metadata_path=$(s3cmd_command ls "s3://${bucket}/${user}/${dataset}/" 2>/dev/null | grep -i METADATA | awk '{print $2}') | |||
| private_path=$(s3cmd_command ls "s3://${bucket}/${user}/${dataset}/" 2>/dev/null | grep -i PRIVATE | awk '{print $2}') | |||
| if [[ -n "$metadata_path" ]]; then | |||
| s3cmd_command get "$metadata_path" --recursive xml-files/ >/dev/null 2>&1 | |||
| s3cmd_command get "$metadata_path" --recursive "$WORKDIR/xml-files/" >/dev/null 2>&1 | |||
| fi | |||
| if [[ -n "$private_path" ]]; then | |||
| s3cmd_command get "$private_path" --recursive xml-files/ >/dev/null 2>&1 | |||
| s3cmd_command get "$private_path" --recursive "$WORKDIR/xml-files/" >/dev/null 2>&1 | |||
| fi | |||
| done | |||
| if [[ "$LANDING_PAGE" == "true" ]]; then | |||
| for bucket in "${INBOX_BUCKETS[@]}"; do | |||
Contributor
There was a problem hiding this comment.
was this needed to run with the workdir addition?
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes the issue that the validator script has to be run at where the script is located.
Changes made
$WORKDIRfor isolated path resolution$WORKDIRbpctldirectly from PATH instead of building locally withgo buildcheck validation, followed by a second run without --dry-run for ingestion