Skip to content

Commit

Permalink
don't copy errored datums to pub bucket
Browse files Browse the repository at this point in the history
  • Loading branch information
covesturtevant committed Nov 28, 2023
1 parent 02414fb commit 97a636c
Show file tree
Hide file tree
Showing 7 changed files with 111 additions and 63 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,23 @@ transform:
python3 -m pub_egress.pub_egress_main
fi
# If there is output, egress it
dirs=$(find $OUT_PATH/* -type d)
dirs=$(find $OUT_PATH/NEON.DOM.SITE* -maxdepth 0 -type d)
if [[ ${dirs} ]]; then
echo "Syncing files to bucket $BUCKET_NAME"
rclone \
--no-check-dest \
--copy-links \
--gcs-bucket-policy-only \
--gcs-no-check-bucket \
copy \
"${OUT_PATH}" \
":gcs://${BUCKET_NAME}"
for DIR in $dirs; do
echo "Syncing $DIR to bucket $BUCKET_NAME"
# Parse the product
[[ "$DIR" =~ ^$OUT_PATH/(.*)$ ]]
PRODUCT="${BASH_REMATCH[1]}"
rclone \
--no-check-dest \
--copy-links \
--gcs-bucket-policy-only \
--gcs-no-check-bucket \
copy \
"${OUT_PATH}/${PRODUCT}" \
":gcs://${BUCKET_NAME}/${PRODUCT}"
done
echo "Done"
fi
# Set some environment variables for the second module
Expand Down
24 changes: 15 additions & 9 deletions pipe/parQuantumLine/parQuantumLine_pub_egress_and_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,23 @@ transform:
python3 -m pub_egress.pub_egress_main
fi
# If there is output, egress it
dirs=$(find $OUT_PATH/* -type d)
dirs=$(find $OUT_PATH/NEON.DOM.SITE* -maxdepth 0 -type d)
if [[ ${dirs} ]]; then
echo "Syncing files to bucket $BUCKET_NAME"
rclone \
--no-check-dest \
--copy-links \
--gcs-bucket-policy-only \
--gcs-no-check-bucket \
copy \
"${OUT_PATH}" \
":gcs://${BUCKET_NAME}"
for DIR in $dirs; do
echo "Syncing $DIR to bucket $BUCKET_NAME"
# Parse the product
[[ "$DIR" =~ ^$OUT_PATH/(.*)$ ]]
PRODUCT="${BASH_REMATCH[1]}"
rclone \
--no-check-dest \
--copy-links \
--gcs-bucket-policy-only \
--gcs-no-check-bucket \
copy \
"${OUT_PATH}/${PRODUCT}" \
":gcs://${BUCKET_NAME}/${PRODUCT}"
done
echo "Done"
fi
# Set some environment variables for the second module
Expand Down
27 changes: 18 additions & 9 deletions pipe/parWaterSurface/parWaterSurface_pub_egress_and_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,31 @@ transform:
- "-c"
- |-
/bin/bash <<'EOF'
# Use bash-scrict mode. See http://redsymbol.net/articles/unofficial-bash-strict-mode/
set -euo pipefail
IFS=$'\n\t'
# Run first module - pub_egress (using environment variables below as input parameters)
if [[ $(echo $DATA_PATH) ]]; then
python3 -m pub_egress.pub_egress_main
fi
# If there is output, egress it
dirs=$(find $OUT_PATH/* -type d)
dirs=$(find $OUT_PATH/NEON.DOM.SITE* -maxdepth 0 -type d)
if [[ ${dirs} ]]; then
echo "Syncing files to bucket $BUCKET_NAME"
rclone \
--no-check-dest \
--copy-links \
--gcs-bucket-policy-only \
--gcs-no-check-bucket \
copy \
"${OUT_PATH}" \
":gcs://${BUCKET_NAME}"
for DIR in $dirs; do
echo "Syncing $DIR to bucket $BUCKET_NAME"
# Parse the product
[[ "$DIR" =~ ^$OUT_PATH/(.*)$ ]]
PRODUCT="${BASH_REMATCH[1]}"
rclone \
--no-check-dest \
--copy-links \
--gcs-bucket-policy-only \
--gcs-no-check-bucket \
copy \
"${OUT_PATH}/${PRODUCT}" \
":gcs://${BUCKET_NAME}/${PRODUCT}"
done
echo "Done"
fi
# Set some environment variables for the second module
Expand Down
24 changes: 15 additions & 9 deletions pipe/relHumidity/relHumidity_pub_egress_and_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,23 @@ transform:
python3 -m pub_egress.pub_egress_main
fi
# If there is output, egress it
dirs=$(find $OUT_PATH/* -type d)
dirs=$(find $OUT_PATH/NEON.DOM.SITE* -maxdepth 0 -type d)
if [[ ${dirs} ]]; then
echo "Syncing files to bucket $BUCKET_NAME"
rclone \
--no-check-dest \
--copy-links \
--gcs-bucket-policy-only \
--gcs-no-check-bucket \
copy \
"${OUT_PATH}" \
":gcs://${BUCKET_NAME}"
for DIR in $dirs; do
echo "Syncing $DIR to bucket $BUCKET_NAME"
# Parse the product
[[ "$DIR" =~ ^$OUT_PATH/(.*)$ ]]
PRODUCT="${BASH_REMATCH[1]}"
rclone \
--no-check-dest \
--copy-links \
--gcs-bucket-policy-only \
--gcs-no-check-bucket \
copy \
"${OUT_PATH}/${PRODUCT}" \
":gcs://${BUCKET_NAME}/${PRODUCT}"
done
echo "Done"
fi
# Set some environment variables for the second module
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,23 @@ transform:
python3 -m pub_egress.pub_egress_main
fi
# If there is output, egress it
dirs=$(find $OUT_PATH/* -type d)
dirs=$(find $OUT_PATH/NEON.DOM.SITE* -maxdepth 0 -type d)
if [[ ${dirs} ]]; then
echo "Syncing files to bucket $BUCKET_NAME"
rclone \
--no-check-dest \
--copy-links \
--gcs-bucket-policy-only \
--gcs-no-check-bucket \
copy \
"${OUT_PATH}" \
":gcs://${BUCKET_NAME}"
for DIR in $dirs; do
echo "Syncing $DIR to bucket $BUCKET_NAME"
# Parse the product
[[ "$DIR" =~ ^$OUT_PATH/(.*)$ ]]
PRODUCT="${BASH_REMATCH[1]}"
rclone \
--no-check-dest \
--copy-links \
--gcs-bucket-policy-only \
--gcs-no-check-bucket \
copy \
"${OUT_PATH}/${PRODUCT}" \
":gcs://${BUCKET_NAME}/${PRODUCT}"
done
echo "Done"
fi
# Set some environment variables for the second module
Expand Down
24 changes: 15 additions & 9 deletions pipe/tempSoil/tempSoil_pub_egress_and_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,23 @@ transform:
python3 -m pub_egress.pub_egress_main
fi
# If there is output, egress it
dirs=$(find $OUT_PATH/* -type d)
dirs=$(find $OUT_PATH/NEON.DOM.SITE* -maxdepth 0 -type d)
if [[ ${dirs} ]]; then
echo "Syncing files to bucket $BUCKET_NAME"
rclone \
--no-check-dest \
--copy-links \
--gcs-bucket-policy-only \
--gcs-no-check-bucket \
copy \
"${OUT_PATH}" \
":gcs://${BUCKET_NAME}"
for DIR in $dirs; do
echo "Syncing $DIR to bucket $BUCKET_NAME"
# Parse the product
[[ "$DIR" =~ ^$OUT_PATH/(.*)$ ]]
PRODUCT="${BASH_REMATCH[1]}"
rclone \
--no-check-dest \
--copy-links \
--gcs-bucket-policy-only \
--gcs-no-check-bucket \
copy \
"${OUT_PATH}/${PRODUCT}" \
":gcs://${BUCKET_NAME}/${PRODUCT}"
done
echo "Done"
fi
# Set some environment variables for the second module
Expand Down
27 changes: 18 additions & 9 deletions pipe/testprod/testprod_pub_egress_and_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,31 @@ transform:
- "-c"
- |-
/bin/bash <<'EOF'
# Use bash-scrict mode. See http://redsymbol.net/articles/unofficial-bash-strict-mode/
set -euo pipefail
IFS=$'\n\t'
# Run first module - pub_egress (using environment variables below as input parameters)
if [[ $(echo $DATA_PATH) ]]; then
python3 -m pub_egress.pub_egress_main
fi
# If there is output, egress it
dirs=$(find $OUT_PATH/* -type d)
dirs=$(find $OUT_PATH/NEON.DOM.SITE* -maxdepth 0 -type d)
if [[ ${dirs} ]]; then
echo "Syncing files to bucket $BUCKET_NAME"
rclone \
--no-check-dest \
--copy-links \
--gcs-bucket-policy-only \
--gcs-no-check-bucket \
copy \
"${OUT_PATH}" \
":gcs://${BUCKET_NAME}"
for DIR in $dirs; do
echo "Syncing $DIR to bucket $BUCKET_NAME"
# Parse the product
[[ "$DIR" =~ ^$OUT_PATH/(.*)$ ]]
PRODUCT="${BASH_REMATCH[1]}"
rclone \
--no-check-dest \
--copy-links \
--gcs-bucket-policy-only \
--gcs-no-check-bucket \
copy \
"${OUT_PATH}/${PRODUCT}" \
":gcs://${BUCKET_NAME}/${PRODUCT}"
done
echo "Done"
fi
# Set some environment variables for the second module
Expand Down

0 comments on commit 97a636c

Please sign in to comment.