zabirauf / icsharp

C# kernel for Jupyter
Other
278 stars 62 forks source link

iCSharp with mono support using Docker #23

Closed awb99 closed 1 year ago

awb99 commented 8 years ago

I think icsharp shoud ideally run on a linux server and have a simple docker container that allows to play around quickly.

I want to share my progress; I havent had complete success yet.

This project has a dockerimage that installs on debian jessie the current jupyter version (via anaconda) the current mono version (via debian contrib): https://github.com/awb99/anaconda-notebook

To compile icsharp I had to do a couple of things:

  1. The dependency csscript does not compile in the old verson, so I have to upgrade to the current master: git clone --recursive https://github.com/awb99/icsharp.git cd icsharp/Engine git checkout master update git pull
  2. With the latest version there are ambiguous namespace references. My fork has corrected some of the issues (not all)

Regards Andreas

den-run-ai commented 8 years ago

Note that Microsoft release csi Roslyn based repl for VS 2015 which has better support for c# language, particularly dynamic. Vb.net support is coming soon.

So icsharp would benefit from this new backend.

Also have a look at binder project for deploying jupyter docker images in the cloud for free.

On Sunday, March 6, 2016, awb99 notifications@github.com wrote:

I think icsharp shoud ideally run on a linux server and have a simple docker container that allows to play around quickly.

I want to share my progress; I havent had complete success yet.

This project has a dockerimage that installs on debian jessie the current jupyter version (via anaconda) the current mono version (via debian contrib): https://github.com/awb99/anaconda-notebook

To compile icsharp I had to do a couple of things:

  1. The dependency csscript does not compile in the old verson, so I have to upgrade to the current master: git clone --recursive https://github.com/awb99/icsharp.git cd icsharp/Engine git checkout master update git pull
  2. With the latest version there are ambiguous namespace references. My fork has corrected some of the issues (not all)

Regards Andreas

— Reply to this email directly or view it on GitHub https://github.com/zabirauf/icsharp/issues/23.

awb99 commented 8 years ago

I am fine with whatever works...ScriptCs is not perfect.. But I would say has a fairly active commuity.. and works..

Facts are that under current mono the old scriptcs does no longer compile.

My fork now compiles the latest version of scriptcs with no errors;however I thinkI messed up the conversion to PowerArgs and the IScriptLibraryComposer.

My docker image correctly installs Jupyter and Mono, and builds icssharp, and installs the kernel.

I think such a docker kernel would greatly help anyone who runs C# in jupyter. Because just installing/compiling from scratch takes DAYS.

In Summer I have played around a little, inrunning icssharp; and so far it was runnign for 6 months fine; but now I had to setup again from scratch.. and found that with current mono it doesnotwork again...

Andreas.

awb99 commented 8 years ago

I have created a test project to see if roslyn engine in scriptcs works. In windows it does,in mono it does not.. i think it is just a simple directory path issue that is causing the issue...

It is really frustrating how difficult this things are in mono... Simple bugs made e loose lots of time..

awb99 commented 8 years ago

https://github.com/awb99/jupyter-icsharp-docker

Docker image. it is building evertyhing from scratch. I made all patches so it would work with most recent csscript version.

Only error is when executing the script an issue related to the missing signing of messages. I had solved this before; but the old trick seems to have changed.

awb99 commented 8 years ago

@minrk this jupyter c# docker image that made should really help people use the c# icsharp kernel in jupyter. What works: Fully automatic install and config of 1. python & jupyter, 2. mono , 3. compilation of icsharp, 4. install of icsharp kernel. What remains is a messaging bug between jupyter and icsharp (but this bug was sorted out in the past in this forum, so I am hopeful that it can be sorted out by someone here).

zabirauf commented 8 years ago

@awb99 Thanks a lot for creating the docker image. I am taking a look into the docker repo you created to understand it better. I will get back to you on it.

@denfromufa Regarding the discussion of roslyn vs mono, the good thing about using scriptcs is that it handles both of those script engines internally. So all we have to do to support the other engine is to initialize the correct Repl and it should hopefully work.

P.S: @awb99 Can you also describe what was the problem "With the latest version there are ambiguous namespace references."?

den-run-ai commented 8 years ago

@zabirauf scriptcs is using old version (at least latest release of scriptcs) of Roslyn which does not support dynamic, and Mono engine has other issues:

http://stackoverflow.com/questions/32471727/for-scriptcs-dynamic-is-not-supported-by-roslyn-and-available-only-with-mono

I use dynamic extensively to call into CPython using pythonnet from .NET:

https://github.com/pythonnet/pythonnet

So until scriptcs releases next version that works with dynamic - I have to resort to CSI REPL provided in VS 2015 Update 1. The problem with CSI REPL is that it only works for 32-bit DLLs:

https://github.com/dotnet/roslyn/issues/8853

So I'm stuck with 32-bit Python and .NET for using C# REPL.

I understand that a lot of users of icsharp work in *nix, hence my pains are not much relevant.

csells commented 8 years ago

I took a whack at using the current instructions at https://github.com/awb99/jupyter-icsharp-docker, but had no luck. After the docker run, I do a "open http://$(docker-machine ip default):8888" (from my Mac) and just get a ERR_CONNECTION_REFUSED. I'm able to get https://github.com/jupyter/docker-stacks to work, so the docker environment on my machine is working.

awb99 commented 8 years ago

@csells My mistake. I forgot to add the CMD to start jupyter when you run the docker image. I will add that in the next couple of days.