<commit_before>#!/bin/bash

mkdir -p claims
mkdir -p deployments

USAGE="$0 <pattern> <storage_size>"
PATTERN=${1:?Please provide a pattern for mlabconfig: $USAGE}
GIGABYTES=${2:?Please give an integer number of gigabytes: $USAGE}

./operator/plsync/mlabconfig.py \
    --format=scraper_kubernetes \
    --template_input=deploy.yml \
    --template_output=deployments/deploy-{{site_safe}}-{{node_safe}}-{{experiment_safe}}-{{rsync_module_safe}}.yml \
    --select="${PATTERN}"

# Must do this sub before the mlabconfig call due to the fix for
#  http://bugs.python.org/issue17078
# not (yet) having propagated globally.
sed -e "s/{{GIGABYTES}}/${GIGABYTES}/" claim.yml > claim_template.yml
./operator/plsync/mlabconfig.py \
    --format=scraper_kubernetes \
    --template_input=claim_template.yml \
    --template_output=claims/claim-{{site_safe}}-{{node_safe}}-{{experiment_safe}}-{{rsync_module_safe}}.yml \
    --select="${PATTERN}"<commit_msg>deployments -> deployment<commit_after>#!/bin/bash

mkdir -p claims
mkdir -p deployment

USAGE="$0 <pattern> <storage_size>"
PATTERN=${1:?Please provide a pattern for mlabconfig: $USAGE}
GIGABYTES=${2:?Please give an integer number of gigabytes: $USAGE}

./operator/plsync/mlabconfig.py \
    --format=scraper_kubernetes \
    --template_input=deploy.yml \
    --template_output=deployment/deploy-{{site_safe}}-{{node_safe}}-{{experiment_safe}}-{{rsync_module_safe}}.yml \
    --select="${PATTERN}"

# Must do this sub before the mlabconfig call due to the fix for
#  http://bugs.python.org/issue17078
# not (yet) having propagated globally.
sed -e "s/{{GIGABYTES}}/${GIGABYTES}/" claim.yml > claim_template.yml
./operator/plsync/mlabconfig.py \
    --format=scraper_kubernetes \
    --template_input=claim_template.yml \
    --template_output=claims/claim-{{site_safe}}-{{node_safe}}-{{experiment_safe}}-{{rsync_module_safe}}.yml \
    --select="${PATTERN}"
{'fraction_non_alphanumeric': 0.16789087093389296, 'fraction_numerical': 0.008394543546694649, 'mean_word_length': 4.511560693641618, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 10, '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': '3191324', 'n_tokens_mistral': 711, 'n_tokens_neox': 642, 'n_words': 118}