<commit_before>#cloud-config
bootcmd:
    - [ mkdir, -p, /run/disksetup ]
    - [ sh, -c, "EPHEMERALS=$(lsblk -ndpoNAME,MODEL | grep 'Instance Storage' | awk -v ORS=' ' '{print $1}'); echo EPHEMERALS=\\\"$EPHEMERALS\\\" > /run/disksetup/disksetup.sh" ]
    - [ sh, -c, "EPHEMERALCOUNT=$(lsblk -ndoNAME,MODEL | grep 'Instance Storage' | wc -l); echo EPHEMERALCOUNT=$EPHEMERALCOUNT >> /run/disksetup/disksetup.sh" ]
    - [ sh, -c, ". /run/disksetup/disksetup.sh; if ! blkid /dev/md0 > /dev/null && [ $EPHEMERALCOUNT -ne 0 ]; then for d in $EPHEMERALS; do dd if=/dev/zero bs=1M count=4 of=$d; done; partprobe; mdadm --create --verbose /dev/md0 --level=0 --raid-devices=$EPHEMERALCOUNT $EPHEMERALS && echo \\\"DEVICE $EPHEMERALS\\\" > /etc/mdadm/mdadm.conf; partprobe; fi" ]
    - [ sh, -c, "if ! blkid -L SCRATCH >/dev/null && lsblk -npoNAME /dev/md0 > /dev/null; then mkfs.ext4 -q -F -L SCRATCH -E nodiscard,lazy_itable_init /dev/md0; fi" ]

mounts:
    - [ "LABEL=SCRATCH", "/scratch", "auto", "defaults,noatime,nodiratime,nofail,nosuid,nodev,x-systemd.requires=cloud-init.service", "0", "2" ]

package_update: true
package_upgrade: true

packages:
    - build-essential
    - chrpath
    - socat
    - cpio
    - gawk
    - wget
    - git-core
    - diffstat
    - unzip
    - texinfo
    - gcc-multilib
    - gcc-7
    - g++-7
    - gcc-8
    - g++-8
    - python
    - python3
    - python3-pip
    - python3-pexpect
    - xz-utils
    - debianutils
    - iputils-ping
    - python3-git
    - python3-jinja2
    - libegl1-mesa
    - libsdl1.2-dev
    - pylint3
    - xterm
    - emacs
    - curl
    {% for pkg in extra_packages %}
    - {{ pkg }}
    {% endfor %}

users:
    - default
    - name: builder
      gecos: Auto Builder
      lock_passwd: true
      uid: "2000"
      shell: /bin/bash

write_files:
    - content: |
        WORKERNAME="{{ workername }}"
        WORKERSECRET="{{ workersecret }}"
        MASTER="{{ master_ip }}"
      path: /run/buildworker/settings
      permissions: '0600'
    - content: |
        {{ master_ip }} {{ master_hostname }} {{ master_fqdn }}
      path: /etc/hosts
      append: true

runcmd:
    - python3 -m pip install awscli
    - python3 -m pip install boto3
    - python3 -m pip install buildbot-worker
    - python3 -m pip install https://github.com/madisongh/buildworker-scripts/releases/download/v0.1.0-pre3/buildworker_scripts-0.1.0-py3-none-any.whl
    - python3 -m pip install https://github.com/madisongh/git-credential-aws-secrets/releases/download/v0.0.2/git_credential_aws_secrets-0.0.2-py3-none-any.whl
    - python3 -m pip install https://github.com/madisongh/digsigserver/releases/download/v0.3.5/digsigserver-0.3.5-py3-none-any.whl
    - mkdir /var/lib/bwsetup
    - [ sh, -c, "curl -L https://github.com/madisongh/buildworker-setup/releases/download/v0.2.2/buildworker-setup-0.2.2.tar.gz | tar -C /var/lib/bwsetup -x -z -f-" ]
    - [ sh, -c, "cd /var/lib/bwsetup/buildworker-setup-0.2.2; ./configure --prefix=/usr --with-buildbot-worker-prefix=/usr/local --with-digsig-prefix=/usr/local --with-keyfile-uri=s3://systems.madison.codesign-material && make && make install" ]
    - systemctl enable buildworker-setup.service
    - systemctl enable buildworker.service
    - systemctl enable digsigserver.service
    - systemctl start buildworker-setup
    {% for cmd in extra_cmds %}
    - {{ cmd }}
    {% endfor %}
    - systemctl start digsigserver
    - systemctl start buildworker<commit_msg>cloud-init.txt: bump version of digsigserver<commit_after>#cloud-config
bootcmd:
    - [ mkdir, -p, /run/disksetup ]
    - [ sh, -c, "EPHEMERALS=$(lsblk -ndpoNAME,MODEL | grep 'Instance Storage' | awk -v ORS=' ' '{print $1}'); echo EPHEMERALS=\\\"$EPHEMERALS\\\" > /run/disksetup/disksetup.sh" ]
    - [ sh, -c, "EPHEMERALCOUNT=$(lsblk -ndoNAME,MODEL | grep 'Instance Storage' | wc -l); echo EPHEMERALCOUNT=$EPHEMERALCOUNT >> /run/disksetup/disksetup.sh" ]
    - [ sh, -c, ". /run/disksetup/disksetup.sh; if ! blkid /dev/md0 > /dev/null && [ $EPHEMERALCOUNT -ne 0 ]; then for d in $EPHEMERALS; do dd if=/dev/zero bs=1M count=4 of=$d; done; partprobe; mdadm --create --verbose /dev/md0 --level=0 --raid-devices=$EPHEMERALCOUNT $EPHEMERALS && echo \\\"DEVICE $EPHEMERALS\\\" > /etc/mdadm/mdadm.conf; partprobe; fi" ]
    - [ sh, -c, "if ! blkid -L SCRATCH >/dev/null && lsblk -npoNAME /dev/md0 > /dev/null; then mkfs.ext4 -q -F -L SCRATCH -E nodiscard,lazy_itable_init /dev/md0; fi" ]

mounts:
    - [ "LABEL=SCRATCH", "/scratch", "auto", "defaults,noatime,nodiratime,nofail,nosuid,nodev,x-systemd.requires=cloud-init.service", "0", "2" ]

package_update: true
package_upgrade: true

packages:
    - build-essential
    - chrpath
    - socat
    - cpio
    - gawk
    - wget
    - git-core
    - diffstat
    - unzip
    - texinfo
    - gcc-multilib
    - gcc-7
    - g++-7
    - gcc-8
    - g++-8
    - python
    - python3
    - python3-pip
    - python3-pexpect
    - xz-utils
    - debianutils
    - iputils-ping
    - python3-git
    - python3-jinja2
    - libegl1-mesa
    - libsdl1.2-dev
    - pylint3
    - xterm
    - emacs
    - curl
    {% for pkg in extra_packages %}
    - {{ pkg }}
    {% endfor %}

users:
    - default
    - name: builder
      gecos: Auto Builder
      lock_passwd: true
      uid: "2000"
      shell: /bin/bash

write_files:
    - content: |
        WORKERNAME="{{ workername }}"
        WORKERSECRET="{{ workersecret }}"
        MASTER="{{ master_ip }}"
      path: /run/buildworker/settings
      permissions: '0600'
    - content: |
        {{ master_ip }} {{ master_hostname }} {{ master_fqdn }}
      path: /etc/hosts
      append: true

runcmd:
    - python3 -m pip install awscli
    - python3 -m pip install boto3
    - python3 -m pip install buildbot-worker
    - python3 -m pip install https://github.com/madisongh/buildworker-scripts/releases/download/v0.1.0-pre3/buildworker_scripts-0.1.0-py3-none-any.whl
    - python3 -m pip install https://github.com/madisongh/git-credential-aws-secrets/releases/download/v0.0.2/git_credential_aws_secrets-0.0.2-py3-none-any.whl
    - python3 -m pip install https://github.com/madisongh/digsigserver/releases/download/v0.3.6/digsigserver-0.3.6-py3-none-any.whl
    - mkdir /var/lib/bwsetup
    - [ sh, -c, "curl -L https://github.com/madisongh/buildworker-setup/releases/download/v0.2.2/buildworker-setup-0.2.2.tar.gz | tar -C /var/lib/bwsetup -x -z -f-" ]
    - [ sh, -c, "cd /var/lib/bwsetup/buildworker-setup-0.2.2; ./configure --prefix=/usr --with-buildbot-worker-prefix=/usr/local --with-digsig-prefix=/usr/local --with-keyfile-uri=s3://systems.madison.codesign-material && make && make install" ]
    - systemctl enable buildworker-setup.service
    - systemctl enable buildworker.service
    - systemctl enable digsigserver.service
    - systemctl start buildworker-setup
    {% for cmd in extra_cmds %}
    - {{ cmd }}
    {% endfor %}
    - systemctl start digsigserver
    - systemctl start buildworker
{'fraction_non_alphanumeric': 0.15710794882851803, 'fraction_numerical': 0.020986057208566913, 'mean_word_length': 2.4912192674360263, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1064014', 'n_tokens_mistral': 2750, 'n_tokens_neox': 2631, 'n_words': 503}