[buildout]
extends =
  ../../../component/vm-img/debian.cfg
parts =
  stress

[stress]
<= vm-run-base
smp = 8
# NEO processes take ~2G with default settings,
# the rest is mainly for the DB (which is in tmpfs)
mem = 4096
duration = 3600
stress-args =
run-args = -L .24 -r 0
mount.slapos = ${:_profile_base_location_}/../../..
command =
  mkdir log software
  cd software
  cat <<EOF >buildout.cfg
  [buildout]
  extends =
    /mnt/slapos/software/neoppod/software.cfg
    /mnt/slapos/software/neoppod/sqlite-mixin.cfg
  parts =
    neoppod-develop
    neoppod
  develop = /mnt/slapos
  extensions -= slapos.rebootstrap
  [slapos-cookbook-develop]
  recipe =
  setup =
  [neoppod-repository]
  repository = /mnt/neoppod
  shared = true
  [neoppod]
  eggs +=
    NetfilterQueue
    gevent
  interpreter = py
  [versions]
  slapos.cookbook =
  NetfilterQueue = 0.8.1
  # use the following components from the OS
  # and don't build dependencies for nothing
  [git]
  recipe =
  location = /usr
  environment =
  configure-options =
  [openssl]
  recipe =
  location = /usr
  configure-options =
  make-options =
  make-targets =
  environment =
  [perl]
  recipe =
  location = /usr
  configure-command =
  environment =
  [pkgconfig]
  recipe =
  location = /usr
  environment =
  [python2.7]
  recipe =
  location = /usr
  environment =
  [xz-utils]
  recipe =
  location = /usr
  EOF
  python -S /mnt/buildout/bin/buildout bootstrap
  MAKEFLAGS=-j${:smp} bin/buildout
  df ~ /tmp >&2
  screen -L -Logfile $PARTDIR/stdout -D -m sudo /mnt/slapos/software/neoppod/stress-testing/stress $PARTDIR ${:duration} ${:stress-args} -- ${:run-args}
  df ~ /tmp >&2
