def tar_file(file_to_tar, destination_dir, tar_name=''):
    tar_name = tar_name or os.path.basename(file_to_tar)
    tar_path = os.path.join(destination_dir, '{0}.tar.gz'.format(tar_name))
    with tarfile.open(tar_path, "w:gz") as tar:
        tar.add(file_to_tar, arcname=tar_name)
    return tar_path
Prepares a SPEC client by copying SPEC to the VM.
dataset/ETHPy150Open cloudify-cosmo/cloudify-manager/tests/testenv/utils.py/tar_file--crossover with--dataset/ETHPy150Open GoogleCloudPlatform/PerfKitBenchmarker/perfkitbenchmarker/linux_benchmarks/specsfs2014_benchmark.py/_PrepareSpec