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

spython is missing DockerRecipe #3

Closed
stain opened this issue Aug 9, 2019 · 5 comments · May be fixed by #4
Closed

spython is missing DockerRecipe #3

stain opened this issue Aug 9, 2019 · 5 comments · May be fixed by #4

Comments

@stain
Copy link

stain commented Aug 9, 2019

The docs do not say which version of spython is needed by */extract.py, so I did simply pip install spython - but this seem to no longer have the DockerRecipe class

(base) stain@biggie:~/src/extract-dockerfile$ pip show spython
Name: spython
Version: 0.0.73
Summary: Command line python tool for working with singularity.
Home-page: http://www.github.com/singularityhub/singularity-cli
Author: Vanessa Sochat
Author-email: [email protected]
License: LICENSE
Location: /scratch/conda/miniconda3/lib/python3.7/site-packages
Requires: semver
Required-by: 


(base) stain@biggie:~/src/extract-dockerfile/SoftwareSourceCode$ python extract.py 
/home/stain/miniconda3/lib/python3.7/site-packages/schemaorg/utils.py:237: YAMLLoadWarning: calling yaml.load_all() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
  for doc in docs:
{'version': 1, 'schemas': {'SoftwareSourceCode': {'recommended': [{'softwareVersion': 'version'}, 'citation', 'identifier', 'keywords', 'license', 'url', 'sameAs', 'spatialCoverage', 'temporalCoverage', 'variableMeasured'], 'required': ['description', 'name']}, 'Person|Organization': {'required': ['description', 'name']}, 'Person': {'required': ['description', 'name']}, 'Organization': {'required': ['description', 'name']}}}
Specification base set to http://www.schema.org
Using Version 3.5
Found http://www.schema.org/Person
Person: found 69 properties
Specification base set to http://www.schema.org
Using Version 3.5
Found http://www.schema.org/ContactPoint
ContactPoint: found 22 properties
Traceback (most recent call last):
  File "extract.py", line 63, in <module>
    from spython.main.parse import DockerRecipe
ImportError: cannot import name 'DockerRecipe' from 'spython.main.parse' (/home/stain/miniconda3/lib/python3.7/site-packages/spython/main/parse/__init__.py)
@stain stain changed the title spython is missing spython is missing DockerRecipe Aug 9, 2019
@stain
Copy link
Author

stain commented Aug 9, 2019

Seems to have moved to spython.main.parse.parsers.docker.DockerParser and now requires a call to .parse() to get the recipe.

stain added a commit to stain/extract-dockerfile that referenced this issue Aug 9, 2019
@vsoch
Copy link
Member

vsoch commented Aug 9, 2019

Oh this is an error on my part! We refactored the recipe parser to be much better organized, and I didn't specify the previous version here (and didn't update it). Let me fix this up right away, stay tuned!

@vsoch
Copy link
Member

vsoch commented Aug 9, 2019

hey @stain I've updated the extract.py examples. Would you care to test? #5

The SoftwareSourceCode is the most straight forward - we are constrained to the existing fields (that largely don't include container-specific things). If you try the other examples, we use ContainerDiff to extract more metadata, and in fact this could be greatly extended to use Files or other to extract meaningful tags. The extraction script itself would likely be written for your use case, depending on the metadata that you have for containers.

@vsoch
Copy link
Member

vsoch commented Aug 9, 2019

Anyway, give the PR a test, and let me know what you are trying to accomplish after, and I'll see if I can be of help. :) Happy Friday!

@stain
Copy link
Author

stain commented Aug 12, 2019

Thanks! For my use case, see ResearchObject/ro-crate#39 - basically we want to include some of your container metadata extracts straight in the ro-crate JSON-LD, so the first step would be to get output as pure JSON-LD without the HTML wrapper.

It could also be that some ContainerRecipe or ContainerImage descriptions are provided manually or through other ways (e.g. minimally the container image name).

We would then try to help improve the specs, e.g. adding/guessing URLs for container images in the hub.

@vsoch vsoch closed this as completed Aug 16, 2019
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 a pull request may close this issue.

2 participants