-
Notifications
You must be signed in to change notification settings - Fork 7
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
add node services URI and fields #445
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we also want to update deprecated-components/flyingpigeon
as well?
I'm very happy to not update deprecated components but I just wanted to double check that you left it out intentionally.
"version": "${FINCH_VERSION}", | ||
"types": [ | ||
"wps" | ||
], | ||
"keywords": [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we leave these keywords as is if we're moving this information to "types". What if we borrowed some of the tags and categories from canarie-api instead. So for finch we could do something like:
"keywords": ["Climatology", "Cloud", "Data Slicer", "Climate Indices", ...]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I would like to do this, but until there is a clear-cut version I can refer to, adding these to the keywords will fail schema validation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. Try now with version 1.2.0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we going to do this in this PR or in a different one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If possible, I'd prefer to work on this only once.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure template expansion actually work.
Also I do not think this PR introduce a breaking change (in reference to this PR description). The new var has a default value so upgrading to this PR is 100% seamless, no manual intervention required, so nothing "breaking" as per deployment as I can see.
I defer to Misha for review of the content of the .json .
Agree with Misha this PR unified the way to specify all the images so it's a very nice side-effect.
Also, it seems all we need are additional copy/paste to make deprecated-components work so probably cheap enough to make it work as well.
Cheap enough for sure, but can we also plan to stop updating these at some point? I mean, at what point do we actually treat them as deprecated instead of just in another folder that happens to be called
We are, it's just that the lnks schema uses the uri-template string type to check the |
I guess at the point where it's expensive. I agree "expensive" is very vague so up to you I guess. |
I did omit |
I don't think this is the cause. jsonschema.validate("^^^!!!! <<SO NOT AN URI>> ???", {"type": "string", "format": "uri-template"}) # OK Looking up the format check in the validator confirms this ( jsonschema.draft202012_format_checker
<FormatChecker checkers=['date', 'email', 'idn-email', 'idn-hostname', 'ipv4', 'ipv6', 'regex', 'uuid']> So, the real fix would be to add a |
Ok that's good to know.... |
{ | ||
"rel": "service-meta", | ||
"type": "application/vnd.oci.image.index.v1+json", | ||
"href": "${FINCH_IMAGE_URI}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just my 2 cents, since the URI, do not start with http, should we name the new field "uri" instead of "href"? "href" would suggest starting with http usually. Ignore if it has to be "href" for compat or other reasons.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"href"
is required by the schema so we can't change the name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A non-http scheme value is a valid URI. It uniquely identifies the resource.
I would prefer to have a docker://
scheme or similar to be more explicit if permitted, but docker does not seem to like it. However, the values provided in the defaults can be used directly (e.g. docker pull 'registry.hub.docker.com/pavics/weaver:5.0.0'
works, but http://registry.hub.docker.com/pavics/weaver:5.0.0
doesn't), so I find them more useful although maybe counter-intuitive.
Maybe one way to avoid confusion would be to use index.docker.io/pavics/weaver:5.0.0
instead, since it does not redirect to https://hub.docker.com/
like registry.hub.docker.com
does? This alternate location still woks with docker pull 'index.docker.io/pavics/weaver:5.0.0'
, and it looks slightly more like the type
definition. The idea of this link is really to have the exact value that can be plugged in the docker-compose service image
field.
…e contents with resolved defaults + use '' from service reference instead of global one
# read and strip leading/trailing whitespaces | ||
SERVICE_CONF="$(cat "${adir}/service-config.json" | sed -z 's/^\s*//;s/\s*$//')" | ||
# merge whether config is an array or a single service | ||
if [ "$(echo "${SERVICE_CONF}" | head -n 1)" = "[" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you just left the stac/service-config.json.template file as is, all of this wouldn't be necessary.
I don't understand why this is needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either this, or we patch everywhere that tries to load the JSON.
I add errors when trying to extract the $schema
in the tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be the only place that tries to load the JSON.
The individual files are not meant to be read by anywhere else, their only purpose is to be concatenated by this script so that they can be displayed as one big list.
One of the reasons we had the files as they were before was so that we didn't have to complicate loading them into one big JSON list like this.
However, if we're going to got this route, I'd be in favour of using a proper json parsing tool like jq
instead of hacking together JSON snippets with sed
. jq
has a docker image that we can use if necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I purposely went without the jq
approach to avoid introducing this extra dependency since the merge is relatively simple in this case.
One issue with the pseudo-JSON is that it is not obvious (for others) that the incorrectly formed content is intentional to work only once merged. Especially when working with IDEs, or investigating the generated JSON on the server, we get flagged about invalid JSON, which doesn't help maintain them. Since there is a way to make them valid JSON definitions and still work for the aggregation, I would favor using a valid list.
"version": "${FINCH_VERSION}", | ||
"types": [ | ||
"wps" | ||
], | ||
"keywords": [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we going to do this in this PR or in a different one?
"name": "finch", | ||
"version": "${FINCH_VERSION}", | ||
"types": [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This hasn't been implemented yet in the schema. Adding this won't cause schema validation to fail but do we plan on updating the schema before or after this PR is merged?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the schema gets updated to include it beforehand, then we can bump its version right away. Otherwise, it can be done later. As mentioned, it doesn't cause an issue regardless at the moment since it is not validated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I have not done a deployment test to ensure all template expansions actually work. I also defer to @mishaschwartz to validate the content of the various .json
files and the test.
# (see: https://github.com/crim-ca/stac-app/blob/40cad1aa7a094d58fca2d3184182761e248f781d/Dockerfile#L15-L20) | ||
# which corresponds to 2.4.3 release | ||
export STAC_VERSION=2.4.3-crim-main | ||
export STAC_IMAGE='ghcr.io/crim-ca/stac-app:main' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, why not push the image with the actual tag 2.4.3-crim
instead of the generic tag main
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I could temporarily push a tag to make the reference more "semver"-like, but like @mishaschwartz highlighted, I would much rather have some work done on using the official image. The one tagged is already 9 months old. I don't want this patch tag to be considered a maintained revision.
# which is some commits ahead of 'v3.0.0-beta.5' (and multiple behind latest official releases) | ||
# version name is slightly tweaked to fulfill schema while leaving an obvious trace | ||
export STAC_BROWSER_VERSION=3.0.0-beta.5-crim-docker-image-push | ||
export STAC_BROWSER_IMAGE='ghcr.io/crim-ca/stac-browser:docker_image_push' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, 3.0.0-beta.5-crim
instead of docker_image_push
. It is allowed to tag while on a branch.
run tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Just double checking if there's still more keywords to add or not (see comment here: #445 (comment))
For the moment, 1.2.0 still refers to |
Right, we're still discussing it here: DACCS-Climate/Marble-node-registry#39 Ok nevermind then |
Overview
Add node services URI and fields.
Changes
Non-breaking changes
Node Services: Add definitions and variables for every service represented by
the DACCS-Climate/Marble-node-registry.
version
field using the corresponding<SERVICE>_VERSION
variables.types
field restricted by specific values instead of previouskeywords
expected to be extendable.<SERVICE>_IMAGE_URI
variables to providerel: service-meta
link for every service.Breaking changes
Related Issue / Discussion
CI Operations
birdhouse_daccs_configs_branch: master
birdhouse_skip_ci: false