Skip to content

Notes on YAML Loading

John Clevenger edited this page Jul 17, 2022 · 1 revision

PC2V9 supports configuring a contest by loading a contest configuration description from a set of YAML files. This page contains various notes related to loading YAML files in PC2V9. For a complete description of the use of YAML files to specify a contest configuration, see the PC2V9 Contest Administrator's Guide, which can be found in the doc/ folder in every PC2v9 distribution. See also the PC2 Wiki page YAML Contest Configuration.

--load does not overwrite

Specifying a --load parameter when starting a PC2v9 Server normally causes the Server to load the contest configuration specified by the argument following the --load. However, while --load does load the YAML configuration on Server first startup, once a configuration is present (i.e., has been loaded) --load is "disabled".

This allows using the --load unconditionally in scripts without overwriting the existing config.

The Admin UI can be used to update/overwrite the current configuration using YAML.

--load NAME supports a bunch of ways to identify CDPs

The NAME argument following the --load parameter is used to specify either a YAML file, or a Contest Data Package (CDP). A CDP is a folder containing a set of contest configuration items (including YAML files). The only requirement when specifying a CDP instead of an explict YAML file is that PC2 finds a contest.yaml file in the CDP folder. For convenience, there are a number of methods used to search for a contest.yaml file, as shown below:

--load FILENAME where FILENAME is contest.yaml or a path to contest.yaml.

For example: --load c:\cdps\spring2020\config\contest.yaml

--load DIRNAME where DIRNAME is the base directory name or config directory name

--load c:\cdps\spring2020 or --load c:\cdps\spring2020\config

--load SAMPLE_CONTEST_CDP
Using the above form, any CDP under the samps/contest folder can be loaded by directory name. SAMPLE_CONTEST_CDP directories include: ccs1, ccs2, mini, sumithello, sumitMTC.

For example: --load sumithello or --load sumitMTC

All YAML files that are loaded

PC2v9 contains support for loading a set of YAML files including the CLICS YAML files. CLICS YAML files are:
contest.yaml
system.yaml
problemset.yaml

PC2v9 will also load a PC2-specific YAML file; the file name is: system.pc2.yaml

system.pc2.yaml

A sample system.pc2.yaml file is shown below:

 sites:
 # Defined by default
 #  - number: 1
 #    name: 'Site 1'
 #    password: site1
 #    IP: localhost
 #    port: 50002
 
  - number: 2
    name: 'Site 2'
    password: site2
    IP: localhost
    port: 51002
 
  - number: 3
    name: 'Site 3'
    password: site3
    IP: localhost
    port: 52002
 
  - number: 4
    name: 'Site 4'
    password: site4
    IP: localhost
    port: 53002
 
  - number: 5
    name: 'Site 5'
    password: site5
    IP: localhost
    port: 54002
 
  - number: 6
    name: 'Site 6'
    password: site6
    IP: localhost
    port: 55002
 
 accounts:
  - account: TEAM
    site: 1
    count: 20
 
  - account: JUDGE
    site: 1
    count: 12
 
  - account: SCOREBOARD
    site: 1
    count: 1
 
  - account: FEEDER
    site: 1
    count: 1
 
  - account: ADMINISTRATOR
    site: 1
    count: 2

PC2 Logo

Clone this wiki locally