.. _publish: Publishing =========== What is publishing? ------------------- The ``Publish`` process is a tool to help send files from a **completed** job to d3VIEW. Requirements ------------ • Python 2.7 (Latest release of Python 2.7 can be found `here `_) • Lucy • Connection to d3VIEW Configure publishing -------------------- Publishing is configured by managing the d3view.json file in the ``${LUCY_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 the ``name`` of the group, and the curves included will match each curve in the ``curves`` list. How to run ---------- The ``Publish`` tool is used by invoking ``Lucy``, and specifying the arguments needed to publish files to a simulation job. The most basic command is as follows:: $ lucy publish ``<>`` -d3view-url http://d3VIEW-internal.com -a ``<>`` :program:`lucy` :program:`publish` :option:`publish USERNAME` :option:`publish -d3view-url` ``http://d3VIEW-internal.com`` :option:`publish -a` ``<>`` If you don't have a job.json file prepared, one will automatically be created after running the command with the keyword arguments outlined below. Arguments --------- ``Publish`` comes with a number of arguments to allow flexibility when sending data from different kinds of jobs. All arguments are shown directly below, with links to their sections. +----------------------------------------+----------------------------------+ | Parameter name | When required | +========================================+==================================+ +----------------------------------------+----------------------------------+ | `publish Positional arguments`_ | | +----------------------------------------+----------------------------------+ |:option:`publish USERNAME` | **Always required** | +----------------------------------------+----------------------------------+ +----------------------------------------+----------------------------------+ | `publish Connection arguments`_ | | +----------------------------------------+----------------------------------+ |:option:`publish -d3view-url` | **Always required** | +----------------------------------------+----------------------------------+ |:option:`publish -d3view-port` | **Always required** | +----------------------------------------+----------------------------------+ |:option:`publish -a`, | **Always required** | |:option:`publish -api-key` | | +----------------------------------------+----------------------------------+ +----------------------------------------+----------------------------------+ | `publish Simulation arguments`_ | | +----------------------------------------+----------------------------------+ |:option:`publish -hpcserver-name` | | +----------------------------------------+----------------------------------+ |:option:`publish -project-id` | | +----------------------------------------+----------------------------------+ |:option:`publish -loadcase-name` | | +----------------------------------------+----------------------------------+ |:option:`publish -loadcase-id` | | +----------------------------------------+----------------------------------+ |:option:`publish -solver-type` | | +----------------------------------------+----------------------------------+ |:option:`publish -solver-log-file` | | +----------------------------------------+----------------------------------+ |:option:`publish -r`, | | |:option:`publish -response-template` | | +----------------------------------------+----------------------------------+ |:option:`publish -n`, | | |:option:`publish -name`, | | |:option:`publish -job-name` | | +----------------------------------------+----------------------------------+ |:option:`publish -d`, | | |:option:`publish -description`, | | |:option:`publish -job-desc` | | +----------------------------------------+----------------------------------+ |:option:`publish -vd`, | | |:option:`publish -variable-definition`, | | +----------------------------------------+----------------------------------+ +----------------------------------------+----------------------------------+ | `publish Additional arguments`_ | | +----------------------------------------+----------------------------------+ |:option:`publish -job-json` | | +----------------------------------------+----------------------------------+ |:option:`publish -job-id` | | +----------------------------------------+----------------------------------+ |:option:`publish -simulation-id` | | +----------------------------------------+----------------------------------+ Publish Positional arguments ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This argument is required for the application to be able to run, and must always be specified. .. program:: publish .. option:: USERNAME d3VIEW user name. Publish Connection arguments ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ These Arguments are required for the application to be able to log into d3VIEW. .. option:: -d3view-url The url to d3VIEW. Such as ``http://d3VIEW-internal.com`` (Note: do not include port number if shown, that is the next parameter.) .. option:: -d3view-port The port to d3VIEW, if it is not 80, this should be set. .. option:: -a, -api-key The `API Key`_ found in d3VIEW. Publish Simulation arguments ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. option:: -hpcserver-name The name of the `HPC server`_ (in d3VIEW) that the simulation is going to be created on. .. option:: -project-id The name of the d3VIEW project that the simulation should be part of. .. option:: -loadcase-name The name of the d3VIEW loadcase that will be attached to the simulation. .. option:: -loadcase-id The id of the loadcase in d3VIEW. .. option:: -t, -solver-type The type of solver that was run, such as ``lsdyna`` .. option:: -solver-log-file Name of the log file the solver will write to. Used in generating preview.tsv. .. option:: -r, -response-template The name of the response template to apply .. option:: -n, -name, -job-name The name of the simulation. If set to ``'auto'``, ``Publish`` will name the simulation as a combination of the working directory and the parent directory. If the folder structure is:: root ├ stage1 │ ├ 1.1 (working directory) │ │ ├ main_input_file.k │ │ └ additional_input_file.key The simulation will be named stage1_1.1. This is especially useful for LS-OPT where multiple simulations will be submitted from the same LS-OPT job. .. option:: -d, -description, -job-desc The description of the simulation .. option:: -vd, -variable-definition Path to the variable definition file. Publish Additional arguments ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. option:: -job-json This option allows loading all parameters from a job.json file instead of having a large command. The contents of the job.json file should look like:: { "api_url": "", "api_port": "", "username": "", "api_key": "", "hpcserver_name": "", "solver_type": "", "response_template": "", "job_name": "", "job_description": "", } .. option:: -job-id The job id used to connect to an existing simulation. .. option:: -simulation-id The simulation id used to connect to an existing simulation.