Event Feed module

From PC2wiki
Jump to: navigation, search

The Event Feed module provides Event Feed and PC² REST services for a programming contest.

Startup

  1. Create a FEEDER pc2 account.
  2. Use the pc2ef script to start the Event Feed module

This command will bring up the event feed server and REST web service server GUI. The event feed server will not be started by default.

bin/pc2ef

This command will start the event feed server non-GUI. The event feed server will be started by default.

bin/pc2ef --login feeder1 --password feeder1 --nogui

Non-gui startup options

On the machine where the feeder/board will be started the web services can be enabled and disable using settings found in pc2ws.properties.

Sample pc2ws.properties file

#
# File:    pc2ws.properties
# Purpose: Sample PC^2 Web Server properties
# Revised: Wed May 10 11:17:45 PDT 2017
#

# enable scoreboard web service
enableScoreboard=yes

# port for web service
port=50443

# enable teams web service
enableTeams=yes

# enable starttime web service
enableStartTime=yes

# enable language web service
enableLanguages=yes

# enable problems web service
enableProblems=yes

# enable submission_files web service
enableFetchRun=yes

# eof pc2ws.properties

Each web server service defaults to NOT enabled for security reasons

Here is a sample of the output to the pc2 log:

161028 195432.544|INFO|Thread-3|showMessage|Event Feed server listening on port 4713
161028 195432.544|INFO|Thread-3|showMessage|Found web server properties file pc2ws.properties loading...
161028 195432.545|INFO|Thread-3|showMessage|Loaded {enableScoreboard=yes, port=50443, enableTeams=yes, enableLanguage=yes, enableStartTime=yes, enableProblem=yes}
161028 195432.545|INFO|Thread-3|showMessage|Starting Web Server
161028 195432.643|INFO|Thread-3|showMessage|Starting /scoreboard web service
161028 195432.644|INFO|Thread-3|showMessage|Starting /problem web service
161028 195432.645|INFO|Thread-3|showMessage|Starting /languages web service
161028 195432.647|INFO|Thread-3|showMessage|Starting /starttime web service
161028 195432.648|INFO|Thread-3|showMessage|Starting /teams web service
161028 195432.671|INFO|Thread-3|showMessage|Loading /root/contest/csus-f2016/ef/realm.properties
161028 195433.088|INFO|Thread-3|showMessage|Started web server on port 50443

Features

GUI

Event Feed Tab

  • Event feed port field - port number to use, default 4713
  • View button - show a snapshot of the current event feed
  • Start - start Event Feed Server
  • Stop - stop Event Feed Server

EventFeedTab.png

Web Services Tab

PC² REST services control

  • Web server port field - port number to use, default 50443
  • Enable Web Services
    • /scoreboard
    • /teams
    • /problems
    • /languages
  • Start - start serving PC² REST services
  • Stop - stop serving PC² REST services


WebServicesTab.png

See Also