<commit_before>#!/bin/bash -e
gardenDir="/var/vcap/data/garden"

# This assumes you are running on an instance with attached ephemeral disk as current (0.70) concourse image does
echo "Mounting ${gardenDir} on to ephemeral disk..."
cp -R ${gardenDir}/* /mnt
umount /mnt

# Unmount all aufs mounts
mounts=$(cat /proc/mounts | grep /var/vcap/data/garden/aufs_graph/aufs/mnt | awk '{print $2}')
[[ -n "${mounts}" ]] && echo ${mounts} | xargs umount

# Only lazy unmount works here
umount -l /var/vcap/data/garden/aufs_graph/aufs

# Mount ephemeral storage as garden data
mount /dev/xvdb ${gardenDir}

/var/vcap/bosh/bin/monit restart garden
<commit_msg>Check if vagrant ephemeral disk is already mounted<commit_after>#!/bin/bash -e
gardenDir="/var/vcap/data/garden"

if ! mount | grep -q $gardenDir; then
    # This assumes you are running on an instance with attached ephemeral disk as current (0.70) concourse image does
    echo "Mounting ${gardenDir} on to ephemeral disk..."
    cp -R ${gardenDir}/* /mnt
    umount /mnt

    # Unmount all aufs mounts
    mounts=$(cat /proc/mounts | grep /var/vcap/data/garden/aufs_graph/aufs/mnt | awk '{print $2}')
    [[ -n "${mounts}" ]] && echo ${mounts} | xargs umount

    # Only lazy unmount works here
    umount -l /var/vcap/data/garden/aufs_graph/aufs

    # Mount ephemeral storage as garden data
    mount /dev/xvdb ${gardenDir}

    /var/vcap/bosh/bin/monit restart garden
fi
{'fraction_non_alphanumeric': 0.1312280701754386, 'fraction_numerical': 0.005614035087719298, 'mean_word_length': 3.526984126984127, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5042527', 'n_tokens_mistral': 534, 'n_tokens_neox': 511, 'n_words': 156}