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

uploadConditions.py is broken in recent IBs #34349

Closed
mmusich opened this issue Jul 6, 2021 · 38 comments
Closed

uploadConditions.py is broken in recent IBs #34349

mmusich opened this issue Jul 6, 2021 · 38 comments

Comments

@mmusich
Copy link
Contributor

mmusich commented Jul 6, 2021

$ uploadConditions.py SiPixelGainCalibration_2021_v0_full.db
Traceback (most recent call last):
  File "/cvmfs/cms-ib.cern.ch/nweek-02688/slc7_amd64_gcc900/cms/cmssw/CMSSW_12_0_X_2021-07-06-0300/bin/slc7_amd64_gcc900/uploadConditions.py", line 25, in <module>
    import cx_Oracle
ImportError: No module named cx_Oracle

related to py3 migration?

@cmsbuild
Copy link
Contributor

cmsbuild commented Jul 6, 2021

A new Issue was created by @mmusich Marco Musich.

@Dr15Jones, @dpiparo, @silviodonato, @smuzaffar, @makortel, @qliphy can you please review it and eventually sign/assign? Thanks.

cms-bot commands are listed here

@davidlange6
Copy link
Contributor

looks like it. I gather there is no unit test coverage for this script..

@mmusich
Copy link
Contributor Author

mmusich commented Jul 6, 2021

I gather there is no unit test coverage for this script..

looks like not.
OTOH, I presume one doesn't want to actually upload to DB every time the test is exercised.

@davidlange6
Copy link
Contributor

davidlange6 commented Jul 6, 2021 via email

@smuzaffar
Copy link
Contributor

correct cx_Oracle is available for python3 only, so try using python3

@smuzaffar
Copy link
Contributor

@ggovi also reported the same issue for conddb --db oradev -a /build/gg list runinfo_31X_mc but this was only in CMSSW_12_0_X_2021-07-01-2300 IB where condb was using #!/usr/bin/env python

@davidlange6
Copy link
Contributor

davidlange6 commented Jul 6, 2021 via email

@mmusich
Copy link
Contributor Author

mmusich commented Jul 6, 2021

Could you change /usr/bin/env python to /usr/bin/env python3 and confirm that it works?

it doesn't.
With:

diff --git a/CondCore/Utilities/scripts/uploadConditions.py b/CondCore/Utilities/scripts/uploadConditions.py
index 25f57d30c27..73b0bc2ff06 100755
--- a/CondCore/Utilities/scripts/uploadConditions.py
+++ b/CondCore/Utilities/scripts/uploadConditions.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 '''Script that uploads to the new CMS conditions uploader.
 Adapted to the new infrastructure from v6 of the upload.py script for the DropBox from Miguel Ojeda.
 '''

I get

$ uploadConditions.py SiPixelGainCalibration_2021_v0_full.db                                                                                                                          Traceback (most recent call last):
  File "/tmp/musich/vanilla/CMSSW_12_0_X_2021-07-06-1100/bin/slc7_amd64_gcc900/uploadConditions.py", line 46, in <module>
    import cStringIO
ModuleNotFoundError: No module named 'cStringIO'

@davidlange6
Copy link
Contributor

davidlange6 commented Jul 6, 2021 via email

@davidlange6
Copy link
Contributor

davidlange6 commented Jul 6, 2021 via email

@mmusich
Copy link
Contributor Author

mmusich commented Jul 6, 2021

But indeed if there is no support for uploading to some file based or otherwise fake db , it would mean having a bit of infrastructure behind..

at the moment I think one can just either upload to the production or to the preparation db, I am not totally sure uploading to a local sqlite file would test all the functionalities. For sure one can make a simple test just running the wizard in order to spot wrong includes or something like that.
I let @ggovi to comment more.

@ggovi
Copy link
Contributor

ggovi commented Jul 6, 2021

@davidlange6 thanks ,a PR is almost ready, i'm about to submit it...

@davidlange6
Copy link
Contributor

davidlange6 commented Jul 6, 2021 via email

@mmusich
Copy link
Contributor Author

mmusich commented Jul 6, 2021

traceback (most recent call last):
  File "/tmp/musich/vanilla/CMSSW_12_0_X_2021-07-06-1100/bin/slc7_amd64_gcc900/uploadConditions.py", line 711, in uploadAllFiles
    with open(metadataFilename, 'rb') as metadataFile:
FileNotFoundError: [Errno 2] No such file or directory: 'SiPixelGainCalibration_2021_v0_full.txt'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/tmp/musich/vanilla/CMSSW_12_0_X_2021-07-06-1100/bin/slc7_amd64_gcc900/uploadConditions.py", line 992, in <module>
    sys.exit(main())
  File "/tmp/musich/vanilla/CMSSW_12_0_X_2021-07-06-1100/bin/slc7_amd64_gcc900/uploadConditions.py", line 977, in main
    return upload(options, arguments)
  File "/tmp/musich/vanilla/CMSSW_12_0_X_2021-07-06-1100/bin/slc7_amd64_gcc900/uploadConditions.py", line 890, in upload
    results = uploadAllFiles(options, arguments)
  File "/tmp/musich/vanilla/CMSSW_12_0_X_2021-07-06-1100/bin/slc7_amd64_gcc900/uploadConditions.py", line 721, in uploadAllFiles
    if getInput('y', '\nIt looks like the metadata file %s does not exist. Do you want me to create it and help you fill it?\nAnswer [y]: ' % metadataFilename).lower() != 'y':
  File "/tmp/musich/vanilla/CMSSW_12_0_X_2021-07-06-1100/bin/slc7_amd64_gcc900/uploadConditions.py", line 56, in getInput
    answer = raw_input(prompt)
NameError: name 'raw_input' is not defined

I guess there's more work to it... @ggovi

@davidlange6
Copy link
Contributor

davidlange6 commented Jul 6, 2021 via email

@davidlange6
Copy link
Contributor

davidlange6 commented Jul 6, 2021 via email

@smuzaffar
Copy link
Contributor

smuzaffar commented Jul 6, 2021

@davidlange6 , I think unit tests are py3 compatible. This uploadConditions.py is part of scripts directory and is not run by any unit test

@mmusich
Copy link
Contributor Author

mmusich commented Jul 6, 2021

Is likely sufficient.

It does work (sort of), for some reason the wizard doesn't recognize yet the internal list of tags present in the input sqlite file, but if it's prompted by the user it does work....

@davidlange6
Copy link
Contributor

davidlange6 commented Jul 6, 2021 via email

@davidlange6
Copy link
Contributor

davidlange6 commented Jul 6, 2021 via email

@mmusich
Copy link
Contributor Author

mmusich commented Jul 6, 2021

Is that something done via the cx-oracle package or something in cmssw?

I am chairing a meeting now, I'll investigate later.
I am tagging also @muhammadhasib and @Dres90 in case they more readily know

@ggovi
Copy link
Contributor

ggovi commented Jul 6, 2021

@mmusich @davidlange6 as I said i have a fix for that issue, i'm currently working to migrate the pycurl related code...

@ggovi
Copy link
Contributor

ggovi commented Jul 6, 2021

@mmusich hasib left CMS more than one year ago...

@mmusich
Copy link
Contributor Author

mmusich commented Jul 6, 2021

@ggovi he just wrote me he has a py3 version of the script in skype chat :)

@ggovi
Copy link
Contributor

ggovi commented Jul 7, 2021

addressed by #34373

@tvami
Copy link
Contributor

tvami commented Jul 8, 2021

assign alca

@cmsbuild
Copy link
Contributor

cmsbuild commented Jul 8, 2021

New categories assigned: alca

@francescobrivio,@tvami,@malbouis,@pohsun,@tlampen,@yuanchao you have been requested to review this Pull request/Issue and eventually sign? Thanks

@tvami
Copy link
Contributor

tvami commented Jul 8, 2021

+alca

@cmsbuild
Copy link
Contributor

cmsbuild commented Jul 8, 2021

This issue is fully signed and ready to be closed.

@mmusich
Copy link
Contributor Author

mmusich commented Jul 8, 2021

I think it should be actually assigned db...

@qliphy
Copy link
Contributor

qliphy commented Jul 9, 2021

#34349 (comment)
@ggovi is for db, so should be fine to close this issue.

@qliphy qliphy closed this as completed Jul 9, 2021
@mmusich
Copy link
Contributor Author

mmusich commented Jul 9, 2021

@qliphy there is still the question of the unit test PR at #34379 which is not signed by db...

@qliphy
Copy link
Contributor

qliphy commented Jul 9, 2021

@qliphy there is still the question of the unit test PR at #34379 which is not signed by db...

Sorry for missing this.

@qliphy qliphy reopened this Jul 9, 2021
@qliphy
Copy link
Contributor

qliphy commented Jul 9, 2021

assign db

@cmsbuild
Copy link
Contributor

cmsbuild commented Jul 9, 2021

New categories assigned: db

@ggovi you have been requested to review this Pull request/Issue and eventually sign? Thanks

@ggovi
Copy link
Contributor

ggovi commented Jul 9, 2021

+1

@cmsbuild
Copy link
Contributor

cmsbuild commented Jul 9, 2021

This issue is fully signed and ready to be closed.

@qliphy
Copy link
Contributor

qliphy commented Jul 12, 2021

#34379

@cms-sw/db-l2 Would you please check #34379 ?

@qliphy qliphy closed this as completed Jul 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants