Page MenuHomePhabricator

Python is different versions on Tool labs and Grit. How run a scripts on grid and with scheduling?
Closed, ResolvedPublic

Description

I need to run a bot on grid with scheduling. It made under the python version 3.4, and normally works in the tool home via command python3 myscript.py.
But on grid installed v3.2, without basic modules like 'request', 'urllib.parse', etc, and I get problem with utf-8, like on obsolete version 2.7. (Errors with utf-8, although that the files in utf-8, have # - * - coding: utf-8 - * -, have the prefix of strings 'u' like u'not english a string'.)

If in console of Tool labs run:

  • python -V, result: 2.7.6
  • python3 -V, result: 3.4.3

For grid run (according Help:Tool_Labs/Developing#Setup_job_submission and Help:Tool Labs/Grid):

  • jsub -N job_name python -V, result error (job_name.err): 2.7.3
  • jsub -N job_name python3 -V, result error (job_name.err): -bash: /usr/bin/python3.4: No such file or directory

If I try run myscript.py for display version:

import sys
print (sys.version_info)

then it say that on grid set v3.2, and wrote errors said above (no modules, utf-8).

How to run a bot on grid scheduled?

Related Objects

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

bastion hosts run trusty; to make grid jobs also run on trusty, pass "-l release=trusty" as parameter to jsub.

yuvipanda claimed this task.
yuvipanda added a subscriber: yuvipanda.

Yup! Run your jobs with -l release=trusty and that should work. We apologize for this confusing situation - the defaults are in the process of being changed. https://lists.wikimedia.org/pipermail/labs-l/2016-August/004586.html

Ok. But, it seems to me, there is a problem with the codepage utf-8 in python or console. T143691