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

Add CI? #1

Open
rabernat opened this issue May 29, 2020 · 13 comments
Open

Add CI? #1

rabernat opened this issue May 29, 2020 · 13 comments

Comments

@rabernat
Copy link
Member

Fantastic work Charles! This is really a great start!

You may want to consider adding a github action to run the STAC validator on the catalog. I know it won't validate yet, but this will help in the future.

@charlesbluca
Copy link
Member

I agree -- once I am done drafting out a README for the repo I will work on adding a workflow for PRs and pushes to master.

@charlesbluca
Copy link
Member

I'm not sure if this is just a personal issue, but the STAC validator doesn't seem to be fetching the specifications properly:

>> stac_validator https://raw.githubusercontent.com/charlesbluca/pangeo-datastore-stac/master/master/catalog.json

Traceback (most recent call last):
  File "c:\users\geniu\miniconda3\envs\pangeo-stac-test\lib\site-packages\stac_validator\stac_validator.py", line 125, in fetch_spec
    spec = requests.get(url(self.stac_version)).json()
  File "c:\users\geniu\miniconda3\envs\pangeo-stac-test\lib\site-packages\requests\models.py", line 898, in json
    return complexjson.loads(self.text, **kwargs)
  File "c:\users\geniu\miniconda3\envs\pangeo-stac-test\lib\json\__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "c:\users\geniu\miniconda3\envs\pangeo-stac-test\lib\json\decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "c:\users\geniu\miniconda3\envs\pangeo-stac-test\lib\json\decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\geniu\miniconda3\envs\pangeo-stac-test\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\geniu\miniconda3\envs\pangeo-stac-test\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\geniu\Miniconda3\envs\pangeo-stac-test\Scripts\stac_validator.exe\__main__.py", line 7, in <module>
  File "c:\users\geniu\miniconda3\envs\pangeo-stac-test\lib\site-packages\stac_validator\stac_validator.py", line 423, in main
    _ = stac.run(nthreads)
  File "c:\users\geniu\miniconda3\envs\pangeo-stac-test\lib\site-packages\stac_validator\stac_validator.py", line 397, in run
    message, status, new_children = task.result()
  File "c:\users\geniu\miniconda3\envs\pangeo-stac-test\lib\concurrent\futures\_base.py", line 425, in result
    return self.__get_result()
  File "c:\users\geniu\miniconda3\envs\pangeo-stac-test\lib\concurrent\futures\_base.py", line 384, in __get_result
    raise self._exception
  File "c:\users\geniu\miniconda3\envs\pangeo-stac-test\lib\concurrent\futures\thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "c:\users\geniu\miniconda3\envs\pangeo-stac-test\lib\site-packages\stac_validator\stac_validator.py", line 326, in _validate
    is_valid_stac, err_message = self.validate_json(stac_content, self.fetch_spec("catalog"))
  File "c:\users\geniu\miniconda3\envs\pangeo-stac-test\lib\site-packages\stac_validator\stac_validator.py", line 129, in fetch_spec
    raise VersionException(f"Could not download STAC specification files for version: {self.stac_version}")
stac_validator.stac_validator.VersionException: Could not download STAC specification files for version: master

It looks like the source code for the validator hasn't been updated in nearly a year, so we may have to push for some updates to be made before it is useful for testing. In the meantime, could you check if the follow works for you?

pip install stac_validator
stac_validator https://raw.githubusercontent.com/charlesbluca/pangeo-datastore-stac/master/master/catalog.json

@rabernat
Copy link
Member Author

rabernat commented Jun 2, 2020

I would ping @m-mohr on this. He has been very helpful in the past.

@m-mohr
Copy link

m-mohr commented Jun 2, 2020

STAC Validator is a bit outdated unfortunately, I'm not sure it supports the latest versions yet. @jbants has developed it. Any news, James? I think for now I'd go with a normal JSON Schema Validator that can pull in the external references.

@charlesbluca
Copy link
Member

Added some basic CI using jsonschema instead! I'll leave this open in case we can figure something out with stac_validator.

@m-mohr
Copy link

m-mohr commented Jun 3, 2020

Things got on speed today... I started working on a STAC validator, for node though. Other people are working on refreshing the python implementations.

@rabernat
Copy link
Member Author

rabernat commented Sep 3, 2020

Based on the discussion in radiantearth/stac-spec#781 (comment), it sounds like the python stac validator may be working now. Should we give it a try again?

https://github.com/m-mohr/stac-node-validator/blob/master/COMPARISON.md

@m-mohr
Copy link

m-mohr commented Sep 3, 2020

One caveat: You are using an external JSON Schema for validating your extension, which is currently only supported by the Node Validator. But for general validation against the STAC Core and other extensions, the Python validator works just fine. It's the "Validates External / Custom Extensions" entry in the table...

Edit: Although I now see there's the --custom flag, which might work...

@rabernat
Copy link
Member Author

rabernat commented Sep 3, 2020

You are using an external JSON Schema for validating your extension

Can you help me understand this? What is the external JSON schema you are referring to?

@m-mohr
Copy link

m-mohr commented Sep 3, 2020

@rabernat See my comment here, which should explain it based on an example: https://github.com/NCAR/esm-collection-spec/pull/23/files#r482980123

@rabernat
Copy link
Member Author

rabernat commented Sep 3, 2020

Thanks for the feedback. Again, I think there is some confusion around esm-collection-spec. The catalog in this repo does not yet attempt to use esm-collection-spec. For now, we are simply trying to catalog indivudal zarr stores in a standard STAC catalog hierarchy. So there is no external schema.

@m-mohr
Copy link

m-mohr commented Sep 3, 2020

Okay, yeah, I'm indeed a bit confused.

@rabernat
Copy link
Member Author

rabernat commented Sep 3, 2020

There are basically two scenarios:

  • You just a a few zarr stores --> no need for esm collection spec (this repo)
  • You have thousands of zarr stores --> esm collection spec

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

No branches or pull requests

3 participants