import path from 'path' const name = 'test' const cwd = process.env.TEST_CWD || process.cwd() + '/test/module/' const cpu = { type: 'perl', script: 'test.pl', params: '--train', listen: (task, line, i) => { if ( (parseInt(line) % 10) === 0) { return { type: 'epoch', task, epoch: (i/10)|0 } } return null } } const gpu = { type: 'python', script: 'test.pl', params: '--test', } const live = { type: 'python', script: 'test.py', live: true, listen: (task, line, i) => { if (line.match('orange')) { return { type: 'progress', task, mode: 'orange', progress: i } } if ( (i % 10) === 9) { return { type: 'epoch', task, epoch: (i/10)|0 } } return null } } export default { name, cwd, activities: { cpu, gpu, live, } }