Skip to content

Commit 0c019a8

Browse files
authored
Merge pull request #377 from hama1080/fix_data_loading
データ読み込み処理の修正
2 parents afef260 + cc4bf94 commit 0c019a8

File tree

5 files changed

+34
-21
lines changed

5 files changed

+34
-21
lines changed

cli/kamonohashi/cli/data_set.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,8 @@ def list_path_pairs(id):
188188
api = rest.DataSetApi(configuration.get_api_client())
189189
result = api.list_dataset_pathpairs(id)
190190
for x in result:
191-
print(x.data_path + " " + x.stored_path)
191+
print(repr(x.data_path)[1:-1])
192+
print(repr(x.stored_path)[1:-1])
192193

193194
@data_set.command('list-data-types')
194195
def list_data_types():

web-api/platypus/platypus/Migrations/20200615001935_v2.1.0.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,19 @@ protected override void Up(MigrationBuilder migrationBuilder)
3535
name: "LocalDataSet",
3636
table: "TrainingHistories",
3737
nullable: false,
38-
defaultValue: false);
38+
defaultValue: true);
3939

4040
migrationBuilder.AddColumn<bool>(
4141
name: "LocalDataSet",
4242
table: "NotebookHistories",
4343
nullable: false,
44-
defaultValue: false);
44+
defaultValue: true);
4545

4646
migrationBuilder.AddColumn<bool>(
4747
name: "LocalDataSet",
4848
table: "InferenceHistories",
4949
nullable: false,
50-
defaultValue: false);
50+
defaultValue: true);
5151
}
5252

5353
protected override void Down(MigrationBuilder migrationBuilder)

web-api/platypus/platypus/ServiceModels/KubernetesModels/Templates/ConfigMap/inference_scripts.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,17 @@ data:
1717
fi
1818
1919
# default: create symlink to raw-data, $LOCAL_DATASET = True : copy raw-data to local
20-
prepare_cmd='ln -s "/kqi/raw/${stored_path}" "/kqi/input/${file_path}"'
20+
prepare_cmd='ln -s "/kqi/raw/${stored_path}" "/kqi/input/${file_path_c_quote}"'
2121
if [ $LOCAL_DATASET = "True" ]; then
22-
prepare_cmd='cp "/kqi/raw/${stored_path}" "/kqi/input/${file_path}"'
22+
prepare_cmd='cp "/kqi/raw/${stored_path}" "/kqi/input/${file_path_c_quote}"'
2323
fi
24-
while read file_path stored_path
24+
while true
2525
do
26-
mkdir -p "/kqi/input/$(dirname ${file_path})" && eval ${prepare_cmd}
26+
read -r file_path
27+
read -r stored_path
28+
if [ -z "$stored_path" ] ; then break; fi
29+
printf -v file_path_c_quote %b "$file_path"
30+
mkdir -p /kqi/input/$(dirname "${file_path}") && eval ${prepare_cmd}
2731
if [ $? -ne 0 ]; then
2832
echo "create dataset failed"
2933
kqi inference halt $TRAINING_ID

web-api/platypus/platypus/ServiceModels/KubernetesModels/Templates/ConfigMap/notebook_scripts.yaml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,21 @@ data:
1919
echo "dataset get failed"
2020
fi
2121
# default: create symlink to raw-data, $LOCAL_DATASET = True : copy raw-data to local
22-
prepare_cmd='ln -s "/kqi/raw/${stored_path}" "/kqi/input/${file_path}"'
22+
prepare_cmd='ln -s "/kqi/raw/${stored_path}" "/kqi/input/${file_path_c_quote}"'
2323
if [ $LOCAL_DATASET = "True" ]; then
24-
prepare_cmd='cp "/kqi/raw/${stored_path}" "/kqi/input/${file_path}"'
24+
prepare_cmd='cp "/kqi/raw/${stored_path}" "/kqi/input/${file_path_c_quote}"'
2525
fi
26-
while read file_path stored_path
26+
while true
2727
do
28-
mkdir -p "/kqi/input/$(dirname ${file_path})" && eval ${prepare_cmd}
29-
if [ $? -ne 0 ]; then
30-
echo "create dataset failed"
31-
exit 0
32-
fi
28+
read -r file_path
29+
read -r stored_path
30+
if [ -z "$stored_path" ] ; then break; fi
31+
printf -v file_path_c_quote %b "$file_path"
32+
mkdir -p /kqi/input/$(dirname "${file_path}") && eval ${prepare_cmd}
33+
if [ $? -ne 0 ]; then
34+
echo "create dataset failed"
35+
exit 0
36+
fi
3337
done </kqi/tmp/datapairs.txt
3438
fi
3539
main: |

web-api/platypus/platypus/ServiceModels/KubernetesModels/Templates/ConfigMap/training_scripts.yaml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,23 @@ data:
1717
fi
1818
1919
# default: create symlink to raw-data, $LOCAL_DATASET = True : copy raw-data to local
20-
prepare_cmd='ln -s "/kqi/raw/${stored_path}" "/kqi/input/${file_path}"'
20+
prepare_cmd='ln -s "/kqi/raw/${stored_path}" "/kqi/input/${file_path_c_quote}"'
2121
if [ $LOCAL_DATASET = "True" ]; then
22-
prepare_cmd='cp "/kqi/raw/${stored_path}" "/kqi/input/${file_path}"'
22+
prepare_cmd='cp "/kqi/raw/${stored_path}" "/kqi/input/${file_path_c_quote}"'
2323
fi
24-
while read file_path stored_path
24+
while true
2525
do
26-
mkdir -p "/kqi/input/$(dirname ${file_path})" && eval ${prepare_cmd}
26+
read -r file_path
27+
read -r stored_path
28+
if [ -z "$stored_path" ] ; then break; fi
29+
printf -v file_path_c_quote %b "$file_path"
30+
mkdir -p /kqi/input/$(dirname "${file_path}") && eval ${prepare_cmd}
2731
if [ $? -ne 0 ]; then
2832
echo "create dataset failed"
2933
kqi training halt $TRAINING_ID
3034
exit 0
3135
fi
32-
done </kqi/tmp/datapairs.txt
36+
done </kqi/tmp/datapairs.txt
3337
main: |
3438
bash /kqi/scripts/common/wait-ready
3539
cd /kqi/git

0 commit comments

Comments
 (0)