sagemath / sage-binder-env

A Binder repo for SageMath computing environment
GNU General Public License v3.0
27 stars 30 forks source link

Fix image building via conda on mybinder #1

Closed nthiery closed 1 year ago

nthiery commented 7 years ago

I was curious to see whether the new conda package for Sage would enable the deployement of SageMath Jupyter notebooks on mybinder. That would be a really cool feature.

It seems to go a long way. However building the mybinder image currently fails during the installation of conda packages:

Taken from: http://mybinder.org/status/nthiery/test-binder-sage:

sage-7.5.1-np1 100% |###############################| Time: 0:00:00 5.78 MB/s
sage-7.5.1-np1 100% |###############################| Time: 0:00:00 4.40 MB/s
sage-7.5.1-np1 100% |###############################| Time: 0:00:00 3.46 MB/s
Extracting packages ... [ ]| | 0% [bdw-gc ]| | 0% [cliquer ]| | 1% [fftw ]|# | 2% [gf2x ]|# | 3% [gmp ]|## | 5% [gsl ]|### | 6% [jpeg ]|### | 7% [libgcc ]|#### | 8% [lrcalc ]|##### | 10% [nauty ]|##### | 11% [openssl ]|###### | 12% [perl ]|###### | 13% [planarity ]|####### | 15% [rw ]|######## | 16%
An unexpected error has occurred, please consider sending the following traceback to the conda GitHub issue tracker at: https://github.com/conda/conda/issues
Include the output of the command 'conda info' in your report.
Traceback (most recent call last):
File "/home/main/anaconda2/bin/conda-env", line 6, in
sys.exit(main()) File "/home/main/anaconda2/lib/python2.7/site-packages/conda_env/cli/main.py", line 68, in main
return args_func(args, parser)
File "/home/main/anaconda2/lib/python2.7/site-packages/conda/cli/main.py", line 146, in args_func
args.func(args, p)
File "/home/main/anaconda2/lib/python2.7/site-packages/conda_env/cli/main_create.py", line 100, in execute
installer.install(prefix, pkg_specs, args, env)
File "/home/main/anaconda2/lib/python2.7/site-packages/conda_env/installers/conda.py", line 17, in install
plan.execute_actions(actions, index, verbose=not args.quiet) File "/home/main/anaconda2/lib/python2.7/site-packages/conda/plan.py", line 539, in execute_actions
inst.execute_instructions(plan, index, verbose)
File "/home/main/anaconda2/lib/python2.7/site-packages/conda/instructions.py", line 149, in execute_instructions
cmd(state, arg) File "/home/main/anaconda2/lib/python2.7/site-packages/conda/instructions.py", line 63, in EXTRACT_CMD
install.extract(config.pkgs_dirs[0], arg)
File "/home/main/anaconda2/lib/python2.7/site-packages/conda/install.py", line 485, in extract
t.extractall(path=path) File "/home/main/anaconda2/lib/python2.7/tarfile.py", line 2078, in extractall
self.extract(tarinfo, path) File "/home/main/anaconda2/lib/python2.7/tarfile.py", line 2115, in extract
self._extract_member(tarinfo, os.path.join(path, tarinfo.name))
File "/home/main/anaconda2/lib/python2.7/posixpath.py", line 73, in join
path += '/' + bUnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 15: ordinal not in range(128)
could not build image nthiery-test-binder-sage: Error: build failed for imageName: nthiery-test-binder-sage
registering template for nthiery-test-binder-sage

Any clue?

cc: @embray

embray commented 7 years ago

Looks like it might be an issue in conda? Either the path to the conda environment contains non-ASCII characters, or somehow the paths in one of the package tarballs contains non-ASCII characters, and it's running into an implicit ASCII decoding caused by trying to concatenate a unicode string with a non-unicode string.

isuruf commented 7 years ago

Saw this issue by accident. You should post this on https://github.com/conda-forge/sage-feedstock/issues This was a problem with the rw package which installed a file share/doc/rw/Hängematte. I've fixed this here, https://github.com/conda-forge/rw-feedstock/pull/2 Note that this error appeared only on anaconda2 and not on anaconda3.

nthiery commented 7 years ago

@isuruf: you are everywhere :-) Thanks so much for spotting and fixing it!

embray commented 7 years ago

Although working out the problem with conda would be worthwhile, now that binder supports Docker images it might be a moot point. Starting from the pre-built Sage image might be faster and simpler even than using Conda for this purpose.

I'm making progress on a few small enhancements to the official sagemath image that will make deploying it on binder easier too.

kwankyu commented 1 year ago

Yes. We now use pre-built Sage image. It works well.