<commit_before># Setup guide
This document describes about Beluganos's setup for white-box switches.

## Pre-requirements
- Please refer [install-guide.md](install-guide.md) before proceeding.

## Config files at a glance

The files under `etc/playbooks/` are configuration files. In this page, `dp-*.yml` and the files under `roles/dpath/` are described.

~~~~
beluganos/
    etc/
        playbooks/
            hosts                           # Inventry file
            dp_sample.yml                   # Sample of playbok
            dp-<switch-name>.yml            # Playbook
            roles/
                dpath/
                    vars/                   # DO NOT EDIT.
                    tasks/                  # DO NOT EDIT.
                    files/
                        common/             # DO NOT EDIT.
                        sample_sw/          # Sample of files
                            fibc.yml
                        <switch-name>/      # Files
                            fibc.yml
~~~~

## Settings for white-box switches

**The sample playbook is `etc/playbooks/dp-sample.yml`**. You may copy sample file and rename this playbook. Any switch name (dpname) are acceptable, and this name is only used for internal configurations. If your switch name is *switchA*, please edit as follows:

~~~~
$ cd ~/beluganos/etc/playbooks
$ cp dp-sample.yml dp-switchA.yml
$ vi dp-switchA.yml

---

- hosts: hosts
  connection: local
  roles:
    - { role: dpath, dpname: switchA, mode: fibc }
  tags:
    fibc

~~~~

The syntax of this playbook is following:

~~~~
- hosts: hosts
  connection: local
  roles:
    - { role: dpath, dpname: <switch-name>, mode: fibc }
  tags:
    fibc
~~~~

- roles
	- dpname (`<switch-name>`): Your preferable switch name (A-Z,a-z,0-9,_-). Do not contain space.

### 2. switch type
**The sample configuration files are under `etc/playbooks/roles/dpath/files/sample_sw`**. The files under `roles/dpath` will determine the type of white-box switches. Beluganos will optimize the writing method to FIB for each switch type. If your switch's name is *switchA*, you may copy sample file and rename to dpname as follows:

~~~~
$ cd ~/beluganos/etc/playbooks
$ cp -r roles/dpath/files/sample_sw roles/dpath/files/switchA<commit_msg>[fix] remove old description<commit_after># Setup guide
This document describes about Beluganos's setup for hardware (white-box switches).

## Pre-requirements
- Please refer [install-guide.md](install-guide.md) before proceeding.

## Config files at a glance

The files under `etc/playbooks/` are configuration files. In this page, `dp-*.yml` and the files under `roles/dpath/` are described.

~~~~
beluganos/
    etc/
        playbooks/
            hosts                           # Inventry file
            dp_sample.yml                   # Sample of playbok
            dp-<switch-name>.yml            # Playbook
            roles/
                dpath/
                    vars/                   # DO NOT EDIT.
                    tasks/                  # DO NOT EDIT.
                    files/
                        common/             # DO NOT EDIT.
                        sample_sw/          # Sample of files
                            fibc.yml
                        <switch-name>/      # Files
                            fibc.yml
~~~~

## Settings for white-box switches

### 1. edit playbook

**The sample playbook is `etc/playbooks/dp-sample.yml`**. You may copy sample file and rename this playbook. Any switch name (dpname) are acceptable, and this name is only used for internal configurations. If your switch name is *switchA*, please edit as follows:

~~~~
$ cd ~/beluganos/etc/playbooks
$ cp dp-sample.yml dp-switchA.yml
$ vi dp-switchA.yml

---

- hosts: hosts
  connection: local
  roles:
    - { role: dpath, dpname: switchA, mode: fibc }
  tags:
    fibc

~~~~

The syntax of this playbook is following:

~~~~
- hosts: hosts
  connection: local
  roles:
    - { role: dpath, dpname: <switch-name>, mode: fibc }
  tags:
    fibc
~~~~

- roles
	- dpname (`<switch-name>`): Your preferable switch name (A-Z,a-z,0-9,_-). Do not contain space.

### 2. edit switch type
**The sample configuration files are under `etc/playbooks/roles/dpath/files/sample_sw`**. The files under `roles/dpath` will determine the type of white-box switches. Beluganos will optimize the writing method to FIB for each switch type. If your switch's name is *switchA*, you may copy sample file and rename to dpname as follows:

~~~~
$ cd ~/beluganos/etc/playbooks
$ cp -r roles/dpath/files/sample_sw roles/dpath/files/switchA
{'fraction_non_alphanumeric': 0.1011943539630836, 'fraction_numerical': 0.0015200868621064061, 'mean_word_length': 1.9337579617834395, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '2439382', 'n_tokens_mistral': 1354, 'n_tokens_neox': 1289, 'n_words': 461}