This repository has been archived by the owner on Oct 20, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
soil_mask_workflow.jx
95 lines (95 loc) · 3.04 KB
/
soil_mask_workflow.jx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
{
"define": {
"WORKSPACE_DIR_NAME": "workspace",
"RESULT_FILENAME": "result.json",
"WORKSPACE_DIR": RELATIVE_WORKING_FOLDER + WORKSPACE_DIR_NAME,
"RUN_RESULTS": WORKSPACE_DIR + "/" + RESULT_FILENAME,
"CACHE_RESULTS_SCRIPT": SCRIPT_FOLDER + "cache_results.py",
"DOCKER_MOUNT_POINT": "/mnt/",
"DOCKER_RUN_PARAMS": DATA_FOLDER_NAME + "/odm_orthophoto.tif",
"PATH_MAPS": DOCKER_MOUNT_POINT + ":" + RELATIVE_WORKING_FOLDER,
"LOCAL_RESULT_FILE": CACHE_DIR + RESULT_FILENAME
},
"rules": [
{
"command": "echo Creating cache folder \\\"${CACHE_DIR}\\\" && mkdir -p \"${CACHE_DIR}\" ",
"environment": {
"CACHE_DIR": CACHE_DIR,
},
"inputs": [],
"output": [
CACHE_DIR
]
},
{
"command": "echo Creating workspace \\\"${WORKSPACE_DIR}\\\" && mkdir -p \"${WORKSPACE_DIR}\" && chmod a+w \"${WORKSPACE_DIR}\" ",
"environment": {
"WORKSPACE_DIR": WORKSPACE_DIR
},
"inputs": [],
"outputs": [
WORKSPACE_DIR
]
},
{
"command": "docker run --rm --name sm_transformer -v \"${IMAGE_MOUNT_SOURCE}:${DOCKER_MOUNT_POINT}\" ${DOCKER_IMAGE} -d --metadata \"${METADATA}\" --working_space \"${WORKSPACE_DIR}\" ${DOCKER_RUN_PARAMS}",
"environment": {
"IMAGE_MOUNT_SOURCE": IMAGE_MOUNT_SOURCE,
"DOCKER_MOUNT_POINT": DOCKER_MOUNT_POINT,
"DOCKER_IMAGE": DOCKER_IMAGE,
"METADATA": EXPERIMENT_METADATA_RELATIVE_PATH,
"WORKSPACE_DIR": WORKSPACE_DIR,
"DOCKER_RUN_PARAMS": DOCKER_RUN_PARAMS
},
"inputs": [
WORKSPACE_DIR
],
"outputs": [
RUN_RESULTS
]
},
{
"command": "echo Copying results \\\"${RUN_RESULTS}\\\" to \\\"${CACHE_DIR}\\\" && mkdir -p \"${CACHE_DIR}\/\" && cp \"${RUN_RESULTS}\" \"${CACHE_DIR}\/\" ",
"environment": {
"RUN_RESULTS": RUN_RESULTS,
"CACHE_DIR": CACHE_DIR
},
"inputs": [
RUN_RESULTS
],
"outputs": [
LOCAL_RESULT_FILE
]
},
{
"command": "echo Processing results && python3 \"${CACHE_RESULTS_SCRIPT}\" --maps \"${PATH_MAPS}\" --extra_files \"${METADATA}\" \"${RUN_RESULTS}\" \"${CACHE_DIR}\" ",
"environment": {
"CACHE_RESULTS_SCRIPT": CACHE_RESULTS_SCRIPT,
"PATH_MAPS": PATH_MAPS,
"METADATA": EXPERIMENT_METADATA_RELATIVE_PATH,
"RUN_RESULTS": RUN_RESULTS,
"CACHE_DIR": CACHE_DIR
},
"inputs": [
LOCAL_RESULT_FILE
],
"outputs": [
CACHE_DIR + EXPERIMENT_METADATA_FILENAME
]
},
{
"command": "echo copying \\\"${CACHE_DIR}${FILE_NAME}\\\" \\\"${RESULTS_FILE_PATH}\\\" && cp \"${CACHE_DIR}${FILE_NAME}\" \"${RESULTS_FILE_PATH}\"",
"environment": {
"CACHE_DIR": CACHE_DIR,
"FILE_NAME": FILE_NAME,
"RESULTS_FILE_PATH": RESULTS_FILE_PATH
},
"inputs": [
CACHE_DIR + EXPERIMENT_METADATA_FILENAME
],
"outputs": [
RESULTS_FILE_PATH + FILE_NAME
]
} for FILE_NAME in RESULTS_FILE_NAMES
]
}