-
Notifications
You must be signed in to change notification settings - Fork 3
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
WIP: Futures #153
base: main
Are you sure you want to change the base?
WIP: Futures #153
Changes from 16 commits
087ee0e
9073ff4
6e429ec
be64081
18d2d89
3096b7a
e644d76
e711bcb
bf86bad
e70353d
4674c41
066c0f5
a53c425
187c5b0
6c2e2bf
c34290c
b2174b7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
graft ./assets/* | ||
include ./assets/futures/* | ||
include ./assets/drs_config.toml | ||
include ./assets/evaluation_system.conf | ||
include ./deploy.py | ||
include src/freva/*.json |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This took me a while: Those are the templates to create content from the futures, aren't they? Please put a separate README in there. I tried multiple times to execute those notebook like an idiot.. |
||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "da58d5ea", | ||
"metadata": { | ||
"tags": [ | ||
"solr-parameters" | ||
] | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"# Define the solr parameter\n", | ||
"project=\"reanalysis\"\n", | ||
"product=\"reanalysis\"\n", | ||
"institute=\"ecmwf\"\n", | ||
"model=\"ifs\"\n", | ||
"experiment=\"era5\" \n", | ||
"ensemble=\"reanalysis\"\n", | ||
"time=\"200001010000-201012310000\"\n", | ||
"time_frequency=\"mon\"\n", | ||
"realm=\"atmos\"\n", | ||
"variable=[\"tx10p\", \"tx90p\", \"tn10p\", \"tn90p\"]" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "ad6886ba", | ||
"metadata": { | ||
"tags": [ | ||
"parameters" | ||
] | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"ntasks=8\n", | ||
"future_code = \"\"" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "0e174599", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from tempfile import TemporaryDirectory\n", | ||
"import freva\n", | ||
"_=freva.config(\"/home/wilfred/workspace/freva/compose/local-eval-system.conf\")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "dbbd8c5a", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"outdir = TemporaryDirectory()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "2da586e1", | ||
"metadata": { | ||
"tags": [ | ||
"code" | ||
] | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"from dateutil import parser\n", | ||
"time_period=\",\".join((str(parser.parse(t).year) for t in time.split(\"-\")))\n", | ||
"res = freva.run_plugin(\n", | ||
" \"climdexcalc\",\n", | ||
" project=project,\n", | ||
" product=product,\n", | ||
" institute=institute,\n", | ||
" model=model,\n", | ||
" experiment=experiment,\n", | ||
" ensemble=ensemble,\n", | ||
" timeperiod=time_period,\n", | ||
" indices=\",\".join(variable),\n", | ||
" ntasks=ntasks,\n", | ||
" outputdir=outdir.name,\n", | ||
" batchmode=True,\n", | ||
")\n", | ||
"res.wait()\n", | ||
"output = res.get_result_paths()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "4f256fd7", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"freva.add_user_data(\n", | ||
" product,\n", | ||
" *output,\n", | ||
" how=\"move\",\n", | ||
" _project=project,\n", | ||
" institute=institute,\n", | ||
" model=model,\n", | ||
" experiment=experiment,\n", | ||
" ensemble=ensemble,\n", | ||
" realm=realm,\n", | ||
" future=future_code\n", | ||
")\n", | ||
"outdir.cleanup()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "7daf2cac", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"celltoolbar": "Tags", | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.10.9" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "0e005d16", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import freva\n", | ||
"from freva._futures import Futures" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "da58d5ea", | ||
"metadata": { | ||
"tags": [ | ||
"solr-parameters" | ||
] | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"# Define the solr parameter\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "ad6886ba", | ||
"metadata": { | ||
"tags": [ | ||
"parameters" | ||
] | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"# Define additional parameters to run the plugin\n", | ||
"future_id = \"\"" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "2da586e1", | ||
"metadata": { | ||
"tags": [ | ||
"code" | ||
] | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"# Run the plugin\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "4f256fd7", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# res.wait()\n", | ||
"output = res.get_result_paths()\n", | ||
"Futures.from_existing_code_hash(future_id).add_data(\n", | ||
" project,\n", | ||
" product,\n", | ||
" *output,\n", | ||
" history_id=res.id,\n", | ||
" institute=institute,\n", | ||
" model=model,\n", | ||
" experiment=experiment,\n", | ||
" ensemble=ensemble,\n", | ||
" realm=realm,\n", | ||
" time_frequency=time_frequency,\n", | ||
" cmor_table=cmor_table,\n", | ||
")" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"celltoolbar": "Tags", | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.10.9" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,7 +86,7 @@ extra_options=--qos=test, --array=20 | |
#python_path=${evaluation_system:root_dir}/plugin4freva/movieplotter/src | ||
#module=movieplotter | ||
# | ||
#[plugin:climdexcalc] | ||
#python_path=/home/wilfred/workspace/climdex-calc | ||
#module=climdex_calc | ||
[plugin:climdexcalc] | ||
python_path=/home/wilfred/workspace/climdex-calc | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. local path which I don't have. I changed the path to locally checked out climdexcalc-plugin but the module name also does not correspond to the one online ( |
||
module=climdex_calc | ||
# |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
version: "3.9" | ||
services: | ||
db: | ||
db1: | ||
image: mariadb:latest | ||
environment: | ||
MYSQL_USER: freva | ||
|
@@ -11,6 +11,17 @@ services: | |
- "3306:3306" | ||
volumes: | ||
- ./compose/config/mysql/create_tables.sql:/docker-entrypoint-initdb.d/create_tables.sql:ro | ||
db2: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did you add a second database? I don't see any usage |
||
image: mariadb:latest | ||
environment: | ||
MYSQL_USER: freva | ||
MYSQL_PASSWORD: T3st | ||
MYSQL_DATABASE: freva | ||
MYSQL_ROOT_PASSWORD: test_password_please_ignore | ||
ports: | ||
- "3308:3306" | ||
volumes: | ||
- ./compose/config/mysql/create_tables.sql:/docker-entrypoint-initdb.d/create_tables.sql:ro | ||
solr: | ||
image: solr:latest | ||
environment: | ||
|
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 tried to add some user-data via
freva user-data add --institute "Andrej" --model "AndrejMod" --experiment AndrejExp --project foo paths /home/afast/Downloads/nc
It broke with:
But I was not able to set the hash as it is missing in the parameters. Is it even desired that the user has to set the hash manually?
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 manually put
hash
into the code in order to bypass this error message and to add my local data into the solr. This didn't work ashash
is not part of the solr. Should it?