google / kctf

kCTF is a Kubernetes-based infrastructure for CTF competitions. For documentation, see
https://google.github.io/kctf/
Apache License 2.0
665 stars 73 forks source link

rebuild binaries on demand only #270

Open sroettger opened 3 years ago

sroettger commented 3 years ago

Once the CTF started, you want to be able to make small fixes in the docker image without rebuilding the challenge binary since rebuilding it means you will need to distribute the new binary to the players.

This doesn't work with the current proposed way to build challenge binaries (as part of the dockerimage) since redeploying will result in a new binary.

We should have a way to

During challenge development, the default should be build=true (otherwise you forget about it and are surprised). During the competition the default should be build=false (otherwise you rebuild by mistake and might not notice).

sroettger commented 3 years ago

this can be as simple as:

if [ KCTF_DO_BUILD == 1 ] && [ -f "challenge/Makefile ]; then
  make -C challenge
done

For dev clusters you configure KCTF_DO_BUILD to be 1, for release clusters you set it to 0 and run make manually if you must.