You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A Machine Learning toolbox based on Docker and IPython Notebook.
10
+
BMO, pronounced Beemo, is a Machine Learning toolbox based on Docker and IPython Notebook. It's extensible with any tool or package you need beacuse it's like having a mini-Linux inside your Linux!
11
11
12
12
Content
13
13
-------
@@ -17,7 +17,14 @@ Content
17
17
2.[nsenter](#12-nsenter)
18
18
3.[BMO](#13-bmo)
19
19
2.[Usage](#2-usage)
20
-
3.[List of Python main packages](#3-list-of-python-main-packages)
3.[List of the installed Python main packages](#3-list-of-the-installed-python-main-packages)
21
28
4.[License and more](#4-license-and-more)
22
29
23
30
1. Installation
@@ -28,7 +35,7 @@ Content
28
35
*[Docker](https://www.docker.com/)
29
36
*[nsenter](https://github.com/jpetazzo/nsenter) and the `docker-enter` utility
30
37
31
-
Being `BMO` based on `Docker`, and the last one can be installed only on `Linux/x64`, `BMO` is restricted to the same platform. This guide only covers the complete `BMO`installation on `Ubuntu 14.04 (Trusty Tahr)`, but excpet for the `Docker` installation step, you can use this guide with any Linux distribution. So, let's start! But before, you need to download `BMO`. For that open a terminal and execute these commands:
38
+
`BMO`is based on `Docker`, and the last one can be installed only on `Linux/x64`, so, `BMO` is restricted to the same platforms. This guide only covers the complete `BMO`installation on `Ubuntu 14.04 (Trusty Tahr)`, but excpet for the `Docker` installation step, you can use this guide with any Linux distribution. So, let's start! But before, you need to download `BMO`. For that open a terminal and execute these commands:
If you are not using `Ubuntu 14.04 (Trusty Tahr)` you can visit the [`Docker` installation page](https://docs.docker.com/installation/) for an extensive documentation.
42
49
43
-
**Important**: after installing `Docker` you need to be sure that it can run without the use of `sudo`.
50
+
**Important**: after installing `Docker` you need to be sure that it can run without the use of `sudo`. If you are using `Ubuntu 14.04 (Trusty Tahr)`, this guide will show you how to do it.
44
51
45
52
In the case you are under `Ubuntu 14.04 (Trusty Tahr)` you can follow the next instructions.
46
53
@@ -75,16 +82,16 @@ $ sudo service docker restart
75
82
76
83
Loogout and log back in and check the version of `Docker` again:
77
84
```
78
-
$ sudo docker version
85
+
$ docker version
79
86
```
80
87
81
-
If you get the same output as before and nothing talking about permissions you have `Docker` installed. Congratulations!
88
+
If you get the same output as before and nothing talking about permissions you have `Docker` installed correctly. Congratulations!
82
89
83
90
### 1.2. nsenter
84
91
85
-
`nsenter` is needed for get a prompt of the `BMO docker image` when this is running (as a `container`) without using `ssh`. You can read [here](http://jpetazzo.github.io/2014/06/23/docker-ssh-considered-evil/) why you shouldn't use `ssh`in a `Docker container`.
92
+
`nsenter` is needed for get a prompt of the `BMO Docker image` when this is running without using `ssh`. You can read [here](http://jpetazzo.github.io/2014/06/23/docker-ssh-considered-evil/) why you shouldn't use `ssh`with `Docker`.
86
93
87
-
For install `nsenter` you can visit [this repo](https://github.com/jpetazzo/nsenter) and follow the instructions detailed there **or** you can trust me and copy a compiled version that I provide in the `nsenter` folder:
94
+
For install `nsenter` you can visit [this repo](https://github.com/jpetazzo/nsenter) and follow the instructions detailed there **or** you can copy a compiled version that is provided in the `nsenter` folder:
You really don't need to install anything, but you need to download or build the `BMO Docker image`. There are no difference for use `BMO` between download or build the image. But if you are a `Docker` user and you want to modify the image, you need to build it. In the other case, it's is preferable to download the image because it's faster, a lot.
103
+
You really don't need to install anything, but you need to download or build the `BMO Docker image`. There are no difference between download or build the `image`. But if you are a `Docker` user and you want to modify the image, you need to build it. In the other case, it's is preferable to download the image because it's faster, a lot.
104
+
105
+
So, to download:
97
106
```
98
107
./bmo -i
99
108
```
100
109
110
+
Or, if you decide to build it:
111
+
```
112
+
./bmo -ib
113
+
```
114
+
101
115
Wait, and that's all. You are finished with the installation.
102
116
103
117
2. Usage
104
118
--------
105
119
106
-
**Working on this section**
120
+
### 2.1. Initial considerations
121
+
122
+
Before start explaining how to use `BMO`, it would be nice to _briefly_ know how `Docker` works. `Docker` takes an `image`, something like in a virtual machine, and boots a `Linux` in your running `Linux`, something like a virutal machine. So, what is the difference? It's a little bit complicated, but you can read about what `Docker` is [here](https://docs.docker.com/introduction/understanding-docker/). The point here is that you will have much better performance that in virtual machine, in most cases, the same as if you run your sofware from your native machine, and this is very important when you are dealing with `Machine Learning`.
123
+
124
+
In summary, the main thing about `Docker` is that you have `images` and `containers`. A `container` is a running instance of an `image`, so you can have multiple `containers` from the same `image`. And what happens when you install some software or you create some files in a `container`? You can lose them if you remove the `container`, but you only need to commit the changes to an `image`, kind of _super easy_.
125
+
126
+
You may now be thinking that using `BMO`, having `Docker` in the middle, can be very difficult. But don't worry, for that, a `Python` script is provided, called `bmo`, something like a very basic `command line utility` for make your life easier. But if you are `Docker` pro-user you can take a look to the `Dockerfile` and the `bmo` script to understand everything. Also, for the last ones, at the end of the `bmo` script you have the full list of `Docker commands` that the script uses.
127
+
128
+
**Important**: if you aren't a `Docker` pro-user, you must know that if you use `Docker` without use the `bmo` script, a proper behaviour is not totally guaranteed.
129
+
130
+
Let's see the main use cases. If you need some more help, you can run:
131
+
```
132
+
./bmo --help
133
+
```
134
+
or you can become a `Docker` pro-user reading [this guide](https://docs.docker.com/userguide/). You will thank yourself for reading it, beacause `Docker` is prety awesome. Also, in that help, it's never mentioned the word `container`, it's used the concept `Docker image`, for try to abstract the logic behind `Docker`.
135
+
136
+
### 2.2. Start
137
+
I
138
+
For start using the `IPython Notebook` that `BMO` provides, you only need to execute the next command:
139
+
```
140
+
./bmo -s
141
+
```
142
+
143
+
The output that you are seeing is a `Docker` output. The `bmo` script always shows them, so you can look for help if any error ocurrs.
144
+
145
+
After that, open your Internet browser and visit:
146
+
```
147
+
http://localhost:8888/
148
+
```
149
+
150
+
Now you are in the IPython Notebook environment. You can visit [this link](http://ipython.org/notebook.html) for get more information about this awesome tool.
151
+
152
+
The directory that you are seeing in your browser it's the `notebooks` folder inside the root of the `BMO Docker container`. This directory corresponds to the `notebooks` folder that is inside the current directory in your terminal. That folder will contain your notebooks.
153
+
154
+
**Important**: `Docker` have a little problem with the files that it creates outside the `container`. The owner of these files is `root`. For change that, you can run the next command everytime you need:
155
+
```
156
+
./bmo -o
157
+
```
158
+
159
+
### 2.3. Finish
160
+
161
+
If you have finished your work with the `IPython Notebook` server for this sesion, you can finish the `BMO Docker container` with:
162
+
```
163
+
./bmo -f
164
+
```
165
+
166
+
This will finish the `container` and remove its reference from `Docker`.
167
+
168
+
If you want to finish the `container` without remove its reference, for example, for [save changes](#26-commit), you can execute:
169
+
```
170
+
./bmo -fo
171
+
```
172
+
173
+
After doing whatever you need, execute the next command for remove the `Docker` reference:
174
+
```
175
+
./bmo -rm
176
+
```
177
+
178
+
Also, after that, it's the perfect time for change the owner of the notebooks with:
179
+
```
180
+
./bmo -o
181
+
```
182
+
as we saw in the previous section.
183
+
184
+
**Important**: remember that for start the `BMO Docker container` again you need that its `Docker`reference is deleted.
185
+
186
+
### 2.4. Kill
187
+
188
+
Please, execute a `kill` command only when the `BMO Docker container` doesn't respond or became frozen, it's your last resort. For kill it, you can execute:
189
+
```
190
+
./bmo -k
191
+
```
192
+
193
+
As the `finish` command, the `kill` one also can be executed without remove the `BMO Docker container` reference:
194
+
```
195
+
./bmo -ko
196
+
```
197
+
198
+
Take a look to the [previous section](#23-finish) for see how to deal with the `Docker` reference after kill the `conainter` without remove it.
199
+
200
+
### 2.5. Enter
201
+
202
+
If you need some `Python` package, or a `Linux` one, that isn't installed on the `BMO Docker image` you can install them wiht `pip` or `apt-get`. For that, if the `BMO Docker containter` is running, you can execute:
203
+
```
204
+
./bmo -e
205
+
```
206
+
207
+
You will see a `prompt`. Now your are inside the `container` logged as `root`. Install everything you need and type:
208
+
```
209
+
exit
210
+
```
211
+
212
+
to return to your machine `prompt`.
213
+
214
+
**Important**: If you want your changes to be permanent, you need to perform a `commit`.
215
+
216
+
### 2.6. Commit
217
+
218
+
If you have made some changes to the `container` that you would like to be permanent you need to `commit` the current `BMO Docker container`. For that you need that the `container` is running or finished, never killed (bad practice) or removed. After check that, execute:
219
+
```
220
+
./bmo -c
221
+
```
222
+
223
+
And your `container` will be saved in the `BMO Docker image`.
224
+
225
+
### 2.7. Status
226
+
227
+
Sometimes you will want to know the state of the `BMO Docker container`. For that, you can use:
228
+
```
229
+
./bmo -st
230
+
```
231
+
232
+
The possible status of `BMO` are:
233
+
* running
234
+
* finished: you need to remove the `container` for start `BMO` again
235
+
* killed: you need to remove the `container` for start `BMO` again
236
+
* non-existent: there isn't any `container` attached to `Docker`, so you can start a new one
107
237
108
-
3. List of Python main packages
109
-
-------------------------------
238
+
3. List of the installed Python main packages
239
+
---------------------------------------------
110
240
111
-
Once the `BMO Docker image` has been downloaded or builded, a bunch of Python packages will be installed in the image. Here is a list of the main ones:
241
+
Once the `BMO Docker image` has been downloaded or builded, a bunch of Python packages will be installed in the `image`. Here is a list of the main ones:
112
242
* beautifulsoup4
113
243
* gensim
114
244
* ipython[notebook]
@@ -132,4 +262,5 @@ Once the `BMO Docker image` has been downloaded or builded, a bunch of Python pa
132
262
-------------------
133
263
134
264
* This project is released under the `MIT License`.
135
-
* The `BMO` name and its logo are property [Cartoon Network](http://www.cartoonnetwork.com/). The logo has been taken from the [Adventure Time wiki](http://adventuretime.wikia.com/) on [Wikia](http://www.wikia.com/).
265
+
* The `BMO` name and its logo are property of [Cartoon Network](http://www.cartoonnetwork.com/). The logo has been taken from the [Adventure Time wiki](http://adventuretime.wikia.com/) on [Wikia](http://www.wikia.com/).
266
+
* This is a project that will always be growing, and of course, you can contribute.
0 commit comments