Skip to content

Commit 619f97f

Browse files
committed
move credentials to an env file
1 parent 008752d commit 619f97f

4 files changed

Lines changed: 134 additions & 17 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
data/
2+
model/
3+
14
# Byte-compiled / optimized / DLL files
25
__pycache__/
36
*.py[cod]

prepare-data.ipynb

Lines changed: 84 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,77 @@
33
{
44
"cell_type": "code",
55
"execution_count": null,
6-
"metadata": {},
6+
"metadata": {
7+
"papermill": {
8+
"duration": 1.488152,
9+
"end_time": "2021-01-13T20:44:49.387618",
10+
"exception": false,
11+
"start_time": "2021-01-13T20:44:47.899466",
12+
"status": "completed"
13+
},
14+
"tags": []
15+
},
716
"outputs": [],
817
"source": [
9-
"!pip install ibm-cos-sdk"
18+
"!pip install ibm-cos-sdk python-dotenv"
1019
]
1120
},
1221
{
1322
"cell_type": "code",
1423
"execution_count": null,
15-
"metadata": {},
24+
"metadata": {
25+
"papermill": {
26+
"duration": 0.091494,
27+
"end_time": "2021-01-13T20:44:49.483776",
28+
"exception": false,
29+
"start_time": "2021-01-13T20:44:49.392282",
30+
"status": "completed"
31+
},
32+
"tags": []
33+
},
1634
"outputs": [],
1735
"source": [
1836
"import os\n",
1937
"import shutil\n",
2038
"import json\n",
2139
"import uuid\n",
2240
"\n",
23-
"import ibm_boto3"
41+
"import ibm_boto3\n",
42+
"\n",
43+
"from dotenv import load_dotenv"
2444
]
2545
},
2646
{
2747
"cell_type": "code",
2848
"execution_count": null,
29-
"metadata": {},
49+
"metadata": {
50+
"papermill": {
51+
"duration": 0.016471,
52+
"end_time": "2021-01-13T20:44:49.504840",
53+
"exception": false,
54+
"start_time": "2021-01-13T20:44:49.488369",
55+
"status": "completed"
56+
},
57+
"tags": []
58+
},
59+
"outputs": [],
60+
"source": [
61+
"load_dotenv()"
62+
]
63+
},
64+
{
65+
"cell_type": "code",
66+
"execution_count": null,
67+
"metadata": {
68+
"papermill": {
69+
"duration": 0.010609,
70+
"end_time": "2021-01-13T20:44:49.520260",
71+
"exception": false,
72+
"start_time": "2021-01-13T20:44:49.509651",
73+
"status": "completed"
74+
},
75+
"tags": []
76+
},
3077
"outputs": [],
3178
"source": [
3279
"bucket = os.getenv(\"BUCKET\", \"\")\n",
@@ -38,7 +85,16 @@
3885
{
3986
"cell_type": "code",
4087
"execution_count": null,
41-
"metadata": {},
88+
"metadata": {
89+
"papermill": {
90+
"duration": 0.864643,
91+
"end_time": "2021-01-13T20:44:50.389077",
92+
"exception": false,
93+
"start_time": "2021-01-13T20:44:49.524434",
94+
"status": "completed"
95+
},
96+
"tags": []
97+
},
4298
"outputs": [],
4399
"source": [
44100
"cos = ibm_boto3.resource(\"s3\",\n",
@@ -57,7 +113,16 @@
57113
{
58114
"cell_type": "code",
59115
"execution_count": null,
60-
"metadata": {},
116+
"metadata": {
117+
"papermill": {
118+
"duration": 14.03486,
119+
"end_time": "2021-01-13T20:45:04.430418",
120+
"exception": false,
121+
"start_time": "2021-01-13T20:44:50.395558",
122+
"status": "completed"
123+
},
124+
"tags": []
125+
},
61126
"outputs": [],
62127
"source": [
63128
"data_dir = \"data\"\n",
@@ -101,6 +166,18 @@
101166
"nbconvert_exporter": "python",
102167
"pygments_lexer": "ipython3",
103168
"version": "3.7.9"
169+
},
170+
"papermill": {
171+
"default_parameters": {},
172+
"duration": 17.417327,
173+
"end_time": "2021-01-13T20:45:04.652484",
174+
"environment_variables": {},
175+
"exception": null,
176+
"input_path": "/Users/niko/Documents/code/elyra-classification/prepare-data.ipynb",
177+
"output_path": "/Users/niko/Documents/code/elyra-classification/prepare-data.ipynb",
178+
"parameters": {},
179+
"start_time": "2021-01-13T20:44:47.235157",
180+
"version": "2.2.2"
104181
}
105182
},
106183
"nbformat": 4,

train.ipynb

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,16 @@
33
{
44
"cell_type": "code",
55
"execution_count": null,
6-
"metadata": {},
6+
"metadata": {
7+
"papermill": {
8+
"duration": 1.167889,
9+
"end_time": "2021-01-13T20:45:06.435383",
10+
"exception": false,
11+
"start_time": "2021-01-13T20:45:05.267494",
12+
"status": "completed"
13+
},
14+
"tags": []
15+
},
716
"outputs": [],
817
"source": [
918
"!pip install \"tensorflow~=2.0\" \"tensorflow-hub[make_image_classifier]~=0.6\""
@@ -12,7 +21,16 @@
1221
{
1322
"cell_type": "code",
1423
"execution_count": null,
15-
"metadata": {},
24+
"metadata": {
25+
"papermill": {
26+
"duration": 22.252066,
27+
"end_time": "2021-01-13T20:45:28.691929",
28+
"exception": false,
29+
"start_time": "2021-01-13T20:45:06.439863",
30+
"status": "completed"
31+
},
32+
"tags": []
33+
},
1634
"outputs": [],
1735
"source": [
1836
"!make_image_classifier \\\n",
@@ -36,7 +54,16 @@
3654
{
3755
"cell_type": "code",
3856
"execution_count": null,
39-
"metadata": {},
57+
"metadata": {
58+
"papermill": {
59+
"duration": 0.133484,
60+
"end_time": "2021-01-13T20:45:28.835616",
61+
"exception": false,
62+
"start_time": "2021-01-13T20:45:28.702132",
63+
"status": "completed"
64+
},
65+
"tags": []
66+
},
4067
"outputs": [],
4168
"source": [
4269
"!mv labels.txt model"
@@ -60,8 +87,20 @@
6087
"nbconvert_exporter": "python",
6188
"pygments_lexer": "ipython3",
6289
"version": "3.7.9"
90+
},
91+
"papermill": {
92+
"default_parameters": {},
93+
"duration": 24.388299,
94+
"end_time": "2021-01-13T20:45:29.055848",
95+
"environment_variables": {},
96+
"exception": null,
97+
"input_path": "/Users/niko/Documents/code/elyra-classification/train.ipynb",
98+
"output_path": "/Users/niko/Documents/code/elyra-classification/train.ipynb",
99+
"parameters": {},
100+
"start_time": "2021-01-13T20:45:04.667549",
101+
"version": "2.2.2"
63102
}
64103
},
65104
"nbformat": 4,
66105
"nbformat_minor": 4
67-
}
106+
}

train.pipeline

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,15 @@
1515
"app_data": {
1616
"filename": "prepare-data.ipynb",
1717
"runtime_image": "tensorflow/tensorflow:2.3.0",
18-
"env_vars": [
19-
"BUCKET=",
20-
"ACCESS_KEY_ID=",
21-
"SECRET_ACCESS_KEY=",
22-
"ENDPOINT_URL="
23-
],
18+
"env_vars": [],
2419
"include_subdirectories": false,
2520
"outputs": [
2621
"data"
2722
],
2823
"invalidNodeError": null,
24+
"dependencies": [
25+
".env"
26+
],
2927
"ui_data": {
3028
"label": "prepare-data.ipynb",
3129
"image": "data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20viewBox%3D%220%200%2022%2022%22%3E%0A%20%20%3Cg%20class%3D%22jp-icon-warn0%20jp-icon-selectable%22%20fill%3D%22%23EF6C00%22%3E%0A%20%20%20%20%3Cpath%20d%3D%22M18.7%203.3v15.4H3.3V3.3h15.4m1.5-1.5H1.8v18.3h18.3l.1-18.3z%22%2F%3E%0A%20%20%20%20%3Cpath%20d%3D%22M16.5%2016.5l-5.4-4.3-5.6%204.3v-11h11z%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E%0A",

0 commit comments

Comments
 (0)