-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #125 from CIROH-UA/test_ds_opts
Test datastream cli options. * Removed mount-s3 * Fixed configure-datastream.py and added test * Update docs in terraform
- Loading branch information
Showing
13 changed files
with
217 additions
and
133 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
name: Test Datastream Options | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test-datastream-options: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Configure AWS | ||
run: | | ||
aws configure set aws_access_key_id ${{ secrets.aws_access_key_id }} | ||
aws configure set aws_secret_access_key ${{ secrets.aws_secret_access_key }} | ||
aws configure set region us-east-1 | ||
- name: Build docker containers | ||
run : | | ||
./scripts/docker_builds.sh -b | ||
- name: Install packages for datastream | ||
run: | | ||
curl -L -O https://github.com/lynker-spatial/hfsubsetCLI/releases/download/v1.1.0/hfsubset-v1.1.0-linux_amd64.tar.gz && tar -xzvf hfsubset-v1.1.0-linux_amd64.tar.gz && sudo mv ./hfsubset /usr/bin/hfsubset && sudo apt-get install git pip pigz awscli python3.9 -y | ||
- name: Get geopackage from hfsubset | ||
run: | | ||
hfsubset -w medium_range -s nextgen -v 2.1.1 -l divides,flowlines,network,nexus,forcing-weights,flowpath-attributes,model-attributes -o palisade.gpkg -t hl "Gages-09106150" | ||
- name: Base test and NWM_RETRO_V3 | ||
run: | | ||
sudo rm -rf $(pwd)/data/datastream_test | ||
./scripts/stream.sh -s 202006200100 -e 202006200200 -C NWM_RETRO_V3 -d $(pwd)/data/datastream_test -g $(pwd)/palisade.gpkg -R $(pwd)/configs/ngen/realization_sloth_nom_cfe_pet.json | ||
- name: Cache resource directory | ||
run: | | ||
mkdir ./data/cache | ||
cp -r ./data/datastream_test/datastream-resources ./data/cache | ||
cp -r ./data/cache/datastream-resources ./data/cache/datastream-resources-no-forcings | ||
cp -r ./data/cache/datastream-resources ./data/cache/datastream-resources-missing | ||
sudo rm -rf ./data/cache/datastream-resources-no-forcings/ngen-forcings | ||
- name: Resource directory test missing all | ||
if: always() | ||
run: | | ||
sudo rm -rf $(pwd)/data/datastream_test | ||
sudo rm -rf ./data/cache/datastream-resources-missing/ngen-forcings | ||
sudo rm -rf ./data/cache/datastream-resources-missing/config/* | ||
./scripts/stream.sh -r ./data/cache/datastream-resources-missing -R $(pwd)/configs/ngen/realization_sloth_nom_cfe_pet.json -s 202006200100 -e 202006200200 -C NWM_RETRO_V3 -d $(pwd)/data/datastream_test -g $(pwd)/palisade.gpkg | ||
- name: Resource directory test | ||
if: always() | ||
run: | | ||
sudo rm -rf $(pwd)/data/datastream_test | ||
./scripts/stream.sh -r ./data/cache/datastream-resources -s 202006200100 -e 202006200200 -C NWM_RETRO_V3 -d $(pwd)/data/datastream_test | ||
- name: Forcings sources option test NWM_RETRO_V2 | ||
if: always() | ||
run: | | ||
sudo rm -rf $(pwd)/data/datastream_test | ||
./scripts/stream.sh -r ./data/cache/datastream-resources-no-forcings -s 201906200100 -e 201906200200 -C NWM_RETRO_V2 -d $(pwd)/data/datastream_test | ||
- name: Forcings sources option test NWM_OPERATIONAL_V3 | ||
if: always() | ||
run: | | ||
sudo rm -rf $(pwd)/data/datastream_test | ||
TODAY=$(env TZ=US/Eastern date +'%Y%m%d') | ||
./scripts/stream.sh -r ./data/cache/datastream-resources-no-forcings -s $TODAY"0100" -e $TODAY"0200" -C NWM_OPERATIONAL_V3 -d $(pwd)/data/datastream_test | ||
- name: Forcings sources option test NOMADS_OPERATIONAL | ||
if: always() | ||
run: | | ||
sudo rm -rf $(pwd)/data/datastream_test | ||
TODAY=$(env TZ=US/Eastern date +'%Y%m%d') | ||
./scripts/stream.sh -r ./data/cache/datastream-resources-no-forcings -s $TODAY"0100" -e $TODAY"0200" -C NOMADS_OPERATIONAL -d $(pwd)/data/datastream_test | ||
- name: Test hfsubset options | ||
if: always() | ||
run: | | ||
sudo rm -rf $(pwd)/data/datastream_test | ||
./scripts/stream.sh -s 202006200100 -e 202006200200 -C NWM_RETRO_V3 -d $(pwd)/data/datastream_test -I "Gages-09106150" -i hl -v 2.1.1 -R $(pwd)/configs/ngen/realization_sloth_nom_cfe_pet.json | ||
- name: S3 write out test | ||
if: always() | ||
run: | | ||
sudo rm -rf $(pwd)/data/datastream_test | ||
./scripts/stream.sh -s 202006200100 -e 202006200200 -C NWM_RETRO_V3 -d $(pwd)/data/datastream_test -g $(pwd)/palisade.gpkg -R $(pwd)/configs/ngen/realization_sloth_nom_cfe_pet.json -S ngen-datastream -o git_actions_test/ | ||
aws s3api wait object-exists --bucket ngen-datastream --key git_actions_test/ngen-run.tar.gz | ||
aws s3api delete-object --bucket ngen-datastream --key git_actions_test/ngen-run.tar.gz | ||
- name: DAILY today test | ||
if: always() | ||
run: | | ||
sudo rm -rf $(pwd)/data/datastream_test | ||
./scripts/stream.sh -s DAILY -C NWM_OPERATIONAL_V3 -d $(pwd)/data/datastream_test -g $(pwd)/palisade.gpkg -R $(pwd)/configs/ngen/realization_sloth_nom_cfe_pet.json | ||
- name: DAILY pick day test | ||
if: always() | ||
run: | | ||
sudo rm -rf $(pwd)/data/datastream_test | ||
./scripts/stream.sh -s DAILY -e 202006200000 -C NWM_RETRO_V3 -d $(pwd)/data/datastream_test -g $(pwd)/palisade.gpkg -R $(pwd)/configs/ngen/realization_sloth_nom_cfe_pet.json | ||
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 |
---|---|---|
@@ -1,55 +1,11 @@ | ||
# Install Instructions for ngen-datastream | ||
These steps are provided [scripted](#scripts) or [step-by-step](#step-by-step). Note some steps are specific to either `x86` or `aarch64` | ||
|
||
## Prerequisites | ||
* Linux OS | ||
* Docker | ||
* git | ||
|
||
These instructions assume launching an instance from a blank Amazon 2023 Linux image. Steps may vary depending on your specific linux distribution. | ||
|
||
## Scripted | ||
1) Clone this repository | ||
``` | ||
git clone https://github.com/CIROH-UA/ngen-datastream.git | ||
``` | ||
2) Execute the startup script | ||
``` | ||
cd ngen-datastream && ./scripts/install.sh | ||
``` | ||
`aws_configure` if you intend to mount an s3 bucket or reference a bucket in the configuration. | ||
|
||
You're ready to run ngen-datastream! | ||
|
||
## Step-by-step | ||
`$USER=($whomami)` | ||
|
||
For `x86`, `PKG_MNGR="dnf"` | ||
|
||
For `aarch64`, `PKG_MNGR="yum"` | ||
|
||
1) Update package manager and install packages | ||
``` | ||
sudo $PKG_MNGR update -y | ||
sudo $PKG_MNGR install git pip python pigz awscli -y | ||
``` | ||
`x86` : `sudo $PKG_MNGR update -y | ||
sudo $PKG_MNGR install dnf-plugins-core -y` | ||
|
||
2) install packages from internet | ||
|
||
`x86` : `curl -L -O https://s3.amazonaws.com/mountpoint-s3-release/latest/x86_64/mount-s3.rpm` | ||
|
||
`aarch64` : `curl -L -O https://s3.amazonaws.com/mountpoint-s3-release/latest/arm64/mount-s3.rpm` | ||
``` | ||
sudo dnf update -y | ||
sudo dnf ./mount-s3.rpm | ||
``` | ||
3) clone this repository | ||
``` | ||
git clone https://github.com/CIROH-UA/ngen-datastream.git | ||
``` | ||
`aws_configure` if you intend to mount an s3 bucket or reference a bucket in the configuration. | ||
|
||
You're ready to run ngen-datastream! | ||
To run ngen-datastream, clone this repository onto a linux machine and make sure the packages below are installed. | ||
|
||
## Required Packages | ||
* docker | ||
* git | ||
* pip | ||
* python>=3.9 | ||
* pigz | ||
* awscli | ||
* [hfsubset](https://github.com/lynker-spatial/hfsubsetCLI) | ||
|
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
Oops, something went wrong.