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

Implementation of extension #1

Merged
merged 6 commits into from
Mar 11, 2024
Merged

Implementation of extension #1

merged 6 commits into from
Mar 11, 2024

Conversation

dchandan
Copy link
Collaborator

A version 1.0.0 implementation with simply two core fields: marble:host_node and marble:is_local.

Copy link

@mishaschwartz mishaschwartz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the best way of testing this to see this extension in action?

json-schema/schema.json Show resolved Hide resolved
json-schema/schema.json Show resolved Hide resolved
json-schema/schema.json Show resolved Hide resolved
{"required": ["template:new_field"]},
{"required": ["template:xyz"]},
{"required": ["template:another_one"]}
{"required": ["marble:host_node"]},

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean that either host_node OR is_local is required? Shouldn't both be required at the same time?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it doesn't mean that. Both are required and extension in the present form will complain if either one is not present.

@dchandan
Copy link
Collaborator Author

dchandan commented Feb 23, 2024

What's the best way of testing this to see this extension in action?

npm install
npm test

These tests are run on GitHub too. All tests are passing. The tests are done against the sample implementations in the "examples" folder. This is the typical stac-extension testing framework.

examples/collection.json Outdated Show resolved Hide resolved
json-schema/schema.json Show resolved Hide resolved
json-schema/schema.json Show resolved Hide resolved
@fmigneault
Copy link

fmigneault commented Feb 26, 2024

@dchandan @huard

Just found this extension: https://github.com/stac-extensions/storage

It seems like representing a self-hosted data would simply be marked by storage:platform: OTHER, and other cloud locations would be represented by the relevant provider, tier, etc. This could be a replacement of marble:is_local.

Interest could be raised here (stac-extensions/storage#22) to indicate that more details about the location for this "OTHER" case should be added. This could replace (or be added alongside) of marble:host_id.

edit: I raised the issue in the STAC Community Meetup of 2024-02-26. The storage adjustment will be looked into (maybe some kind of storage:location and storage:id field)?

@huard
Copy link

huard commented Feb 26, 2024

I don't think I'm qualified enough to review this intelligently.

@fmigneault
Copy link

@dchandan @mishaschwartz
As future reference, I believe this extension would be relevant as well https://github.com/stac-extensions/authentication
This could be used for Magpie-protected STAC Collection/Items (if applicable) by a given DACCS/Marble node.

@mishaschwartz
Copy link

edit: I raised the issue in the STAC Community Meetup of 2024-02-26. The storage adjustment will be looked into (maybe some kind of storage:location and storage:id field)?

Thanks @fmigneault for raising that.

If we can get the storage extension to support our use-case then I have no issue using it

@mishaschwartz
Copy link

As future reference, I believe this extension would be relevant as well https://github.com/stac-extensions/authentication

Yes I agree, especially with Ouranosinc/Magpie#589

@dchandan
Copy link
Collaborator Author

I also like the idea of the storage extension. But, my concern here would be how soon they can update the extension to have the flexibility that we need? There is a bit of a time constraint, so one option would be to just go with the marble extension in the meantime.

One thing worth considering is future expansion potential with a marble extension. We could use the extension to, in the future, include all sorts of other marble network related information.

@fmigneault
Copy link

@dchandan I agree as long a marble extension doesn't become a quick fix for anything in the long run. Its use should be limited as much as possible. It would go against the point of using registered STAC extensions used by various organizations to standardize metadata sharing/retrieval.

@dchandan
Copy link
Collaborator Author

@fmigneault @mishaschwartz PR is good to go now?

Comment on lines 74 to 75
"marble:host_node",
"marble:is_local"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These fields are nested under the "type": {"const": "Collection"} definition.
This whole block should be removed, or nested into a not disallowing "type": "collection" explicitly.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! done.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to be sure, is the oneOf to allOf change caused by a lib complaining about a single-item in oneOf?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I just changed it. Schema works in the present form with either one. Since it was just one case right now, I felt allOf was more readable.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there's only one item then you could just remove the allOf/oneOf key entirely, right? Wouldn't that be the most readable since then its clear that there's only one option?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it needs to be under one of the keys (again, based on studying other implementations, I'm not a schema-guy myself).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think most implementations leave them with the oneOf no matter how many entries are defined to make them extensible more easily without major refactors. They are also more similar between extensions, making them easier to read when switching between them.

Copy link

@mishaschwartz mishaschwartz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. (I just left one suggestion about the allOf/oneOf comment)

@dchandan dchandan merged commit 6e94d8b into main Mar 11, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants