Stability-AI / stability-sdk

SDK for interacting with stability.ai APIs (e.g. stable diffusion inference)
https://platform.stability.ai/
MIT License
2.43k stars 339 forks source link

sane interfaces integration #135

Closed dmarx closed 1 year ago

dmarx commented 1 year ago

followup from #131 and #114

dmarx commented 1 year ago

@wbrown looks like this is still missing a serializer submodule that I think is supposed to be part of the tensorizer package?

dmarx commented 1 year ago

local test failure gives different error message than the error being reported in gh actions. local error:

=================================================== test session starts ===================================================
platform darwin -- Python 3.9.6, pytest-7.2.0, pluggy-1.0.0
rootdir: /Users/dmarx/proj/stability-sdk, configfile: pyproject.toml
collecting ... 
--------------------------------------------------- live log collection ---------------------------------------------------
WARNING  dotenv.main:main.py:21 Python-dotenv could not parse statement starting at line 1
collected 20 items / 1 error                                                                                              

========================================================= ERRORS ==========================================================
______________________ ERROR collecting src/stability_sdk/interfaces/src/tensorizer/test_protobuf.py ______________________
ImportError while importing test module '/Users/dmarx/proj/stability-sdk/src/stability_sdk/interfaces/src/tensorizer/test_protobuf.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
src/stability_sdk/interfaces/src/tensorizer/test_protobuf.py:2: in <module>
    import serializer
E   ModuleNotFoundError: No module named 'serializer'
================================================= short test summary info =================================================
ERROR src/stability_sdk/interfaces/src/tensorizer/test_protobuf.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
==================================================== 1 error in 0.07s =============================================== /0.3s

gh actions:

ImportError while loading conftest '/home/runner/work/stability-sdk/stability-sdk/tests/conftest.py'.
tests/conftest.py:18: in <module>
    import stability_sdk.interfaces.gooseai.generation.generation_pb2 as generation
/opt/hostedtoolcache/Python/3.8.[14](https://github.com/Stability-AI/stability-sdk/actions/runs/3465307474/jobs/5787958295#step:6:15)/x64/lib/python3.8/site-packages/stability_sdk/interfaces/gooseai/generation/generation_pb2.py:16: in <module>
    import tensors_pb2 as tensors__pb2
E   ModuleNotFoundError: No module named 'tensors_pb2'
Error: Process completed with exit code 4.

is it possible the recursive checkout action isn't actually recursing properly? i.e. maybe tensorizers isn't being checked out to the working tree in the test runner?

pharmapsychotic commented 1 year ago

@dmarx looks like may need to update import paths as in https://github.com/Stability-AI/generator_server/commit/ceeec6babfd90bc599cf154d5684095bc315de8f

palp commented 1 year ago

is it possible the recursive checkout action isn't actually recursing properly? i.e. maybe tensorizers isn't being checked out to the working tree in the test runner?

Maybe try manually running something like this after checkout?

- git submodule init
- git submodule update --recursive
dmarx commented 1 year ago

this is legit driving me crazy. as far as I can tell, i've got this working on the [..].ci_test version of this branch (up to matching my local error anyway), but the changes don't seem to have carried over to this branch when I made what I'm pretty sure are the sam updates. Moreover, the error is currently being thrown by line 19 of conftest, which is past an assertion for the existence of a file that should resolve the issue that causes this error to be thrown. so the file is there, but it can't be imported?

...pretty sure all of this would be resolved if api-interfaces and tensorizer were modified to be properly installed packages, i.e. with a setup.py?

dmarx commented 1 year ago

backup plan if this continues to be a headache: rollback the version on api-interfaces to pre-tensorizer. call updating api-interfaces a separate dependent PR.

sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication