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

Remove/replace MySQL-python library by something else that supports python3 #9805

Closed
amaltaro opened this issue Jul 7, 2020 · 37 comments · Fixed by #9848 or #10454
Closed

Remove/replace MySQL-python library by something else that supports python3 #9805

amaltaro opened this issue Jul 7, 2020 · 37 comments · Fixed by #9848 or #10454

Comments

@amaltaro
Copy link
Contributor

amaltaro commented Jul 7, 2020

Impact of the new feature
WMCore in general (and perhaps other services depending on it)

Is your feature request related to a problem? Please describe.
Yes, this package MySQL-python does not support python3. Actually, its last commit dates back from 2014...

Describe the solution you'd like
Either completely deprecate this package from the COMP cmsdist repo:
https://github.com/cms-sw/cmsdist/blob/comp_gcc630/py2-mysqldb.spec

and update all the other specs depending on it. Or if this functionality is needed in WMCore (or other DMWM services), we need to find a library that supports python3 (and probably works still in python2), like PyMySQL:
https://pypi.org/project/PyMySQL/

Describe alternatives you've considered
There is no alternative.

Additional context
Issue initially created here: cms-sw/cmsdist#6025

@amaltaro
Copy link
Contributor Author

amaltaro commented Jul 7, 2020

From a quick look in WMCore, it seems this is the only place still depending on this library:

from _mysql_exceptions import OperationalError

(which is currently gone)

so it can be easily deprecated in WMCore.

@mapellidario
Copy link
Member

Currently, MySQL-python source code is hosted at https://github.com/farcepest/MySQLdb1 . The python package name is MySQLdb. In addition to the the occurrence that you found, where we can drop the dependency by using a more generic exception, there are some occurrences of MySQLdb in src/python/WMCore/REST/Server.py, such as

It does not seem that this dependency is playing a big role. It seems to be used just to set some metadata in the form of some class members, or to select some errorcode depending on the DB backend. We can either make some changes to state clearly that we are not using MySQL-python / MySQLdb or we can leave this module untouched and avoid to insert any bug and simply drop the dependency.

@amaltaro
Copy link
Contributor Author

amaltaro commented Jul 14, 2020

Hmm, from the package dependencies:
https://github.com/dmwm/WMCore/blob/master/setup_dependencies.py#L8

it looks like such change in the REST module would affect:

  • reqmgr2
  • reqmgr2ms
  • workqueue
  • crabcache
  • crabserver
  • reqmon

I thought DBS was also relying on it... So my concern is with CRABServer (and maybe CRABCache). In case you come up with a PR to remove this functionality from WMCore, we should ping Stefano to test things before we merge anything.

@mapellidario
Copy link
Member

That is why I would actually only drop the dependency for now and leave all the code cleaning for the future.

I assume that "discarding the dependency" for us only means

Am I correct? Do you see any problem in just changing our dependencies and trying to run our agents without that dependency before contacting others?

mapellidario added a commit to mapellidario/WMCore that referenced this issue Jul 15, 2020
This is related to dmwm#9805

We want not to depend anymore on MySQL-python, since it does
not support python3.

This is the only occurrence of this package left in dmwm/WMCore
mapellidario added a commit to mapellidario/WMCore that referenced this issue Jul 15, 2020
This is related to dmwm#9805

We want not to depend anymore on MySQL-python, since it does
not support python3.

This is the only occurrence of this package left in dmwm/WMCore
@amaltaro
Copy link
Contributor Author

I was going to remove py2-mysqldb from the Requires list for the t0.spec and wmagent.spec, but I think it's too risky to make this change just before I'm gone. I will keep this issue open and resume working on it in August.

@amaltaro amaltaro reopened this Jul 15, 2020
@amaltaro
Copy link
Contributor Author

amaltaro commented Oct 8, 2020

@mapellidario I guess this issue is still opened because there was this pending item to remove the dependency from the spec files in cmsdist, right?

@mapellidario
Copy link
Member

Yes, you are correct.

@amaltaro amaltaro assigned amaltaro and unassigned mapellidario Oct 8, 2020
@amaltaro
Copy link
Contributor Author

amaltaro commented Oct 8, 2020

Sigh... I forgot testing it this week when a new WMAgent production release was made. Will try again in the coming days. Thanks Dario.

@mapellidario
Copy link
Member

We continued our investigations to understand if a repository uses MySQL-python.

Purpose:

  • drop py2-mysqldb from the list of dependencies in WMCore packages spec files and WMCore clients spec files, such as crabserver.spec

References:

How can this package be imported

import MySQLdb
# or also
import _mysql_exceptions.py

WMCore does not contain such import. It should be safe to drop py2-mysqldb from WMCore pacakges spec files

@mapellidario
Copy link
Member

We opened a similar issue in dmwm/CRABServer: dmwm/CRABServer#6228

@amaltaro
Copy link
Contributor Author

amaltaro commented Nov 2, 2020

I have not debugged this problem yet, but deployment of 1.4.2.pre7 - which no longer has the dependency on py2-mysqldb - failed when installing the database, see:

*** Starting services ***
WMAgent with Rucio enabled: true
Starting Services...
starting couch...
CouchDB has not been initialised... running pre initialisation
Initialising CouchDB on 127.0.0.1:5984...
Apache CouchDB has started, time to relax.
CouchDB has not been initialised... running post initialisation
Starting mysql...
MySQL has not been initialised... running pre initialisation
Installing the mysql database area...
./manage: line 336: mysql_install_db: command not found
starting mysqld_safe...
Checking MySQL Socket file exists...
ERROR: Timeout waiting for mysqld to start.
Done!

Dario, this is likely something that we have to discuss and see what our options are.

@amaltaro
Copy link
Contributor Author

amaltaro commented Nov 2, 2020

And another problem while stopping the agent

cmst1@vocms0262:/data/srv/wmagent/current $ $manage stop-agent
WMAgent with Rucio enabled: true
Shutting down WMAgent...
Checking default database connection... Unable to make connection to using 
parameters provided in mysql://cmst1:Someslc7Senha@localhost/wmagent
No module named MySQLdb
Traceback (most recent call last):
  File "/data/srv/wmagent/v1.4.2.pre7/sw/slc7_amd64_gcc630/cms/wmagent/1.4.2.pre7/bin/wmcoreD", line 351, in <module>
    connectionTest(config)
  File "/data/srv/wmagent/v1.4.2.pre7/sw/slc7_amd64_gcc630/cms/wmagent/1.4.2.pre7/bin/wmcoreD", line 191, in connectionTest
    raise ex
ImportError: No module named MySQLdb

@amaltaro
Copy link
Contributor Author

Since we failed to get rid of this library, let me get it reassigned to you Dario ;-)

@amaltaro amaltaro removed their assignment Dec 16, 2020
@amaltaro
Copy link
Contributor Author

Hi @amaltaro Regarding this comment: #9805 (comment)
Can you please, provide a pointer to the so pending issue in cmsdist.

So, I did test WMAgent without the py2-mysqldb dependency and the result is the failure reported here
#9805 (comment)

meaning, we somehow still need it (not sure what for though).

Because it seems to me the dependency from py2-mysqldb.spec has already been dropped in the wmagentpy3.spec

Yes, I didn't even try to create the mysqldb package on python3 (thus py3-mysqldb.spec) because the developers say there is no support for python3. So there was no point in trying to build it and/or add it as a dependency for the python3 stack.

but strangely enough, the MariaDB server dependency is somehow referred through this spec file [2]

good catch! That means, our wmagentpy3.spec file has no dependency at all in mariadb. We could try adding this dependency and try to deploy wmagent again (both in py2 and py3 stacks).

I also wonder if we should just link the dependency of mariadb directly into the wmagentpy3.spec

Yes, this is the first attempt I would chase. If it does not work, then we need to build a py3-mysqlclient.spec file to ship the python3 supported mysqlclient, and if needed, add MariaDB in there as a "Requires".

Just to wrap up these comments, here is what I would suggest to change (ordered):

  • add mariadb dependency directly to the wmagentpy3.spec file and try to deploy it (it might be needed to do the same with wmagent.spec, just to have a solid comparison baseline)
  • create a py3-mysqlclient.spec spec to ship mysqlclient library in python3 stack (without MariaDB, to start with). Add this spec as a dependency to wmagentpy3.spec and test deployment/running.
  • last option, create the spec above but adding mariadb as a dependency inside this spec. Add it to the wmagentpy3.spec and test deployment/running.

What do you think? Have I missed anything? Thanks for this investigation, Todor.

@todor-ivanov
Copy link
Contributor

Hi @amaltaro thanks. This plan is exactly what I was having in my mind too. So we are on the same page here. But just to be sure: should we try the first two bullets separately/consequently or both together from the very first attempt?

@todor-ivanov
Copy link
Contributor

todor-ivanov commented Apr 16, 2021

Just before I forget I need to log two additional steps which are a must in order to put the above plan in action.

  • We need to fix the fact that with installing the wmagentpy3 package the deployment area changes, but the $manage variable still points to /data/srv/wmagent/current/config/wmagent/manage. So we need a soft link of the type:
cmst1@vocms0260:/data/srv $ ln -s /data/srv/wmagent/current/config/wmagentpy3/  /data/srv/wmagent/current/config/wmagent
/data/srv/wmagent/current/config/wmagent -> /data/srv/wmagent/current/config/wmagentpy3/

Should be notified here too #10302

  • When installing from a personal repository in cmsrep (adding the option -r comp=comp.<username> to the deployment script) the deployment area is created as /data/srv/wmagent/current/sw.<username>, but all sort of *PATH variables in the environment point to /data/srv/wmagent/current/sw. An example is:
/data/srv/wmagent/current/apps/wmagent -> ../sw/slc7_amd64_gcc630/cms/wmagentpy3/1.4.7.patch1-comp

Which is crucial for the rest of the software to initiate and run. So we will have to fix the deployment script such that it also creates the following symlink:

/data/srv/wmagent/current/sw -> sw.<username>

Otherwise even if the MariaDB dependency is properly set in the rpm [1], we still experience the previous errors, only because the environment is not set properly.

[1]

cmst1@vocms0260:/data/srv $ rpm -q --requires -p cms+wmagentpy3+1.4.7.patch1-comp-1-1.slc7_amd64_gcc630.rpm  |grep mariadb
external+mariadb+10.1.21-comp3

FYI @amaltaro

@amaltaro
Copy link
Contributor Author

Todor, on your first bullet above. Another option would be to update the env.sh script, as mentioned in #10302

@todor-ivanov
Copy link
Contributor

todor-ivanov commented Apr 16, 2021

Hi @amaltaro. Yes, indeed this is an option, but it would require a manual intervention every time we deploy with -py3, which is error prone. (I personally tend to forget those peculiarities the minute I am done with the first deployment after the PR introducing the change). So I'd rather put the link and let the deployment script do the rest for me.

@todor-ivanov
Copy link
Contributor

Following the first scenario from this comment : #9805 (comment) and adding the MariaDB dependency directly into the wmagentpy3.spec: cms-sw/cmsdist#6817 , together with the proposed changes to the deployment script from #10454 I managed to properly deploy the WMAgent and the relevant mysql databases [1]. I am fighting with another error now [2]. But I think we already agreed the later is a problem related to a separate set of package dependency.

So @amaltaro if you think we may merge those two PRs (in WMCore and cmsdist repositories) and close the current issue it would be great. The error mentioned in [2], we can follow in it's dedicated GH issue.

[1]

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
To do so, start the server, then issue the following commands:

'/data/srv/wmagent/v1.4.7.patch1-comp/sw.tivanov/slc7_amd64_gcc630/external/mariadb/10.1.21-comp3/bin/mysqladmin' -u root password 'new-password'
'/data/srv/wmagent/v1.4.7.patch1-comp/sw.tivanov/slc7_amd64_gcc630/external/mariadb/10.1.21-comp3/bin/mysqladmin' -u root -h vocms0260.cern.ch password 'new-password'

Alternatively you can run:
'/data/srv/wmagent/v1.4.7.patch1-comp/sw.tivanov/slc7_amd64_gcc630/external/mariadb/10.1.21-comp3/bin/mysql_secure_installation'

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the MariaDB Knowledgebase at http://mariadb.com/kb or the
MySQL manual for more instructions.

You can start the MariaDB daemon with:
cd '/data/srv/wmagent/v1.4.7.patch1-comp/sw.tivanov/slc7_amd64_gcc630/external/mariadb/10.1.21-comp3' ; /data/srv/wmagent/v1.4.7.patch1-comp/sw.tivanov/slc7_amd64_gcc630/external/mariadb/10.1.21-comp3/bin/mysqld_safe --datadir='/data/srv/wmagent/v1.4.7.patch1-comp/install/mysql/database'

You can test the MariaDB daemon with mysql-test-run.pl
cd '/data/srv/wmagent/v1.4.7.patch1-comp/sw.tivanov/slc7_amd64_gcc630/external/mariadb/10.1.21-comp3/mysql-test' ; perl mysql-test-run.pl

Please report any problems at http://mariadb.org/jira

The latest information about MariaDB is available at http://mariadb.org/.
You can find additional information about the MySQL part at:
http://dev.mysql.com
Consider joining MariaDB's strong and vibrant community:
https://mariadb.org/get-involved/

starting mysqld_safe...
Checking MySQL Socket file exists...
Socket file exists: /data/srv/wmagent/v1.4.7.patch1-comp/install/mysql/logs/mysql.sock
MySQL has not been initialised... running post initialisation
Installing the mysql schema...
Socket file exists, proceeding with schema install...
Installing WMAgent Database: wmagent
Checking Server connection...
Connection OK
Done!

[2]

*** Initializing the agent ***
Initialising Agent...
Traceback (most recent call last):
  File "/data/srv/wmagent/v1.4.7.patch1-comp/sw.tivanov/slc7_amd64_gcc630/cms/wmagentpy3/1.4.7.patch1-comp/bin/wmagent-mod-config", line 14, in <module>
    standard_library.install_aliases()
  File "/data/srv/wmagent/v1.4.7.patch1-comp/sw.tivanov/slc7_amd64_gcc630/external/py3-future/0.18.2/lib/python3.8/site-packages/future/standard_library/__init__.py", line 453, in install_aliases
    __import__(newmodname)
ImportError: No module named reprlib
Traceback (most recent call last):
  File "/data/srv/wmagent/v1.4.7.patch1-comp/sw.tivanov/slc7_amd64_gcc630/cms/wmagentpy3/1.4.7.patch1-comp/bin/wmcore-db-init", line 19, in <module>
    from WMCore.Configuration import loadConfigurationFile
ImportError: No module named WMCore.Configuration
Traceback (most recent call last):
  File "/data/srv/wmagent/v1.4.7.patch1-comp/sw.tivanov/slc7_amd64_gcc630/cms/wmagentpy3/1.4.7.patch1-comp/bin/wmagent-couchapp-init", line 9, in <module>
    standard_library.install_aliases()
  File "/data/srv/wmagent/v1.4.7.patch1-comp/sw.tivanov/slc7_amd64_gcc630/external/py3-future/0.18.2/lib/python3.8/site-packages/future/standard_library/__init__.py", line 453, in install_aliases
    __import__(newmodname)
ImportError: No module named reprlib
Done!

*** Checking if couchdb migration is needed ***
Done!

@amaltaro
Copy link
Contributor Author

Perfect! Thanks for spotting these issues and providing these fixes.

However, I think those were pre-requirements to get you to be able to debug the actual issue reported in this issue. There has been quite some discussion here, but I'm still not sure whether we need MySQL-python (or a python3 version of it) integrated into WMAgent or not.

As we have already discussed in other venues, when creating the wmagentpy3 spec file, py2-mysqldb.spec was not added because that library does not support python3. That said, it does not mean we don't need it, because our codebase might be trying to use it somewhere in the code.

So, the expected outcome of this issue will be either:
a) WMCore codebase no longer depends in MySQL-python and there is nothing else to be done in wmagentpy3.spec
b) WMCore codebase still depends on MySQL-python and we have to find a python3 base library replacement; then update the WMCore codebase with the new library.

Could you please investigate it?

@todor-ivanov
Copy link
Contributor

Oook then. Let me take a deep breath and I am about to dive deeper now :)

@todor-ivanov
Copy link
Contributor

Hi @amaltaro . So far, from what I am capable of tracing as imports in WMCore, I can not spot any direct or indirect import of the library MySQLdb (which is the one provided by the MySQL-python package). And also @mapellidario managed to run the pythondep tool as explained here [1], and confirmed my observation. All that said, I dare to state that we are in the position:

a) WMCore codebase no longer depends in MySQL-python and there is nothing else to be done in wmagentpy3.spec

[1]
https://cms-dmwm-test.docs.cern.ch/py2py3/tools/pydeps/

@amaltaro
Copy link
Contributor Author

Wonderful! Thanks Todor and Dario.

Just a note, if we face issues related with this in the future, we might want to directly add the "mariadb" dependency in wmagent.spec and drop "py2-mysqldb" one. This way we can compare things against something that we know is solid and working.

@amaltaro
Copy link
Contributor Author

amaltaro commented May 19, 2021

Now that I managed to progress with the python3 environment, we seem to have missed one usage of this library (but I could be wrong as well...):

*** Initializing the agent ***
Initialising Agent...
checking default database connection
DEBUG:root:Log file ready
Unable to make connection to using 
parameters provided in mysql://UUU:PPP@localhost/wmagent
No module named 'MySQLdb'
Traceback (most recent call last):
  File "/data/srv/wmagent/v1.4.9.pre2/sw/slc7_amd64_gcc630/cms/wmagentpy3/1.4.9.pre2/bin/wmcore-db-init", line 158, in <module>
    connectionTest(cfgObject)
  File "/data/srv/wmagent/v1.4.9.pre2/sw/slc7_amd64_gcc630/cms/wmagentpy3/1.4.9.pre2/bin/wmcore-db-init", line 123, in connectionTest
    raise ex
  File "/data/srv/wmagent/v1.4.9.pre2/sw/slc7_amd64_gcc630/cms/wmagentpy3/1.4.9.pre2/bin/wmcore-db-init", line 115, in connectionTest
    wmInit.setDatabaseConnection(dbConfig = config.CoreDatabase.connectUrl,
  File "/data/srv/wmagent/v1.4.9.pre2/sw/slc7_amd64_gcc630/cms/wmagentpy3/1.4.9.pre2/lib/python3.8/site-packages/WMCore/WMInit.py", line 131, in setDatabaseConnection
    myThread.dbFactory = DBFactory(logging, dbConfig, options)
  File "/data/srv/wmagent/v1.4.9.pre2/sw/slc7_amd64_gcc630/cms/wmagentpy3/1.4.9.pre2/lib/python3.8/site-packages/WMCore/Database/DBFactory.py", line 84, in __init__
    create_engine(self.dburl,
  File "/data/srv/wmagent/v1.4.9.pre2/sw/slc7_amd64_gcc630/external/py3-sqlalchemy/1.3.3/lib/python3.8/site-packages/sqlalchemy/engine/__init__.py", line 435, in create_engine
    return strategy.create(*args, **kwargs)
  File "/data/srv/wmagent/v1.4.9.pre2/sw/slc7_amd64_gcc630/external/py3-sqlalchemy/1.3.3/lib/python3.8/site-packages/sqlalchemy/engine/strategies.py", line 87, in create
    dbapi = dialect_cls.dbapi(**dbapi_args)
  File "/data/srv/wmagent/v1.4.9.pre2/sw/slc7_amd64_gcc630/external/py3-sqlalchemy/1.3.3/lib/python3.8/site-packages/sqlalchemy/dialects/mysql/mysqldb.py", line 118, in dbapi
    return __import__("MySQLdb")
ModuleNotFoundError: No module named 'MySQLdb'
Installing FWJRDump into wmagent_jobdump/fwjrs

debugging

@amaltaro amaltaro reopened this May 19, 2021
@todor-ivanov
Copy link
Contributor

@amaltaro
Where is this StackTrace from?

@amaltaro
Copy link
Contributor Author

It looks like we have a couple of optional drivers to use for MySQL which are supported in python3:
https://docs.sqlalchemy.org/en/14/core/engines.html#mysql

I had a quick look and PyMySQL seems to be easier to integrate with our stack, given that it's purely written in python. However, I have also found a few places suggesting that it delivers a performance worse than mysqlclient, another driver supported in python3 and based in the mysql library (c?).

I guess I will try to build mysqlclient in our COMP repo first. If it works, we will have to change the connect string in WMCore.

@vkuznet
Copy link
Contributor

vkuznet commented May 19, 2021

@amaltaro , in python if you need speed it is accomplished by Python-C bindings, therefore "pure" python is always slow with respect to Python-C binding implementation. Therefore, based on your use-case you need to decide to go with pure python or c-based implementation. The latter will always require gcc/glibc stack and therefore will be dependent on it. All high-performance tasks/libraries in python, e.g. NumPy, are basically Python-C binding to underlying C libraries.

@todor-ivanov
Copy link
Contributor

@amaltaro I am trying to create a pip build backage of mysqlclient and installing in a minute
I will post the result here.

@todor-ivanov
Copy link
Contributor

todor-ivanov commented May 19, 2021

@amaltaro here [1] is the PR providing a properly build package mysqlclient for py3 but the error during the deployment still persists. I am checking what else is missing.

[1]
cms-sw/cmsdist#6926

@todor-ivanov
Copy link
Contributor

Hi again @amaltaro,

Actually I figured out why it was having troubles. I had to put some more dependencies here and there - like making py3-sqlachemy depending on py3-mysqlclien[1], which was basically the reason for the error we were facing (The one from Alan's stack trace). Now my deployment passed through it and hit another wall [2], but this one I believe is no longer related to MySQLdb for py3.

[1]
cms-sw/cmsdist@af7fc4a

[2]

*** Populating resource-control ***
Adding only T1 and T2 sites to resource-control...
Executing wmagent-resource-control --add-T1s --plugin=SimpleCondorPlugin --pending-slots=50 --running-slots=50 --down ...
Traceback (most recent call last):
  File "/data/srv/wmagent/v1.4.9.pre2-comp2/sw.tivanov/slc7_amd64_gcc630/cms/wmagentpy3/1.4.9.pre2-comp2/bin/wmagent-resource-control", line 16, in <module>
    from WMCore.ResourceControl.ResourceControl import ResourceControl
  File "/data/srv/wmagent/v1.4.9.pre2-comp2/sw.tivanov/slc7_amd64_gcc630/cms/wmagentpy3/1.4.9.pre2-comp2/lib/python3.8/site-packages/WMCore/ResourceControl/ResourceControl.py", line 11, in <module>
    from WMCore.BossAir.BossAirAPI import BossAirAPI
  File "/data/srv/wmagent/v1.4.9.pre2-comp2/sw.tivanov/slc7_amd64_gcc630/cms/wmagentpy3/1.4.9.pre2-comp2/lib/python3.8/site-packages/WMCore/BossAir/BossAirAPI.py", line 23, in <module>
    from WMCore.JobStateMachine.ChangeState import ChangeState
  File "/data/srv/wmagent/v1.4.9.pre2-comp2/sw.tivanov/slc7_amd64_gcc630/cms/wmagentpy3/1.4.9.pre2-comp2/lib/python3.8/site-packages/WMCore/JobStateMachine/ChangeState.py", line 20, in <module>
    from WMCore.Services.Dashboard.DashboardReporter import DashboardReporter
  File "/data/srv/wmagent/v1.4.9.pre2-comp2/sw.tivanov/slc7_amd64_gcc630/cms/wmagentpy3/1.4.9.pre2-comp2/lib/python3.8/site-packages/WMCore/Services/Dashboard/DashboardReporter.py", line 13, in <module>
    from WMCore.Services.Dashboard.DashboardAPI import DashboardAPI
  File "/data/srv/wmagent/v1.4.9.pre2-comp2/sw.tivanov/slc7_amd64_gcc630/cms/wmagentpy3/1.4.9.pre2-comp2/lib/python3.8/site-packages/WMCore/Services/Dashboard/DashboardAPI.py", line 12, in <module>
    from WMCore.Services.Dashboard import apmon
  File "/data/srv/wmagent/v1.4.9.pre2-comp2/sw.tivanov/slc7_amd64_gcc630/cms/wmagentpy3/1.4.9.pre2-comp2/lib/python3.8/site-packages/WMCore/Services/Dashboard/apmon.py", line 55, in <module>
    from types import LongType
ImportError: cannot import name 'LongType' from 'types' (/data/srv/wmagent/v1.4.9.pre2-comp2/sw.tivanov/slc7_amd64_gcc630/external/python3/3.8.2-comp/lib/python3.8/types.py)
Executing wmagent-resource-control --add-T2s --plugin=SimpleCondorPlugin --pending-slots=50 --running-slots=50 --down ...
Traceback (most recent call last):
  File "/data/srv/wmagent/v1.4.9.pre2-comp2/sw.tivanov/slc7_amd64_gcc630/cms/wmagentpy3/1.4.9.pre2-comp2/bin/wmagent-resource-control", line 16, in <module>
    from WMCore.ResourceControl.ResourceControl import ResourceControl
  File "/data/srv/wmagent/v1.4.9.pre2-comp2/sw.tivanov/slc7_amd64_gcc630/cms/wmagentpy3/1.4.9.pre2-comp2/lib/python3.8/site-packages/WMCore/ResourceControl/ResourceControl.py", line 11, in <module>
    from WMCore.BossAir.BossAirAPI import BossAirAPI
  File "/data/srv/wmagent/v1.4.9.pre2-comp2/sw.tivanov/slc7_amd64_gcc630/cms/wmagentpy3/1.4.9.pre2-comp2/lib/python3.8/site-packages/WMCore/BossAir/BossAirAPI.py", line 23, in <module>
    from WMCore.JobStateMachine.ChangeState import ChangeState
  File "/data/srv/wmagent/v1.4.9.pre2-comp2/sw.tivanov/slc7_amd64_gcc630/cms/wmagentpy3/1.4.9.pre2-comp2/lib/python3.8/site-packages/WMCore/JobStateMachine/ChangeState.py", line 20, in <module>
    from WMCore.Services.Dashboard.DashboardReporter import DashboardReporter
  File "/data/srv/wmagent/v1.4.9.pre2-comp2/sw.tivanov/slc7_amd64_gcc630/cms/wmagentpy3/1.4.9.pre2-comp2/lib/python3.8/site-packages/WMCore/Services/Dashboard/DashboardReporter.py", line 13, in <module>
    from WMCore.Services.Dashboard.DashboardAPI import DashboardAPI
  File "/data/srv/wmagent/v1.4.9.pre2-comp2/sw.tivanov/slc7_amd64_gcc630/cms/wmagentpy3/1.4.9.pre2-comp2/lib/python3.8/site-packages/WMCore/Services/Dashboard/DashboardAPI.py", line 12, in <module>
    from WMCore.Services.Dashboard import apmon
  File "/data/srv/wmagent/v1.4.9.pre2-comp2/sw.tivanov/slc7_amd64_gcc630/cms/wmagentpy3/1.4.9.pre2-comp2/lib/python3.8/site-packages/WMCore/Services/Dashboard/apmon.py", line 55, in <module>
    from types import LongType
ImportError: cannot import name 'LongType' from 'types' (/data/srv/wmagent/v1.4.9.pre2-comp2/sw.tivanov/slc7_amd64_gcc630/external/python3/3.8.2-comp/lib/python3.8/types.py)
Done!

@todor-ivanov
Copy link
Contributor

todor-ivanov commented May 19, 2021

Actually I think the dependency I've put in py3-sqlachemy is redundant. The py3-mysqlclient is already properly referred by wmagentpy3.spec. Maybe during the first deployment attempt I messed up the wmagentpy3 package versions compiled and uploaded in my repository. So I am removing this from the py3-sqlalchemy.spec file [1] and we are ready to go now ... I think...

p.s. I just checked and everything is deploying correctly upon reverting my previous commit in cmsdist
[1]
cms-sw/cmsdist@daabf0c

@amaltaro
Copy link
Contributor Author

Thanks for providing a swift fix to this issue, Todor.
It's been fixed with this cmsdist PR: cms-sw/cmsdist#6926

@todor-ivanov shall we close it? If so, please go ahead.

@todor-ivanov
Copy link
Contributor

I think we are safe to close it again.
Thanks @amaltaro

@amaltaro
Copy link
Contributor Author

@todor-ivanov can you please open a new issue where we should have a basic benchmark between the two MySQL drivers that we have (for the different python stack)?

It's important to assess what the performance impact might be with this new library, to avoid surprises on the FNAL nodes.
I think I saw some script examples while I was googling for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment