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

patch reframe script to ensure Python packages are picked up from ReFrame installation directory in recent ReFrame easyconfigs #13844

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

boegel
Copy link
Member

@boegel boegel commented Aug 27, 2021

(created using eb --new-pr)

This fixes the problem I described in EESSI/software-layer#127.

For "normal" installations (not in an alternate sysroot like Gentoo Prefix) this fix is also relevant, to ensure that ReFrame picks up the Python packages as intended, rather than accidentally picking up stuff from the OS.

cc @vkarak, @victorusu, @teojgo

…rame installation directory in recent ReFrame easyconfigs
@boegel
Copy link
Member Author

boegel commented Aug 27, 2021

@boegelbot please test @ generoso

@boegelbot
Copy link
Collaborator

@boegel: Request for testing this PR well received on generoso

PR test command 'EB_PR=13844 EB_ARGS= /apps/slurm/default/bin/sbatch --job-name test_PR_13844 --ntasks=4 ~/boegelbot/eb_from_pr_upload_generoso.sh' executed!

  • exit code: 0
  • output:
Submitted batch job 18227

Test results coming soon (I hope)...

- notification for comment with ID 907061074 processed

Message to humans: this is just bookkeeping information for me,
it is of no use to you (unless you think I have a bug, which I don't).

@boegel
Copy link
Member Author

boegel commented Aug 27, 2021

Test report by @boegel
SUCCESS
Build succeeded for 3 out of 3 (3 easyconfigs in total)
node2723.swalot.os - Linux centos linux 7.9.2009, x86_64, Intel(R) Xeon(R) CPU E5-2660 v3 @ 2.60GHz (haswell), Python 3.6.8
See https://gist.github.com/8d965abda7a1610c0cf12e13651093a6 for a full test report.

@boegelbot
Copy link
Collaborator

Test report by @boegelbot
SUCCESS
Build succeeded for 3 out of 3 (3 easyconfigs in total)
generoso-c1-s-6 - Linux centos linux 8.2.2004, x86_64, Intel(R) Xeon(R) CPU E5-2667 v3 @ 3.20GHz (haswell), Python 3.6.8
See https://gist.github.com/75010b2945ee25821184dbd317aa0a45 for a full test report.

branfosj
branfosj previously approved these changes Aug 28, 2021
Copy link
Member

@branfosj branfosj left a comment

Choose a reason for hiding this comment

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

lgtm

@branfosj
Copy link
Member

Test report by @branfosj
FAILED
Build succeeded for 0 out of 3 (3 easyconfigs in total)
bear-pg0211u03a.bear.cluster - Linux RHEL 8.3, x86_64, Intel(R) Xeon(R) Gold 6248 CPU @ 2.50GHz (cascadelake), Python 3.6.8
See https://gist.github.com/55fc1d89a2a792461cc1edb69be30360 for a full test report.

@branfosj branfosj dismissed their stale review August 28, 2021 10:18

a bit early on the positive review ...

@@ -40,6 +40,9 @@ exts_list = [
postinstallcmds = [
"cp -r tutorials %(installdir)s",
"mkdir -p %(installdir)s/share && cp -r share/completions %(installdir)s/share/completions",
# patch reframe script to disable import of 'site' module to make sure that Python packages installed
# in ReFrame installation directory are used, rather than those in the Python installation
r"sed -i 's@/\(python[0-9.]*\)$@/\1 -S@g' %(installdir)s/bin/reframe",
Copy link
Member

Choose a reason for hiding this comment

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

I've checked and this change is causing the failure that I see. The Python being used is the one from my easybuild virtualenv.

diff on bin/reframe with and without this change.

< #!/rds/bear-apps/devel/eb-sjb-up/EL8/EL8-cas/venv-dev-develop-up/bin/python -S
---
> #!/rds/bear-apps/devel/eb-sjb-up/EL8/EL8-cas/venv-dev-develop-up/bin/python

Copy link
Member Author

Choose a reason for hiding this comment

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

So adding the -S led to zipfile not being found anymore, because it's installed in your virtualenv?

Copy link
Member

Choose a reason for hiding this comment

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

In the virtualenv

$ python -c "import zipfile; print(zipfile.__file__)"
/usr/lib64/python3.6/zipfile.py

Copy link
Contributor

Choose a reason for hiding this comment

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

Would in this case help if you start python with -S, prepend external to the sys.path as is being done now and then call site.main()?

@boegel boegel modified the milestones: 4.4.2, release after 4.4.2 Sep 2, 2021
@boegel boegel added the EESSI Related to EESSI project label Sep 2, 2021
@akesandgren
Copy link
Contributor

@boegel What about the 3.8.0 version? And is there a correct solution for this in the works?

I need to get back to ReFrame stuff....

@akesandgren
Copy link
Contributor

Test report by @akesandgren
FAILED
Build succeeded for 0 out of 1 (1 easyconfigs in total)
skalman.hpc2n.umu.se - Linux ubuntu 18.04, x86_64, Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz, Python 3.6.9
See https://gist.github.com/4d53d34e59cc793d5ec7b0fe1b3d2285 for a full test report.

@akesandgren
Copy link
Contributor

I get the same with the 3.8.0 version

@akesandgren
Copy link
Contributor

akesandgren commented Sep 22, 2021

Adding setuptools to by build container I get this:

== FAILED: Installation ended unsuccessfully (build directory: /scratch/eb-ake/ReFrame/3.8.0/system-system): build failed (first 300 chars): `pip check` failed:
pygobject 3.36.0 requires pycairo, which is not installed.

missing stuff in the easyconfig?

No, problem with the container having python3-gi installed due to a Recommends from another python package and python3-gi lacking a depends on pycairo with all that includes...

@akesandgren
Copy link
Contributor

@boegel You probably need this for 3.8.x too?

@smoors
Copy link
Contributor

smoors commented Dec 4, 2021

I wouldn't do this for existing installations, as it might break reframe tests that depend on system installed packages.
I'm fine with this for new installations (as is already the case for v3.9.0+).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug fix EESSI Related to EESSI project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants