Compare commits

...

6 Commits

8 changed files with 232 additions and 2 deletions
+28 -2
View File
@@ -1,3 +1,29 @@
# benchmark-states
# Bit Goblin Benchmarking States
A collection of SaltStack states to configure benchmarking systems consistently.
A collection of SaltStack states to configure benchmarking systems consistently.
## Deploying
The only thing required for deploying and running these states is [Salt Formula Manager](https://git.metaunix.net/Metaunix/salt-formula-manager).
To install the formulas with SFM: `sfm`
## Running States
The states in this collection are intended to be run via Salt SSH, or a Salt run locally. You *can* run them via a Salt minion/master setup, **but you should verify the minion is disabled before benchmarks are run** to make sure it doesn't impact benchmarks.
Apply states: `salt-call -c ./config --local state.apply`
## Available States
* `gaming` - installs software needed for running gaming benchmarks (e.g. Steam, MangoHUD)
* `cpu_compute` - installs benchmarks/tools needed for running CPU compute benchmarks
* `gpu_compute` - installs benchmarks/tools needed for running GPU compute benchmarks
## Development
To run the Salt Linter, use the script in `./bin/salt-lint.sh`:
`./bin/salt-lint.sh`
This requires installing Docker.
+4
View File
@@ -0,0 +1,4 @@
#!/bin/bash
docker run -v $(pwd):/src:ro --entrypoint=/bin/bash -it warpnetbv/salt-lint:v0.9.2 \
-c 'find /src -type f -name "*.sls" -print0 | xargs -0 --no-run-if-empty salt-lint'
+12
View File
@@ -0,0 +1,12 @@
# config/minion
file_client: local
# Relative paths resolved from the directory where salt-call is executed
file_roots:
base:
- ./states
- ./formulas/*
pillar_roots:
base:
- ./pillar
+90
View File
@@ -0,0 +1,90 @@
# NTP (chrony) client configs
chrony:
ntpservers:
- virginia.time.system76.com
- ohio.time.system76.com
- oregon.time.system76.com
options: 'iburst nts'
allow:
- 127.0.0.1
# Common packages to install everywhere - this is self-explanatory
packages:
pkgs:
wanted:
- bash
- curl
- git
- gzip
- rsync
- screen
- unzip
- wget
- zip
# SSH server config
openssh:
banner_string: |
# ____ _ _ ____ _ _ _
# | __ )(_) |_ / ___| ___ | |__ | (_)_ __
# | _ \| | __| | | _ / _ \| '_ \| | | '_ \
# | |_) | | |_ | |_| | (_) | |_) | | | | | |
# |____/|_|\__| \____|\___/|_.__/|_|_|_| |_|
#
# The machine you are currently attempting to access is
# restricted to only those within the Bit Goblin organization and
# those otherwise granted permission to do so. Unauthorized access
# is prohibited. This system is monitored, and actions are logged.
#
sshd_config:
ListenAddress: '0.0.0.0'
Port: 22
Protocol: 2
Banner: '/etc/ssh/banner'
HostKey:
- '/etc/ssh/ssh_host_rsa_key'
- '/etc/ssh/ssh_host_ecdsa_key'
- '/etc/ssh/ssh_host_ed25519_key'
SyslogFacility: 'AUTHPRIV'
LogLevel: 'INFO'
LoginGraceTime: 120
PermitRootLogin: 'without-password'
PasswordAuthentication: 'yes'
PubkeyAuthentication: 'yes'
PermitEmptyPasswords: 'no'
X11Forwarding: 'yes'
PrintMotd: 'yes'
UsePAM: 'yes'
UseDNS: 'yes'
# Timezone configuration - self-explanatory, but turns off UTC system clock
timezone:
name: 'America/New_York'
utc: True
# Host vim configuration - tries to set sane defaults
vim:
managed_vimrc: False
config:
syntax: 'on'
settings:
bs: indent,eol,start
cindent:
nocompatible:
smartindent:
laststatus: 2
tabstop: 4
softtabstop: 4
shiftwidth: 4
noexpandtab:
nowrap:
swapsync: ''
mappings:
<C-u>: :tabp<enter>
<C-i>: :tabn<enter>
<C-J>: <C-W>j
<C-K>: <C-W>k
<C-H>: <C-W>h
<C-L>: <C-W>l
+4
View File
@@ -0,0 +1,4 @@
base:
## Common stuff
'*':
- common
+32
View File
@@ -0,0 +1,32 @@
---
# the default formula url
formulas_url: https://github.com/saltstack-formulas/
# where to store the new formulas (relative to current directory)
formulas_dir: ./formulas
# remove unmanaged formulas
purge_formulas: true
# list of formulas to import
formulas:
- chrony:
version: v1.3.0
- openssh:
version: v3.0.1
- packages:
version: v0.13.0
- salt:
version: v1.13.0
- sudoers:
version: v0.23.3
- system:
version: v0.2.0
url: https://git.metaunix.net/Salt-Formulas/system-formula.git
- timezone:
version: v0.4.4
- users:
version: v0.48.6
- vim:
version: v0.15.4
+49
View File
@@ -0,0 +1,49 @@
# 1. Enable 32-bit architecture required for Steam
enable_i386_architecture:
cmd.run:
- name: dpkg --add-architecture i386
- unless: dpkg --print-foreign-architectures | grep -q i386
{% if grains['os'] == 'Ubuntu' %}
# 2a. Ensure universe and multiverse repositories are enabled on Ubuntu
enable_ubuntu_repos:
pkgrepo.managed:
- name: "deb http://archive.ubuntu.com/ubuntu/ {{ grains['oscodename'] }} main restricted universe multiverse"
- file: /etc/apt/sources.list.d/official-package-repositories.list
- clean_file: True
- require_in:
- pkg: install_gaming_tools
{% elif grains['os'] == 'Debian' %}
# 2b. Ensure contrib and non-free repositories are enabled on Debian
enable_debian_repos:
pkgrepo.managed:
- name: "deb http://deb.debian.org/debian/ {{ grains['oscodename'] }} main contrib non-free non-free-firmware"
- file: /etc/apt/sources.list.d/official-package-repositories.list
- clean_file: True
- require_in:
- pkg: install_gaming_tools
{% endif %}
# 3. Refresh package lists after adding i386 and repositories
update_apt_cache:
cmd.run:
- name: apt-get update
- onchanges:
- cmd: enable_i386_architecture
{% if grains['os'] == 'Ubuntu' %}
- pkgrepo: enable_ubuntu_repos
{% elif grains['os'] == 'Debian' %}
- pkgrepo: enable_debian_repos
{% endif %}
- require_in:
- pkg: install_gaming_tools
# 4. Install Steam and MangoHud
install_gaming_tools:
pkg.installed:
- pkgs:
- steam:i386
- mangohud
- require:
- cmd: enable_i386_architecture
+13
View File
@@ -0,0 +1,13 @@
base:
## Common stuff
'*':
# base system configuration; these need to run early and in a specific order
- timezone
- chrony
- openssh
- openssh.banner
- openssh.config
- vim
- system.sleep
# keep this at the end of the common stuff since these are one-off installs
- packages