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

Pywren and python ORM support (SQLAlchemy module) #253

Open
vijayaratha opened this issue Jun 4, 2018 · 2 comments
Open

Pywren and python ORM support (SQLAlchemy module) #253

vijayaratha opened this issue Jun 4, 2018 · 2 comments

Comments

@vijayaratha
Copy link

Im testing pywren to see whether we can work with python ORM (MYSQL DB runs on AMAZON RDS)

My sample program;


import pywren
import...

def saveObservations(tankNo):
   sortedList=[...] <--Hardcoded list
    listToSave = []
    values = calculate(sortedList)
    listToSave.append(mapperObservations.toDbObj(values))
    saveObservations(listToSave)


 tanks=[1, 2, 3, 4]
 wrenexec = pywren.default_executor()
 futures = wrenexec.map(saveObservations, tanks)
  print [f.result() for f in futures]

To get ORM support, we use SQLAlchemy[1] library.
I checked my python environment , it has all libraries installed. (sqlalchemy, flask-sqlalchemy,..)
But when trying to execute this test program, I get following error.My pyCharm configurations/python/libraries path are correct. I checked several times. Without Pywren library, Our normal project with ORM support (using sqlalchemy module) works.
When I modify that with Pywren I get this error. I suspect some issue at Pywren library which could not find sqlalchemy module.
Can anyone point me the what i'm doing wrong here?

Traceback (most recent call last):

  File "/Users/ratha/projects/test711/ATGWS/ParallelProcessor/ATGObservationORM.py", line 28, in <module>
    print [f.result() for f in futures]
  File "/Users/ratha/projects/test711/ATGWS/venv/lib/python2.7/site-packages/pywren/future.py", line 202, in result
    reraise(*self._traceback)
  File "/var/task/jobrunner.py", line 29, in <module>
ImportError: No module named sqlalchemy.util._collections

[1] https://www.sqlalchemy.org/

@ericmjonas
Copy link
Collaborator

It looks like SQLAlchemy is a module with a c extension that our runtime does not currently support. To use sqlalchemy we would have to currently build a custom runtime, whcih might be possible. You're using mysql for your db backend?

@vijayaratha
Copy link
Author

vijayaratha commented Jun 5, 2018

Yes.MySql is my backend. Do you have any guide on how to build custom runtime and how to use that?. If a guide is provided which would be great help for us.So, in the future we may not need to ask for help for custom runtime.

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

2 participants