-
Notifications
You must be signed in to change notification settings - Fork 321
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
base: master
Are you sure you want to change the base?
Scala notebooks #46
Changes from 19 commits
e6002f5
efa2fdf
0ac2d8b
db2cf1d
ddabc16
bd19457
02303da
7dcac70
a9e5e2d
66602f1
aa4a08c
24bdca7
493e4e4
f4063b9
01f9682
f5a2693
57c90e5
541162d
f101840
8883d7b
2d6d6fe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
||
```bash | ||
export HOSTNAME=ec2-107-22-159-132.compute-1.amazonaws.com | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
|
||
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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.