Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AwsRegistry #49

Merged
merged 3 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 30 additions & 2 deletions aodn_cloud_optimised/bin/create_aws_registry_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@
from importlib.resources import files

from aodn_cloud_optimised.lib.CommonHandler import CommonHandler
from aodn_cloud_optimised.lib.config import load_dataset_config
from aodn_cloud_optimised.lib.config import (
load_dataset_config,
load_config,
load_variable_from_config,
)
import requests
import xmltodict
import io
Expand Down Expand Up @@ -208,6 +212,7 @@ def update_nested_dict_key(dataset_config, keys, new_value):

def populate_dataset_config_with_geonetwork_metadata(json_file):
""" """

json_path = str(files("aodn_cloud_optimised.config.dataset").joinpath(json_file))
dataset_config = load_dataset_config(json_path)

Expand Down Expand Up @@ -278,13 +283,36 @@ def populate_dataset_config_with_geonetwork_metadata(json_file):
]
}

dataset_path_arn = os.path.join(
load_variable_from_config("BUCKET_OPTIMISED_DEFAULT"),
load_variable_from_config("ROOT_PREFIX_CLOUD_OPTIMISED_PATH"),
dataset_config["dataset_name"] + "." + dataset_config["cloud_optimised_format"],
)

dataset_location = {
"Description": f"Cloud Optimised AODN dataset of {dataset_config['aws_opendata_registry']['Name']}",
"ARN": f"arn:aws:s3:::{dataset_path_arn}",
"Region": "ap-southeast-2",
"Type": "S3 Bucket",
}

dataset_config = update_nested_dict_key(
dataset_config, ["aws_opendata_registry", "DataAtWork"], data_at_work
)

dataset_config = update_nested_dict_key(
dataset_config, ["aws_opendata_registry", "Resources"], dataset_location
)

# dataset confi coming from load_dataset_config is the result of parent and child configuration. When writting back
# the configuration, we only want to write the child data back
dataset_config_child = load_config(json_path)
# Overwrite the original JSON file with the modified dataset_config
with open(json_path, "w") as f:
json.dump(dataset_config, f, indent=2)
dataset_config_child["aws_opendata_registry"] = dataset_config[
"aws_opendata_registry"
]
json.dump(dataset_config_child, f, indent=2)

print(f"Updated JSON file saved at: {json_path}")

Expand Down
33 changes: 6 additions & 27 deletions aodn_cloud_optimised/config/dataset/argo.json
Original file line number Diff line number Diff line change
Expand Up @@ -426,33 +426,12 @@
"UpdateFrequency": "As Needed",
"Tags": [],
"License": "http://creativecommons.org/licenses/by/4.0/",
"Resources": [
{
"Description": "",
"ARN": "",
"Region": "",
"Type": "",
"Explore": []
},
{
"Description": "",
"ARN": "",
"Region": "",
"Type": ""
},
{
"Description": "",
"ARN": "",
"Region": "",
"Type": ""
},
{
"Description": "",
"ARN": "",
"Region": "",
"Type": ""
}
],
"Resources": {
"Description": "Cloud Optimised AODN dataset of Argo Core",
"ARN": "arn:aws:s3:::imos-data-lab-optimised/cloud_optimised/cluster_testing/argo.parquet",
"Region": "ap-southeast-2",
"Type": "S3 Bucket"
},
"DataAtWork": {
"Tutorials": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,33 +136,12 @@
"UpdateFrequency": "As Needed",
"Tags": [],
"License": "http://creativecommons.org/licenses/by/4.0/",
"Resources": [
{
"Description": "",
"ARN": "",
"Region": "",
"Type": "",
"Explore": []
},
{
"Description": "",
"ARN": "",
"Region": "",
"Type": ""
},
{
"Description": "",
"ARN": "",
"Region": "",
"Type": ""
},
{
"Description": "",
"ARN": "",
"Region": "",
"Type": ""
}
],
"Resources": {
"Description": "Cloud Optimised AODN dataset of IMOS - OceanCurrent - Gridded sea level anomaly - Near real time",
"ARN": "arn:aws:s3:::imos-data-lab-optimised/cloud_optimised/cluster_testing/model_sea_level_anomaly_gridded_realtime.zarr",
"Region": "ap-southeast-2",
"Type": "S3 Bucket"
},
"DataAtWork": {
"Tutorials": [
{
Expand Down
33 changes: 6 additions & 27 deletions aodn_cloud_optimised/config/dataset/mooring_ctd_delayed_qc.json
Original file line number Diff line number Diff line change
Expand Up @@ -290,33 +290,12 @@
"UpdateFrequency": "As Needed",
"Tags": [],
"License": "http://creativecommons.org/licenses/by/4.0/",
"Resources": [
{
"Description": "",
"ARN": "",
"Region": "",
"Type": "",
"Explore": []
},
{
"Description": "",
"ARN": "",
"Region": "",
"Type": ""
},
{
"Description": "",
"ARN": "",
"Region": "",
"Type": ""
},
{
"Description": "",
"ARN": "",
"Region": "",
"Type": ""
}
],
"Resources": {
"Description": "Cloud Optimised AODN dataset of IMOS - Australian National Mooring Network (ANMN) - CTD Profiles",
"ARN": "arn:aws:s3:::imos-data-lab-optimised/cloud_optimised/cluster_testing/mooring_ctd_delayed_qc.parquet",
"Region": "ap-southeast-2",
"Type": "S3 Bucket"
},
"DataAtWork": {
"Tutorials": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -775,45 +775,24 @@
},
"force_old_pq_del": true,
"aws_opendata_registry": {
"Name": "ANMN hourly timeseries",
"Name": "IMOS - Moorings - Hourly time-series product",
"Description": "Integrated Marine Observing System (IMOS) have moorings across both it's National Mooring Network and Deep Water Moorings facilities. The National Mooring Network facility comprises a series of national reference stations and regional moorings designed to monitor particular oceanographic phenomena in Australian coastal ocean waters. The Deep Water Moorings facility (formerly known as the Australian Bluewater Observing System) provides the coordination of national efforts in the sustained observation of open ocean properties with particular emphasis on observations important to climate and carbon cycle studies, with selected moorings from its Deep Water Arrays sub-facility providing data to this collection.\nThis collection represents the hourly aggregated time-series product, which combines selected variables measured by all the instruments deployed at a site, binning the values into a fixed one-hour interval. Only good-quality measurements (according to the automated quality-control procedures applied by the National Mooring Network) are included. \nThe parameters are: temperature, salinity, dissolved oxygen, chlorophyll estimates, turbidity, down-welling photosynthetic photon flux (PAR), and current velocity, accompanied by depth and pressure when available. The observations were made using a range of temperature loggers, conductivity-temperature-depth (CTD) instruments, water-quality monitors (WQM), acoustic Doppler current profilers (ADCPs), and single-point current meters.",
"Documentation": "https://catalogue.aodn.org.au/geonetwork/srv/eng/catalog.search#/metadata/efd8201c-1eca-412e-9ad2-0534e96cea14",
"Contact": "[email protected]",
"ManagedBy": "AODN",
"UpdateFrequency": "As Needed",
"Tags": [],
"License": "http://creativecommons.org/licenses/by/4.0/",
"Resources": [
{
"Description": "",
"ARN": "",
"Region": "",
"Type": "",
"Explore": []
},
{
"Description": "",
"ARN": "",
"Region": "",
"Type": ""
},
{
"Description": "",
"ARN": "",
"Region": "",
"Type": ""
},
{
"Description": "",
"ARN": "",
"Region": "",
"Type": ""
}
],
"Resources": {
"Description": "Cloud Optimised AODN dataset of IMOS - Moorings - Hourly time-series product",
"ARN": "arn:aws:s3:::imos-data-lab-optimised/cloud_optimised/cluster_testing/mooring_hourly_timeseries_delayed_qc.parquet",
"Region": "ap-southeast-2",
"Type": "S3 Bucket"
},
"DataAtWork": {
"Tutorials": [
{
"Title": "Accessing ANMN hourly timeseries",
"Title": "Accessing IMOS - Moorings - Hourly time-series product",
"URL": "https://nbviewer.org/github/aodn/aodn_cloud_optimised/blob/main/notebooks/mooring_hourly_timeseries_delayed_qc.ipynb",
"NotebookURL": "https://githubtocolab.com/aodn/aodn_cloud_optimised/blob/main/notebooks/mooring_hourly_timeseries_delayed_qc.ipynb",
"Services": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,33 +200,12 @@
"UpdateFrequency": "As Needed",
"Tags": [],
"License": "http://creativecommons.org/licenses/by/4.0/",
"Resources": [
{
"Description": "",
"ARN": "",
"Region": "",
"Type": "",
"Explore": []
},
{
"Description": "",
"ARN": "",
"Region": "",
"Type": ""
},
{
"Description": "",
"ARN": "",
"Region": "",
"Type": ""
},
{
"Description": "",
"ARN": "",
"Region": "",
"Type": ""
}
],
"Resources": {
"Description": "Cloud Optimised AODN dataset of IMOS - Australian National Mooring Network (ANMN) Facility - Temperature and salinity time-series",
"ARN": "arn:aws:s3:::imos-data-lab-optimised/cloud_optimised/cluster_testing/mooring_temperature_logger_delayed_qc.parquet",
"Region": "ap-southeast-2",
"Type": "S3 Bucket"
},
"DataAtWork": {
"Tutorials": [
{
Expand Down
Loading
Loading