1个不稳定版本
| 0.1.2 | 2020年3月22日 |
|---|---|
| 0.1.1 |
|
| 0.1.0 |
|
#977 in 文件系统
每月 22 下载
87KB
2K SLoC
郁金香

郁金香是Project Polya的一部分。
它是端点程序,负责创建裁判环境和运行学生项目。
tulip 0.1.0
USAGE:
tulip [OPTIONS] <SUBCOMMAND>
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-l, --log-level <log-level> The log level [env: TULIP_LOG_LEVEL=] [default: info] [possible values: error,
trace, info, debug, off, warn]
-n, --nutshell <nutshell> Path to nutshell binary [env: NUTSHELL_BIN=] [default: nutshell]
-t, --tulip-dir <tulip-dir> The work directory of tulip [env: TULIP_DIR=] [default: .tulip]
SUBCOMMANDS:
auto-current Auto run the current project
build Build the current project
clean-all Unregister the client and clean up local environment
clear Clear the current project
comment Open the comment editor
destroy-overlay Delete the current overlay system
enter-sandbox Manually enter the sandbox
fetch Fetch student project
grade Give a grade to the student
help Prints this message or the help of the given subcommand(s)
init-overlay Initialize the overlay filesystem
mark Mark the current project
pull Pull the target student project
pull-image Pull the base image
refresh-config Refresh the global config
register Register this client
report Read the report
run Build the current project
skip Skip the current project
status See the current status
submit Edit current global settings
使用要求
-
需要
Linux。 -
nutshell已安装并放在PATH中。 -
需要其中之一
aria2c或wget。 -
openssl可用于https。 -
sudo在PATH中,并且你有成为root的权限。 -
需要
systemd-nspawn和firejail进行沙盒。
构建要求
- 需要
Linux。 - 确保您的rust工具链正在运行。
cmake已安装,并且c/c++开发环境准备好通过cargo调用。
环境变量
-
以下变量是可选的,也可以作为命令行参数传递
TULIP_LOG_LEVELtulip的日志级别,默认设置为info。建议设置为比warn更细的级别。可能的值-
off
-
error
-
warn
-
info
-
debug
-
trace
-
TULIP_REPORT_READER打开学生报告的应用程序,默认设置为xdg-open。NUTSHELL_BINnutshell可执行文件路径,默认设置为nutshell。TULIP_DIRtulip的工作目录,默认设置为.tulipTULIP_MOUNT_DIR临时overlayfs的挂载目录。注意:默认设置为\mnt
-
以下系统变量被使用
- 如果设置了,将使用
EDITOR编辑配置
- 如果设置了,将使用
-
以下变量必须提供或作为命令行参数传递
TULIP_SERVER如果设置了,将用于注册TULIP_TOKEN如果设置了,将用于注册
关于评分状态
-
一旦项目被获取,它将被获取者锁定。
-
可以通过
commit/skip/revoke来解锁项目,其中最后一个操作包含在clean-all中。 -
pull总是允许的。然而,如果当前项目是拉取的而不是获取的,您将始终需要使用--override标志来更新远程状态。 -
commit可以用来提交当前项目。然而,如果存在以前的提交,必须设置--override标志。 -
fetch将自动获取下一个未被触及的项目。 -
skip可以忽略当前项目并解锁它。然而,一旦项目被skipped,它只能被拉取,不会放入可获取列表中。
关于评分流程
-
您需要在最开始注册一个 UUID。
-
评分之前,您应该拉取一个镜像。默认的
pull-image将下载镜像和全局配置。然而,它们都可以在本地设置。-
image可以通过将镜像放入<workdir>/image/image.sfs并使用带有--local-set的pull-image子命令来设置。 -
global-config可以通过tulip status edit-global来设置。
-
-
现在,您可以拉取或获取一个项目。在拉取时,您可以使用
tulip status remote [--detail]或tulip status remote-id --id <student id>。如果在获取项目文件时遇到下载错误或者您只想更新当前项目信息,可以使用tulip fetch --download-only -
如何初始化覆盖。学生文件通过
rsynced放入 chroot 环境中的/data目录。 -
您可以使用
build子命令来构建项目。 -
您可以使用
run子命令来运行项目。 -
您可以使用
comment子命令来留言。 -
您可以使用
grade -s <score>子命令来评分项目。 -
您可以使用
mark [-r]子命令来标记/取消标记项目。 -
您可以使用
commit/skip子命令来提交/跳过项目。 -
您可以使用
report子命令来阅读学生的报告。 -
在整个过程中,您可以使用
enter-sandbox来进入沙盒,包括firejail和systemd-nspawn。 -
在本地项目设置后,可以通过
auto-current子命令整体调用构建-运行-报告过程。
注意
有很多更多细节:例如,您可以强制重建,强制重新评分,直接编辑状态等。所有功能都在CLI中详细描述。如果您感到困惑,请随时使用--help调用CLI。
配置
依赖项
~42–58MB
~1M SLoC