-
Notifications
You must be signed in to change notification settings - Fork 4
Support for Model output endpoint me.org #332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 8 commits
0b6e138
334e729
56b399c
52d2349
f411043
5305362
69c2f2a
11a5174
87dd853
fcf3a2c
b101645
b344ca3
57d53dc
45e1456
726d4e9
fc4c18b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
abhaasgoyal marked this conversation as resolved.
Show resolved
Hide resolved
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,26 +18,48 @@ set -ev | |
| # Set some things | ||
| DATA_DIR={{data_dir}} | ||
| NUM_THREADS={{num_threads}} | ||
| MODEL_OUTPUT_ID={{model_output_id}} | ||
| CACHE_DELAY={{cache_delay}} | ||
| MEORG_BIN={{meorg_bin}} | ||
| MODEL_PROFILE_ID={{ model_prof_id }} | ||
| MODEL_OUTPUT_NAME={{ mo.name }} | ||
| MODEL_OUTPUT_ARGS=() | ||
|
|
||
| {% if purge_outputs %} | ||
| # Purge existing model outputs | ||
| echo "Purging existing outputs from $MODEL_OUTPUT_ID" | ||
| $MEORG_BIN file detach_all $MODEL_OUTPUT_ID | ||
| # Create new model output entity | ||
| MODEL_OUTPUT_ARGS+="--state-selection {{ mo.state_selection }}" | ||
| MODEL_OUTPUT_ARGS+=" --parameter-selection {{ mo.parameter_selection }}" | ||
| {% if mo.is_bundle %} | ||
| MODEL_OUTPUT_ARGS+=" --is-bundle" | ||
| {% endif %} | ||
|
|
||
| MODEL_OUTPUT_ID=$($MEORG_BIN output query $MODEL_OUTPUT_NAME | head -n 1 ) | ||
| if [ ! -z "${MODEL_OUTPUT_ID}" ] ; then | ||
| echo "Deleting existing files from model output ID" | ||
| $MEORG_BIN file delete_all $MODEL_OUTPUT_ID | ||
| echo "Updated model output ID" | ||
|
||
| else | ||
| echo "Create new model output ID" | ||
| fi | ||
|
|
||
| MODEL_OUTPUT_ID="$($MEORG_BIN output create $MODEL_PROFILE_ID $MODEL_OUTPUT_NAME $MODEL_OUTPUT_ARGS | head -n 1 | awk '{print $NF}')" | ||
| echo "Add experiments to model output" | ||
| $MEORG_BIN experiment update $MODEL_OUTPUT_ID {{ model_exp_ids|join(',') }} | ||
|
|
||
| # Upload the data | ||
| echo "Uploading data to $MODEL_OUTPUT_ID" | ||
| $MEORG_BIN file upload $DATA_DIR/*.nc -n $NUM_THREADS --attach_to $MODEL_OUTPUT_ID | ||
| $MEORG_BIN file upload $DATA_DIR/*.nc -n $NUM_THREADS $MODEL_OUTPUT_ID | ||
|
|
||
| # Wait for the cache to transfer to the object store. | ||
| echo "Waiting for object store transfer ($CACHE_DELAY sec)" | ||
| sleep $CACHE_DELAY | ||
|
|
||
| {% for exp_id in model_exp_ids %} | ||
| echo "Replace benchmarks to model output" | ||
|
||
| $MEORG_BIN benchmark update $MODEL_OUTPUT_ID {{ exp_id }} {{ model_benchmark_ids|join(',') }} | ||
|
|
||
| # Trigger the analysis | ||
| echo "Triggering analysis on $MODEL_OUTPUT_ID" | ||
| $MEORG_BIN analysis start $MODEL_OUTPUT_ID | ||
| $MEORG_BIN analysis start $MODEL_OUTPUT_ID {{ exp_id }} | ||
|
|
||
| {% endfor %} | ||
|
|
||
| echo "DONE" | ||
abhaasgoyal marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neither "with without optional keys" nor "with/without optional keys" make any sense. Any idea what we are trying to say here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe it's like the user may already have passed in the optional key (thus not replacing it), otherwise if the config file is without the necessary optional key, it would be replaced by a value calculated in
read_optional_key.