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

Provide concurrent implementation for wmstatsserver jobdetail API #11885

Merged
merged 1 commit into from
Mar 12, 2024

Conversation

amaltaro
Copy link
Contributor

@amaltaro amaltaro commented Feb 3, 2024

Fixes #11571

Status

ready

Description

This PR started as a characterization process of the jobdetail WMStats REST API, which ended up with a sequential mode for retrieving data from CouchDB.

This PR provides an alternative implementation - enabled by default - which results in concurrent calls to CouchDB, thus substantially decreasing the total time to retrieve data from CouchDB/wmstats.

Is it backward compatible (if not, which system it affects?)

YES

Related PRs

None

External dependencies / deployment changes

None

@cmsdmwmbot
Copy link

Jenkins results:

  • Python3 Unit tests: failed
    • 2 new failures
    • 1 tests no longer failing
  • Python3 Pylint check: failed
    • 2 warnings and errors that must be fixed
    • 1 warnings
    • 53 comments to review
  • Pylint py3k check: succeeded
  • Pycodestyle check: succeeded
    • 4 comments to review

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/DMWM-WMCore-PR-test/14815/artifact/artifacts/PullRequestReport.html

@cmsdmwmbot
Copy link

Jenkins results:

  • Python3 Unit tests: failed
    • 2 new failures
    • 1 tests no longer failing
    • 1 changes in unstable tests
  • Python3 Pylint check: failed
    • 2 warnings and errors that must be fixed
    • 1 warnings
    • 53 comments to review
  • Pylint py3k check: succeeded
  • Pycodestyle check: succeeded
    • 4 comments to review

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/DMWM-WMCore-PR-test/14839/artifact/artifacts/PullRequestReport.html

@cmsdmwmbot
Copy link

Jenkins results:

  • Python3 Unit tests: failed
    • 1 new failures
    • 28 tests no longer failing
    • 1 changes in unstable tests
  • Python3 Pylint check: failed
    • 3 warnings and errors that must be fixed
    • 13 warnings
    • 92 comments to review
  • Pylint py3k check: succeeded
  • Pycodestyle check: succeeded
    • 17 comments to review

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/DMWM-WMCore-PR-test/14864/artifact/artifacts/PullRequestReport.html

@cmsdmwmbot
Copy link

Jenkins results:

  • Python3 Unit tests: failed
    • 2 new failures
    • 27 tests no longer failing
    • 2 changes in unstable tests
  • Python3 Pylint check: failed
    • 2 warnings and errors that must be fixed
    • 1 warnings
    • 53 comments to review
  • Pylint py3k check: succeeded
  • Pycodestyle check: succeeded
    • 4 comments to review

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/DMWM-WMCore-PR-test/14866/artifact/artifacts/PullRequestReport.html

@cmsdmwmbot
Copy link

Jenkins results:

  • Python3 Unit tests: failed
    • 1 new failures
    • 1 tests no longer failing
    • 1 changes in unstable tests
  • Python3 Pylint check: failed
    • 2 warnings and errors that must be fixed
    • 1 warnings
    • 53 comments to review
  • Pylint py3k check: succeeded
  • Pycodestyle check: succeeded
    • 4 comments to review

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/DMWM-WMCore-PR-test/14869/artifact/artifacts/PullRequestReport.html

@cmsdmwmbot
Copy link

Jenkins results:

  • Python3 Unit tests: succeeded
  • Python3 Pylint check: failed
    • 3 warnings and errors that must be fixed
    • 2 warnings
    • 54 comments to review
  • Pylint py3k check: succeeded
  • Pycodestyle check: succeeded
    • 5 comments to review

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/DMWM-WMCore-PR-test/14871/artifact/artifacts/PullRequestReport.html

@cmsdmwmbot
Copy link

Jenkins results:

  • Python3 Unit tests: succeeded
  • Python3 Pylint check: failed
    • 4 warnings and errors that must be fixed
    • 2 warnings
    • 54 comments to review
  • Pylint py3k check: succeeded
  • Pycodestyle check: succeeded
    • 6 comments to review

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/DMWM-WMCore-PR-test/14872/artifact/artifacts/PullRequestReport.html

@cmsdmwmbot
Copy link

Jenkins results:

  • Python3 Unit tests: succeeded
    • 1 changes in unstable tests
  • Python3 Pylint check: failed
    • 3 warnings and errors that must be fixed
    • 2 warnings
    • 54 comments to review
  • Pylint py3k check: succeeded
  • Pycodestyle check: succeeded
    • 5 comments to review

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/DMWM-WMCore-PR-test/14873/artifact/artifacts/PullRequestReport.html

@cmsdmwmbot
Copy link

Jenkins results:

  • Python3 Unit tests: succeeded
    • 1 changes in unstable tests
  • Python3 Pylint check: failed
    • 3 warnings and errors that must be fixed
    • 2 warnings
    • 55 comments to review
  • Pylint py3k check: succeeded
  • Pycodestyle check: succeeded
    • 5 comments to review

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/DMWM-WMCore-PR-test/14874/artifact/artifacts/PullRequestReport.html

@cmsdmwmbot
Copy link

Jenkins results:

  • Python3 Unit tests: failed
    • 3 new failures
  • Python3 Pylint check: failed
    • 4 warnings and errors that must be fixed
    • 2 warnings
    • 55 comments to review
  • Pylint py3k check: succeeded
  • Pycodestyle check: succeeded
    • 5 comments to review

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/DMWM-WMCore-PR-test/14875/artifact/artifacts/PullRequestReport.html

@cmsdmwmbot
Copy link

Jenkins results:

  • Python3 Unit tests: succeeded
    • 1 changes in unstable tests
  • Python3 Pylint check: failed
    • 4 warnings and errors that must be fixed
    • 1 warnings
    • 55 comments to review
  • Pylint py3k check: succeeded
  • Pycodestyle check: succeeded
    • 5 comments to review

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/DMWM-WMCore-PR-test/14876/artifact/artifacts/PullRequestReport.html

@cmsdmwmbot
Copy link

Jenkins results:

  • Python3 Unit tests: succeeded
    • 1 changes in unstable tests
  • Python3 Pylint check: failed
    • 4 warnings and errors that must be fixed
    • 1 warnings
    • 55 comments to review
  • Pylint py3k check: succeeded
  • Pycodestyle check: succeeded
    • 5 comments to review

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/DMWM-WMCore-PR-test/14877/artifact/artifacts/PullRequestReport.html

@cmsdmwmbot
Copy link

Jenkins results:

  • Python3 Unit tests: succeeded
    • 1 changes in unstable tests
  • Python3 Pylint check: failed
    • 4 warnings and errors that must be fixed
    • 1 warnings
    • 54 comments to review
  • Pylint py3k check: succeeded
  • Pycodestyle check: succeeded
    • 5 comments to review

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/DMWM-WMCore-PR-test/14879/artifact/artifacts/PullRequestReport.html

@cmsdmwmbot
Copy link

Jenkins results:

  • Python3 Unit tests: failed
    • 1 new failures
  • Python3 Pylint check: failed
    • 4 warnings and errors that must be fixed
    • 1 warnings
    • 54 comments to review
  • Pylint py3k check: succeeded
  • Pycodestyle check: succeeded
    • 5 comments to review

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/DMWM-WMCore-PR-test/14880/artifact/artifacts/PullRequestReport.html

@cmsdmwmbot
Copy link

Jenkins results:

  • Python3 Unit tests: succeeded
    • 1 tests no longer failing
    • 3 changes in unstable tests
  • Python3 Pylint check: failed
    • 1 warnings and errors that must be fixed
    • 13 warnings
    • 76 comments to review
  • Pylint py3k check: succeeded
  • Pycodestyle check: succeeded
    • 15 comments to review

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/DMWM-WMCore-PR-test/14911/artifact/artifacts/PullRequestReport.html

@amaltaro amaltaro changed the title Debug wmstatsserver jobdetail API Provide concurrent implementation for wmstatsserver jobdetail API Mar 2, 2024
@amaltaro amaltaro requested review from vkuznet and anpicci March 2, 2024 03:37
startKey = row["key"][:4]
endKey = []
site = row["key"][4]
if site:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to use try-except in place of the if statement?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it can be either None or an empty string. In such cases, we do not want to have it as part of the query, hence we don't append it.

callRuntime = round((time.time() - reqStart), 3)
msg = f"Retrieved job details (pycurl mode: {usePycurl}) for {requestName} in "
msg += f"{callRuntime} seconds, with a total of {len(results['rows']) + 1} CouchDB calls"
print(msg)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that I put this print statement here because it's the only way to get this logged into the service access_log. If we prefer, I can remove it. But I think it's beneficial to keep it around for a while, at least.

@amaltaro amaltaro requested a review from vkuznet March 7, 2024 00:30
@amaltaro
Copy link
Contributor Author

amaltaro commented Mar 7, 2024

@vkuznet Valentin, I finally managed to get back to this and applied some of your suggestions. The files look ugly somehow with those very large queries and/or output, but if it makes things more clear, let's keep it.

@cmsdmwmbot
Copy link

Jenkins results:

  • Python3 Unit tests: failed
    • 1 new failures
    • 1 tests no longer failing
    • 1 changes in unstable tests
  • Python3 Pylint check: failed
    • 1 warnings and errors that must be fixed
    • 13 warnings
    • 79 comments to review
  • Pylint py3k check: succeeded
  • Pycodestyle check: succeeded
    • 18 comments to review

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/DMWM-WMCore-PR-test/14950/artifact/artifacts/PullRequestReport.html

:return: dictionary with job detail information

A decoded example of this query would be:
scurl "https://cmsweb-test9.cern.ch/couchdb/wmstats/_design/WMStatsErl3/_view/jobsByStatusWorkflow?reduce=false&include_docs=true&startkey=["pdmvserv_Run2017G_DoubleMuon_UL2017_MiniAODv2_BParking_230917_124108_9876","/pdmvserv_Run2017G_DoubleMuon_UL2017_MiniAODv2_BParking_230917_124108_9876/DataProcessing","jobfailed",8006,"T2_US_Wisconsin"]&endkey=["pdmvserv_Run2017G_DoubleMuon_UL2017_MiniAODv2_BParking_230917_124108_9876","/pdmvserv_Run2017G_DoubleMuon_UL2017_MiniAODv2_BParking_230917_124108_9876/DataProcessing","jobfailed",8006,"T2_US_Wisconsin",{}]&limit=1&stale=update_after"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to replace actual workflow names by shorter examples, e.g.

["workflow_name","/workflow_name/DataProcessing","jobfailed",8006,"T2_US_XXX"]&endkey=["workfow_name","/workflow_name/DataProcessing","jobfailed",8006,"T2_US_XXX",{}]&limit=1&stale=update_after"

and then add how reader should treat workflow_name as placeholder of actual value.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, it will be shorter that way. I am pushing my code in soon.

A decoded example of this query would be:
scurl "https://cmsweb-test9.cern.ch/couchdb/wmstats/_design/WMStatsErl3/_view/jobsByStatusWorkflow?reduce=false&include_docs=true&startkey=["pdmvserv_Run2017G_DoubleMuon_UL2017_MiniAODv2_BParking_230917_124108_9876","/pdmvserv_Run2017G_DoubleMuon_UL2017_MiniAODv2_BParking_230917_124108_9876/DataProcessing","jobfailed",8006,"T2_US_Wisconsin"]&endkey=["pdmvserv_Run2017G_DoubleMuon_UL2017_MiniAODv2_BParking_230917_124108_9876","/pdmvserv_Run2017G_DoubleMuon_UL2017_MiniAODv2_BParking_230917_124108_9876/DataProcessing","jobfailed",8006,"T2_US_Wisconsin",{}]&limit=1&stale=update_after"
while encoding the url would result in:
scurl "https://****.cern.ch/couchdb/wmstats/_design/WMStatsErl3/_view/jobsByStatusWorkflow?reduce=false&include_docs=true&startkey=%5B%22pdmvserv_Run2017G_DoubleMuon_UL2017_MiniAODv2_BParking_230917_124108_9876%22%2C+%22%2Fpdmvserv_Run2017G_DoubleMuon_UL2017_MiniAODv2_BParking_230917_124108_9876%2FDataProcessing%22%2C+%22jobfailed%22%2C+8006%2C+%22T2_US_Wisconsin%22%5D&endkey=%5B%22pdmvserv_Run2017G_DoubleMuon_UL2017_MiniAODv2_BParking_230917_124108_9876%22%2C+%22%2Fpdmvserv_Run2017G_DoubleMuon_UL2017_MiniAODv2_BParking_230917_124108_9876%2FDataProcessing%22%2C+%22jobfailed%22%2C+8006%2C+%22T2_US_Wisconsin%22%2C+%7B%7D%5D&limit=1&stale=update_after"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you'll adopt my suggestion above, this one will change too


Example of output is:
{"total_rows":4764135,"offset":4056263,"rows":[
{"id":"12703ce5-b288-42cb-8658-f0b4a921406d-34","key":["pdmvserv_Run2017G_DoubleMuon_UL2017_MiniAODv2_BParking_230917_124108_9876","/pdmvserv_Run2017G_DoubleMuon_UL2017_MiniAODv2_BParking_230917_124108_9876/DataProcessing","jobfailed",8006,"T2_US_Wisconsin","https://cmsweb.cern.ch/couchdb/acdcserver","vocms0255.cern.ch",["Fatal Exception"]],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need in actual ids, and you can easily change them to 123-xyz to shorter the output and make it better for readability, or even put uuid in the value of id.

Example of output is:
{"total_rows":4764135,"offset":4056263,"rows":[
{"id":"12703ce5-b288-42cb-8658-f0b4a921406d-34","key":["pdmvserv_Run2017G_DoubleMuon_UL2017_MiniAODv2_BParking_230917_124108_9876","/pdmvserv_Run2017G_DoubleMuon_UL2017_MiniAODv2_BParking_230917_124108_9876/DataProcessing","jobfailed",8006,"T2_US_Wisconsin","https://cmsweb.cern.ch/couchdb/acdcserver","vocms0255.cern.ch",["Fatal Exception"]],
"value":{"id":"12703ce5-b288-42cb-8658-f0b4a921406d-34","rev":"4-90ba3bcfff9d8eb4dd16f023f8f45742"},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need for full revision id which can be sortened to something like 4-xyz.

@amaltaro
Copy link
Contributor Author

amaltaro commented Mar 7, 2024

@vkuznet my latest commit should cover your previous review, where I basically massaged the query and output examples.

@cmsdmwmbot
Copy link

Jenkins results:

  • Python3 Unit tests: succeeded
    • 1 tests no longer failing
  • Python3 Pylint check: failed
    • 1 warnings and errors that must be fixed
    • 13 warnings
    • 79 comments to review
  • Pylint py3k check: succeeded
  • Pycodestyle check: succeeded
    • 18 comments to review

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/DMWM-WMCore-PR-test/14956/artifact/artifacts/PullRequestReport.html

Copy link
Contributor

@vkuznet vkuznet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My main concern is memory impact of jobDetailByTasksPycurl due to returned nested dictionary of results. Instead, I rather would like to see what is expected in upstream code as a data-structure and once it will be clear we may convert the code into a generator.

:param serviceOpts: dictionary with CouchDB options (url, db name and couchapp name)
:return: dictionary with job detail information

A decoded example of this query would be:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please either use placeholder or add explicit comment about jobfailed and 8006 values in queries shown below. Reader of the code may have wrong impression, e.g. look only at jobfailed, when in fact it may have different values. I would use JOB_STATUS, and EXIT_CODE as placeholders and then provide some values in examples below.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, to me it looks too much verbose to be added to the docstring, but here it is.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for update, it will pay off when someone will start refactoring the code. And, it show how complex the data structure is and how to address this complexity when we'll need refactoring.

:param queries: list of CouchDB query parameters
:param limit: number of documents to retrieve from CouchDB
:param serviceOpts: dictionary with CouchDB options (url, db name and couchapp name)
:return: dictionary with job detail information
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please provide structure of returned dictionary as it is very nested and complex.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My second comment is that I would like to know if combined jobInfoDoc is really required here and would it be beneficial to convert this function to a generator to reduce memory footprint. But yielding a generator will affect other code re-factoring.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Example structured is provided in this very same docstring.
On what concerns memory footprint, I am afraid yes, we do need to load everything in memory because of further data reorganization. In addition, a dictionary is returned, making it harder to send to the user piece by piece of information.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alan, I put this comment in exact place where clarification is required. I'm talking about structure of return jobInfoDoc dictionary and not structure of couchdb calls which you provided. As far as I can read what jobInfoDoc looks like it has the following structure:

{ workflow_name : {
           task: {
               job_status: {
                    exit_code: { 
                         site: {.....}
                    }
               }      
           }
      }
}

In my opinion it would be useful to have it in docstring with full structure (including parts of site dictionary).

thisUrl = f"{baseUrl}?{urlencode(options, doseq=True)}"
urlsPool.append(thisUrl)

jobInfoDoc = {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of making one, very nested, dictionary, would it be better only to yield individual data-structures and convert this function to a generator?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have any benefits with that because data is further manipulated before it is sent back to the end user. In addition to what is done here, there is also this extra method manipulating/modifying it: https://github.com/dmwm/WMCore/pull/11885/files#diff-2f9af48630184a7dfd398437ef3c7ec5026da5d3a3c3813e39b5f5650421b69fR390

jobDetails = nestedDictUpdate(jobDetails, jobInfo)
else:
# then it is sequential
for row in results['rows']:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we'll consider converting jobDetailByTasksPycurl to a generator then code over here should be re-factored as well to be a generator. To make such transition easier the code below first should be put into individual function and then we can convert this function to a generator with common data-structure.

@amaltaro
Copy link
Contributor Author

@vkuznet Valentin, I just wanted to point out that I have no intention of refactoring the data structure with this PR. Change of data structure here would impact the data consumed by end user clients (in addition to WM services).

The only goal with this PR is to provide a concurrent implementation for the WMStatsReader getTaskJobSummaryByRequest and jobDetailByTasks methods. If you have any concerns or comments regarding those changes, please update this PR with a further review.

@vkuznet
Copy link
Contributor

vkuznet commented Mar 11, 2024

Alan, if we will not refactor the code to generator kind, then the only issue I had is listed here: #11885 (comment), once updated I'm ok with changes.

@amaltaro
Copy link
Contributor Author

Valentin, I fixed your remaining question/request on this review. There is another comment that I think we can mark as resolved, but I will leave that around for now.

On what concerns the generator and decrease in memory footprint, I feel like this will have to be tackled in a future PR focused on the actual data structure of WMStats server. Such that we make breaking changes (not backwards compatible) only once.

@amaltaro amaltaro requested a review from vkuznet March 11, 2024 20:14
@cmsdmwmbot
Copy link

Jenkins results:

  • Python3 Unit tests: failed
    • 26 new failures
    • 1 tests no longer failing
  • Python3 Pylint check: failed
    • 1 warnings and errors that must be fixed
    • 13 warnings
    • 79 comments to review
  • Pylint py3k check: succeeded
  • Pycodestyle check: succeeded
    • 18 comments to review

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/DMWM-WMCore-PR-test/14960/artifact/artifacts/PullRequestReport.html

@amaltaro
Copy link
Contributor Author

test this please

@cmsdmwmbot
Copy link

Jenkins results:

  • Python3 Unit tests: failed
    • 1 new failures
    • 2 tests no longer failing
    • 1 changes in unstable tests
  • Python3 Pylint check: failed
    • 1 warnings and errors that must be fixed
    • 13 warnings
    • 79 comments to review
  • Pylint py3k check: succeeded
  • Pycodestyle check: succeeded
    • 18 comments to review

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/DMWM-WMCore-PR-test/14962/artifact/artifacts/PullRequestReport.html

Copy link
Contributor

@vkuznet vkuznet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from clarification of docstructure jobInfoDoc I see no other changes are needed.

:param queries: list of CouchDB query parameters
:param limit: number of documents to retrieve from CouchDB
:param serviceOpts: dictionary with CouchDB options (url, db name and couchapp name)
:return: dictionary with job detail information
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alan, I put this comment in exact place where clarification is required. I'm talking about structure of return jobInfoDoc dictionary and not structure of couchdb calls which you provided. As far as I can read what jobInfoDoc looks like it has the following structure:

{ workflow_name : {
           task: {
               job_status: {
                    exit_code: { 
                         site: {.....}
                    }
               }      
           }
      }
}

In my opinion it would be useful to have it in docstring with full structure (including parts of site dictionary).

@cmsdmwmbot
Copy link

Jenkins results:

  • Python3 Unit tests: failed
    • 2 new failures
    • 1 changes in unstable tests
  • Python3 Pylint check: failed
    • 1 warnings and errors that must be fixed
    • 13 warnings
    • 79 comments to review
  • Pylint py3k check: succeeded
  • Pycodestyle check: succeeded
    • 18 comments to review

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/DMWM-WMCore-PR-test/14967/artifact/artifacts/PullRequestReport.html

@amaltaro amaltaro requested a review from vkuznet March 12, 2024 13:51
@amaltaro
Copy link
Contributor Author

@vkuznet Valentin, I updated the docstring with your request. I also noticed that a nestedUpdate call is not needed when using the pycurl implementation, so I removed it in the (now) 2nd commit. If everything looks Okay to you, I will squash commits once again and get these changes in.

:param serviceOpts: dictionary with CouchDB options (url, db name and couchapp name)
:return: dictionary with job detail information

A decoded example of this query would be:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for update, it will pay off when someone will start refactoring the code. And, it show how complex the data structure is and how to address this complexity when we'll need refactoring.

replace logging by print function

refactor print statements

Single print message with workflow name, time and num of calls

Created methods to make concurrent calls with pycurl

fixed key names

fixed the baseUrl

properly parse the response and keys

Correctly set errorCount

Need a sub-set of the keys for comparison

Remove some debugging

Handle HTTP errors

Separate methods in their own module: WMStatsPycurl

Apply Valentins suggestions

more Valentins suggestions for shortening the line length

more Valentins requests

provide example of jobInfoDoc

No need for nestedDictUpdate when using pycurl
@cmsdmwmbot
Copy link

Jenkins results:

  • Python3 Unit tests: succeeded
    • 2 tests no longer failing
    • 2 changes in unstable tests
  • Python3 Pylint check: failed
    • 1 warnings and errors that must be fixed
    • 13 warnings
    • 79 comments to review
  • Pylint py3k check: succeeded
  • Pycodestyle check: succeeded
    • 18 comments to review

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/DMWM-WMCore-PR-test/14969/artifact/artifacts/PullRequestReport.html

@amaltaro
Copy link
Contributor Author

commits squashed and it's good to go. Thanks for the reviews, Valentin.

@amaltaro amaltaro merged commit 81a8251 into dmwm:master Mar 12, 2024
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Determine WMStats current limits
4 participants