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

Update deployment script to accept python3 WMAgent service #10302

Merged
merged 1 commit into from
Feb 24, 2021

Conversation

amaltaro
Copy link
Contributor

@amaltaro amaltaro commented Feb 22, 2021

Fixes #10230

Status

tested

Description

Add a new argument to the deploy-wmagent script such that we can specify which RPM we would like to deploy:

  • wmagent (python2)
  • wmagentpy3 (python3 stack)

NOTE: when deploying a python3 agent, we need to update the env.sh script to point to:

export install=/data/srv/wmagent/current/install/wmagentpy3
export config=/data/srv/wmagent/current/config/wmagentpy3

instead of:

export install=/data/srv/wmagent/current/install/wmagent
export config=/data/srv/wmagent/current/config/wmagent

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

yes

Related PRs

none

External dependencies / deployment changes

Deployment changes: dmwm/deployment#1034

@cmsdmwmbot
Copy link

Jenkins results:

  • Unit tests: succeeded
    • 3 tests no longer failing
  • Pylint check: succeeded
  • Pylint py3k check: succeeded
    • 0 errors and warnings that should be fixed
    • 0 warnings
    • 0 comments to review
  • Pycodestyle check: succeeded
  • Python3 compatibility checks: succeeded

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

@amaltaro amaltaro force-pushed the fix-10230 branch 2 times, most recently from c09de30 to 18edc37 Compare February 22, 2021 16:45
@cmsdmwmbot
Copy link

Jenkins results:

  • Unit tests: succeeded
    • 3 tests no longer failing
  • Pylint check: succeeded
  • Pylint py3k check: succeeded
    • 0 errors and warnings that should be fixed
    • 0 warnings
    • 0 comments to review
  • Pycodestyle check: succeeded
  • Python3 compatibility checks: succeeded

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

@cmsdmwmbot
Copy link

Jenkins results:

  • Unit tests: succeeded
    • 3 tests no longer failing
  • Pylint check: succeeded
  • Pylint py3k check: succeeded
    • 0 errors and warnings that should be fixed
    • 0 warnings
    • 0 comments to review
  • Pycodestyle check: succeeded
  • Python3 compatibility checks: succeeded

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

@amaltaro
Copy link
Contributor Author

With the proposed changes, WMAgent and all its dependencies can be installed. Unfortunately things fail to get initialized and the final agent deployment setup cannot be completed. This is the error message from the logs:

*** Initializing the agent ***
Initialising Agent...
Traceback (most recent call last):
  File "/data/srv/wmagent/v1.4.6.pre7/sw/slc7_amd64_gcc630/cms/wmagentpy3/1.4.6.pre7/bin/wmagent-mod-config", line 14, in <module>
    standard_library.install_aliases()
  File "/data/srv/wmagent/v1.4.6.pre7/sw/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.6.pre7/sw/slc7_amd64_gcc630/cms/wmagentpy3/1.4.6.pre7/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.6.pre7/sw/slc7_amd64_gcc630/cms/wmagentpy3/1.4.6.pre7/bin/wmagent-couchapp-init", line 9, in <module>
    standard_library.install_aliases()
  File "/data/srv/wmagent/v1.4.6.pre7/sw/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!

and we are ending up with a mix of python2 and python3 libraries (we haven't yet migrated away of some python2-only libraries), examples are:

I will make some new issues soon.

@amaltaro
Copy link
Contributor Author

In terms of deployment changes, I think this covers what is needed. The whole wmagentpy3 deployment is not fully working yet because there are many other issues with RPMs and their dependencies.

Copy link
Contributor

@todor-ivanov todor-ivanov left a comment

Choose a reason for hiding this comment

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

@amaltaro I just made two comments inline. I hope you have already tested the current deployment script with the python3 version of the rpm package and it is working, but those lines that I am pointing to seem confusing. Could you please take a look.

@@ -285,12 +293,15 @@ echo -e "\n*** Applying agent patches ***"
if [ "x$PATCHES" != "x" ]; then
cd $CURRENT_DIR
for pr in $PATCHES; do
wget -nv https://github.com/dmwm/WMCore/pull/$pr.patch -O - | patch -d apps/wmagent/lib/python2*/site-packages/ -p 3
wget -nv https://github.com/dmwm/WMCore/pull/$pr.patch -O - | patch -d apps/${RPM_NAME}/lib/python2*/site-packages/ -p 3
Copy link
Contributor

Choose a reason for hiding this comment

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

I am pretty sure you have already tested it, but just my curiosity: Why hard coded path leading to python2 libraries even though here we provide the option to deploy a python3 version of the rpm package

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch! This needs to be fixed.

done
set +e

echo -e "\n*** Creating wmagent symlink ***"
cd $CURRENT_DIR
ln -s ../sw/${WMA_ARCH}/cms/${RPM_NAME}/${WMA_TAG} apps/wmagent
Copy link
Contributor

@todor-ivanov todor-ivanov Feb 24, 2021

Choose a reason for hiding this comment

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

Here you seem to create the link name always as apps/wmagent, which to me is logical, but down bellow you refer to it as apps/${RPM_NAME} (line 296 in the current commit)

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 had to create this symlink because some of those bin/* scripts look for files under apps/wmagent, which does not exist when we deploy wmagentpy3.
The Deploy script automatically creates a symlink according to the package name. So, for python2, it won't make any difference since the symlink will be already there. For python3, we will have both symlinks pointing to the same directory structure.

In short, I could simply use apps/wmagent below as well, but I tried to keep it as consistent as possible.

update MANAGE_DIR

create wmagent symlink

fix reference to python directory
@amaltaro
Copy link
Contributor Author

Thanks for the review, Todor. I fixed one issue that you spotted.
Just wanted to mention that, ideally, I'd like to use this new RPM/package name (wmagentpy3) only for a transition period. Once WMCore/WMAgent is fully validated and functional in python3, we could likely rename it back to wmagent and drop the python2-based agent.

@cmsdmwmbot
Copy link

Jenkins results:

  • Unit tests: succeeded
    • 4 tests no longer failing
    • 1 changes in unstable tests
  • Pylint check: succeeded
  • Pylint py3k check: succeeded
    • 0 errors and warnings that should be fixed
    • 0 warnings
    • 0 comments to review
  • Pycodestyle check: succeeded
  • Python3 compatibility checks: succeeded

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

Copy link
Contributor

@todor-ivanov todor-ivanov left a comment

Choose a reason for hiding this comment

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

looks good to me

@todor-ivanov
Copy link
Contributor

Thanks @amaltaro. the temporary name sounds logical to me too.

@amaltaro
Copy link
Contributor Author

Thanks Todor.

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.

Create deployment scripts for python3 WMAgent
3 participants