diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 64b4fcd5e0..df59e019e2 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -1,15 +1,16 @@ =========================== How to contribute to WMCore =========================== -Thank you for participating to WMCore! +Thank you for participating in WMCore! -* Please ensure that an `issue `_ exists before submitting your contribution as a pull request. - * There are two templates available to create a new issue, select the one matching your issue type. +* Please ensure that a GitHub `issue `_ exists before submitting your contribution through a pull request. + * There are two templates available to create a new Github issue, select the one matching your issue type. * Pull request will only be merged if there is an associated issue (different solutions/implementations can be discussed on the issue). + * And at least one approval through the GitHub review process. A contribution can be either a **patch** or a **feature**: - * **patch**: includes a bugfixes or an outstanding enhancement; besides going to the **master** branch, we also backport the same contribution to the latest **wmagent** branch. - * **feature**: includes major developments or potentially disruptive changes and are included in feature releases made multiple times a year. + * **patch**: includes a bug-fixes or an outstanding enhancement; besides going to the **master** branch, we also backport the same contribution to the latest **wmagent** branch. + * **feature**: includes major developments or potentially disruptive changes and are included in feature releases following a monthly cycle. From the contribution types, we can also define at least two different branches: * **master**: it includes both features and patches contributions and it only reaches production when there is a CMSWEB/WMAgent upgrade. @@ -34,8 +35,8 @@ Setting up the development environment -------------------------------------- There is no real recipe here, people use different operating systems and different IDE (Integrated Development Environment). -However, please make sure you implement using the python 2.7 interpreter (having a virtualenv to switch between python2 and python3 is practically a must for the near future). -A non-exhaustive list of libraries which WMCore depend on can be found on the `requirements `_ file. +However, please make sure your dev environment defaults to python 3.8 interpreter. +A non-exhaustive list of libraries which WMCore depends on can be found on the `requirements_py3 `_ file. Last but not least, please also have a look at the `Coding Style and checks` section below Setting up the testing environment @@ -47,7 +48,7 @@ You can find an extensive documentation on this `wiki_page `_ created, if not, then create one following one of the templates and providing all the necessary information. +**Step 1**: Make sure there is already an `issue `_ created, if not, then create one according to the templates and providing all the necessary information. Note that there is text in the templates that you must replace by the description you are going to provide. **Step 2**: Create a local branch to start working on a proposal for that issue, branching off the "master" branch:: @@ -68,23 +69,26 @@ Contributing **Step 6**: repeat the Step 4 to add and create a new commit. We **highly recommend** a separate commit for test-related changes like unit tests, emulation, json data,templates and so on. In addition to unit tests, we ask you that any code refactoring **not changing any logical blocks**, as pylint, pep8 convention, fixing typos, etc; to be added to the same test commit. -**Step 7**: At this point you should have 2 commits in your branch: where the 1st commit contains real changes the proposed fix and; the 2nd commit contains aesthetic and unit tests changes. -Check the commits you have on your branch and then push your them to your forked repository:: +**Step 7**: At this point you should have 2 commits in your branch: where the 1st commit contains the real logic for your feature and/or bug-fix; and the 2nd commit contains aesthetic and unit tests changes. +Check the commits you have on your branch and then push them to your forked repository (amend commit messages if needed):: git log -10 --pretty=oneline --decorate git push origin your-branch-name **Step 8**: then create a pull request either from your fork, or from the official github repository. There is a pull request template that you need to edit/update before confirming the pull request creation. -If you're proposing a **patch** that needs to be backported to a specific branch, please make sure to mention it in your pull request, such that the project responsible can properly label it. +If you're proposing a **patch** that needs to be backported to a specific branch, please make sure to mention it in your pull request, such that the project responsible can properly label it. If your pull request requires further effort, please use the labels "Do not merge yet" and "Work in progress". The pull request title has to be meaningful as well, even though it's not used for the release notes. You might want to describe your changes and the reason behind that, it's quite helpful when we need to check a module's history. -**Step 9**: watch the pull request for comments and; if your pull request is ready to be reviewed, use the `Reviewers` option to ask a specific person(s) to review it. -If further changes are required to your pull request, please make sure to squash your commits in order to keep a clean commit history (remember, if you need to update both src/ and test/ files, then you need to squash them into the correct commits). +**Step 9**: once your pull request is ready to be reviewed, use the `Reviewers` option to ask a specific person(s) to review it. Watch your pull request for comments and feedback. +If further changes are required to your pull request, you might want to provide them in a separate commit, making it easier to review only the latest difference. + +**Step 10**: when your pull request gets approved by at least one reviewer, you must squash your commits accordingly in order to keep a clean commit history (remember, if you need to update both src/ and test/ files, then you need to squash them into the correct commits). +If you need further instructions for squashing your commits, please check `this `_ quick and simple document. Automatic Tests ---------------- -Every pull request - and further updates to that - trigger an automatic evaluation of your changes through our DMWM Jenkins infrastructure (only pull requests made against the **master** branch) and results are expected to come back within 30min. +Every pull request - and further updates made to it - trigger an automatic evaluation of your changes through our DMWM Jenkins infrastructure (only pull requests made against the **master** branch) and results are expected to come back within 20min. This infrastructure is thoroughly described in this `wiki_section `_. However, in short there are 4 types of checks done by jenkins: 1. **unit tests**: all the WMCore unit tests are executed on top of your changes and compared against a master/HEAD baseline (which gets created twice a day). Besides unstable unit tests, your pull request will only be accepted once **all** unit tests succeed. @@ -96,7 +100,7 @@ This infrastructure is thoroughly described in this `wiki_section `_ in our WMCore wiki documentation. -In addition to that, we've also compiled a long list of important git commands `here `_. If none of those work for you, google and stackoverflow will be your best friend. +In addition to that, we've also compiled a long list of important git `commands `_. If none of those work for you, google and stackoverflow will be your best friend. diff --git a/deploy/deploy-wmagent.sh b/deploy/deploy-wmagent.sh index 30200eee36..bd494dfddb 100644 --- a/deploy/deploy-wmagent.sh +++ b/deploy/deploy-wmagent.sh @@ -22,11 +22,10 @@ ### Usage: -r Comp repository to look for the RPMs (defaults to comp=comp) ### Usage: -p List of PR numbers in double quotes and space separated (e.g., "5906 5934 5922") ### Usage: -n Agent number to be set when more than 1 agent connected to the same team (defaults to 0) -### Usage: -2|--py2 Uses the python2 stack WMAgent package (soon to be deprecated) ### Usage: ### Usage: deploy-wmagent.sh -w -d -t [-s ] [-r ] [-n ] -### Usage: Example: sh deploy-wmagent.sh -w 1.5.4.patch3 -d HG2110b -t production -n 30 -### Usage: Example: sh deploy-wmagent.sh -w 1.5.4.patch3 -d HG2110b -t testbed-vocms001 -p "10853" -r comp=comp.amaltaro --py2 +### Usage: Example: sh deploy-wmagent.sh -w 1.5.7.patch1 -d HG2201e -t production -n 30 +### Usage: Example: sh deploy-wmagent.sh -w 1.5.7.patch1 -d HG2201e -t testbed-vocms001 -p "10853" -r comp=comp.amaltaro ### Usage: IAM=`whoami` @@ -189,7 +188,6 @@ for arg; do -r) REPO=$2; shift; shift ;; -p) PATCHES=$2; shift; shift ;; -n) AG_NUM=$2; shift; shift ;; - -2|--py2) RPM_NAME=wmagent; shift;; -*) usage ;; esac done diff --git a/doc/wmcore/WMCore_Jenkins.drawio b/doc/wmcore/WMCore_Jenkins.drawio index ff22d4ea79..dcaa1efc05 100644 --- a/doc/wmcore/WMCore_Jenkins.drawio +++ b/doc/wmcore/WMCore_Jenkins.drawio @@ -1 +1 @@ -7Vttd6I4FP41frQHCKB+rLXzstvO6c501vZjhAhskTgQWp1fv4mE94DUBXGrnXPmkEvIy32e3NzcGwfgZrX57MO1fY9N5A4UydwMwGygKBNVp/8zwTYS6PIkEli+Y0YiORX8cH4jLpS4NHRMFOQqEoxd4qzzQgN7HjJITgZ9H7/lqy2xm+91DS1UEvwwoFuWzh2T2JF0rIxS+RfkWHbcs6zz+a1gXJnPJLChid8yInA7ADc+xiR6Wm1ukMt0F+tl/nU7d+9e9M9//BX8gj+nfz5++3sYNfbpPZ8kU/CRRw5uOlRmv7/Ovy0060l+hXffbefBHcogavsVuiFXGJ8s2cYatHwcrgdgymsin6CNCDq4iL+QGg5YTrRI2YfwChF/S7/jrQPeDCeexotvKYpA4jI7g2BSEXLmWEnLqXboA1fQO3DQBbrSXdrtdEEfLPYwu5/fD+f3N9hHw0doTWGAXMdDcT3abVK1pGffxqtFSAc9fbMdgn6socHevNFlSWU2WdHBzmT6mBBRooUl9sgnuHJcpqYvyH1FxDEgf8GXo0y1PIWuY3m0YFBMkM+aIT5+SRbFrmHapeNZtKSnpUdMu58NVdak47o32MX+bsDA1NDYVJOWMm/GygLoejLJLBHqaVgkVyU5ZCnPDlBmhyxix7gFcginoJTIwblwbdG5Dx9RQK5ZK0XQceiZyOQA7AG+CKnlwiDgPBCgmaNJHrrlcqkYhgg6U1/oml633BuiWYaOQyWLsAICrNSusCobvSxWD1twgSuz0kb5ldY/fGoVfDuz+9NzCIMvOGvwOFiJG9YbWFodWGypXfCqWWz941fr9GTQ0n+FzBHe4TAMdkBc0wqyut6kL2PfZwUD5oM08YqohknB/cnB4mHqXuUx5KKSw8Pwor6Re81frBzTZN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/XLa+K9ibuCceDlZskSYCXo0iFKSJvzhGJRezMIKifjQmHLJsGBRNmP9Kd4kuY6S1ru1ikbGbCvopiX7DfF4AZ01y79zZ0Go/E88vPoX \ No newline at end of file diff --git a/doc/wmcore/WMCore_Jenkins.png b/doc/wmcore/WMCore_Jenkins.png index 1f8349a12e..7be0ddde1b 100644 Binary files a/doc/wmcore/WMCore_Jenkins.png and b/doc/wmcore/WMCore_Jenkins.png differ diff --git a/src/python/WMComponent/DBS3Buffer/DBSUploadPoller.py b/src/python/WMComponent/DBS3Buffer/DBSUploadPoller.py index 2e885339c1..c9a1f8ed32 100644 --- a/src/python/WMComponent/DBS3Buffer/DBSUploadPoller.py +++ b/src/python/WMComponent/DBS3Buffer/DBSUploadPoller.py @@ -85,7 +85,7 @@ def uploadWorker(workInput, results, dbsUrl): dbsApi.insertBulkBlock(blockDump=block) results.put({'name': name, 'success': "uploaded"}) except Exception as ex: - exString = str(ex) + exString = str(getattr(ex, "body", ex)) if 'Block %s already exists' % name in exString: # Then this is probably a duplicate # Ignore this for now diff --git a/src/python/WMComponent/JobAccountant/AccountantWorker.py b/src/python/WMComponent/JobAccountant/AccountantWorker.py index 59ade7ab3a..a77ac7f32d 100644 --- a/src/python/WMComponent/JobAccountant/AccountantWorker.py +++ b/src/python/WMComponent/JobAccountant/AccountantWorker.py @@ -454,6 +454,8 @@ def handleJob(self, jobID, fwkJobReport): conn=self.getDBConn(), transaction=self.existingTransaction()) + # FIXME: temporary workaround for: https://github.com/dmwm/WMCore/issues/9633 + skipOutputFiles = False if jobSuccess: fileList = fwkJobReport.getAllFiles() @@ -504,6 +506,7 @@ def handleJob(self, jobID, fwkJobReport): if not fwjrFile.get("locations") and fwjrFile.get("lfn", "").endswith(".root"): logging.warning("The following file doesn't have any location: %s", fwjrFile) jobSuccess = False + skipOutputFiles = True break else: fileList = fwkJobReport.getAllFilesFromStep(step='logArch1') @@ -548,6 +551,12 @@ def handleJob(self, jobID, fwkJobReport): else: wmbsJob["outcome"] = "failure" + # FIXME: BAD HACK to avoid crashing the component + if skipOutputFiles: + logging.warning("Skipping output file registration for failed job: %d", jobID) + self.listOfJobsToFail.append(wmbsJob) + return jobSuccess + for fwjrFile in fileList: logging.debug("Job %d , register output %s", jobID, fwjrFile["lfn"]) diff --git a/src/python/WMCore/WMExceptions.py b/src/python/WMCore/WMExceptions.py index e74c9c84a6..52735fed51 100644 --- a/src/python/WMCore/WMExceptions.py +++ b/src/python/WMCore/WMExceptions.py @@ -192,9 +192,9 @@ 71104: "JobSubmitter component could not find a job pickle object.", 71105: "JobSubmitter component loaded an empty job pickle object.", 71300: "The job was killed by the WMAgent, reason is unknown (WMAgent).", - 71301: "The job was killed by the WMAgent because the site it was running at was set to Aborted (WMAgent).", - 71302: "The job was killed by the WMAgent because the site it was running at was set to Draining (WMAgent).", - 71303: "The job was killed by the WMAgent because the site it was running at was set to Down (WMAgent).", + 71301: "The job was killed by WMAgent because the site it was supposed to run at was set to Aborted (WMAgent).", + 71302: "The job was killed by WMAgent because the site it was supposed to run at was set to Draining (WMAgent).", + 71303: "The job was killed by WMAgent because the site it was supposed to run at was set to Down (WMAgent).", 71304: "The job was killed by the WMAgent for using too much wallclock time (WMAgent) Job status was Running.", 71305: "The job was killed by the WMAgent for using too much wallclock time (WMAgent) Job status was Pending.", 71306: "The job was killed by the WMAgent for using too much wallclock time (WMAgent) Job status was Error.",