Skip to content

Commit

Permalink
Merge pull request #1019 from nasa/issue_1018
Browse files Browse the repository at this point in the history
Issue #1018: feat(accountability): install DSWx-S1 validator tool on metrics.
  • Loading branch information
hhlee445 authored Nov 11, 2024
2 parents f95db5e + 5f1492d commit dfbfdc8
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
39 changes: 39 additions & 0 deletions cluster_provisioning/modules/common/grq_factotum_metrics.tf
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,45 @@ resource "aws_instance" "metrics" {
EOT
]
}

provisioner "remote-exec" {
inline = [<<-EOT
while [ ! -f /var/lib/cloud/instance/boot-finished ]; do echo 'Waiting for cloud-init...'; sleep 5; done
set -ex
cd ~/metrics/ops
if [ "${var.use_artifactory}" = true ]; then
~/download_artifact.sh -m "${var.artifactory_mirror_url}" -b "${var.artifactory_base_url}" "${var.artifactory_base_url}/${var.artifactory_repo}/gov/nasa/jpl/${var.project}/sds/pcm/${var.project}-sds-pcm-${var.pcm_branch}.tar.gz"
tar xfz ${var.project}-sds-pcm-${var.pcm_branch}.tar.gz
ln -s ~/metrics/ops/${var.project}-sds-pcm-${var.pcm_branch} ~/metrics/ops/${var.project}-pcm
rm -rf ${var.project}-sds-pcm-${var.pcm_branch}.tar.gz
else
git clone --quiet --single-branch -b ${var.pcm_branch} https://${var.git_auth_key}@${var.pcm_repo} ${var.project}-pcm
fi
EOT
]
}

provisioner "remote-exec" {
inline = [<<-EOT
while [ ! -f /var/lib/cloud/instance/boot-finished ]; do echo 'Waiting for cloud-init...'; sleep 5; done
source ~/.bash_profile
set -ex
echo INSTALLING DSWX-S1 VALIDATOR
cd ~/metrics/ops/opera-pcm
cd report/dswx-s1-validator
pip install pandas tabulate tqdm requests python-cmr
# For DSWx-S1 validator tool
mkdir ~/Downloads/
aws s3 cp s3://opera-ancillaries/mgrs_tiles/dswx_s1/MGRS_tile_collection_v0.3.sqlite ~/Downloads/
echo INSTALLED DSWX-S1 VALIDATOR
EOT
]
}
}

resource "null_resource" "setup_cron" {
Expand Down
2 changes: 1 addition & 1 deletion report/dswx-s1-validator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ This guide provides a quick way to get started with the script.
### Setup Instructions

1. Clone the repository to your local machine.
2. Install the required Python libraries: `pip install pandas tabulate tqdm sqlite3 requests python_cmr`.
2. Install the required Python libraries: `pip install pandas tabulate tqdm sqlite3 requests python-cmr`.
3. Ensure you have internet access to the CMR API

### Run Instructions
Expand Down

0 comments on commit dfbfdc8

Please sign in to comment.