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

Bug: 0.9.0 ModuleNotFoundError: No module named 'goblet.infrastructures' #261

Closed
rasnes opened this issue Oct 17, 2022 · 9 comments
Closed
Labels
bug Something isn't working

Comments

@rasnes
Copy link

rasnes commented Oct 17, 2022

Hi. I just tried to update from version 0.8.4 to 0.9.0, and I get this error when I try to run goblet deploy:

Run poetry run goblet deploy --location europe-north1
Traceback (most recent call last):
  File "/home/runner/.cache/pypoetry/virtualenvs/bucket-to-bigquery-85QkY9Aq-py3.10/bin/goblet", line 5, in <module>
    from goblet.cli import main
  File "/home/runner/.cache/pypoetry/virtualenvs/bucket-to-bigquery-85QkY9Aq-py3.10/lib/python3.10/site-packages/goblet/__init__.py", line 1, in <module>
    from goblet.app import Goblet, jsonify, goblet_entrypoint  # noqa: F401
  File "/home/runner/.cache/pypoetry/virtualenvs/bucket-to-bigquery-85QkY9Aq-py3.10/lib/python3.10/site-packages/goblet/app.py", line 7, in <module>
    from goblet.decorators import Register_Handlers
  File "/home/runner/.cache/pypoetry/virtualenvs/bucket-to-bigquery-85QkY9Aq-py3.10/lib/python3.10/site-packages/goblet/decorators.py", line 8, in <module>
    from goblet.infrastructures.redis import Redis
ModuleNotFoundError: No module named 'goblet.infrastructures'
Error: Process completed with exit code 1.

Anything I can do about this, or is this something that should be fixed on your end?

@anovis anovis added the bug Something isn't working label Oct 17, 2022
@anovis
Copy link
Collaborator

anovis commented Oct 17, 2022

let me take a look into it. what were you trying to deploy?

@anovis
Copy link
Collaborator

anovis commented Oct 17, 2022

this looks like it could be a poetry caching issue, or a pythonpath issue potentially. I use conda and i was able to deploy a cloudfuntion, cloudrun, and cloudrun job ok. will continue to look into it

@rasnes
Copy link
Author

rasnes commented Oct 17, 2022

Thanks for looking at this so quickly. I checked the caching in my Github Actions workflow, and it seemed to work as intended, i.e. that poetry did a fresh install (not from cache) of the updated dependencies, including goblet 0.9.0. Then it runs poetry export -f requirements.txt --output requirements.txt to produce

goblet-gcp==0.9.0 ; python_version >= "3.10" and python_version < "3.11" \
    --hash=sha256:75b1a1e7cdc096cf4b9a76d14f957ac71b821b6b61532ab5c7920b8e39336583 \
    --hash=sha256:7acbff7413805f046d23e140d4fe236aec3674cf6632f65abc0e48f6e65b1e08

in my requirements.txt file that goblet deploy will fetch to deploy my Cloud Run Jobs. UPDATE: the requirements.txt should not matter in this case I think, this issue is on deploying the container, not running it. My main.py code looks like:

from goblet import Goblet, goblet_entrypoint
import logging

app = Goblet(
    function_name="bucket-to-bigquery",
    backend="cloudrun",
)
goblet_entrypoint(app)
app.log.setLevel(logging.DEBUG)

@app.job("ingest-routes")
def ingest_routes(id):
    app.log.info(f"executes {id}")
    foo(bar)
    return "200"

But I will try to look more closely at my end of course. I might have been a bit fast to report this as a bug, but these things should, ideally, just work 😆 (Sorry for the close and reopen, I had my kids running on my keyboard.)

@rasnes rasnes closed this as completed Oct 17, 2022
@rasnes rasnes reopened this Oct 17, 2022
@anovis
Copy link
Collaborator

anovis commented Oct 17, 2022

thanks for the example. i will try with poetry locally as well and see if i can replicate.

@AdeelK93
Copy link
Contributor

I fully uninstalled goblet and reinstalled, and I'm still having this issue when installing with poetry.
Here's a guess - is it because __init__.py is missing from infrastructures?

@AdeelK93
Copy link
Contributor

@jissac seems we're on the same page! with #263

@anovis
Copy link
Collaborator

anovis commented Oct 17, 2022

yup! appreciate the help. will merge and create a new release.

Sorry about the bug

@anovis
Copy link
Collaborator

anovis commented Oct 17, 2022

released 0.9.1 so hopefully this is fixed.

@rasnes
Copy link
Author

rasnes commented Oct 19, 2022

This is fixed now with 0.9.1. Thanks!

@rasnes rasnes closed this as completed Oct 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants