Script to dump and restore hazard outputs useful for risk
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenQuake (deprecated) |
Fix Released
|
High
|
Michele Simionato |
Bug Description
Add two scripts which are able to dump a hazard computation from a
database and to restore it into another. The idea is that a heavy
hazard computation can be performed on a source db (the cluster) and
then copied on a target db (a scientist laptop), where several light
weight risk computations can be performed.
Here is the workflow.
1. Identify the hazard_
2. Dump the associated data to a .tar file with the command
python dump_hazards.py <hc_id> <output> <remotehost> <dbname> <user> <pwd>
3. Restore the data from the tarfile with the command
python restore_hazards.py <output.tar> localhost <dbname> <user> <pwd>
<output> is the name of a temporary directory were the files are
stored (must have enough space and must not already exists).
<output.tar> is the name of the tarfile containing the output.
Internally the tarfile contains several .csv.gz files, one
for each table to restore.
The <user> must have sufficient permissions to write on <dbname>.
If your database already contains a hazard calculation
with the same id, the script will not override it and will not restore the
new data. If you think that the hazard calculation on your database
is not important and can removed together with all of its outputs, then
remove it by using ``bin/openquake --delete-
must be run by a user with sufficient permissions). Then run again
``restore_
In the present implementations the following table are dumped:
admin.
admin.oq_user
uiapi.
hzrdr.
uiapi.oq_job
uiapi.output
hzrdr.
hzrdr.gmf_agg
hzrdr.
hzrdr.
hzrdr.
Changed in openquake: | |
status: | New → Confirmed |
assignee: | nobody → Michele Simionato (michele-simionato) |
milestone: | none → 1.0.0 |
Changed in openquake: | |
importance: | Undecided → High |
Changed in openquake: | |
status: | Confirmed → In Progress |
description: | updated |
description: | updated |
Changed in openquake: | |
status: | In Progress → Fix Committed |
Changed in openquake: | |
status: | Fix Committed → Fix Released |
Implemented in https:/ /github. com/gem/ oq-engine/ pull/1096