<commit_before>#!/bin/bash

set -x

BASE_PATH=$(dirname $0)

function main() {
  source /var/vcap/jobs/grootfs/bin/utils

  export PATH=/var/vcap/packages/xfs-progs/sbin:$PATH
  local privileged_store_path=/var/vcap/data/grootfs/store/privileged
  local privileged_volume_file=/var/vcap/data/grootfs/volume_privileged
  local unprivileged_store_path=/var/vcap/data/grootfs/store/unprivileged
  local unprivileged_volume_file=/var/vcap/data/grootfs/volume_unprivileged

  mkdir -p "$privileged_store_path"
  mkdir -p "$unprivileged_store_path"

  create_volume_file $privileged_volume_file
  create_volume_file $unprivileged_volume_file

  format_volume_file $privileged_volume_file
  format_volume_file $unprivileged_volume_file

  create_loop_devices
  permit_device_control

  mount_xfs_volume $unprivileged_volume_file $unprivileged_store_path
  mount_xfs_volume $privileged_volume_file $privileged_store_path

  setup_unprivileged_store $unprivileged_store_path
  chmod 700 $privileged_store_path
}

function format_volume_file() {
  local volume_file=$1

  # Verify if volume is already a XFS file and if it is, skip
  if [ -z "$(file $volume_file | grep "XFS Filesystem")" ]
  then
    echo "fomatting volume..."
    mkfs.xfs $volume_file
  fi
}

function mount_xfs_volume() {
  local volume_file=$1
  local store_path=$2

  echo "mounting volume..."
  umount $store_path || true
  mount -t xfs -o pquota $volume_file $store_path

}

main<commit_msg>Fix tardis setup for overlay-xfs driver<commit_after>#!/bin/bash

set -x

BASE_PATH=$(dirname $0)

function main() {
  source /var/vcap/jobs/grootfs/bin/utils

  export PATH=/var/vcap/packages/xfs-progs/sbin:$PATH
  local privileged_store_path=/var/vcap/data/grootfs/store/privileged
  local privileged_volume_file=/var/vcap/data/grootfs/volume_privileged
  local unprivileged_store_path=/var/vcap/data/grootfs/store/unprivileged
  local unprivileged_volume_file=/var/vcap/data/grootfs/volume_unprivileged

  mkdir -p "$privileged_store_path"
  mkdir -p "$unprivileged_store_path"

  create_volume_file $privileged_volume_file
  create_volume_file $unprivileged_volume_file

  format_volume_file $privileged_volume_file
  format_volume_file $unprivileged_volume_file

  create_loop_devices
  permit_device_control

  mount_xfs_volume $unprivileged_volume_file $unprivileged_store_path
  mount_xfs_volume $privileged_volume_file $privileged_store_path

  setup_unprivileged_store $unprivileged_store_path
  chmod 700 $privileged_store_path

  tardis_setup
}

function format_volume_file() {
  local volume_file=$1

  # Verify if volume is already a XFS file and if it is, skip
  if [ -z "$(file $volume_file | grep "XFS Filesystem")" ]
  then
    echo "fomatting volume..."
    mkfs.xfs $volume_file
  fi
}

function mount_xfs_volume() {
  local volume_file=$1
  local store_path=$2

  echo "mounting volume..."
  umount $store_path || true
  mount -t xfs -o pquota $volume_file $store_path

}

function tardis_setup() {
  echo "setting up tardis..."
  chmod u+s /var/vcap/packages/grootfs/bin/tardis
}

main
{'fraction_non_alphanumeric': 0.08586353248449233, 'fraction_numerical': 0.004570682337577538, 'mean_word_length': 5.031496062992126, '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': '7582338', 'n_tokens_mistral': 1174, 'n_tokens_neox': 1120, 'n_words': 208}