GUI Reference — sysreseval

Launching

source venv/bin/activate && python3 src/sysreseval.py   # dev
sysreseval                                              # production

One instance per user. A PID file at /tmp/sysreseval-{uid}.pid kills any prior instance on startup.

Opening a project

File → Open Project (or the + tab) shows a dialog built from sre list --with-titles. Leaves display each lab’s translated title (from per-directory titles.json sidecars, generated by sre make-titles), falling back to the filename without .py; a sub-directory listed in the titles.json of its parent shows its title too. The entries of a directory come in the order its titles.json sets ("@sort", see sre make-titles in the CLI reference): by file name, by title in the language priority of the GUI, or in the order of the file; the sub-directories always come first. The web front-end shows the same tree in the same order. If the lab’s Flavor sets flavor_form_at_startup = True, a form runs first. A progress dialog then tracks image pulls and container starts (JSON on stderr from sre start); the project tab appears when every machine is up.

During an exam, Open Project is disabled — only pre-authorised exam labs open automatically.

The project tabs are the projects of the logged-in user, plus those started on the host by root or the sre user (sudo sre start …). The projects of the other users of the host (another local login, the users of the web front-end placed on this host) are neither listed nor reachable through sre-wrapper; with check_project_owner = False in the site parameters every project of the host is listed, as before. File → Close All Projects runs sre-wrapper stop-all on the listed projects (sre wipe is privileged only).

Saving and restoring a project

File → Save Project appears only when the current project’s lab sets allow_save_restore = True. A file dialog asks where to write the .sre save file (default ~/<lab>.sre); the GUI then runs sre-wrapper save <project> with its stdout redirected to that file, showing a progress dialog. The file contains the filesystem of every machine (as a diff against its base image) and the project files; it is encrypted when the lab defines save_key.

File → Restore Project (always available outside exam mode) asks for a .sre file and runs sre-wrapper restore - with the file on stdin, showing the same image-pull / machine-start progress as Open Project. The saved project comes back as a new tab (new instance); the original one, if still open, is untouched. Only files are restored — the lab’s restore state relaunches its services.

Exporting a project

File → Export Kathara Project (enabled unless the lab sets export_kathara_project = False) runs sre-wrapper export <project> with the display settings of the Schema tab and writes ~/<lab>.zip: the Kathara project (lab.conf, the files of every machine) with schema.pdf and informations.pdf.

File → Export Schema to PDF (right below; enabled unless the lab sets export_schema_pdf = False) writes the drawing of the Schema tab to a PDF chosen in a file dialog (default ~/<lab>_schema.pdf): the visible machines only, never the hidden ones, even for a debug project or while the Instructor mode button is on, with the tab’s current Lines / Compact-Spread / Order / Icons settings and the machine order of info.json. The GUI draws it itself with graphviz from info.json; no sre command is run.

Both items are disabled in exam mode.

Project tabs

Tab

Content

Schema

Topology drawn by graphviz from the machines of info.json, without the hidden machines. Scroll = zoom, click-drag = pan.

Full Schema

Debug projects only (sre start --debug-project). The same drawing and controls with every machine: the hidden machines, their links and the networks only they use are in red, like the titles of the hidden machines in the Terminals tab. The Schema tab keeps showing what a student sees.

Informations

Markdown lab description from self.informations in NetScheme.__init__().

Machines

Per-machine state (polled from Kathara every 1 s), NAT network, ports, plus a Connect button opening an external terminal.

Networks

Always shown. One row per network with its type — Hub, Switch or Manageable switch — and, for a manageable switch the lab leaves open to students, a Connect button opening its management console in an external terminal (sre-wrapper connect <project> <network>). The type of a manageable switch the lab closed is on a red background and has no button — except in a debug project, where it gets an orange Connect button and an orange-titled terminal in the Terminals tab. See Hubs, switches and VLANs for the three types and the commands of the console.

Questions

Three types: question_text (free text), question_form (inline fields: single-line text with a regex, multi-line text, dropdown, checkbox — the @@{field:spec}@@ grammar is in Questions), question_dummy (display only). Written to answers/answers.json on every edit: the file is read first and only the answers changed in the GUI are merged in, then it is replaced atomically, so what the web front-end wrote meanwhile (the same student in a browser, an instructor helping) is kept; the read and the write are done under an advisory lock on the answers/ directory that the web agent takes too, so that two writes at the same moment do not lose one of them; the file is read again every second when another program changed it and the current question shows the new value.

Evaluation

Last grade table + Start evaluation button. Letter grades (OK/MEH/FAIL) appear when the lab sets no_mark_on_self_grade. A countdown replaces the button while delay_between_self_grade is active.

Terminals

Embedded terminals per machine, launched via params.terminal_cmd_prefix, plus one per manageable switch students may use (its console).

Log

Debug projects (sre start --debug-project), and instructor-mode projects while the Instructor mode button is on (states only). Live tail of the project’s operations.log: one === <time>  state <name> / === <time>  evaluation header per run, then one `stepN - on <machine

answers/answers.json also carries metadata (hostname, login, fullname, email, language, answers_updated_at, plus exam_* fields in exam mode, and group for the projects of the web front-end); see Archive format for the full schema.

Start evaluation runs sre eval --auto-eval in a background thread. The periodic background eval (eval_interval_without_exam_mode) and eval_before_exit run plain sre eval (no cooldown, no log line, no stdout).

Instructor mode

A project in instructor mode (sre start --instructor-mode, sre restore --instructor-mode or sre set-instructor-mode, all privileged) adds a checkable Instructor mode button (mortarboard icon) at the left of the Wrap / Settings / Language buttons. The button is visible only while the current tab is such a project; it is off when the GUI starts and its state is not saved.

Button

Informations / Questions

Apply Configuration

Log tab

off

Exactly what a student sees: the instructor() texts are not displayed.

Only the states a student may apply (the tab is hidden when there is none).

Hidden.

on

The instructor() texts are displayed in colour (params.instructor_text_color on params.instructor_background_color, or the colours given by the lab).

Every state of the lab, those reserved to the instructor in red.

Shown, with what each applied state executed (no evaluation).

The button applies to every open project in instructor mode. Switching the mode of an open project with sre set-instructor-mode / sre remove-instructor-mode is picked up within a second.

A debug project (sre start --debug-project, or --debug-web-project for a lab named from the catalog) shows the same button: its info.json holds the instructor() texts too. There the button only displays or hides those texts in the Informations and Questions views; every state and the Log tab are shown whatever its position, as in any debug project.

Exam mode

When /var/lib/sre/exam.json exists, the GUI switches modes: File → Open / Restore / Save / Close / Close All / Export Kathara Project / Export Schema to PDF are disabled, and answers re-save with an updated exam_time_remaining on every exam-config change.

Phase

Trigger

Shows / actions

Waiting

now < start_after

SRE logo + countdown to start_after. Calls sre pre-start-exam once ~60 s before start_after.

Active

start_after ≤ now < end and exam projects up

Project tabs + remaining-time countdown. Calls sre start-exam once on entry, sre eval-exam every eval_interval; re-calls pre-start-exam if labs changes.

Ended

now ≥ end_before, or now ≥ started_at + duration

Calls sre eval-exam then sre end-exam once; displays the That’s All Folks logo.

Settings

File → Settings (persisted in ~/.config/sysreseval, INI):

Section

Setting

Default

Effect / applies

Interface

Font size

10 pt

Menus and dialog text; immediate

Terminal

Font size

12 pt

Terminals opened after the change

Terminal

Color scheme

Black on White

black_on_white / white_on_black; new terminals

Schema

Lines

Straight

Straight or curved edges; next lab open

Schema

Spacing

3 (0–9)

Node spacing; next lab open

Schema

Nodes

Shapes

Icons or geometric shapes; next lab open

Content

Font size

12 pt

Informations + Questions panes; immediate