Skip to content

Update python3 to 3.7.7 donald #109

Merged
merged 18 commits into from
Apr 1, 2020
Merged

Conversation

donald
Copy link
Contributor

@donald donald commented Mar 30, 2020

Alternative to #108

Now that @david did all the main work in #107, #108 , I didn't want to ask him for less important cosmetic changes and instead help a bit with that myself. I've shuffled and amended Davids commits to clean the history and made some less important changes. David, okay with you?

donald and others added 17 commits March 29, 2020 14:00
…ariux64/pkg-scripts/pull/104/files"

This reverts commit 10307f6.

The commit has been added to the master branch by accident. Remove it.
Create bee file with

    cp python-3.7.4-2.build.sh python-3.7.6-0.build.sh

and update version and build number.
If pip finds the system installation path not writable, it falls
back to --user and installs into ~/.local.

Of course, when this script runs, its system installation path should
be writable. However, other errors in our environment, which prevent
$PREFIX from being written to, might go undetected because of the
fallback.

Specify --prefix to abort if $PREFIX is not writable.
Add

    python3 -c 'help("modules")'

at the end of build script. The idea is, that this command requires all
available modules to be loaded and would emmit error messages and
non-zero exist status in case of any errors in the installation.
We are going to install pycuda into this package, which requires
cuda at compile- and runtime, so add the cuda package to this packages
environment.
We are going to install Tensorflow into this package.

Tensorflow loads implementation libraries at runtime which need to be
found. Add LD_LIBRARY_PATH to avoid runtime errors like

    Traceback (most recent call last):
      File "/dev/shm/python-3.7.6-0/lib/python3.7/site-packages/tensorflow-2.1.0-py3.7-linux-x86_64.egg/tensorflow_core/python/pywrap_tensorflow.py", line 58, in <module>
        from tensorflow.python.pywrap_tensorflow_internal import *
      File "/dev/shm/python-3.7.6-0/lib/python3.7/site-packages/tensorflow-2.1.0-py3.7-linux-x86_64.egg/tensorflow_core/python/pywrap_tensorflow_internal.py", line 28, in <module>
        _pywrap_tensorflow_internal = swig_import_helper()
      File "/dev/shm/python-3.7.6-0/lib/python3.7/site-packages/tensorflow-2.1.0-py3.7-linux-x86_64.egg/tensorflow_core/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
        _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
      File "/dev/shm/python-3.7.6-0/lib/python3.7/imp.py", line 242, in load_module
        return load_dynamic(name, filename, file)
      File "/dev/shm/python-3.7.6-0/lib/python3.7/imp.py", line 342, in load_dynamic
        return _load(spec)
    ImportError: libnccl.so.2: cannot open shared object file: No such file or directory
We are going to install Tensorflow into this package. The compilation of
Tendowflow produces huge amounts of data (335612 files, 35 GB) in
~/.cache/bazel.

Change BUILD_TMPDIR (which implies $HOME during the build) away from
/dev/shm to avoid running out of memory.
The requireiments of hic2cool would downgrade a lot of packages, so
build it from source.
The latest version of pyGenomeTracks on PyPi (3.3) has a dependency on
hicmatrix>=12 which is not yet published. Request previous version.
Store the variants of BOOST_VERSION in an array instead of in a space
seperated string to avoid parsing it over and over.
The distribuition server seems to be broken at the moment:

    + wget https://dl.bintray.com/boostorg/release/1.72.0/source/boost_1_72_0.tar.gz
    --2020-03-28 13:02:47--  https://dl.bintray.com/boostorg/release/1.72.0/source/boost_1_72_0.tar.gz
    Resolving dl.bintray.com... 52.28.187.224, 52.29.129.139
    Connecting to dl.bintray.com|52.28.187.224|:443... connected.
    HTTP request sent, awaiting response... 403 Forbidden
    2020-03-28 13:02:47 ERROR 403: Forbidden.

Use cached copy.
This reverts commit 5e93e04.

The requirements of hic2cool have been updated and we can fetch it with
pip again [1] [2]

[1]: https://github.com/4dn-dcic/hic2cool/issues/46
[2]: https://github.com/4dn-dcic/hic2cool/releases/tag/0.8.2
@donald
Copy link
Contributor Author

donald commented Mar 30, 2020

@david david self-requested a review March 30, 2020 08:26
Copy link
Contributor

@david david left a comment

Choose a reason for hiding this comment

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

looks pretty nice :-)

@donald
Copy link
Contributor Author

donald commented Mar 30, 2020

buczek@theinternet:~/git/pkg-scripts (update-python3-to-3.7.6-donald)$ /package/pkg/python-3.7.6-0/bin/pip freeze>x.1
buczek@theinternet:~/git/pkg-scripts (update-python3-to-3.7.6-donald)$ /dev/shm/python-3.7.6-0/bin/pip freeze>x.2
buczek@theinternet:~/git/pkg-scripts (update-python3-to-3.7.6-donald)$ diff x.1 x.2
14c14
< bleach==3.1.3
---
> bleach==3.1.4
16,17c16,17
< boto3==1.12.27
< botocore==1.15.27
---
> boto3==1.12.31
> botocore==1.15.31
31c31
< Cython==0.29.15
---
> Cython==0.29.16
33c33
< datrie==0.8
---
> datrie==0.8.2
55c55
< google-auth==1.11.3
---
> google-auth==1.12.0
60c60
< hic2cool==0.8.0
---
> hic2cool==0.8.2
63c63
< HTSeq==0.11.3
---
> HTSeq==0.11.4
68c68
< importlib-metadata==1.5.0
---
> importlib-metadata==1.6.0
80c80
< json5==0.9.3
---
> json5==0.9.4
82c82
< jupyter-client==6.1.0
---
> jupyter-client==6.1.2
85c85
< jupyterlab-git==0.9.0
---
> jupyterlab-git==0.10.0
101c101
< meson==0.53.2
---
> meson==0.54.0
109c109
< nbdime==2.0.0
---
> nbdime==1.1.0
134c134
< prompt-toolkit==3.0.4
---
> prompt-toolkit==3.0.5
156c156
< pyrsistent==0.15.7
---
> pyrsistent==0.16.0
166c166
< qtconsole==4.7.1
---
> qtconsole==4.7.2
186c186
< snakemake==5.11.2
---
> snakemake==5.13.0
217c217
< virtualenv==20.0.13
---
> virtualenv==20.0.15

@thomas
Copy link
Contributor

thomas commented Mar 30, 2020

So this means that the rebuild succeeded? Cool! (Mega-Cool!!!)
From the diffs shown, I guess this PR carries still the build tag '0', what is a bit of a curiosity.
Anyway, are there any plans to release it during the lockdown?

@donald
Copy link
Contributor Author

donald commented Mar 30, 2020

I guess this PR carries still the build tag '0', what is a bit of a curiosity.

Well as long as it isn't merged, we still have the option to replace it, don't we?

Are there any plans to release it during the lockdown?

Mild irony(tm)? I was about to attempt Python 3.8.2 . Or 3.7.7 ? Would fix the build number question, too :-)

@thomas
Copy link
Contributor

thomas commented Mar 30, 2020

Well, let's call it an 'interim' package (and merge it asap). The rationale is, that this build provides a functional environment for the openGL/CUDA stuff/issues that still sit in our back. (There are reasons why instagraal (cough...) isn't part of this package, albeit it was helpfull to try: )
And no doubt, this is useful for jumping to the next pythons.

Create bee file with

    mv python-3.7.6.build.sh python-3.7.7.build.sh

and update version.
@donald
Copy link
Contributor Author

donald commented Mar 30, 2020

Rebuilt with python-3.7.7. Tested with tensorflow on CPU and GPU. pip freeze output didn't change. So I suggest with use that now.

@thomas
Copy link
Contributor

thomas commented Mar 31, 2020

LGTM :)

@donald
Copy link
Contributor Author

donald commented Mar 31, 2020

Building into package/pkg/python-3.7.7-0 currently. When the build is done in a few hours and some testing has been done, this is ready to rumble.

@thomas
Copy link
Contributor

thomas commented Mar 31, 2020

Tröööt! -- Well, I opt to keep the 'older' 3.7.6 build lying around (at least for some time).

@donald
Copy link
Contributor Author

donald commented Mar 31, 2020

Warum? Benutzt den schon wer?

@thomas
Copy link
Contributor

thomas commented Mar 31, 2020

Naja, es wurde in der build phase benutzt, und es existieren hier und da scripte die das profile sourcen. Zwar meist nur für tests, aber dennoch. Und auch wenn es unwahrscheinlich ist, wenn da sowas wie 'regression in 3.7.7' aufpoppt, dann gucken wir ein bischen doof aus der wäsche.

@donald
Copy link
Contributor Author

donald commented Mar 31, 2020

Build finished. Ready to be tested.

buczek@deinemuddah:~/tf$ prun python-3.7.7-0 ./keras_train.py 
2020-03-31 18:46:03.176304: F tensorflow/core/platform/cpu_feature_guard.cc:37] The TensorFlow library was compiled to use SSE4.1 instructions, but these aren't available on your machine.
Aborted (core dumped)

Ohhhhh..... :-(

buczek@theinternet:~/tf$ prun python-3.7.7-0 ./keras_train.py 
2020-03-31 18:46:53.428586: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.2
[...]
2020-03-31 18:47:01.226112: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x3d12bf0 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2020-03-31 18:47:01.226129: I tensorflow/compiler/xla/service/service.cc:176]   StreamExecutor device (0): Host, Default Version
[...]
Epoch 10/10
60000/60000 [==============================] - 2s 33us/sample - loss: 0.2281 - accuracy: 0.9146
10000/10000 - 0s - loss: 0.3433 - accuracy: 0.8831
test_loss: 0.34329232338666915 test_acc: 0.8830999732017517

Ahhh. :-)

2020-03-31 18:48:25.535620: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.2
[...]
2020-03-31 18:49:56.575404: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1241] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 7217 MB memory) -> physical GPU (device: 0, name: GeForce RTX 2080, pci bus id: 0000:01:00.0, compute capability: 7.5)
[...]
Epoch 10/10
60000/60000 [==============================] - 2s 35us/sample - loss: 0.2263 - accuracy: 0.9145
10000/10000 - 0s - loss: 0.3436 - accuracy: 0.8860
test_loss: 0.34359997473955156 test_acc: 0.8859999775886536

Ahhhhhh :-)

@donald donald changed the title Update python3 to 3.7.6 donald Update python3 to 3.7.7 donald Apr 1, 2020
@donald donald merged commit 999be4f into master Apr 1, 2020
@donald
Copy link
Contributor Author

donald commented Apr 2, 2020

Okay, the systems have pulled this to local disk over night. I make it the default for python-3. Objections?

@thomas
Copy link
Contributor

thomas commented Apr 2, 2020

Yes (Call it Minority-Report:),
I doubt that the switch would do any harm, but on the other hand I see no true reason to update while we are doing homeoffice. Or is it a 'signal', saying business-as-usual continues?
Ok, so much for me

@david
Copy link
Contributor

david commented Apr 2, 2020 via email

@donald
Copy link
Contributor Author

donald commented Apr 4, 2020

I see no true reason to update while we are doing homeoffice

Ich kann von zu Hause besser arbeiten als im Institut. Und da ich durchaus bereit bin, mich auch mit eventuellen Problemen zu beschäftigen, zählt das Argument hier nicht :-)

@thomas
Copy link
Contributor

thomas commented Apr 4, 2020

-- no risk, no fun :) --
Donald, du kennst meine zögerliche art (?), andereseits bist du auch die ganzen fallstricke & neuerungen des 'best python ever' durchgegangen -- go ahead brauch ich ja nicht mehr sagen, da schon gemerged.

N.B. kannst du dir einen reim drauf machen, warum die keras samples je nach prozessor (gpu, cpu-arch1, cpu-arch2) unerschiedliche model-parameter liefern, und ob die so 'trainierten' modelle (wufff) dann doch die gleichen resultate liefern?

@donald
Copy link
Contributor Author

donald commented Apr 6, 2020

Two features, I've read about, had in my mind, wanted to use and learned, that they are in python 3.8 only:

  • pp directly from pprint ( from pprint import pp instead of from pprint import pprint as pp)
  • self-documenting expressions in f-strings (f"{user=}" instead of f"user={user}"))

Time of 3.8, hhehe

@thomas
Copy link
Contributor

thomas commented Apr 6, 2020

Wow, syntactic sugar - when will there be a real printf in (% (python)) (it took ages in java) :)
Just kidding. Yeah, but I guess we need to watch how the major packages adopt to 3.8.

@david david mentioned this pull request Apr 20, 2020
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants