Open wiwichips opened 1 month ago
Bifrost version (2.0.2 dcp from pypi)
dcp
Code Repro:
# Install Bifrost2 and dcp-client. Takes >1 min !pip install dcp !npm i -g dcp-util !mkdir -p ~/.dcp !mkad new id --passphrase "" !mkad new default --passphrase "" # Install nest asyncio (Google Colab runs an event loop so we need to nest our event loop - workaround for now ): !pip install nest_asyncio # nest event loop import nest_asyncio nest_asyncio.apply() # initialize dcp import dcp dcp.init() # make new job from dcp import compute_for def workfn(datum): import dcp dcp.progress() return datum * datum job = compute_for([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], workfn) # add event listeners job.on('readystatechange', print) job.on('result', print) @job.on('accepted') def accepted_handler(ev): print(f"jobid = {job.id}") # add extra job details job.public.name = 'Bifrost2 Google Colab Example' #job.computeGroups = [{'joinKey': '<joinkeyhere>', 'joinSecret': '<joinsecrethere>'}] # deploy job, wait for it to be done, print results job.exec() res = job.wait() print(">>>>>>>>>>>>>>>>>>>>>>>>>> RESULTS ARE IN") print(res)
Output:
exec init preauth deploying listeners compute-groups uploading ERROR:asyncio:Future exception was never retrieved future: <Future finished exception=SpiderMonkeyError('Error in file <string>, on line 1, column 1:\nError: Python AttributeError: module \'__main__\' has no attribute \'__file__\'\nTraceback (most recent call last):\nFile "<string>", line 1, in <module>\n\nJS Stack Trace:\n dcpEnv$$getProcessPath@/usr/local/lib/python3.10/dist-packages/dcp/js/node_modules/dcp-client/dist/dcp-client-bundle.js:1:1046861\n dcpEnv$$getProcessName@/usr/local/lib/python3.10/dist-packages/dcp/js/node_modules/dcp-client/dist/dcp-client-bundle.js:1:1047015\n DCPError@/usr/local/lib/python3.10/dist-packages/dcp/js/node_modules/dcp-client/dist/dcp-client-bundle.js:1:1047817\n Connection530$$close@/usr/local/lib/python3.10/dist-packages/dcp/js/node_modules/dcp-client/dist/dcp-client-bundle.js:1:1431413\n addSlices@/usr/local/lib/python3.10/dist-packages/dcp/js/node_modules/dcp-client/dist/dcp-client-bundle.js:1:1143853\n async*exec@/usr/local/lib/python3.10/dist-packages/dcp/js/node_modules/dcp-client/dist/dcp-client-bundle.js:1:1119293\n\n')> pythonmonkey.SpiderMonkeyError: Error in file <string>, on line 1, column 1: Error: Python AttributeError: module '__main__' has no attribute '__file__' Traceback (most recent call last): File "<string>", line 1, in <module> JS Stack Trace: dcpEnv$$getProcessPath@/usr/local/lib/python3.10/dist-packages/dcp/js/node_modules/dcp-client/dist/dcp-client-bundle.js:1:1046861 dcpEnv$$getProcessName@/usr/local/lib/python3.10/dist-packages/dcp/js/node_modules/dcp-client/dist/dcp-client-bundle.js:1:1047015 DCPError@/usr/local/lib/python3.10/dist-packages/dcp/js/node_modules/dcp-client/dist/dcp-client-bundle.js:1:1047817 Connection530$$close@/usr/local/lib/python3.10/dist-packages/dcp/js/node_modules/dcp-client/dist/dcp-client-bundle.js:1:1431413 addSlices@/usr/local/lib/python3.10/dist-packages/dcp/js/node_modules/dcp-client/dist/dcp-client-bundle.js:1:1143853 async*exec@/usr/local/lib/python3.10/dist-packages/dcp/js/node_modules/dcp-client/dist/dcp-client-bundle.js:1:1119293 ERROR:asyncio:Exception in callback JSFunctionProxy.timerJobWrapper(<_UnixSelecto...e debug=False>, 61, 10.001, 0) handle: <TimerHandle when=221.931323064 JSFunctionProxy.timerJobWrapper(<_UnixSelecto...e debug=False>, 61, 10.001, 0)> Traceback (most recent call last): File "/usr/lib/python3.10/asyncio/events.py", line 80, in _run self._context.run(self._callback, *self._args) pythonmonkey.SpiderMonkeyError: Error in file <string>, on line 1, column 1: Error: Python AttributeError: module '__main__' has no attribute '__file__' Traceback (most recent call last): File "<string>", line 1, in <module> JS Stack Trace: dcpEnv$$getProcessPath@/usr/local/lib/python3.10/dist-packages/dcp/js/node_modules/dcp-client/dist/dcp-client-bundle.js:1:1046861 dcpEnv$$getProcessName@/usr/local/lib/python3.10/dist-packages/dcp/js/node_modules/dcp-client/dist/dcp-client-bundle.js:1:1047015 DCPError@/usr/local/lib/python3.10/dist-packages/dcp/js/node_modules/dcp-client/dist/dcp-client-bundle.js:1:1047817 Connection530$$close@/usr/local/lib/python3.10/dist-packages/dcp/js/node_modules/dcp-client/dist/dcp-client-bundle.js:1:1431413 62886/useDeployConnection/</this.deployConnectionTimeout<@/usr/local/lib/python3.10/dist-packages/dcp/js/node_modules/dcp-client/dist/dcp-client-bundle.js:1:1129931 ERROR:asyncio:Exception in callback JSFunctionProxy.timerJobWrapper(<_UnixSelecto...e debug=False>, 163, 0.0, 0) handle: <TimerHandle when=222.699276614 JSFunctionProxy.timerJobWrapper(<_UnixSelecto...e debug=False>, 163, 0.0, 0)> Traceback (most recent call last): File "/usr/lib/python3.10/asyncio/events.py", line 80, in _run self._context.run(self._callback, *self._args) pythonmonkey.SpiderMonkeyError: Error in file <string>, on line 1, column 1: Error: Python AttributeError: module '__main__' has no attribute '__file__' Traceback (most recent call last): File "<string>", line 1, in <module> JS Stack Trace: dcpEnv$$getProcessPath@/usr/local/lib/python3.10/dist-packages/dcp/js/node_modules/dcp-client/dist/dcp-client-bundle.js:1:1046861 dcpEnv$$getProcessName@/usr/local/lib/python3.10/dist-packages/dcp/js/node_modules/dcp-client/dist/dcp-client-bundle.js:1:1047015 DCPError@/usr/local/lib/python3.10/dist-packages/dcp/js/node_modules/dcp-client/dist/dcp-client-bundle.js:1:1047817 Connection530$$close@/usr/local/lib/python3.10/dist-packages/dcp/js/node_modules/dcp-client/dist/dcp-client-bundle.js:1:1431413 58770/computeApi$$getTransientConnection/tc$closeIfNotActive/<@/usr/local/lib/python3.10/dist-packages/dcp/js/node_modules/dcp-client/dist/dcp-client-bundle.js:1:1550901
Bifrost version (2.0.2
dcp
from pypi)Code Repro:
Output: