Skip to content

Commit 91969ba

Browse files
committed
General framework
1 parent 25e38f1 commit 91969ba

File tree

11 files changed

+122
-286
lines changed

11 files changed

+122
-286
lines changed

CHANGELOG.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1616

1717
### Fixed
1818

19-
## [v2.0.0] - 2021-06-23
19+
## [v2.0.0] - 2024-08-30
2020

2121
### Added
2222

23-
- `storage:schemes`, `storage:refs` and Storage Scheme Object
23+
- `storage:schemes`, `storage:ref` and Storage Scheme Object
2424
- Support the storage extension in Links
2525
- Support for the Alternate Assets Extension
2626
- Support for other storage providers, including custom S3 hosts
2727

2828
### Changed
2929

30+
- The extension is a framework for storage providers, it doesn't strictly define the individual providers.
3031
- The storage providers are grouped in `storage:schemes` and located in the Item Properties, Collections or Catalog metadata
31-
- Assets and Links reference the storage schemes by key in `storage:refs`
32+
- Assets and Links reference the storage schemes by key in `storage:ref`
3233

3334
### Removed
3435

CONTRIBUTING.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Contributing
2+
3+
All contributions are subject to the
4+
[STAC Specification Code of Conduct](https://github.com/radiantearth/stac-spec/blob/master/CODE_OF_CONDUCT.md).
5+
For contributions, please follow the
6+
[STAC specification contributing guide](https://github.com/radiantearth/stac-spec/blob/master/CONTRIBUTING.md) Instructions
7+
for running tests are copied here for convenience.
8+
9+
## Running tests
10+
11+
The same checks that run as checks on PR's are part of the repository and can be run locally to verify that changes are valid.
12+
To run tests locally, you'll need `npm`, which is a standard part of any [node.js installation](https://nodejs.org/en/download/).
13+
14+
First you'll need to install everything with npm once. Just navigate to the root of this repository and on
15+
your command line run:
16+
17+
```bash
18+
npm install
19+
```
20+
21+
Then to check markdown formatting and test the examples against the JSON schema, you can run:
22+
23+
```bash
24+
npm test
25+
```
26+
27+
This will spit out the same texts that you see online, and you can then go and fix your markdown or examples.
28+
29+
If the tests reveal formatting problems with the examples, you can fix them with:
30+
31+
```bash
32+
npm run format-examples
33+
```

README.md

Lines changed: 36 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ It allows adding details related to cloud object storage access and costs to be
1212
This extension does not cover NFS solutions provided by PaaS cloud companies.
1313

1414
- Examples:
15-
- [NAIP Item](examples/item-naip.json): Shows a mixture of storage providers, including custom S3 hosts.
16-
- [NSL Item](examples/item-nsl.json): Shows the usage of the extension in combination with the
17-
[alternate asset extension](https://github.com/stac-extensions/alternate-assets).
15+
- [NAIP Item with Alternate Assets](examples/item-naip.json): Shows a mixture of storage providers, including custom S3 hosts
16+
and the [alternate assets extension](https://github.com/stac-extensions/alternate-assets).
1817
- [Catalog with Link](examples/catalog-link.json): Shows the usage of the extension on a link in a STAC Catalog.
1918
- [Collection with Auth](examples/catalog-link.json): Shows the usage of the extension in a STAC Collecion in combination with the
2019
[authentication extension](https://github.com/stac-extensions/authentication).
@@ -46,82 +45,56 @@ The fields in the table below can be used in these parts of STAC documents:
4645
- [x] Links
4746
- [x] [Alternate Assets Object](https://github.com/stac-extensions/alternate-assets?tab=readme-ov-file#alternate-asset-object)
4847

49-
| Field Name | Type | Description |
50-
| -------------- | ---------- | ----------- |
51-
| `storage:refs` | \[string\] | A property that specifies which schemes in `storage:schemes` may be used to access an Asset or Link. Each value must be one of the keys defined in `storage:schemes`. |
48+
| Field Name | Type | Description |
49+
| ------------- | ------- | ----------- |
50+
| `storage:ref` | string | A property that specifies which schemes in `storage:schemes` may be used to access an Asset or Link. Each value must be one of the keys defined in `storage:schemes`. |
5251

5352
### Storage Scheme Object
5453

5554
| Field Name | Type | Description |
5655
| -------------- | ------- | ----------- |
57-
| platform | string | **REQUIRED.** The [cloud provider](#platforms) where data is stored. |
58-
| region | string | The region where the data is stored. Relevant to speed of access and inter region egress costs (as defined by PaaS provider) |
59-
| requester_pays | boolean | Is the data requester pays or is it data manager/cloud provider pays. Defaults to `false` |
60-
| tier | string | The title for the tier type (as defined by PaaS provider) |
56+
| platform | string | **REQUIRED.** The cloud provider where data is stored as URI or URI template to the API. |
57+
| region | string | The region where the data is stored. Relevant to speed of access and inter region egress costs (as defined by PaaS provider). |
58+
| requester_pays | boolean | Is the data "requester pays" (`true`) or is it "data manager/cloud provider pays" (`false`). Defaults to `false`. |
59+
| ... | ... | Additional properties as defined in the URL template or in the platform specific documents. |
6160

62-
The properties `title` and `description` as defined in Common Metadata can be used as well.
61+
The properties `title` and `description` as defined in Common Metadata should be used as well.
6362

64-
#### Platforms
63+
#### platform
6564

66-
The `platform` field identifies the cloud provider where the data is stored.
65+
The `platform` field identifies the cloud provider where the data is stored as URI or URI template to the API of the service.
6766

68-
There are a couple of pre-defined values for common providers:
67+
If a URI template is provided, all variables must be defined in the Storage Scheme Object as a property with the same name.
68+
For example, the URI template `https://{bucket}.{region}.example.com` must have at least the properties
69+
`bucket` and `region` defined:
6970

70-
- Alibaba Cloud (Aliyun): `ALIBABA`
71-
- Amazon AWS: `AWS`
72-
- Microsoft Azure: `AZURE`
73-
- Google Cloud Platform: `GCP`
74-
- IBM Cloud: `IBM`
75-
- Oracle Cloud: `ORACLE`
76-
77-
All other PaaS solutions must use a unique URL to the service.
71+
```json
72+
{
73+
"platform": "https://{bucket}.{region}.example.com",
74+
"region": "eu-fr",
75+
"bucket": "john-doe-stac",
76+
"requester_pays": true
77+
}
78+
```
7879

7980
In case an `href` contains a non-HTTP URL that is not directly resolvable,
8081
the `platform` property must identify the host so that the URL can be resolved without further information.
81-
This is especially useful to provide the endpoint URL for custom S3 providers.
82-
In this case the `platform` is effectively the endpoint URL.
83-
84-
#### Tiers
85-
86-
Recommended values for the `tier` field:
87-
88-
| Minimum Duration | [Google Cloud Platform](https://cloud.google.com/storage/docs/storage-classes) | [Amazon AWS](https://aws.amazon.com/s3/storage-classes/) | [Microsoft Azure](https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blob-storage-tiers) | [IBM Cloud](https://cloud.ibm.com/objectstorage/create#pricing) | [Oracle Cloud](https://www.oracle.com/cloud/storage/pricing.html) | [Alibaba Cloud](https://www.alibabacloud.com/product/oss/pricing) |
89-
| ------------- | --------- | ------------------------ | ------- |---------- | ----------------- | ----------------- |
90-
| 0 (Auto-Tier) | | Intelligent-Tiering | | Smart Tier |
91-
| 0 days | STANDARD | Standard | hot | Standard | Standard | Standard |
92-
| 30 days | NEARLINE | Standard-IA, One Zone-IA | cool | Vault | Infrequent Access | Infrequent Access |
93-
| 60 days | | | | | | Archive |
94-
| 90 days | COLDLINE | Glacier | | Cold Vault | Archive | |
95-
| 180 days | | Glacier Deep Archive | archive | | | Cold Archive |
96-
| 365 days | ARCHIVE | | | | | |
97-
98-
## Contributing
99-
100-
All contributions are subject to the
101-
[STAC Specification Code of Conduct](https://github.com/radiantearth/stac-spec/blob/master/CODE_OF_CONDUCT.md).
102-
For contributions, please follow the
103-
[STAC specification contributing guide](https://github.com/radiantearth/stac-spec/blob/master/CONTRIBUTING.md) Instructions
104-
for running tests are copied here for convenience.
82+
For example, this is especially useful to provide the endpoint URL for custom S3 providers.
83+
In this case the `platform` could effectively provide the endpoint URL.
10584

106-
### Running tests
85+
We try to collect pre-defined templates and best pratices for as many providers as possible
86+
in this repository, but be aware that these are not part of the official extension releases
87+
and are not validated. This extension just provides the framework, the provider best pratices
88+
may change at any time without a new version of this extension being released.
10789

108-
The same checks that run as checks on PR's are part of the repository and can be run locally to verify that changes are valid.
109-
To run tests locally, you'll need `npm`, which is a standard part of any [node.js installation](https://nodejs.org/en/download/).
90+
The following providers have defined best pratices at this point:
11091

111-
First you'll need to install everything with npm once. Just navigate to the root of this repository and on
112-
your command line run:
113-
```bash
114-
npm install
115-
```
92+
- [AWS S3](platforms/aws-s3.md)
93+
- [Generic S3 (non-AWS)](platforms/s3.md)
94+
- [Microsoft Azure](platforms/ms-azure.md)
11695

117-
Then to check markdown formatting and test the examples against the JSON schema, you can run:
118-
```bash
119-
npm test
120-
```
96+
Feel encouraged to submit additional platform specifications via Pull Requests.
12197

122-
This will spit out the same texts that you see online, and you can then go and fix your markdown or examples.
98+
## Contributing
12399

124-
If the tests reveal formatting problems with the examples, you can fix them with:
125-
```bash
126-
npm run format-examples
127-
```
100+
See the [Contributor documentation](CONTRIBUTING.md) for details.

examples/catalog-link.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
"description": "An example catalog with a link to documentation on object storage.",
1010
"storage:schemes": {
1111
"aws": {
12-
"platform": "AWS",
12+
"platform": "https://{bucket}.s3.{region}.amazonaws.com",
13+
"bucket": "mybucket",
1314
"region": "us-west-2",
14-
"requester_pays": true,
15-
"tier": "Standard"
15+
"requester_pays": true
1616
}
1717
},
1818
"links": [
@@ -25,9 +25,7 @@
2525
"href": "s3://mybucket/project/documentation.pdf",
2626
"type": "application/pdf",
2727
"rel": "about",
28-
"storage:refs": [
29-
"aws"
30-
]
28+
"storage:ref": "aws"
3129
}
3230
]
3331
}

examples/collection.json

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"license": "CC-0",
1212
"storage:schemes": {
1313
"aws": {
14-
"platform": "AWS",
14+
"platform": "https://{bucket}.s3.{region}.amazonaws.com",
15+
"bucket": "mybucket",
1516
"region": "us-west-2",
1617
"requester_pays": true,
1718
"tier": "Standard"
@@ -27,9 +28,7 @@
2728
"title": "STAC Items as GeoParquet",
2829
"href": "s3://mybucket/project/items.parquet",
2930
"type": "application/vnd.apache.parquet",
30-
"storage:refs": [
31-
"aws"
32-
],
31+
"storage:ref": "aws",
3332
"auth:refs": [
3433
"aws"
3534
]
@@ -45,9 +44,7 @@
4544
"href": "s3://mybucket/project/documentation.pdf",
4645
"type": "application/pdf",
4746
"rel": "about",
48-
"storage:refs": [
49-
"aws"
50-
],
47+
"storage:ref": "aws",
5148
"auth:refs": [
5249
"aws"
5350
]

examples/item-naip.json

Lines changed: 15 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"stac_version": "1.0.0",
33
"stac_extensions": [
44
"https://stac-extensions.github.io/storage/v2.0.0/schema.json",
5-
"https://stac-extensions.github.io/version/v1.2.0/schema.json"
5+
"https://stac-extensions.github.io/version/v1.2.0/schema.json",
6+
"https://stac-extensions.github.io/alternate-assets/v1.1.0/schema.json"
67
],
78
"id": "m_3009743_sw_14_1_20160928_20161129",
89
"bbox": [
@@ -45,35 +46,16 @@
4546
"platform": "UNKNOWN_PLATFORM",
4647
"gsd": 1,
4748
"storage:schemes": {
48-
"az-wus2-arc": {
49-
"platform": "AZURE",
50-
"region": "westus2",
51-
"tier": "archive"
52-
},
53-
"gs-cld": {
54-
"platform": "GCP",
55-
"region": "us-central1",
56-
"requester_pays": true,
57-
"tier": "COLDLINE"
49+
"az-wus2-ar": {
50+
"platform": "https://{account}.blob.core.windows.net",
51+
"account": "jon-doe-123",
52+
"region": "westus2"
5853
},
5954
"aws-std": {
60-
"platform": "AWS",
55+
"platform": "https://{bucket}.s3.{region}.amazonaws.com",
56+
"bucket": "naip-visualization",
6157
"region": "us-west-2",
62-
"requester_pays": true,
63-
"tier": "Standard"
64-
},
65-
"az-weu-hot": {
66-
"platform": "AZURE",
67-
"region": "westeurope",
68-
"requester_pays": false,
69-
"tier": "hot"
70-
},
71-
"az-eus-hot": {
72-
"platform": "AZURE",
73-
"region": "eastus",
74-
"requester_pays": false,
75-
"tier": "hot",
76-
"deprecated": true
58+
"requester_pays": true
7759
},
7860
"minio": {
7961
"platform": "https://play.min.io:9000"
@@ -82,62 +64,18 @@
8264
},
8365
"assets": {
8466
"CO_GEOTIFF_RGB": {
85-
"href": "s3://mybucket/tx/2016/100cm/rgb/30097/m_3009743_sw_14_1_20160928.tif",
86-
"type": "image/tiff; application=geotiff; profile=cloud-optimized",
87-
"storage:refs": [
88-
"minio"
89-
]
90-
},
91-
"CO_GEOTIFF_AWS_RGB": {
9267
"href": "s3://naip-visualization/tx/2016/100cm/rgb/30097/m_3009743_sw_14_1_20160928.tif",
9368
"type": "image/tiff; application=geotiff; profile=cloud-optimized",
94-
"storage:refs": [
95-
"aws-std"
96-
]
69+
"storage:ref": "aws-std",
70+
"alternate": {
71+
"href": "s3://mybucket/tx/2016/100cm/rgb/30097/m_3009743_sw_14_1_20160928.tif",
72+
"storage:ref": "minio"
73+
}
9774
},
9875
"GEOTIFF_AZURE_RGBIR": {
9976
"href": "https://naip-nsl.blob.core.windows.net/tx/2016/100cm/rgb/30097/m_3009743_sw_14_1_20160928.tif",
10077
"type": "image/tiff; application=geotiff",
101-
"storage:refs": [
102-
"az-wus2-ar"
103-
]
104-
},
105-
"CO_GEOTIFF_GCP_RGB": {
106-
"href": "gs://naip-data/tx/2016/100cm/rgb/30097/m_3009743_sw_14_1_20160928.tif",
107-
"type": "image/tiff; application=geotiff; profile=cloud-optimized",
108-
"storage:refs": [
109-
"gs-cld"
110-
]
111-
},
112-
"CO_GEOTIFF_AZURE_RGB": {
113-
"href": "https://naipeuwest.blob.core.windows.net/naip/v002/tx/2016/tx_100cm_2016/30097/m_3009743_sw_14_1_20160928.tif",
114-
"type": "image/tiff; application=geotiff; profile=cloud-optimized",
115-
"storage:refs": [
116-
"az-weu-hot"
117-
]
118-
},
119-
"CO_GEOTIFF_AZURE_RGB_DEPRECATED": {
120-
"href": "https://naipblobs.blob.core.windows.net/naip/v002/tx/2016/tx_100cm_2016/30097/m_3009743_sw_14_1_20160928.tif",
121-
"type": "image/tiff; application=geotiff; profile=cloud-optimized",
122-
"storage:refs": [
123-
"az-eus-hot"
124-
],
125-
"deprecated": true
126-
},
127-
"THUMBNAIL": {
128-
"href": "https://naipblobs.blob.core.windows.net/naip/v002/tx/2016/tx_100cm_2016/30097/m_3009743_sw_14_1_20160928.200.jpg",
129-
"type": "image/jpeg",
130-
"storage:refs": [
131-
"minio"
132-
]
133-
},
134-
"THUMBNAIL_AZURE_DEPRECATED": {
135-
"href": "https://naipblobs.blob.core.windows.net/naip/v002/tx/2016/tx_100cm_2016/30097/m_3009743_sw_14_1_20160928.200.jpg",
136-
"type": "image/jpeg",
137-
"storage:refs": [
138-
"az-eus-hot"
139-
],
140-
"deprecated": true
78+
"storage:ref": "az-wus2-ar"
14179
}
14280
},
14381
"links": [

0 commit comments

Comments
 (0)