cog
cog copied to clipboard
Inform user if `cog.yaml` or `predict.py` are missing
cog.command.openapi_schema
should inform users if cog.yaml
is missing.
Currently, cog.command.openapi_schema
silently returns {}
if cog.yaml
is missing (see here).
This is undesirable in situations where cog.yaml
is in fact missing, but the user thinks that it is present. In such cases, cog build
will fail on openapi schema validation, but it won't be clear why.
This just happened to me!
For various questionable reasons, cog.yaml
in my project root is a symlink and the target was accidentally excluded in my .dockerignore
. This led to an interesting situation where cog run python -m cog.command.openapi_schema
returned the correct schema, but cog build
failed at schema validation because the schema returned empty.
A warning or just a note that my cog.yaml
was missing would have saved me quite a bit of detective work.
@joehoover this is a easy fix by adding a warning, should I raise a PR to fix this ?
should I raise a PR to fix this ?
@asingh9530 yes please!
@zeke missed notification, added PR for fix.