cryptobiu / MATRIX

MPC Simulation Framework
MIT License
24 stars 13 forks source link

Configuration cannot include equals sign #42

Open GuutBoy opened 5 years ago

GuutBoy commented 5 years ago

MATRIX fails when the arguments given in the configurations section of the MATRIX config file includes an equals sign.

Example:

Using the following config

{
  "protocol":"FRESCO-SPDZ",
  "CloudProviders":
  {
    "local":
    {
      "numOfParties":2,
      "git":
      {
        "gitBranch": ["matrix-framework-test"],
        "gitAddress": ["https://github.com/aicis/fresco.git"]
      }
    }
  },
  "executableName": ["MATRIX/run.sh"],
  "configurations":
  [
    "-e@SEQUENTIAL_BATCHED@-s@spdz@-Dspdz.preprocessingStrategy=DUMMY"
  ],
  "numOfRepetitions":1,
  "numOfInternalRepetitions":1,
  "IsPublished": "true",
  "isExternal": "true",
  "workingDirectory": ["~/MATRIX-EXP/fresco-test"],
  "resultsDirectory": "~/MATRIX-EXP/MATRIX",
  "emails": ["peter.s.nordholt@alexandra.dk"],
  "institute":"The Alexandra Institute"
}

I get the following error when trying to execute the experiment

Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/process.py", line 114, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/psn/Library/Python/2.7/lib/python/site-packages/fabric/tasks.py", line 242, in inner
    submit(task.run(*args, **kwargs))
  File "/Users/psn/Library/Python/2.7/lib/python/site-packages/fabric/tasks.py", line 174, in run
    return self.wrapped(*args, **kwargs)
TypeError: run_protocol() got an unexpected keyword argument '-e@SEQUENTIAL_BATCHED@-s@spdz@-Dspdz.preprocessingStrategy'

Looks like some issue with the configurations strings not being properly handled.

liorko87 commented 5 years ago

Hi @GuutBoy

The issue at your configuration string is the =. When MATRIX sends request to the execution module, fabric, it's parse the = as an operator to the module and not as a part of a string. I sent an email to the developers of the module for workaround.

GuutBoy commented 5 years ago

For now I am dealing with it by using % instead of = and then substituting back in the run.sh script. Not pretty, but it seems to work. Would be great to have this fixed though. In the long run banning = from the configurations does not seem sustainable.

liorko87 commented 5 years ago

After #38 will be available, = will not be a problem anymore.