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

Scala notebooks #46

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 19 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,65 @@ The python notebooks are written in [Jupyter](http://jupyter.org/).
5. Now we are able to view and edit the notebooks on the browser using the URL: http://localhost:8888/tree/mxnet-notebooks/python/outline.ipynb


### Scala

The scala notebooks are written in [Jupyter](http://jupyter.org/) using [Jupyter-Scala Kernel V0.3.x](https://github.com/alexarchambault/jupyter-scala).

- **Run** We can run and modify these notebooks if both [mxnet scala package](http://mxnet.io/get_started/index.html#setup-and-installation), [jupyter](http://jupyter.org/) and Jupyter-Scala Kernel are installed. There are various options for jupyter scala kernel. You can choose whichever you like.

If you have a AWS account, here is an easier way to run the notebooks:

1. Launch a g2.2xlarge or p2.2xlarge instance by using AMI `ami-fe217de9` on N. Virginia (us-east-1). This AMI is built by using [this script](https://gist.github.com/mli/b64322f446b2043e3350ddcbfa5957be). Remember to open the TCP port 8888 in the security group.

2. Once launch is succeed, setup the following variable with proper value
Copy link

Choose a reason for hiding this comment

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

  • Change "Once launch is succeed" to "Once the instance successfully launches"
  • Change variable to variables


```bash
export HOSTNAME=ec2-107-22-159-132.compute-1.amazonaws.com
Copy link

Choose a reason for hiding this comment

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

A user might simply copy/paste what you have here and realize it does not work.

  • Instead of a real host name, I'd suggest changing this to export HOSTNAME=
  • export PERM=

export PERM=~/Downloads/my.pem
```

3. Now we should be able to ssh to the machine by

```bash
chmod 400 $PERM
ssh -i $PERM -L 8888:localhost:8888 ubuntu@HOSTNAME
```

Here we forward the EC2 machine's 8888 port into localhost.
Copy link

Choose a reason for hiding this comment

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

Change to "Here we forward the EC2 machine's 8888 port to local port 8888"


4. Install [Maven](https://gist.github.com/sebsto/19b99f1fa1f32cae5d00). Install [Scala 2.11.8](https://www.scala-lang.org/files/archive/scala-2.11.8.rpm). Go to MXNet source code, compile scala-package by command `make scalapkg`. Compiled jar file will be created in `mxnet/scala-package/assembly/{your-architecture}/target` directory.
Copy link

Choose a reason for hiding this comment

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

Change "by command" to "by running command"


5. Install [coursier](https://github.com/coursier/coursier), a Scala library to fetch dependencies from Maven / Ivy repositories as follows.

On OS X, `brew install --HEAD paulp/extras/coursier`
On Linux,

```bash
curl -L -o coursier https://git.io/vgvpD && chmod +x coursier && ./coursier --help
```

Make sure coursier launcher is available in the PATH.

6. Install [Jupyter-Scala Kernel V0.3.x](https://github.com/alexarchambault/jupyter-scala) according to the instructions given below:
Copy link

Choose a reason for hiding this comment

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

change "according to" to "by following"


```bash
git clone https://github.com/alexarchambault/jupyter-scala.git
git checkout 0.3.x
./jupyter-scala
```

To check if scala-kernel is installed, type command `jupyter kernelspec list`.

7. Clone this repo on the EC2 machine and run jupyter

```bash
git clone https://github.com/dmlc/mxnet-notebooks
jupyter notebook
```

8. Now we are able to view and edit the notebooks on the browser using the URL: http://localhost:8888/tree/mxnet-notebooks/scala/. Choose scala211 kernel if asked. Include mxnet-scala jar created in step-4 in classpath by command `classpath.addPath("jar-path")` in the notebook you want to run.
Copy link

Choose a reason for hiding this comment

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

change "on the browser" to "from the browser"



## How to develop

Some general guidelines
Expand Down
Loading