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

Adding service information for the STAC catalog #373

Merged
merged 14 commits into from
Oct 2, 2023
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
6 changes: 3 additions & 3 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.33.4
current_version = 1.33.5
commit = True
tag = False
tag_name = {new_version}
Expand Down Expand Up @@ -30,11 +30,11 @@ search = {current_version}
replace = {new_version}

[bumpversion:file:RELEASE.txt]
search = {current_version} 2023-10-02T13:49:23Z
search = {current_version} 2023-10-02T15:13:02Z
replace = {new_version} {utcnow:%Y-%m-%dT%H:%M:%SZ}

[bumpversion:part:releaseTime]
values = 2023-10-02T13:49:23Z
values = 2023-10-02T15:13:02Z

[bumpversion:file(version):birdhouse/config/canarie-api/docker_configuration.py.template]
search = 'version': '{current_version}'
Expand Down
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@

[//]: # (list changes here, using '-' for each new entry, remove this when items are added)

[1.33.5](https://github.com/bird-house/birdhouse-deploy/tree/1.33.5) (2023-10-02)
------------------------------------------------------------------------------------------------------------------

## CHANGES

- Adding a description for the STAC service that will be served at the `/services` endpoint
dchandan marked this conversation as resolved.
Show resolved Hide resolved

[1.33.4](https://github.com/bird-house/birdhouse-deploy/tree/1.33.4) (2023-10-02)
------------------------------------------------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Generic variables
override SHELL := bash
override APP_NAME := birdhouse-deploy
override APP_VERSION := 1.33.4
override APP_VERSION := 1.33.5

# utility to remove comments after value of an option variable
override clean_opt = $(shell echo "$(1)" | $(_SED) -r -e "s/[ '$'\t'']+$$//g")
Expand Down
8 changes: 4 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ for a full-fledged production platform.
* - releases
- | |latest-version| |commits-since|

.. |commits-since| image:: https://img.shields.io/github/commits-since/bird-house/birdhouse-deploy/1.33.4.svg
.. |commits-since| image:: https://img.shields.io/github/commits-since/bird-house/birdhouse-deploy/1.33.5.svg
:alt: Commits since latest release
:target: https://github.com/bird-house/birdhouse-deploy/compare/1.33.4...master
:target: https://github.com/bird-house/birdhouse-deploy/compare/1.33.5...master

.. |latest-version| image:: https://img.shields.io/badge/tag-1.33.4-blue.svg?style=flat
.. |latest-version| image:: https://img.shields.io/badge/tag-1.33.5-blue.svg?style=flat
:alt: Latest Tag
:target: https://github.com/bird-house/birdhouse-deploy/tree/1.33.4
:target: https://github.com/bird-house/birdhouse-deploy/tree/1.33.5

.. |readthedocs| image:: https://readthedocs.org/projects/birdhouse-deploy/badge/?version=latest
:alt: ReadTheDocs Build Status (latest version)
Expand Down
2 changes: 1 addition & 1 deletion RELEASE.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.33.4 2023-10-02T13:49:23Z
1.33.5 2023-10-02T15:13:02Z
1 change: 1 addition & 0 deletions birdhouse/components/stac/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
config/magpie/config.yml
config/proxy/conf.extra-service.d/stac.conf
config/canarie-api/canarie_api_monitoring.py
service-config.json
54 changes: 54 additions & 0 deletions birdhouse/components/stac/service-config.json.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"$schema": "https://raw.githubusercontent.com/DACCS-Climate/Marble-node-registry/main/node_registry.schema.json#service",
"name": "stac",
"keywords": [
"catalog"
],
"description": "Searchable spatiotemporal metadata describing climate and Earth observation datasets.",
"links": [
{
"rel": "service",
"type": "application/json",
"href": "https://${PAVICS_FQDN_PUBLIC}/stac/"
},
{
"rel": "service-doc",
"type": "text/html",
"href": "https://github.com/radiantearth/stac-api-spec/tree/v1.0.0"
},
{
"rel": "service-desc",
"type": "application/yaml",
"href": "https://raw.githubusercontent.com/radiantearth/stac-api-spec/main/core/openapi.yaml"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it would be better actually to refer to a pinned version (release/tag).
https://github.com/radiantearth/stac-api-spec/tree/v1.0.0 should be good.
We should probably make this a configurable env-var with the corresponding app tag for the docker image.
Right now, crim-ca/stac-app:main is used as well:
https://github.com/bird-house/birdhouse-deploy/blob/master/birdhouse/components/stac/docker-compose-extra.yml#L13

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 agree about the pinned version. I didn't quite understand your second comment..

Copy link
Collaborator

Choose a reason for hiding this comment

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

@fmigneault can this be addressed in a different PR? It's a good point but probably should be addressed later when we actually start using a version other than crim-ca/stac-app:main

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes. I agree to move it to another PR while addressing the reference image.

},
{
"rel": "alternate",
"type": "text/html",
"href": "https://${PAVICS_FQDN_PUBLIC}/stac-browser/"
}
]
}, {
"$schema": "https://raw.githubusercontent.com/DACCS-Climate/Marble-node-registry/main/node_registry.schema.json#service",
"name": "stac-browser",
"keywords": [
"catalog"
],
"description": "A web interface to browse the STAC catalogs.",
"links": [
{
"rel": "service",
"type": "text/html",
"href": "https://${PAVICS_FQDN_PUBLIC}/stac-browser/"
},
{
"rel": "service-doc",
"type": "text/html",
"href": "https://github.com/radiantearth/stac-browser"
},
{
"rel": "alternate",
"type": "application/json",
"href": "https://${PAVICS_FQDN_PUBLIC}/stac/"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ SERVICES = {
# NOTE:
# Below version and release time auto-managed by 'make VERSION=x.y.z bump'.
# Do NOT modify it manually. See 'Tagging policy' in 'birdhouse/README.rst'.
'version': '1.33.4',
'releaseTime': '2023-10-02T13:49:23Z',
'version': '1.33.5',
'releaseTime': '2023-10-02T15:13:02Z',
'institution': 'Ouranos',
'researchSubject': 'Climatology',
'supportEmail': '${SUPPORT_EMAIL}',
Expand Down Expand Up @@ -142,8 +142,8 @@ PLATFORMS = {
# NOTE:
# Below version and release time auto-managed by 'make VERSION=x.y.z bump'.
# Do NOT modify it manually. See 'Tagging policy' in 'birdhouse/README.rst'.
'version': '1.33.4',
'releaseTime': '2023-10-02T13:49:23Z',
'version': '1.33.5',
'releaseTime': '2023-10-02T15:13:02Z',
'institution': 'Ouranos',
'researchSubject': 'Climatology',
'supportEmail': '${SUPPORT_EMAIL}',
Expand Down
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@
# built documents.
#
# The short X.Y version.
version = '1.33.4'
version = '1.33.5'
# The full version, including alpha/beta/rc tags.
release = '1.33.4'
release = '1.33.5'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
30 changes: 19 additions & 11 deletions tests/test_deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import jsonschema
import pytest
import requests

COMPONENT_LOCATIONS = ("components", "optional-components", "config")
TEMPLATE_SUBSTITUTIONS = {
Expand Down Expand Up @@ -43,11 +42,18 @@ def test_service_config_name_same_as_dirname(self, component_paths):
service_config_file = os.path.join(path, "service-config.json.template")
if os.path.isfile(service_config_file):
with open(service_config_file) as f:
service_config = json.loads(Template(f.read()).safe_substitute(TEMPLATE_SUBSTITUTIONS))
config_name = service_config.get("name")
path_name = os.path.basename(path)
if config_name != path_name:
invalid_names.append((config_name, path_name))
config_info = Template(f.read()).safe_substitute(TEMPLATE_SUBSTITUTIONS)
service_configs = json.loads("[{}]".format(config_info))
invalid_config_names = []
for service_config in service_configs:
config_name = service_config.get("name")
path_name = os.path.basename(path)
if config_name == path_name:
# If at least one service_config in the file contains a matching name, that's ok
break
invalid_config_names.append((config_name, path_name))
else:
invalid_names.extend(invalid_config_names)
assert not invalid_names, "service names in service-config.json.template should match the directory name"

@pytest.mark.online
Expand All @@ -58,9 +64,11 @@ def test_service_config_valid(self, component_paths, services_config_schema):
service_config_file = os.path.join(path, "service-config.json.template")
if os.path.isfile(service_config_file):
with open(service_config_file) as f:
service_config = json.loads(Template(f.read()).safe_substitute(TEMPLATE_SUBSTITUTIONS))
try:
jsonschema.validate(instance=service_config, schema=services_config_schema)
except jsonschema.exceptions.ValidationError as e:
invalid_schemas.append(f"{os.path.basename(path)} contains invalid service configuration: {e}")
config_info = Template(f.read()).safe_substitute(TEMPLATE_SUBSTITUTIONS)
service_configs = json.loads("[{}]".format(config_info))
for service_config in service_configs:
try:
jsonschema.validate(instance=service_config, schema=services_config_schema)
except jsonschema.exceptions.ValidationError as e:
invalid_schemas.append(f"{os.path.basename(path)} contains invalid service configuration: {e}")
assert not invalid_schemas, "\n".join(invalid_schemas)
Loading