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

Fix timeout in jupyter_jsmol installation #34421

Closed
dimpase opened this issue Aug 24, 2022 · 32 comments
Closed

Fix timeout in jupyter_jsmol installation #34421

dimpase opened this issue Aug 24, 2022 · 32 comments

Comments

@dimpase
Copy link
Member

dimpase commented Aug 24, 2022

after #33866 update, I get an error on Gentoo.

As it turns out, jupyter_jsmol installation process fetches more js stuff than there is in the tarball:

jjupyter_jsmol-2022.1.0] Building wheels for collected packages: jupyter-jsmol
[jupyter_jsmol-2022.1.0]   WARNING: Ignoring --build-option when building jupyter-jsmol using PEP 517
[jupyter_jsmol-2022.1.0]   Building wheel for jupyter-jsmol (pyproject.toml): started
[jupyter_jsmol-2022.1.0]   Running command Building wheel for jupyter-jsmol (pyproject.toml)
[jupyter_jsmol-2022.1.0]   setup.py entered
[jupyter_jsmol-2022.1.0]   $PATH=/mnt/opt/Sage/sage-dev/build/bin:/mnt/opt/Sage/sage-dev/local/var/lib/sage/venv-python3.10/bin:/mnt/opt/Sage/sage-dev/local/bin:/mnt/opt/Sage/sage-dev/build/bin:/mnt/opt/Sage/sage-dev/local/bin:/mnt/opt/Sage/sage-dev/local/var/lib/sage/venv-python3.10/bin:/mnt/opt/Sage/sage-dev/build/bin:/mnt/opt/Sage/sage-dev/src/bin:/mnt/opt/Sage/sage-dev/local/bin:/home/dima/.elan/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/lib/llvm/14/bin:/home/dima/.local/bin:/home/dima/.local/bin
[jupyter_jsmol-2022.1.0]   <string>:47: DeprecatedWarning: create_cmdclass is deprecated as of 0.8 and will be removed in 1.0. "
[jupyter_jsmol-2022.1.0]   Use `wrap_installers` to handle prebuild steps in cmdclass.
[jupyter_jsmol-2022.1.0]   Use `get_data_files` to handle data files.
[jupyter_jsmol-2022.1.0]   Use `include_package_data=True` and `MANIFEST.in` for package data.
[jupyter_jsmol-2022.1.0] 
[jupyter_jsmol-2022.1.0]   <string>:49: DeprecatedWarning: install_npm is deprecated as of 0.8 and will be removed in 1.0. Use `npm_builder` and `wrap_installers`
[jupyter_jsmol-2022.1.0]   running bdist_wheel
[jupyter_jsmol-2022.1.0]   running jsdeps
[jupyter_jsmol-2022.1.0]   Installing build dependencies with npm.  This may take a while...
[jupyter_jsmol-2022.1.0]   > yarn install
[jupyter_jsmol-2022.1.0]   yarn install v1.22.19
[jupyter_jsmol-2022.1.0]   warning package.json: No license field
[jupyter_jsmol-2022.1.0]   warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[jupyter_jsmol-2022.1.0]   warning jupyter-jsmol@2022.1.0: No license field
[jupyter_jsmol-2022.1.0]   [1/4] Resolving packages...
[jupyter_jsmol-2022.1.0]   [2/4] Fetching packages...
[jupyter_jsmol-2022.1.0]   info There appears to be trouble with your network connection. Retrying...
...

and it hangs - even tough the network is OK.
Also reported on sage-devel with Arch Linux.

A straight ./sage --pip install jupyter_jsmol is almost instant success.

CC: @mkoeppe @videlec @kiwifb @slel @strogdon

Component: packages: standard

Keywords: jupyter_jsmol

Author: Matthias Koeppe

Branch/Commit: 6fb910f

Reviewer: Dima Pasechnik

Issue created by migration from https://trac.sagemath.org/ticket/34421

@dimpase dimpase added this to the sage-9.7 milestone Aug 24, 2022
@dimpase

This comment has been minimized.

@slel
Copy link
Member

slel commented Aug 24, 2022

Changed keywords from none to jupyter_jsmol

@slel

This comment has been minimized.

@slel slel changed the title jupyter_jsmol installation times out Fix timeout in jupyter_jsmol installation Aug 24, 2022
@jhpalmieri
Copy link
Member

comment:4

While fixing this, is it worth also addressing this message in the log file?

  Looking in links: /Users/palmieri/Desktop/Sage/sage_builds/TESTING/clean/sage-9.7.beta8/local/var/lib/sage/venv-python3.9/var/lib/sage/wheels
  ERROR: Could not find a version that satisfies the requirement jupyter_packaging~=0.7.9 (from versions: none)
  ERROR: No matching distribution found for jupyter_packaging~=0.7.9

I don't know where this version number for jupyter_packaging is coming from.

@jhpalmieri
Copy link
Member

comment:5

I don't see the problem in the ticket description on my OS X machine. Is it because of this from the log file?

  yarn not found, ignoring yarn.lock file
  `yarn` unavailable.  If you're running this command using sudo, make sure `yarn` is available to sudo

@dimpase
Copy link
Member Author

dimpase commented Aug 24, 2022

comment:6

Replying to @jhpalmieri:

I don't see the problem in the ticket description on my OS X machine. Is it because of this from the log file?

  yarn not found, ignoring yarn.lock file
  `yarn` unavailable.  If you're running this command using sudo, make sure `yarn` is available to sudo

on another Linux box, without yarn installed, I can't reproduce this either.

@mkoeppe
Copy link
Contributor

mkoeppe commented Aug 24, 2022

comment:7

My guess would be that on the affected system, there's an installation of some Javascript tools such as yarn, and that this interacts poorly with the fact we poison the https proxy when installing normal packages.

@mkoeppe
Copy link
Contributor

mkoeppe commented Aug 25, 2022

comment:9

It would be worth trying if export JUPYTER_PACKAGING_SKIP_NPM=1 resolves this problem.

See https://github.com/jupyter/jupyter-packaging/blob/main/jupyter_packaging/setupbase.py#L74

@kiwifb
Copy link
Member

kiwifb commented Aug 25, 2022

comment:10

That'd be nice if it works. The previous version (0.2.4) had a switch to avoid the npm stuff (--skip-npm) but it has been removed.

@dimpase
Copy link
Member Author

dimpase commented Aug 25, 2022

comment:11

it's weird that absence of yarn does not lead to build failure, and still produces something that works (?).

@mkoeppe
Copy link
Contributor

mkoeppe commented Aug 25, 2022

comment:12

The sdist of this package contains the prebuilt Javascript assets.

@dimpase
Copy link
Member Author

dimpase commented Aug 25, 2022

comment:13

why can't we just install the binary wheel? How is it different?

@videlec
Copy link
Contributor

videlec commented Aug 25, 2022

comment:14

Replying to @mkoeppe:

It would be worth trying if export JUPYTER_PACKAGING_SKIP_NPM=1 resolves this problem.

See https://github.com/jupyter/jupyter-packaging/blob/main/jupyter_packaging/setupbase.py#L74

It fails for two reasons. First the handling of this environment variable is buggy

  Skipping npm install as requested.
  Traceback (most recent call last):
    File "/opt/sage/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
      main()
    File "/opt/sage/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/opt/sage/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 164, in prepare_metadata_for_build_wheel
      return hook(metadata_directory, config_settings)
    File "/opt/sage/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/setuptools/build_meta.py", line 188, in prepare_metadata_for_build_wheel
      self.run_setup()
    File "/opt/sage/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/setuptools/build_meta.py", line 174, in run_setup
      exec(code, locals())
    File "<string>", line 8, in <module>
    File "/opt/sage/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/jupyter_packaging/__init__.py", line 6, in <module>
      from .setupbase import *  # noqa
    File "/opt/sage/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/jupyter_packaging/setupbase.py", line 77, in <module>
      sys.argv.remove("--skip-npm")
  ValueError: list.remove(x): x not in list
  error: subprocess-exited-with-error

Secondly, there seems to be a missing build dependency

  ERROR: Could not find a version that satisfies the requirement jupyter_packaging~=0.7.9 (from versions: none)
  ERROR: No matching distribution found for jupyter_packaging~=0.7.9
  error: subprocess-exited-with-error
  
  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: /opt/sage/local/var/lib/sage/venv-python3.10/bin/python3 /tmp/pip-standalone-pip-a17tx8xr/__env_pip__.zip/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-
myzlxjyq/overlay --no-warn-script-location --no-binary :all: --only-binary :none: --no-index --find-links /opt/sage/local/var/lib/sage/venv-python3.10/var/lib/sage/wheels -- 'jupyter_packagin
g~=0.7.9' 'jupyterlab>=3.0.0,==3.*' 'setuptools>=40.8.0' wheel

@mkoeppe
Copy link
Contributor

mkoeppe commented Aug 25, 2022

comment:15

Replying to @videlec:

Replying to @mkoeppe:

It would be worth trying if export JUPYTER_PACKAGING_SKIP_NPM=1 resolves this problem.

See https://github.com/jupyter/jupyter-packaging/blob/main/jupyter_packaging/setupbase.py#L74

It fails for two reasons. First the handling of this environment variable is buggy

Can you report this upstream please?

@mkoeppe
Copy link
Contributor

mkoeppe commented Aug 25, 2022

@mkoeppe
Copy link
Contributor

mkoeppe commented Aug 25, 2022

comment:17

Try with this please


New commits:

987a32ebuild/pkgs/jupyter_jsmol/spkg-install.in: Use --no-build-isolation

@mkoeppe
Copy link
Contributor

mkoeppe commented Aug 25, 2022

Commit: 987a32e

@dimpase
Copy link
Member Author

dimpase commented Aug 25, 2022

comment:18

this does not seem to change anything (same x not in list error with JUPYTER_PACKAGING_SKIP_NPM=1, hang with yarn without the latter).

I tried overriding the system yarn with src/bin/yarn pointing to /bin/true. Then build finishes, and
tests with jsmol pass.

I'm however suspicious of it being non-working, still.
Is there a visual test I can do?

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 25, 2022

Changed commit from 987a32e to 6fb910f

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 25, 2022

Branch pushed to git repo; I updated commit sha1. New commits:

6fb910fbuild/pkgs/jupyter_jsmol/spkg-install.in: Use --config-settings

@mkoeppe
Copy link
Contributor

mkoeppe commented Aug 25, 2022

comment:20

Try with this please

@mkoeppe
Copy link
Contributor

mkoeppe commented Aug 25, 2022

@dimpase
Copy link
Member Author

dimpase commented Aug 25, 2022

comment:22

OK, it's actually in the docs, how to test jsmol - in notebook one has to run

plot3d(lambda u,v:(u^2+v^2)/4-2,(-2,2),(-2,2)).show(viewer="jmol")

and see it producing stuff.
It works for my crude yarn->true workaround.


New commits:

6fb910fbuild/pkgs/jupyter_jsmol/spkg-install.in: Use --config-settings

@dimpase
Copy link
Member Author

dimpase commented Aug 25, 2022

comment:23

OK, this works!

@dimpase
Copy link
Member Author

dimpase commented Aug 25, 2022

Author: Matthias Koeppe

@dimpase
Copy link
Member Author

dimpase commented Aug 25, 2022

Reviewer: Dima Pasechnik

@mkoeppe
Copy link
Contributor

mkoeppe commented Aug 25, 2022

comment:25

Follow up in #34430 for a similar change that should be applied to other packages.

@videlec
Copy link
Contributor

videlec commented Aug 25, 2022

comment:26

Replying to @mkoeppe:

Replying to @videlec:

Replying to @mkoeppe:

It would be worth trying if export JUPYTER_PACKAGING_SKIP_NPM=1 resolves this problem.

See https://github.com/jupyter/jupyter-packaging/blob/main/jupyter_packaging/setupbase.py#L74

It fails for two reasons. First the handling of this environment variable is buggy

Can you report this upstream please?

Done at jupyter/jupyter-packaging#160

@slel
Copy link
Member

slel commented Aug 25, 2022

comment:27

Thanks for reporting upstream at

and providing a fix at

A new release is out that thas the fix:

Upgrade ticket for Sage: #34432.

@mkoeppe
Copy link
Contributor

mkoeppe commented Aug 25, 2022

comment:28

What happened here is that the comment regarding jupyter_jsmol in #33138 (ticket description) was no longer true after the jupyter_jsmol upgrade in #33530.

@mkoeppe

This comment has been minimized.

@vbraun
Copy link
Member

vbraun commented Aug 29, 2022

Changed branch from u/mkoeppe/fix_timeout_in_jupyter_jsmol_installation to 6fb910f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants