Skip to content

Commit

Permalink
daemon: fix job params (#680)
Browse files Browse the repository at this point in the history
* daemon: fix job params
  • Loading branch information
FeelyChau committed Dec 28, 2020
1 parent 90a63b5 commit e0848c0
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: build
on:
push:
branches:
- master
- v1.x
paths-ignore:
- 'docker/**'
- 'docs/**'
Expand All @@ -12,7 +12,7 @@ on:
pull_request:
types: [ opened, synchronize, reopened, ready_for_review ]
branches:
- master
- v1.x
paths-ignore:
- 'docker/**'
- 'docs/**'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/esbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: esBuild
on:
push:
branches:
- master
- v1.x
paths-ignore:
- 'docker/**'
- 'docs/**'
Expand All @@ -12,7 +12,7 @@ on:
pull_request:
types: [ opened, synchronize, reopened, ready_for_review ]
branches:
- master
- v1.x
paths-ignore:
- 'docker/**'
- 'docs/**'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/markdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: check markdown files
on:
push:
branches:
- master
- v1.x
pull_request:
types: [ opened, synchronize, reopened, ready_for_review ]
branches:
- master
- v1.x

jobs:
markdown-link-check:
Expand Down
2 changes: 1 addition & 1 deletion packages/daemon/src/runner/job-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ export class JobRunner {
* @param modelPath where the model saves to
*/
async runModelTrain(dataset: any, model: RunnableResponse, modelPath: string): Promise<any> {
const params = this.findParamsByType('modelLoad', this.opts.job.params);
const params = this.findParamsByType('modelTrain', this.opts.job.params);

return this.runPlugin('modelTrain', dataset, model, this.getParams(this.opts.plugins.modelTrain.params, {
modelPath
Expand Down
8 changes: 6 additions & 2 deletions packages/daemon/test/utils/job-runner.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ describe('test JobRunner', () => {

it('#test runModelTrain', async () => {
const runner = new JobRunner({
job: {} as any,
job: { params: [ { pluginType: 'modelTrain', data: { mockJobParams: 'mockData' } } ] } as any,
pipeline: {} as any,
plugins: {
modelTrain: {
Expand All @@ -325,7 +325,11 @@ describe('test JobRunner', () => {
const runPlugin = sinon.stub(runner, 'runPlugin').resolves(mockResult as any);
const mockDataset = { mockDataset: '' };
assert.equal(await runner.runModelTrain(mockDataset, mockModel as any, '/model/path'), mockResult);
assert.ok(runPlugin.calledOnceWith('modelTrain', mockDataset, mockModel, { mockParam: 'value', modelPath: '/model/path' }));
assert.ok(runPlugin.calledOnceWith('modelTrain', mockDataset, mockModel, {
mockParam: 'value',
modelPath: '/model/path',
mockJobParams: 'mockData'
}));
});

it('#test runModelEvaluate', async () => {
Expand Down

0 comments on commit e0848c0

Please sign in to comment.