<commit_before># LabelMaker

_labelmaker.py_ is a tool that reads key:value pairs from a json file, and labels the running instance and all attached drives accordingly. It is designed to run on boot in a startup-script or userdata. Labels show up in billing exports to BigQuery, and allow organization to run complex cost analysis over their cloud spend.

  **NOTE:** At the time of this document, labels are only supported in the Console and API.

## Usage

The package includes a DeploymentManager configuration that:

  - Boots and instance and attached different type disks
  - Install python dependencies
  - Creates a labels json file

Best practice would be to store labelmaker in a repo or bucket, and download via a startup script.

    ## Example run on instance
    $ ./labelmaker.py /tmp/labels.json
    Labels set on instances:instance-labelmaker<commit_msg>mdauphinee fixes for pull labelmaker project #5<commit_after># LabelMaker

_labelmaker.py_ is a tool that reads key:value pairs from a json file, and labels the running instance and all attached drives accordingly. It is designed to run on boot in a startup-script or userdata. Labels show up in billing exports to BigQuery, and allow organization to run complex cost analysis over their cloud spend.

  **NOTE:** At the time of this document, labels are only supported in the Console and API.

## Usage

The package includes a DeploymentManager configuration that:

  - Boots and instance and attaches different disk types
  - Installs python dependencies
  - Creates a labels json file

Best practice would be to store labelmaker in a repo or bucket, and download via a startup script.

    ## Example run on instance
    $ ./labelmaker.py /tmp/labels.json
    Labels set on instances:instance-labelmaker
{'fraction_non_alphanumeric': 0.04333145751266179, 'fraction_numerical': 0.0005627462014631402, 'mean_word_length': 4.036827195467422, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6326487', 'n_tokens_mistral': 439, 'n_tokens_neox': 422, 'n_words': 253}