3.5. Publishing¶
In the bin directory a file named publish.sh
exists to provide a hook to
publish files to d3VIEW.
Add publishing to run script¶
Publishing to d3VIEW is as simple as the following:
$ publish.sh $USERNAME $APPLICATION_NAME
To add publishing to an existing run script, simply call publisher using the specified parameters after the completion of the simulation.
Example run script would look as follows:
Before adding publishing
lsdyna -inf $SOLVER_INPUT_FILE -o $SOLVER_ARGSAfter adding publishing
lsdyna -inf $SOLVER_INPUT_FILE -o $SOLVER_ARGS publish.sh $USERNAME lsdyna
Configure publishing¶
Publishing is configured by managing two files in the
${D3VIEW_HOME}/etc/config
directory.
The
d3view.json
file can be modified to change which files will be uploaded to d3VIEW from the compute node. To change this modify the section titled"publisher":
. By default the section looks as follows:"publisher": { "included_files": { "global": { "types": [ "image", "curve", "cad" ], "extensions": [ "txt", "log", "tsv" ] }, "lsdyna": { "types": [ "dyna_d3plot", "dyna_binout", "dyna_d3hsp" ], "grouped_curves": [ { "name": "energy", "curves": [ "internal_energy", "total_energy", "kinetic_energy", "spring_and_damper_energy", "hourglass_energy", "sliding_interface_energy" ] }, { "name": "eroded_energy", "curves": [ "eroded_kinetic_energy", "eroded_internal_energy", "eroded_hourglass_energy" ] }, { "name": "joint and total", "curves": [ "joint_internal_energy", "total_energy" ] } ] } } }
The included files section lists all included files by type or by extension. To add a solver type, add a new tag under
included_files
. This tag should match the name of the solver.The
global
tag affects all solvers.types
are specified as mimetypes, which are also defined in the d3view.json file.extensions
are specified as file extensions, the part of the filename that comes after the last ‘.’ for example ‘txt’ in ‘solver_1.txt’grouped_curves
can be defined for each solver. When publishing, the selected curves will be grouped into a single response where the name matches thename
of the group, and the curves included will match each curve in thecurves
list.The
user_api_keys.json
is a site specific json file that must be created after installation. This stores which users (by name) are allowed to use `preview`_ and publishing. The file can easily be created in vim using the following format:{ "example_user": "e4d0b71d5a0a80c11ce890919edcb1ef972c06b1", "<user_id>": "<user_api_key>", "<user_id_2>": "<user_api_key_2>" }
Each user’s api key can be found by logging into d3VIEW, and clicking on the name button found in the top right of the screen, just to the left of logout.
Copy the
User Name
andAPI Key
directly from d3VIEW into theuser_api_keys.json
file.Note
Please assure that the file is in proper json format.