Skip to content

Commit 5e9612e

Browse files
committed
Added travis config for CI/CD.
1 parent d311aae commit 5e9612e

File tree

3 files changed

+120
-59
lines changed

3 files changed

+120
-59
lines changed

.travis.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
# limitations under the License.
1515
#
1616

17-
dist: bionic
1817
language: python
19-
services:
20-
- docker
18+
python:
19+
- "3.8"
20+
- "3.9"
21+
- "3.9-dev" # 3.9 development branch
22+
- "nightly" # nightly build
2123

22-
#before_install:
23-
# - ./scripts/travis.sh
24+
install:
25+
- pip install -r requirements.txt
2426

25-
#install:
26-
# - pyenv global 3.8.1
27-
# - pip install --upgrade pip
28-
# - pip install .
27+
script:
28+
- pytest

README.md

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,35 @@ pip install --upgrade pip
3232
pip install .
3333
```
3434

35-
### Try a first example
35+
### Example notebooks
3636

37-
**TODO:** Add instructions for running the notebooks in the `notebooks` directory.
37+
You can find a selection of examples in [notebooks](./notebooks). As a first example, we recommend the [Sample Pipeline](./notebooks/sample_pipeline.ipynb
38+
39+
**Running locally**
40+
41+
To run the example pipelines, you will need the following requirements:
42+
- Jupyter Jupyter
43+
- Ray
44+
- sklearn
45+
- pandas
46+
- pytest
47+
- numpy
48+
- pickle51
49+
- graphviz
50+
51+
They can be installed with:
52+
53+
If you use pip, you can install it with:
54+
```shell
55+
pip install -r requirements.txt
56+
```
57+
58+
Run the sample pipeline with:
59+
```shell
60+
jupyter-lab sample_pipeline.ipynb
61+
```
62+
63+
The pipeline will use `ray.init()` to start a local Ray cluster. See [configuring Ray](https://docs.ray.io/en/master/configure.html) to ensure you are able to run a Ray cluster locally.
3864

3965
## Contributing
4066

notebooks/Sample Pipeline.ipynb renamed to notebooks/sample_pipeline.ipynb

Lines changed: 83 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@
1212
},
1313
{
1414
"cell_type": "code",
15-
"execution_count": 1,
15+
"execution_count": 2,
1616
"id": "simplified-summit",
1717
"metadata": {},
1818
"outputs": [
1919
{
20-
"output_type": "execute_result",
2120
"data": {
2221
"text/plain": [
2322
"Gender object\n",
@@ -35,8 +34,9 @@
3534
"dtype: object"
3635
]
3736
},
37+
"execution_count": 2,
3838
"metadata": {},
39-
"execution_count": 1
39+
"output_type": "execute_result"
4040
}
4141
],
4242
"source": [
@@ -49,19 +49,19 @@
4949
},
5050
{
5151
"cell_type": "code",
52-
"execution_count": 2,
52+
"execution_count": 3,
5353
"id": "configured-clinton",
5454
"metadata": {},
5555
"outputs": [
5656
{
57-
"output_type": "execute_result",
5857
"data": {
5958
"text/plain": [
6059
"(614, 12)"
6160
]
6261
},
62+
"execution_count": 3,
6363
"metadata": {},
64-
"execution_count": 2
64+
"output_type": "execute_result"
6565
}
6666
],
6767
"source": [
@@ -130,10 +130,10 @@
130130
"metadata": {},
131131
"outputs": [
132132
{
133-
"output_type": "stream",
134133
"name": "stdout",
134+
"output_type": "stream",
135135
"text": [
136-
"Time taken: 0.014804840087890625\n"
136+
"Time taken: 0.010515928268432617\n"
137137
]
138138
}
139139
],
@@ -230,14 +230,14 @@
230230
"metadata": {},
231231
"outputs": [
232232
{
233-
"output_type": "execute_result",
234233
"data": {
235234
"text/plain": [
236235
"KNeighborsClassifier(n_neighbors=3)"
237236
]
238237
},
238+
"execution_count": 12,
239239
"metadata": {},
240-
"execution_count": 12
240+
"output_type": "execute_result"
241241
}
242242
],
243243
"source": [
@@ -274,14 +274,14 @@
274274
"metadata": {},
275275
"outputs": [
276276
{
277-
"output_type": "execute_result",
278277
"data": {
279278
"text/plain": [
280279
"True"
281280
]
282281
},
282+
"execution_count": 15,
283283
"metadata": {},
284-
"execution_count": 15
284+
"output_type": "execute_result"
285285
}
286286
],
287287
"source": [
@@ -295,14 +295,14 @@
295295
"metadata": {},
296296
"outputs": [
297297
{
298-
"output_type": "execute_result",
299298
"data": {
300299
"text/plain": [
301300
"ScaleTestEstimator(classifier=DecisionTreeClassifier(), num_iters=50)"
302301
]
303302
},
303+
"execution_count": 16,
304304
"metadata": {},
305-
"execution_count": 16
305+
"output_type": "execute_result"
306306
}
307307
],
308308
"source": [
@@ -332,10 +332,10 @@
332332
"metadata": {},
333333
"outputs": [
334334
{
335-
"output_type": "stream",
336335
"name": "stdout",
336+
"output_type": "stream",
337337
"text": [
338-
"time taken: 9.157356023788452\n"
338+
"time taken: 9.11965799331665\n"
339339
]
340340
}
341341
],
@@ -369,11 +369,11 @@
369369
{
370370
"data": {
371371
"text/plain": [
372-
"array([0.18937852, 0.11576017, 0.15804519, 0.0422178 , 0.29690848,\n",
373-
" 0. , 0.01586572, 0.0056865 , 0.01781055, 0.00389469,\n",
374-
" 0. , 0.02261156, 0.03051274, 0.00307078, 0.00307078,\n",
375-
" 0.00690926, 0.01138089, 0.00499624, 0.02322422, 0.00829843,\n",
376-
" 0.01728413, 0.01025423, 0.01281911, 0. ])"
372+
"array([0.25963757, 0.12413346, 0.15603435, 0.02163518, 0.26895302,\n",
373+
" 0.02420672, 0. , 0.00735991, 0.01356057, 0.02023574,\n",
374+
" 0. , 0.016999 , 0.00676174, 0.00954828, 0.00981587,\n",
375+
" 0. , 0.01254879, 0.00851478, 0.01445153, 0. ,\n",
376+
" 0. , 0.00044522, 0.01758959, 0.00756869])"
377377
]
378378
},
379379
"execution_count": 18,
@@ -387,33 +387,47 @@
387387
},
388388
{
389389
"cell_type": "code",
390-
"execution_count": 18,
390+
"execution_count": 19,
391391
"id": "coordinate-gossip",
392392
"metadata": {},
393-
"outputs": [
394-
{
395-
"output_type": "error",
396-
"ename": "ModuleNotFoundError",
397-
"evalue": "No module named 'ray'",
398-
"traceback": [
399-
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
400-
"\u001b[0;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)",
401-
"\u001b[0;32m<ipython-input-18-b94c8db5a623>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0;32mimport\u001b[0m \u001b[0mray\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2\u001b[0m \u001b[0mray\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mshutdown\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
402-
"\u001b[0;31mModuleNotFoundError\u001b[0m: No module named 'ray'"
403-
]
404-
}
405-
],
393+
"outputs": [],
406394
"source": [
407395
"import ray\n",
408396
"ray.shutdown()"
409397
]
410398
},
411399
{
412400
"cell_type": "code",
413-
"execution_count": null,
401+
"execution_count": 20,
414402
"id": "bfe20bd8",
415403
"metadata": {},
416-
"outputs": [],
404+
"outputs": [
405+
{
406+
"name": "stderr",
407+
"output_type": "stream",
408+
"text": [
409+
"2021-06-12 19:04:59,104\tINFO services.py:1267 -- View the Ray dashboard at \u001b[1m\u001b[32mhttp://127.0.0.1:8265\u001b[39m\u001b[22m\n"
410+
]
411+
},
412+
{
413+
"data": {
414+
"text/plain": [
415+
"{'node_ip_address': '192.168.86.160',\n",
416+
" 'raylet_ip_address': '192.168.86.160',\n",
417+
" 'redis_address': '192.168.86.160:6379',\n",
418+
" 'object_store_address': '/tmp/ray/session_2021-06-12_19-04-57_727692_23228/sockets/plasma_store',\n",
419+
" 'raylet_socket_name': '/tmp/ray/session_2021-06-12_19-04-57_727692_23228/sockets/raylet',\n",
420+
" 'webui_url': '127.0.0.1:8265',\n",
421+
" 'session_dir': '/tmp/ray/session_2021-06-12_19-04-57_727692_23228',\n",
422+
" 'metrics_export_port': 57599,\n",
423+
" 'node_id': '2942ae78a25dfdfabdde6aee3dd586a83644c3b3c51615cc864d7c93'}"
424+
]
425+
},
426+
"execution_count": 20,
427+
"metadata": {},
428+
"output_type": "execute_result"
429+
}
430+
],
417431
"source": [
418432
"ray.init()"
419433
]
@@ -506,7 +520,7 @@
506520
"name": "stdout",
507521
"output_type": "stream",
508522
"text": [
509-
"Time taken: 9.811173915863037\n"
523+
"Time taken: 7.180877923965454\n"
510524
]
511525
}
512526
],
@@ -532,7 +546,7 @@
532546
{
533547
"data": {
534548
"text/plain": [
535-
"[<codeflare.pipelines.Datamodel.XYRef at 0x7f95d8b9f550>]"
549+
"[<codeflare.pipelines.Datamodel.XYRef at 0x186fe9c10>]"
536550
]
537551
},
538552
"execution_count": 29,
@@ -564,8 +578,28 @@
564578
"name": "stdout",
565579
"output_type": "stream",
566580
"text": [
567-
"preprocess=\r\n",
568-
"c_a=preprocess \r\n",
581+
"preprocess{'n_jobs': None, 'remainder': 'drop', 'sparse_threshold': 0.3, 'transformer_weights': None, 'transformers': [('num', Pipeline(steps=[('imputer', SimpleImputer(strategy='median')),\n",
582+
" ('scaler', StandardScaler())]), Index(['ApplicantIncome', 'CoapplicantIncome', 'LoanAmount',\n",
583+
" 'Loan_Amount_Term', 'Credit_History'],\n",
584+
" dtype='object')), ('cat', Pipeline(steps=[('imputer',\n",
585+
" SimpleImputer(fill_value='missing', strategy='constant')),\n",
586+
" ('onehot', OneHotEncoder(handle_unknown='ignore'))]), Index(['Gender', 'Married', 'Dependents', 'Education', 'Self_Employed',\n",
587+
" 'Property_Area'],\n",
588+
" dtype='object'))], 'verbose': False, 'num': Pipeline(steps=[('imputer', SimpleImputer(strategy='median')),\n",
589+
" ('scaler', StandardScaler())]), 'cat': Pipeline(steps=[('imputer',\n",
590+
" SimpleImputer(fill_value='missing', strategy='constant')),\n",
591+
" ('onehot', OneHotEncoder(handle_unknown='ignore'))]), 'num__memory': None, 'num__steps': [('imputer', SimpleImputer(strategy='median')), ('scaler', StandardScaler())], 'num__verbose': False, 'num__imputer': SimpleImputer(strategy='median'), 'num__scaler': StandardScaler(), 'num__imputer__add_indicator': False, 'num__imputer__copy': True, 'num__imputer__fill_value': None, 'num__imputer__missing_values': nan, 'num__imputer__strategy': 'median', 'num__imputer__verbose': 0, 'num__scaler__copy': True, 'num__scaler__with_mean': True, 'num__scaler__with_std': True, 'cat__memory': None, 'cat__steps': [('imputer', SimpleImputer(fill_value='missing', strategy='constant')), ('onehot', OneHotEncoder(handle_unknown='ignore'))], 'cat__verbose': False, 'cat__imputer': SimpleImputer(fill_value='missing', strategy='constant'), 'cat__onehot': OneHotEncoder(handle_unknown='ignore'), 'cat__imputer__add_indicator': False, 'cat__imputer__copy': True, 'cat__imputer__fill_value': 'missing', 'cat__imputer__missing_values': nan, 'cat__imputer__strategy': 'constant', 'cat__imputer__verbose': 0, 'cat__onehot__categories': 'auto', 'cat__onehot__drop': None, 'cat__onehot__dtype': <class 'numpy.float64'>, 'cat__onehot__handle_unknown': 'ignore', 'cat__onehot__sparse': True}=\n",
592+
"c_a{'classifier__ccp_alpha': 0.0, 'classifier__class_weight': None, 'classifier__criterion': 'gini', 'classifier__max_depth': None, 'classifier__max_features': None, 'classifier__max_leaf_nodes': None, 'classifier__min_impurity_decrease': 0.0, 'classifier__min_impurity_split': None, 'classifier__min_samples_leaf': 1, 'classifier__min_samples_split': 2, 'classifier__min_weight_fraction_leaf': 0.0, 'classifier__random_state': None, 'classifier__splitter': 'best', 'classifier': DecisionTreeClassifier(), 'num_iters': 50}=preprocess{'n_jobs': None, 'remainder': 'drop', 'sparse_threshold': 0.3, 'transformer_weights': None, 'transformers': [('num', Pipeline(steps=[('imputer', SimpleImputer(strategy='median')),\n",
593+
" ('scaler', StandardScaler())]), Index(['ApplicantIncome', 'CoapplicantIncome', 'LoanAmount',\n",
594+
" 'Loan_Amount_Term', 'Credit_History'],\n",
595+
" dtype='object')), ('cat', Pipeline(steps=[('imputer',\n",
596+
" SimpleImputer(fill_value='missing', strategy='constant')),\n",
597+
" ('onehot', OneHotEncoder(handle_unknown='ignore'))]), Index(['Gender', 'Married', 'Dependents', 'Education', 'Self_Employed',\n",
598+
" 'Property_Area'],\n",
599+
" dtype='object'))], 'verbose': False, 'num': Pipeline(steps=[('imputer', SimpleImputer(strategy='median')),\n",
600+
" ('scaler', StandardScaler())]), 'cat': Pipeline(steps=[('imputer',\n",
601+
" SimpleImputer(fill_value='missing', strategy='constant')),\n",
602+
" ('onehot', OneHotEncoder(handle_unknown='ignore'))]), 'num__memory': None, 'num__steps': [('imputer', SimpleImputer(strategy='median')), ('scaler', StandardScaler())], 'num__verbose': False, 'num__imputer': SimpleImputer(strategy='median'), 'num__scaler': StandardScaler(), 'num__imputer__add_indicator': False, 'num__imputer__copy': True, 'num__imputer__fill_value': None, 'num__imputer__missing_values': nan, 'num__imputer__strategy': 'median', 'num__imputer__verbose': 0, 'num__scaler__copy': True, 'num__scaler__with_mean': True, 'num__scaler__with_std': True, 'cat__memory': None, 'cat__steps': [('imputer', SimpleImputer(fill_value='missing', strategy='constant')), ('onehot', OneHotEncoder(handle_unknown='ignore'))], 'cat__verbose': False, 'cat__imputer': SimpleImputer(fill_value='missing', strategy='constant'), 'cat__onehot': OneHotEncoder(handle_unknown='ignore'), 'cat__imputer__add_indicator': False, 'cat__imputer__copy': True, 'cat__imputer__fill_value': 'missing', 'cat__imputer__missing_values': nan, 'cat__imputer__strategy': 'constant', 'cat__imputer__verbose': 0, 'cat__onehot__categories': 'auto', 'cat__onehot__drop': None, 'cat__onehot__dtype': <class 'numpy.float64'>, 'cat__onehot__handle_unknown': 'ignore', 'cat__onehot__sparse': True} \n",
569603
"\n"
570604
]
571605
}
@@ -584,9 +618,13 @@
584618
}
585619
],
586620
"metadata": {
621+
"interpreter": {
622+
"hash": "aee8b7b246df8f9039afb4144a1f6fd8d2ca17a180786b69acc140d282b71a49"
623+
},
587624
"kernelspec": {
588-
"name": "python3",
589-
"display_name": "Python 3.9.2 64-bit"
625+
"display_name": "Python 3",
626+
"language": "python",
627+
"name": "python3"
590628
},
591629
"language_info": {
592630
"codemirror_mode": {
@@ -598,12 +636,9 @@
598636
"name": "python",
599637
"nbconvert_exporter": "python",
600638
"pygments_lexer": "ipython3",
601-
"version": "3.9.2"
602-
},
603-
"interpreter": {
604-
"hash": "aee8b7b246df8f9039afb4144a1f6fd8d2ca17a180786b69acc140d282b71a49"
639+
"version": "3.8.6"
605640
}
606641
},
607642
"nbformat": 4,
608643
"nbformat_minor": 5
609-
}
644+
}

0 commit comments

Comments
 (0)