def _parse_init_params(params: str):
    """
    Parse the initialization parameters.
    Currently supports 2:
        -i DOCKER_IMAGE_NAME
        -w WORK_PATH
    :returns: The working dir and image name.
    """
    supported_msg = (
        'Supported -w for working directory and                      -i for COMPSs docker image.'
        )
    working_dir = ''
    image = ''
    fields = params.split()
    if len(fields) == 2:
        if fields[0] == '-w':
            working_dir = fields[1]
        elif fields[0] == '-i':
            image = fields[1]
        else:
            Exception('Unsupported flag: ' + str(fields[0]) + '. ' +
                supported_msg)
    elif len(fields) == 4:
        if fields[0] == '-w':
            working_dir = fields[1]
        elif fields[0] == '-i':
            image = fields[1]
        else:
            Exception('Unsupported flag: ' + str(fields[0]) + '. ' +
                supported_msg)
        if fields[2] == '-w':
            working_dir = fields[3]
        elif fields[2] == '-i':
            image = fields[3]
        else:
            Exception('Unsupported flag: ' + str(fields[2]) + '. ' +
                supported_msg)
    else:
        raise Exception('Incorrect number of parameters')
    return working_dir, image
