Repackaging of the VM

From TASTE
Jump to: navigation, search

Repackaging of the VM

Since the VM contains all the necessary tools used by TASTE (custom compilers, graphical editors, etc) it is a quite large mini-distribution by itself. It makes sense therefore when distributing it, to strive to create as minimal tarballs as possible.

The steps below are the ones we follow when releasing a new VM:

  1. A successful Update-TASTE.sh is executed.
  2. A successful regression check is executed.
  3. All the binary folders generated during the compilation of the TASTE tools and the regression suite are removed to save space.
  4. For the same reason, sudo apt-get clean
  5. To prepare for optimal .vmdk creation, the free space of the VM's "drive" is then erased:
    sudo dd if=/dev/zero of=/clearMe bs=1M
    sync
    sudo rm /clearMe
    This makes sure that all the free space in the VM is filled with zeros
  6. sudo poweroff
  7. In the folder where the VM's "drive" is stored (i.e. the .vmdk file), the vmware-vdiskmanager tool is used:
    vmware-vdiskmanager -r HardDrive.vmdk -t 0 new.vmdk
    mv new.vmdk HardDrive.vmdk
    This will compress all the free space (which was conveniently erased in step 4) thus creating a minimal .vmdk file
  8. Finally, an rsync-able tarball is then generated:
    tar cpf - TASTE-VM/ | gzip --rsyncable > TASTE-VM.tar.gz

By nature of the --rsyncable option, this gzipped tarball can be optimally transferred to the remote server(s) hosting the VM (via rsync), since only the parts of the VM that actually changed will be transferred. This is usually less than 5% of the full size of the VM tarball.