Skip to content

Conversation

@Flamefire
Copy link
Contributor

In e.g. easybuilders/easybuild-easyconfigs#13622 we need to run Bazel to generate a whl file and then install that using pip. This is currently unsupported by the PythonPackage easyblock.

This PR allows this by setting:

use_pip = True
buildcmd = '%(python)s build/build.py`
install_src = 'dist/*.whl'

Also some minor moving around:

  • Setting PYTHONNOUSERSITE a bit earlier
  • Combining 2 very related run_cmd into one as external commands have a lot overhead

Allow to specify an explicit path (e.g. a whl file) for PythonPackage to be installed.
This allows to e.g. run a custom build script which builds a whl file
which is then installed with pip.
@Flamefire
Copy link
Contributor Author

Test report by @Flamefire

Overview of tested easyconfigs (in order)

  • SUCCESS Amara-1.2.0.2-foss-2019a-Python-2.7.15.eb

Build succeeded for 1 out of 1 (1 easyconfigs in total)
taurusi6606.taurus.hrsk.tu-dresden.de - Linux RHEL 7.9, x86_64, Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz (haswell), Python 2.7.5
See https://gist.github.com/02a8cf29f47c3f4e90a161f428c17cfc for a full test report.

@Flamefire
Copy link
Contributor Author

Test report by @Flamefire

Overview of tested easyconfigs (in order)

  • SUCCESS poetry-1.0.9-GCCcore-9.3.0-Python-3.8.2.eb
  • SUCCESS Amara-1.2.0.2-foss-2019a-Python-2.7.15.eb

Build succeeded for 2 out of 2 (2 easyconfigs in total)
taurusi6606.taurus.hrsk.tu-dresden.de - Linux RHEL 7.9, x86_64, Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz (haswell), Python 2.7.5
See https://gist.github.com/512908e5ebb263072d9d6ccbf9e17476 for a full test report.

@Flamefire
Copy link
Contributor Author

Test report by @Flamefire

Overview of tested easyconfigs (in order)

  • SUCCESS poetry-1.0.9-GCCcore-9.3.0-Python-3.8.2.eb
  • SUCCESS Amara-1.2.0.2-foss-2019a-Python-2.7.15.eb

Build succeeded for 2 out of 2 (2 easyconfigs in total)
taurusa5 - Linux centos linux 7.7.1908, x86_64, Intel(R) Xeon(R) CPU E5-2603 v4 @ 1.70GHz (broadwell), Python 2.7.5
See https://gist.github.com/c185f02d3a66c169a298e8e654c4f7f2 for a full test report.

@boegel boegel changed the title PythonPackage: Add install_src option and enhance buildcmd option add install_src option and enhance buildcmd option in PythonPackage easyblock Aug 12, 2021
@boegel boegel added this to the 4.x milestone Aug 12, 2021
@boegel
Copy link
Member

boegel commented Aug 12, 2021

@Flamefire Hmm, I ran into an easyconfig that's setting buildcmd that is failing with these changes, resulting in:

/bin/bash: build_ext: command not found

(see test report for libgpuarray)

@boegel
Copy link
Member

boegel commented Aug 12, 2021

Test report by @boegel

Overview of tested easyconfigs (in order)

Build succeeded for 0 out of 1 (1 easyconfigs in total)
node3302.joltik.os - Linux centos linux 7.9.2009, x86_64, Intel(R) Xeon(R) Gold 6242 CPU @ 2.80GHz (cascadelake), Python 3.6.8
See https://gist.github.com/9b4d4b36a69b4938630c2d44bf50e979 for a full test report.

@Flamefire
Copy link
Contributor Author

@boegel That is actually a good thing. The EC sets buildcmd but uses use_pip=True which means it was silently unused.
We should check and probably fix that EC

@Flamefire
Copy link
Contributor Author

As far as I can tell using pip works fine, so the buildcmd should be removed: https://github.com/Theano/libgpuarray/blob/9cec61435c11cf2ffcf7c480c2d524772585c47f/doc/installation.rst

@boegel
Copy link
Member

boegel commented Aug 12, 2021

@boegel That is actually a good thing. The EC sets buildcmd but uses use_pip=True which means it was silently unused.
We should check and probably fix that EC

Ah, that explains it, I was having trouble understand why the changes in this PR could cause trouble like that 😅

I'll look into fixing the libgpuarray easyconfigs by stripping out the unused buildcmd

@boegel
Copy link
Member

boegel commented Aug 12, 2021

Test report by @boegel

Overview of tested easyconfigs (in order)

  • SUCCESS Meson-0.58.2-GCCcore-11.2.0.eb
  • SUCCESS archspec-0.1.2-GCCcore-10.3.0.eb
  • SUCCESS h5py-3.2.1-foss-2021a.eb
  • SUCCESS CellRank-1.4.0-foss-2021a.eb
  • SUCCESS matplotlib-3.4.2-foss-2021a.eb
  • SUCCESS QUAST-5.0.2-foss-2020a-Python-3.8.2.eb
  • SUCCESS IPython-7.25.0-GCCcore-10.3.0.eb
  • SUCCESS Python-3.8.6-GCCcore-10.2.0.eb
  • SUCCESS Python-2.7.18-GCCcore-9.3.0.eb
  • SUCCESS sklearn-som-1.1.0-foss-2020b.eb
  • SUCCESS PyQt5-5.15.1-GCCcore-10.2.0.eb

Build succeeded for 11 out of 11 (11 easyconfigs in total)
node3112.skitty.os - Linux centos linux 7.9.2009, x86_64, Intel(R) Xeon(R) Gold 6140 CPU @ 2.30GHz, Python 3.6.8
See https://gist.github.com/1091fbd99826d9fc17dde88f60862b17 for a full test report.

@boegel boegel modified the milestones: 4.x, next release (4.4.2?) Aug 12, 2021
@boegel boegel merged commit 3747ab5 into easybuilders:develop Aug 12, 2021
@Flamefire Flamefire deleted the install_src branch August 17, 2021 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants