zenika/ztraining2strigoztraining2strigo Docker镜像是一个用于为Zenika培训创建和管理Strigo课程的工具。它提供了交互式配置创建、现有课程配置检索以及基于本地配置更新Strigo课程的功能,帮助培训管理者高效维护Strigo平台上的培训课程。
strigo.json配置文件适用于Zenika培训课程管理者或培训师,需要在Strigo平台上创建、维护和更新培训课程,尤其是需要标准化课程配置和脚本管理的场景。
shelldocker image pull zenika/ztraining2strigo:x.y.z
为简化命令使用,建议创建别名:
shellalias ztraining2strigo='docker container run --rm --volume $(pwd):/training --user $(id -u):$(id -g) --env STRIGO_ORG_ID --env STRIGO_API_KEY --env Z2S_TRACE_HTTP --interactive --tty zenika/ztraining2strigo:x.y.z'
STRIGO_ORG_ID:对应"Organization ID"的值STRIGO_API_KEY:对应"API Key"的值若未设置环境变量,工具将在启动时交互式询问凭据。
shell$ ztraining2strigo --help usage: ztraining2strigo [-h] [--config CONFIG] COMMAND ... positional arguments: COMMAND sub-command help create Create config for new Strigo class. The class parameters are asked interactively. retrieve Retrieve config from existing Strigo class update Update Strigo class from config optional arguments: -h, --help show this help message and exit --config CONFIG
shell$ ztraining2strigo retrieve --help usage: ztraining2strigo retrieve [-h] CLASS_ID positional arguments: CLASS_ID Existing Strigo class ID optional arguments: -h, --help show this help message and exit
功能:从现有Strigo课程创建配置文件
strigo.json(或--config指定的文件)Installation/strigo/init_<machine_name>.shInstallation/strigo/post_launch_<machine_name>.shshell$ ztraining2strigo create --help usage: ztraining2strigo create [-h] optional arguments: -h, --help show this help message and exit
功能:交互式创建新的Strigo课程配置
strigo.jsonshell$ ztraining2strigo update --help usage: ztraining2strigo update [-h] [--dry-run] [--diff] optional arguments: -h, --help show this help message and exit --dry-run, -n Do not perform update --diff, -d Display diff of changes to apply in machines scripts
功能:基于本地配置更新Strigo课程
--dry-run选项可检查是否需要更新--diff选项可显示脚本变更差异配置文件采用JSON格式,默认保存为培训根目录的strigo.json,遵循JSON Schema([***]
id: Strigo课程ID(不应修改)name: 课程名称description: 课程描述(字符串列表,支持多行)labels: 课程标签列表presentations: 演示材料列表(目前仅支持1个元素)
file: 演示文件路径(通常为pdf/Zenika-training-material-Slides.pdf)notes_source: 幻灯片列表路径(应为Slides/slides.json)resources: 实验机器列表
name: 机器显示名称instance_type: 机器规格(t3.medium/t3.large/t3.xlarge)image: 机器镜像(可使用预配置镜像名称或自定义镜像)
-)image_id(AMI ID)、image_user(默认用户)、ec2_region(区域)init_scripts: 初始化脚本列表(内容将合并为一个Strigo初始化脚本)
path(培训仓库中的本地路径)script(脚本文件名)、version(git版本,默认main)、env(环境变量映射)post_launch_scripts: 启动后脚本列表(仅Windows,格式同init_scripts)view_interface: 默认界面(terminal/desktop,默认无)webview_links: Web界面链接列表
name: 界面名称url: 界面URL(如[***]<port>)json{ "$schema": "[***]", "name": "My training", "id": "43t8s3ZNSGwy89Ffo", "description": [ "The description of the training", "", "Can be on multiple lines in a list" ], "presentations": [ { "file": "pdf/Zenika-training-material-Slides.pdf", "notes_source": "Slides/slides.json" } ], "resources": [ { "name": "machine1", "instance_type": "t2.medium", "image": "ubuntu-16.04.2", "init_scripts": [ { "path": "Installation/strigo/init_all.sh" }, { "path": "Installation/strigo/init_machine1.sh" }, { "script": "code-server.sh", "env": { "code_server_version": "3.11.1", "code_server_extensions": "ms-azuretools.vscode-docker coenraads.bracket-pair-colorizer-2", "code_server_settings": "{\"workbench.colorTheme\": \"Default Dark+\"}" } } ], "post_launch_scripts": [], "webview_links": [ { "name": "code-server", "url": "[***]" } ] } ] }
设置环境变量Z2S_TRACE_HTTP为1或True可启用HTTP请求跟踪:
shellexport Z2S_TRACE_HTTP=1
manifest unknown 错误
TLS 证书验证失败
DNS 解析超时
410 错误:版本过低
402 错误:流量耗尽
身份认证失败错误
429 限流错误
凭证保存错误
来自真实用户的反馈,见证轩辕镜像的优质服务