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

python3Packages.dask: fix sandboxed builds #120310

Merged
merged 1 commit into from Apr 24, 2021

Conversation

nbren12
Copy link
Contributor

@nbren12 nbren12 commented Apr 23, 2021

Motivation for this change

Allow dask.dataframe to be used in sandboxed builds. See #120307.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@r-rmcgibbo
Copy link

Result of nixpkgs-review pr 120310 at 031a8b7e run on x86_64-linux 1

7 packages marked as broken and skipped:
  • python38Packages.clifford
  • python38Packages.dask-jobqueue
  • python38Packages.dask-xgboost
  • python38Packages.rl-coach
  • python39Packages.dask-jobqueue
  • python39Packages.dask-xgboost
  • python39Packages.rl-coach
16 packages skipped due to time constraints:
  • python38Packages.caffe
  • python38Packages.dask-glm
  • python38Packages.dask-ml
  • python38Packages.datashader
  • python38Packages.imgaug
  • python38Packages.intake
  • python38Packages.mask-rcnn
  • python38Packages.spectral-cube
  • python38Packages.stumpy
  • python38Packages.sunpy
  • ...
46 packages built successfully:
  • python38Packages.aplpy
  • python38Packages.asdf
  • python38Packages.batchgenerators
  • python38Packages.dask
  • python38Packages.dask-gateway
  • python38Packages.dask-image
  • python38Packages.dask-mpi
  • python38Packages.distributed
  • python38Packages.glymur
  • python38Packages.image-match
  • python38Packages.imagecorruptions
  • python38Packages.pims
  • python38Packages.pyfftw
  • python38Packages.pyregion
  • python38Packages.pytest-astropy
  • python38Packages.pytest-astropy-header
  • python38Packages.radio_beam
  • python38Packages.reproject
  • python38Packages.scikitimage
  • python38Packages.slicedimage
  • python38Packages.sparse
  • python38Packages.streamz
  • python38Packages.stytra
  • python38Packages.tensorly
  • python39Packages.aplpy
  • python39Packages.asdf
  • python39Packages.batchgenerators
  • python39Packages.dask
  • python39Packages.dask-gateway
  • python39Packages.dask-image
  • python39Packages.dask-mpi
  • python39Packages.distributed
  • python39Packages.glymur
  • python39Packages.image-match
  • python39Packages.imagecorruptions
  • python39Packages.intake
  • python39Packages.pims
  • python39Packages.pyfftw
  • python39Packages.pyregion
  • python39Packages.pytest-astropy
  • python39Packages.pytest-astropy-header
  • python39Packages.radio_beam
  • python39Packages.reproject
  • python39Packages.scikitimage
  • python39Packages.slicedimage
  • python39Packages.streamz
1 suggestion:
  • warning: missing-patch-comment

    Please add a comment on the line above, explaining the purpose of this patch.
    Near pkgs/development/python-modules/dask/default.nix:55:15:

       |
    55 |   patches = [ ./0001-guard-blocksize-inference-logic.patch ];
       |               ^
    

@FRidh
Copy link
Member

FRidh commented Apr 23, 2021

Did you report the issue upstream? If not, please do so, submit the patch, and fetch it instead of including directly in Nixpkgs.

@nbren12
Copy link
Contributor Author

nbren12 commented Apr 23, 2021

I opened a PR upstream: dask/dask#7601.

Will I need to wait for this to be merged before using it here?

@FRidh
Copy link
Member

FRidh commented Apr 23, 2021

Will I need to wait for this to be merged before using it here?

No need for that. Please use fetchpatch instead of keeping the patch in the tree.

@nbren12
Copy link
Contributor Author

nbren12 commented Apr 23, 2021

Please use fetchpatch

I just did this.

One question: can github possibly garbage collect a patch if the upstream PR uses a merge strategy that modifies the history (e.g. rebase or squash)?

Importing dask.dataframe in a sandboxed build results in a TypeError like
this:

  File "/nix/store/nv60iri29bia4szhhcvsdxgsci4wxvp6-python3.8-dask-2021.03.0/lib/python3.8/site-packages/dask/dataframe/io/csv.py", line 392, in <module>
    AUTO_BLOCKSIZE = auto_blocksize(TOTAL_MEM, CPU_COUNT)
  File "/nix/store/nv60iri29bia4szhhcvsdxgsci4wxvp6-python3.8-dask-2021.03.0/lib/python3.8/site-packages/dask/dataframe/io/csv.py", line 382, in auto_blocksize
    blocksize = int(total_memory // cpu_count / memory_factor)
  TypeError: unsupported operand type(s) for //: 'int' and 'NoneType'

This occurs because dask.dataframe has a non-deterministic component which
generates an automatic chunk-size based on system information.

This went unnoticed because the dask tests were disabled.

Changes:
- add a patch making the chunk-size inference more robust
- re-enable the tests

Resolves NixOS#120307
@SuperSandro2000
Copy link
Member

SuperSandro2000 commented Apr 24, 2021

One question: can github possibly garbage collect a patch if the upstream PR uses a merge strategy that modifies the history (e.g. rebase or squash)?

It shouldn't https://github.community/t/does-github-ever-purge-commits-or-files-that-were-visible-at-some-time/1944/2.

@SuperSandro2000
Copy link
Member

This is a semi-automatic executed nixpkgs-review with nixpkgs-review-checks extension. It is checked by a human on a best effort basis and does not build all packages (e.g. lumo, tensorflow or pytorch).
If you have any questions or problems please reach out to SuperSandro2000 on IRC.

Result of nixpkgs-review pr 120310 run on x86_64-linux 1

7 packages marked as broken and skipped:
  • python38Packages.clifford
  • python38Packages.dask-jobqueue
  • python38Packages.dask-xgboost
  • python38Packages.rl-coach
  • python39Packages.dask-jobqueue
  • python39Packages.dask-xgboost
  • python39Packages.rl-coach
4 packages failed to build and already failed to build on hydra master:
  • python38Packages.imgaug: log was empty
  • python38Packages.mask-rcnn: log was empty
  • python39Packages.imgaug: log was empty
  • python39Packages.mask-rcnn: log was empty
1 package failed to build and are new build failure:
  • python39Packages.streamz: log was empty
57 packages built:
  • python38Packages.aplpy
  • python38Packages.asdf
  • python38Packages.batchgenerators
  • python38Packages.caffe
  • python38Packages.dask
  • python38Packages.dask-gateway
  • python38Packages.dask-glm
  • python38Packages.dask-image
  • python38Packages.dask-ml
  • python38Packages.dask-mpi
  • python38Packages.datashader
  • python38Packages.distributed
  • python38Packages.glymur
  • python38Packages.image-match
  • python38Packages.imagecorruptions
  • python38Packages.intake
  • python38Packages.pims
  • python38Packages.pyfftw
  • python38Packages.pyregion
  • python38Packages.pytest-astropy
  • python38Packages.pytest-astropy-header
  • python38Packages.radio_beam
  • python38Packages.reproject
  • python38Packages.scikitimage
  • python38Packages.slicedimage
  • python38Packages.sparse
  • python38Packages.spectral-cube
  • python38Packages.streamz
  • python38Packages.stumpy
  • python38Packages.stytra
  • python38Packages.sunpy
  • python38Packages.tensorly
  • python39Packages.aplpy
  • python39Packages.asdf
  • python39Packages.batchgenerators
  • python39Packages.caffe
  • python39Packages.dask
  • python39Packages.dask-gateway
  • python39Packages.dask-glm
  • python39Packages.dask-image
  • python39Packages.dask-mpi
  • python39Packages.distributed
  • python39Packages.glymur
  • python39Packages.image-match
  • python39Packages.imagecorruptions
  • python39Packages.intake
  • python39Packages.pims
  • python39Packages.pyfftw
  • python39Packages.pyregion
  • python39Packages.pytest-astropy
  • python39Packages.pytest-astropy-header
  • python39Packages.radio_beam
  • python39Packages.reproject
  • python39Packages.scikitimage
  • python39Packages.slicedimage
  • python39Packages.spectral-cube
  • python39Packages.sunpy

@SuperSandro2000 SuperSandro2000 merged commit 292b2d3 into NixOS:master Apr 24, 2021
@nbren12 nbren12 deleted the fix-dask-in-sandbox branch April 24, 2021 16:45
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.

None yet

4 participants