本地测试吉诃德模型的脚本
dulcinee的Python项目详细描述
杜尔西尼亚
允许在本地测试吉诃德模型的脚本。
安装
pip install -r requirements.txt
如何使用Dulcinea
usage:dulcinea.py[-h]-cCONFIG_FILE-iINFO_FILE[-rROOT_DIR]moulinette_directorypositionalarguments:moulinette_directoryoptionalarguments:-h,--helpshowthishelpmessageandexit-cCONFIG_FILE,--config-fileCONFIG_FILEjsonfilecontainingtheuserinformations-iINFO_FILE,--info-fileINFO_FILEjsonfilecontainingtheinformationofthejobstoexecute-rROOT_DIR,--root-dirROOT_DIRdirectorywherethejobswillbeexecuted
conf文件示例
conf文件必须使用-c
选项给出,并且包含要插入到上下文中的有用元数据,如用户信息
{"intra_user":"login_z","intra_password":"superPassSecure","gitlab_token":"superCuteToken"}
蓝图
为了在本地测试moulinette,脚本必须能够获取一些要测试的虚拟传递。
通常,这是通过使用内置的fetch.copy
将获取步骤替换为“本地”获取来实现的:
importquixote.fetch.copyasfetch@quixote.fetcherdeffetch_by_copying():fetch.copy(path_to_the_dummy_delivery_folder)
The dummy delivery folder must contain a directory for each group_id specified in the info file which will act as dummy delivery for the specific job. See the documentation for
fetch.copy
.
信息文件示例
信息文件必须使用-i
选项给出,并且应该包含所有虚拟传递的元数据。
[
{
"module_id": 1,
"activity_id": 1,
"group_id": 1
},
{
"module_id": 1,
"activity_id": 1,
"group_id": 2
}
]
The values for
module_id
andactivity_id
don't really matter, they are just dummy values to insert into the context.group_id
however must match the directory name inside the dummy delivery folder.