Skip to content

Instantly share code, notes, and snippets.

@vans163
Last active September 24, 2016 03:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vans163/7d26a4651ef56fe0352563cc45a09e8b to your computer and use it in GitHub Desktop.
Save vans163/7d26a4651ef56fe0352563cc45a09e8b to your computer and use it in GitHub Desktop.
Saltstack erlang development configuration
# "(( id|processo).*:|^ *$)" /proc/cpuinfo
kernel.grub_args:
file.replace:
- path: /etc/default/grub
- repl: 'GRUB_CMDLINE_LINUX_DEFAULT="intel_iommu=on isolcpus=1-15,17-31 nohz_full=1-15,17-31 rcu_nocbs=1-15,17-31 default_hugepagesz=1GB hugepagesz=1GB hugepages=8"'
- pattern: 'GRUB_CMDLINE_LINUX_DEFAULT=".*?"'
- flags: ['IGNORECASE', 'MULTILINE']
#cat /proc/cmdline
#grub2-mkconfig -o /boot/grub2/grub.cfg
kernel.irqbalance:
file.replace:
- path: /etc/default/irqbalance
- repl: 'ENABLED="0"'
- pattern: 'ENABLED=".*?"'
- flags: ['IGNORECASE', 'MULTILINE']
kernel.ksm:
cmd.run:
- unless: if [ $(cat /sys/kernel/mm/ksm/run) != "0" ]; then do_error; fi
- name: |
echo 0 > /sys/kernel/mm/ksm/run
echo 0 > /sys/kernel/mm/ksm/merge_across_nodes
kernel.ulimit:
cmd.run:
- name: |
echo 20000000 > /proc/sys/fs/nr_open
ulimit -n 20000000
kernel.tcp:
cmd.run:
- name: |
echo "1024 4096 16384" > /proc/sys/net/ipv4/tcp_rmem
echo "1024 4096 16384" > /proc/sys/net/ipv4/tcp_wmem
echo "0" > /proc/sys/net/ipv4/tcp_moderate_rcvbuf
util.packages:
pkg.installed:
- pkgs:
- git
{% if grains['os'] == 'Fedora' %}
- vim-enhanced
{% else %}
- vim
{% endif %}
monitor.packges:
pkg.installed:
- pkgs:
- iotop
- iftop
- htop
- byobu
- tcpdump
https://github.com/erlang/otp:
git.latest:
- rev: OTP-19.1
- target: /src_code/otp
- require:
- pkg: git
erlang_R19_compile:
require:
- git: https://github.com/erlang/otp
cmd.run:
- unless: if [ $(erl -noshell -eval "{ok, Version} = file:read_file(filename:join([code:root_dir(), \"releases\", erlang:system_info(otp_release), \"OTP_VERSION\"])), io:fwrite(\"~s\", [Version]), halt().") != "19.1" ]; then do_error; fi
- cwd: /src_code/otp
- name: |
{% if grains['os'] == 'Fedora' %}
dnf install -y @development-tools m4 sed autoconf openssl-devel ncurses-devel
{% else if grains['os'] == 'Debian' %}
apt-get install -y build-essential m4 sed autoconf libssl-dev ncurses-dev libwxgtk3.0-dev
{% else %}
{% endif %}
export MAKEFLAGS=-j$(nproc)
export ERL_TOP=`pwd`
./otp_build autoconf
./configure
make
make install
erlang_rebar3_compile:
cmd.run:
- unless: if [ $(rebar3 -v | awk '{print $2}') != "3.2.0" ]; then do_error; fi
- cwd: /usr/bin
- name: |
wget https://s3.amazonaws.com/rebar3/rebar3
chmod +x rebar3
mkdir -p ~/.config/rebar3/
echo "{plugins, [rebar3_auto]}." > ~/.config/rebar3/rebar3.config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment