-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(Feat) add clustering capability - precommit (#23)
### Feature Additions: - Feat: add clustering capability for both Zarr and Parquet * local dask cluster * remote coiled cluster * Driven by dataset config - Feat: add generic_cloud_optimised_creation script - Implemented coiled cluster for zarr with parallelism - Added unittests for parquet and zarr using moto to mock aws ### Bug Fixes: - Fix version number release in artifacts - Fix parquet queries ### Refactorings: - a lot of refactoring for zarr and parquet + removed a lot of functions - Change to_cloud_optimised to take argument. work for zarr +dask - Clean all scripts to use generic co + add args ### Documentation and Miscellaneous: - Update README - Improve docstrings
- Loading branch information
Showing
79 changed files
with
8,926 additions
and
6,304 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
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 |
---|---|---|
@@ -1,31 +1,18 @@ | ||
#!/usr/bin/env python3 | ||
import importlib.resources | ||
|
||
from aodn_cloud_optimised.lib.CommonHandler import cloud_optimised_creation_loop | ||
from aodn_cloud_optimised.lib.config import ( | ||
load_variable_from_config, | ||
load_dataset_config, | ||
) | ||
from aodn_cloud_optimised.lib.s3Tools import s3_ls | ||
import subprocess | ||
|
||
|
||
def main(): | ||
BUCKET_RAW_DEFAULT = load_variable_from_config("BUCKET_RAW_DEFAULT") | ||
obj_ls = s3_ls(BUCKET_RAW_DEFAULT, "IMOS/AATAMS/acoustic_tagging/", suffix=".csv") | ||
|
||
dataset_config = load_dataset_config( | ||
str( | ||
importlib.resources.path( | ||
"aodn_cloud_optimised.config.dataset", "aatams_acoustic_tagging.json" | ||
) | ||
) | ||
) | ||
|
||
cloud_optimised_creation_loop( | ||
obj_ls, | ||
dataset_config=dataset_config, | ||
) | ||
|
||
command = [ | ||
"generic_cloud_optimised_creation", | ||
"--paths", | ||
"IMOS/AATAMS/acoustic_tagging/", | ||
"--dataset-config", | ||
"aatams_acoustic_tagging.json", | ||
"--clear-existing-data", | ||
"--cluster-mode", | ||
"remote", | ||
] | ||
|
||
if __name__ == "__main__": | ||
main() | ||
# Run the command | ||
subprocess.run(command, check=True) |
53 changes: 14 additions & 39 deletions
53
aodn_cloud_optimised/bin/acorn_gridded_qc_turq.py
100644 → 100755
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,43 +1,18 @@ | ||
#!/usr/bin/env python3 | ||
import importlib.resources | ||
|
||
from aodn_cloud_optimised.lib.GenericZarrHandler import GenericHandler | ||
from aodn_cloud_optimised.lib.CommonHandler import cloud_optimised_creation_loop | ||
|
||
from aodn_cloud_optimised.lib.config import ( | ||
load_variable_from_config, | ||
load_dataset_config, | ||
) | ||
from aodn_cloud_optimised.lib.s3Tools import s3_ls | ||
import subprocess | ||
|
||
|
||
def main(): | ||
BUCKET_RAW_DEFAULT = load_variable_from_config("BUCKET_RAW_DEFAULT") | ||
nc_obj_ls = s3_ls( | ||
BUCKET_RAW_DEFAULT, "IMOS/ACORN/gridded_1h-avg-current-map_QC/TURQ/2023" | ||
) | ||
|
||
dataset_config = load_dataset_config( | ||
str( | ||
importlib.resources.path( | ||
"aodn_cloud_optimised.config.dataset", "acorn_gridded_qc_turq.json" | ||
) | ||
) | ||
) | ||
|
||
# First zarr creation | ||
cloud_optimised_creation_loop( | ||
[nc_obj_ls[0]], dataset_config=dataset_config, reprocess=True | ||
) | ||
|
||
# append to zarr | ||
cloud_optimised_creation_loop(nc_obj_ls[1:], dataset_config=dataset_config) | ||
# rechunking | ||
GenericHandler( | ||
input_object_key=nc_obj_ls[0], | ||
dataset_config=dataset_config, | ||
).rechunk() | ||
|
||
|
||
if __name__ == "__main__": | ||
main() | ||
command = [ | ||
"generic_cloud_optimised_creation", | ||
"--paths", | ||
"IMOS/ACORN/gridded_1h-avg-current-map_QC/TURQ/2024/01/", | ||
"--dataset-config", | ||
"acorn_gridded_qc_turq.json", | ||
"--clear-existing-data", | ||
"--cluster-mode", | ||
"remote", | ||
] | ||
|
||
# Run the command | ||
subprocess.run(command, check=True) |
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,28 +1,18 @@ | ||
#!/usr/bin/env python3 | ||
import importlib.resources | ||
|
||
from aodn_cloud_optimised.lib.CommonHandler import cloud_optimised_creation_loop | ||
from aodn_cloud_optimised.lib.config import ( | ||
load_variable_from_config, | ||
load_dataset_config, | ||
) | ||
from aodn_cloud_optimised.lib.s3Tools import s3_ls | ||
import subprocess | ||
|
||
|
||
def main(): | ||
BUCKET_RAW_DEFAULT = load_variable_from_config("BUCKET_RAW_DEFAULT") | ||
nc_obj_ls = s3_ls(BUCKET_RAW_DEFAULT, "IMOS/ANFOG/slocum_glider") | ||
|
||
dataset_config = load_dataset_config( | ||
str( | ||
importlib.resources.path( | ||
"aodn_cloud_optimised.config.dataset", "anfog_slocum_glider.json" | ||
) | ||
) | ||
) | ||
|
||
cloud_optimised_creation_loop(nc_obj_ls, dataset_config=dataset_config) | ||
|
||
command = [ | ||
"generic_cloud_optimised_creation", | ||
"--paths", | ||
"IMOS/ANFOG/slocum_glider", | ||
"--dataset-config", | ||
"anfog_slocum_glider.json", | ||
"--clear-existing-data", | ||
"--cluster-mode", | ||
"remote", | ||
] | ||
|
||
if __name__ == "__main__": | ||
main() | ||
# Run the command | ||
subprocess.run(command, check=True) |
Oops, something went wrong.