Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Overview:

Currently cPickle is used to dump configuration using save_configuration() & load_configuration() is used to load it, which does not work as intended. Pickle is slow, unsafe and is not human readable. Storing configurations in json format would be a better option.

Forum Discussionhttp://community.pbspro.org/t/update-file-format-and-file-name-for-data-saved-using-save-configuration-method-in-ptl/1516

Technical Details:

Interface Update

...

  • Interface: save_configuration()
    Synopsis: Update to save configuration in .json file. 
    Details: This method will encode configuration file contents in base64 format based on  & save it in a json file.

save_configuration() will continue to save the following from the PBS cluster:

Server configurations to be saved:

...

  • Interface: load_configuration()
    Synopsis: Apply configuration saved by save_configuration()
    Details: This method will load json file that was saved by save_configuration & apply the corresponding changes.

...

Info

{

    "hostname1":

    {

        ..............................

        "qmgr_print_server" : "set server default_chunk.ncpus = 1
                                            set server flatuid = True
                                            set server resv_enable = True
                                            set server node_fail_requeue = 310"

         .............................

    }

}

2. File format: File contents can All config and hook files content will be encoded in base64 & that base64 is format before adding to json file. Hooks file content will be added to same json file.

e.g, Suppose sched file contents are:

...

Info

{

....

"hostname1":

    {

        ....

        "qmgr_print_server" : "set server default_chunk.ncpus = 1
                                            set server flatuid = True
                                            set server resv_enable = True
                                            set server node_fail_requeue = 310"

         ....

         "sched_config_file": "cmVzb3VyY2VzOiAibmNwdXMsIG1lbSwgYXJjaCwgaG9zdCwgdm5vZGUsIGFvZSwgZW9lLCBjbG91ZF9zY2VuYXJpbywgY2

                                           xvdWRfbm9kZV9pbWFnZSwgY2xvdWRfbm9kZV9pbnN0YW5jZV90eXBlLCBjbG91ZF9uZXR3b3JrIg=="

....

}

.

.

.

"PBS hooks":

    {

        "PBS_hookname.PY": "hook contents encoded in base64 format",

        "PBS_hookname.CF": "hook contents encoded in base64 format",

        .....

    }

"site hooks":

    {

        "site_hook_name.PY": "hook contents encoded in base64 format",

        "site_hook_name.CF": "hook contents encoded in base64 format",

        .....

     }


3. When user invokes pbs_benchpress, cleanup of tempdir is performed in case file with same name is present.

...