VOLTTRON / volttron

VOLTTRON Distributed Control System Platform
https://volttron.readthedocs.io/
Other
456 stars 216 forks source link

volttron-pkg not able have a proper environment in /tmp #951

Closed ocschwar closed 7 years ago

ocschwar commented 7 years ago

I'm checking some modifications to VolttronCentral, but am unable to repackage them: (develop branch)

(volttron)volttron@pnpserver:~/volttron$ volttron-pkg package services/core/VolttronCentral Traceback (most recent call last): File "setup.py", line 79, in <module> _temp = __import__(agent_module, globals(), locals(), ['__version__'], -1) File "/tmp/tmp2OR9hP/pkg/volttroncentral/agent.py", line 108, in <module> from volttron.platform.vip.agent.connection import Connection ImportError: No module named connection 2016-10-25 15:28:30,496 () volttron.platform.packaging ERROR: Command '['/home/volttron/volttron/env/bin/python2.7', 'setup.py', '--no-user-cfg', '--quiet', 'bdist_wheel']' returned non-zero exit status 1

craig8 commented 7 years ago

Please tell me what branch you are working on. I believe that this is caused because the Connection object has been moved.

Please pull down the latest develop code and rebuild the volttroncentral agent (version is 3.5.5) currently.

ocschwar commented 7 years ago

It is the develop branch, pulled an hour ago. And IIUC, volttron-pkg is the command I should be using to rebuild.

craig8 commented 7 years ago

Generally we use modifications to the script located in scripts/core make-listener or upgrade-listener. We place them in a config folder under the root of the volttron directory (the config directory is in .gitignore).

If you do a pip list make sure you have volttron 4.0.0 in the list. If not then execute python bootstrap.py from your activated shell. My output from my volttron is below using the same command that you used.

(volttron)volttron@vc:~/volttron-develop$ volttron-pkg package services/core/VolttronCentral
2016-10-25 08:54:46,406 wheel INFO: creating '/tmp/tmpEme_Mc/pkg/dist/volttroncentralagent-3.5.5-py2-none-any.whl' and adding '.' to it
2016-10-25 08:54:46,407 wheel INFO: adding 'volttroncentral/sessions.py'
2016-10-25 08:54:46,408 wheel INFO: adding 'volttroncentral/authenticate.py'
2016-10-25 08:54:46,408 wheel INFO: adding 'volttroncentral/resource_directory.py'
2016-10-25 08:54:46,409 wheel INFO: adding 'volttroncentral/registry.py'
2016-10-25 08:54:46,409 wheel INFO: adding 'volttroncentral/__init__.py'
2016-10-25 08:54:46,411 wheel INFO: adding 'volttroncentral/agent.py'
2016-10-25 08:54:46,412 wheel INFO: adding 'volttroncentral/webroot/api-tests.html'
2016-10-25 08:54:46,413 wheel INFO: adding 'volttroncentral/webroot/index.html'
2016-10-25 08:54:46,413 wheel INFO: adding 'volttroncentral/webroot/new-register.html'
2016-10-25 08:54:46,414 wheel INFO: adding 'volttroncentral/webroot/register-platforms.html'
2016-10-25 08:54:46,414 wheel INFO: adding 'volttroncentral/webroot/remove-agent.html'
2016-10-25 08:54:46,415 wheel INFO: adding 'volttroncentral/webroot/websocket-test.html'
2016-10-25 08:54:46,416 wheel INFO: adding 'volttroncentral/webroot/css/app-1d7b93c5.css'
2016-10-25 08:54:46,417 wheel INFO: adding 'volttroncentral/webroot/css/normalize-1e9c0f3b.css'
2016-10-25 08:54:46,417 wheel INFO: adding 'volttroncentral/webroot/css/nv.d3.min-c0fe03eb.css'
2016-10-25 08:54:46,421 wheel INFO: adding 'volttroncentral/webroot/fonts/fontawesome-webfont.woff'
2016-10-25 08:54:46,424 wheel INFO: adding 'volttroncentral/webroot/fonts/fontawesome-webfont.woff2'
2016-10-25 08:54:46,425 wheel INFO: adding 'volttroncentral/webroot/fonts/montserrat-bold.woff'
2016-10-25 08:54:46,426 wheel INFO: adding 'volttroncentral/webroot/fonts/montserrat-bold.woff2'
2016-10-25 08:54:46,427 wheel INFO: adding 'volttroncentral/webroot/fonts/opensans-bold.woff'
2016-10-25 08:54:46,427 wheel INFO: adding 'volttroncentral/webroot/fonts/opensans-bold.woff2'
2016-10-25 08:54:46,428 wheel INFO: adding 'volttroncentral/webroot/fonts/opensans.woff'
2016-10-25 08:54:46,429 wheel INFO: adding 'volttroncentral/webroot/fonts/opensans.woff2'
2016-10-25 08:54:46,438 wheel INFO: adding 'volttroncentral/webroot/js/app-04d33897.js'
2016-10-25 08:54:46,507 wheel INFO: adding 'volttroncentral/webroot/js/vendor-3ac3895b.js'
2016-10-25 08:54:46,507 wheel INFO: adding 'volttroncentralagent-3.5.5.dist-info/DESCRIPTION.rst'
2016-10-25 08:54:46,507 wheel INFO: adding 'volttroncentralagent-3.5.5.dist-info/entry_points.txt'
2016-10-25 08:54:46,507 wheel INFO: adding 'volttroncentralagent-3.5.5.dist-info/metadata.json'
2016-10-25 08:54:46,508 wheel INFO: adding 'volttroncentralagent-3.5.5.dist-info/top_level.txt'
2016-10-25 08:54:46,508 wheel INFO: adding 'volttroncentralagent-3.5.5.dist-info/WHEEL'
2016-10-25 08:54:46,508 wheel INFO: adding 'volttroncentralagent-3.5.5.dist-info/METADATA'
2016-10-25 08:54:46,509 wheel INFO: adding 'volttroncentralagent-3.5.5.dist-info/RECORD'
_create_initial_package
Package created at: /home/volttron/.volttron/packaged/volttroncentralagent-3.5.5-py2-none-any.whl
(volttron)volttron@vc:~/volttron-develop$ #!/usr/bin/env bash
ocschwar commented 7 years ago

pip list confirms volttron 4.0.0 .

craig8 commented 7 years ago

did you get any merge conflicts when you last pulled? Is this a new instance?

There is a possibility that your temp directory doesn't allow executable code.

ocschwar commented 7 years ago

Here's the branch comparison. The file list doesn't point to anything.

https://github.com/VOLTTRON/volttron/compare/develop...FraunhoferCSE:fh-base

ocschwar commented 7 years ago

Runnign strike with volttron-pkg shows that /tmp is allowing writeable files files to open: All calls appear to ask for 0666.

open("/tmp/tmpHChkG5/pkg/package.json", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 4 open("/tmp/tmpHChkG5/pkg/volttroncentral/webroot/api-tests.html", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 4 open("/tmp/tmpHChkG5/pkg/volttroncentral/webroot/index.html", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 4 open("/tmp/tmpHChkG5/pkg/volttroncentral/webroot/js/app-04d33897.js", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 4 open("/tmp/tmpHChkG5/pkg/volttroncentral/webroot/js/vendor-3ac3895b.js", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 4 [...]

craig8 commented 7 years ago

What is strike? Perhaps I can run it on my side and see if that's the culprit.

ocschwar commented 7 years ago

strace (autocorrect goofup.) I used it to confirm /tmp was not the problem. And it just started working.

craig8 commented 7 years ago

magically?

craig8 commented 7 years ago

hmm did you deactivate/close your console and reactivate?

ocschwar commented 7 years ago

Yes. I also reran bootstrap.py. So it's one of those two.

craig8 commented 7 years ago

Thanks...glad you got it working. I am going to close this issue for you.