Skip to content

CodeRunner Configuration

edmundhighcock edited this page Apr 2, 2016 · 12 revisions

Introduction

CodeRunner global configuration is hierarchical. The hierarchy is:

  1. The file coderunner/config.rb in the coderunner gem.
  • The file ~/.coderunner/config.rb.
  • Individual environment variables such as CODE_RUNNER_NO_REPO or CODE_RUNNER_SYSTEM.

All these are ways of changing the configuration stored in the hash CodeRunner::GLOBAL_OPTIONS.

Setting an option

Here we show how to set an example option: :system. If you are on a high performance computer, you will typically want to get CodeRunner to use the appropriate system configuration module (e.g. which batch launcher to use, etc). You will therefore want to set the :system global option. You can do this in 2 ways:

either edit ~/.coderunner/config.rb

CodeRunner::GLOBAL_OPTIONS[:system] = "archer"

or

export CODE_RUNNER_SYSTEM=archer

Available options

The full list of available options and defaults is (see coderunner/config.rb in case this is out of date):

  GLOBAL_OPTIONS = {
    system: 'generic_linux', # See coderunner/system_modules for more options
    short_run_name: false, # If true, use simple run_names like v_id_1
    no_repo: true, # Disable CodeRunner repo, true for now as in development
    simple_prompt: false, # If true have a less fancy prompt in interactive mode
    non_interactive: false, # If true, don't prompt for feedback when executing commands. Use with caution.
  }

##Configuring Interactive Mode

The default configuration for CodeRunner interactive mode is in /coderunner/interactive_config.rb. You can add additional configuration (or change things like the prompt) by creating and adding code to the file ~/.coderunner/interactive_config.rb

Clone this wiki locally