Skip to content

Commit 7c2dd45

Browse files
author
Javier Garcia Ordonez
committed
cleaning && adding necessary new files
1 parent 64f1a8a commit 7c2dd45

File tree

5 files changed

+36
-18
lines changed

5 files changed

+36
-18
lines changed

{{cookiecutter.project_slug}}/.osparc/metadata.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ inputs:
1717
label: input_{{ i+1 }}_label
1818
description: The input {{ i+1 }} description
1919
type: string
20+
# allowed input / output types are "string", "number", "bool", "data:*/*"
2021
defaultValue: some_value(optional)
2122
fileToKeyMap:
2223
somefilename.ext: input_{{ i+1 }}
@@ -28,6 +29,7 @@ outputs:
2829
label: output_{{ i+1 }}_label
2930
description: The input {{ i+1 }} description
3031
type: string
32+
# allowed input / output types are "string", "number", "bool", "data:*/*"
3133
fileToKeyMap:
3234
somefilename.ext: output_{{ i+1 }}
3335
{% endfor %}

{{cookiecutter.project_slug}}/.osparc/runtime.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ settings:
77
- name: Resources
88
type: Resources
99
value:
10-
Limits:
10+
Limits: # TODO Default resource limits. Change if necessary.
1111
NanoCPUs: 1000000000 # 100% of CPU cycles on 1 CPU
12-
MemoryBytes: 2147483648 # 2 Gigabytes
13-
12+
MemoryBytes: 2147483648 # 2 Gigabytes
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: '3.7'
2+
services:
3+
{{ cookiecutter.project_slug }}:
4+
image: simcore/services/{%- if cookiecutter.project_type == "computational" -%}comp{%- elif cookiecutter.project_type == "dynamic" -%}dynamic{%- endif -%}/{{ cookiecutter.project_name.lower().replace(' ', '-') }}:{{ cookiecutter.version }}
5+
volumes:
6+
- ${PWD}/validation/input:/input
7+
- ${PWD}/validation/output:/output

{{cookiecutter.project_slug}}/service.cli/execute.sh

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,27 @@ set -o errexit
44
set -o nounset
55
IFS=$(printf '\n\t')
66

7-
cd /home/scu/{{ cookiecutter.project_package_name }}
7+
cd /home/scu/src/{{ cookiecutter.project_package_name }}
88

99
echo "starting service as"
1010
echo User : "$(id "$(whoami)")"
1111
echo Workdir : "$(pwd)"
1212
echo "..."
1313
echo
1414
# ----------------------------------------------------------------
15-
# This script shall be modified according to the needs in order to run the service
16-
# The inputs defined in ${INPUT_FOLDER}/inputs.json are available as env variables by their key in capital letters
17-
# For example: input_1 -> $INPUT_1
15+
# This script shall be modified according to the needs in order to run the service. You can use the inputs in ${INPUT_FOLDER}
16+
# then retrieve the output and move it to the $OUTPUT_FOLDER as defined in the output labels
17+
# For example: cp output.csv $OUTPUT_FOLDER or to $OUTPUT_FOLDER/outputs.json using jq
18+
# TODO: Replace following
1819

1920
# put the code to execute the service here
2021
# For example:
2122
env
2223
ls -al "${INPUT_FOLDER}"
24+
# or for example, to execute a python script on some input data:
25+
env
26+
python3 myscript.py -i path/to/input_data/input_file.txt
27+
cp output_file.json "${OUTPUT_FOLDER}"/outputs.json
2328

24-
# then retrieve the output and move it to the $OUTPUT_FOLDER
25-
# as defined in the output labels
26-
# For example: cp output.csv $OUTPUT_FOLDER or to $OUTPUT_FOLDER/outputs.json using jq
27-
#TODO: Replace following
28-
cat > "${OUTPUT_FOLDER}"/outputs.json << EOF
29-
{
30-
{%- for i in range(cookiecutter.number_of_outputs|int) -%}
31-
{%- if i > 0 -%},{%- endif %}
32-
"output_{{ i+1 }}":"some_stuff"
33-
{%- endfor %}
34-
}
3529
EOF
3630

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
#!/bin/sh
3+
#---------------------------------------------------------------
4+
# AUTO-GENERATED CODE, do not modify this will be overwritten!!!
5+
#---------------------------------------------------------------
6+
# shell strict mode:
7+
set -o errexit
8+
set -o nounset
9+
IFS=$(printf '\n\t')
10+
cd "$(dirname "$0")"
11+
12+
INPUT_1=$INPUT_FOLDER/input.zip
13+
export INPUT_1
14+
15+
exec execute.sh
16+

0 commit comments

Comments
 (0)