From be3b2bd56550b71a2ffb7eb1604c1b8c1d2dd4a2 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sat, 26 May 2018 21:33:26 +0200 Subject: refactor some task stuff --- app/client/system/system.actions.js | 2 +- app/client/system/system.component.js | 79 ++++++++++++++++++++---------- app/client/system/system.reducer.js | 90 ----------------------------------- 3 files changed, 56 insertions(+), 115 deletions(-) (limited to 'app/client/system') diff --git a/app/client/system/system.actions.js b/app/client/system/system.actions.js index 1732179..ff32fd6 100644 --- a/app/client/system/system.actions.js +++ b/app/client/system/system.actions.js @@ -2,6 +2,6 @@ import * as socket from '../socket' import types from '../types' export const run = (cmd) => { - socket.run_system_command(cmd) + socket.system.run_system_command(cmd) return { type: types.system.running_command, cmd } } diff --git a/app/client/system/system.component.js b/app/client/system/system.component.js index 7428c22..00c5395 100644 --- a/app/client/system/system.component.js +++ b/app/client/system/system.component.js @@ -6,6 +6,19 @@ import Group from '../common/group.component' import Param from '../common/param.component' import * as systemActions from './system.actions' +import * as taskActions from '../task/task.actions' + +const cpu_test_task = { + id: 1073, + activity: 'train', + library: 'test', + dataset: 'test', + epochs: 1, + opt: {} +} +const gpu_test_task = { + +} class System extends Component { constructor(props){ @@ -20,30 +33,45 @@ class System extends Component {
- - {server.status} - {server.error && - {server.error.message} - } - {relay.status} - {rpc.status} - {rpc.cpu_cmd} - {rpc.gpu_cmd} - train samplernn - - - - - - - - - - - - +
+ + {server.status} + {server.error && + {server.error.message} + } + {relay.status} + {rpc.status} + {rpc.cpu_cmd} + {rpc.gpu_cmd} + train samplernn + + + + + + + + + + + + + + + + + + + + + + + + + +
+ {this.renderCommandOutput()}
- {this.renderCommandOutput()} ) } @@ -76,7 +104,10 @@ const mapStateToProps = state => ({ }) const mapDispatchToProps = (dispatch, ownProps) => ({ - actions: bindActionCreators(systemActions, dispatch) + actions: { + system: bindActionCreators(systemActions, dispatch), + task: bindActionCreators(taskActions, dispatch), + }, }) export default connect(mapStateToProps, mapDispatchToProps)(System) diff --git a/app/client/system/system.reducer.js b/app/client/system/system.reducer.js index a21966d..ac7b20e 100644 --- a/app/client/system/system.reducer.js +++ b/app/client/system/system.reducer.js @@ -34,96 +34,6 @@ const systemInitialState = { stdout: null, stderr: null, }, - - currentTask: { - id: 1072, - activity: 'train', - library: 'pix2pix', - dataset: 'video/woods_final', - epoch: 87, - epochs: 100, - }, - images: [ - { - url: 'https://s3.amazonaws.com/i.asdf.us/bucky/data/4282/woodscaled_4_true_20180521_2125.png', - }, - { - url: 'https://s3.amazonaws.com/i.asdf.us/bucky/data/4282/woodscaled_4_true_20180521_2146%20(1).png', - }, - { - url: 'https://s3.amazonaws.com/i.asdf.us/bucky/data/4282/woodscaled_4_true_20180521_2149.png', - }, - { - url: 'https://s3.amazonaws.com/i.asdf.us/bucky/data/4282/woodscaled_4_true_20180521_2150.png', - }, - { - url: 'https://s3.amazonaws.com/i.asdf.us/bucky/data/4282/woodscaled_4_true_20180521_2146%20(1).png', - }, - ], - tasks: [ - { - id: 1073, - activity: 'train', - library: 'pix2pix', - dataset: 'video/woods_green', - epochs: 100, - }, - { - id: 1073, - activity: 'train', - library: 'samplernn', - dataset: 'bobby_brown_-_every_little_step', - epochs: 6, - }, - { - id: 1073, - activity: 'train', - library: 'pix2pix', - checkpoint: 'lyra_voice_layers', - dataset: 'audio/lyra_improv', - epochs: 30, - }, - { - id: 1073, - activity: 'train', - library: 'pix2pix', - checkpoint: 'lyra_melody_lines', - dataset: 'audio/lyra_improv', - epochs: 30, - }, - { - id: 1073, - activity: 'train', - library: 'pix2pix', - checkpoint: 'ensemble_chords', - dataset: 'audio/lyra_improv', - epochs: 30, - }, - { - id: 1073, - activity: 'generate', - library: 'samplernn', - dataset: 'coccoglass3', - opt: { time: 5, count: 6 }, - }, - { - id: 1073, - activity: 'train', - library: 'pix2pix', - dataset: 'video/woods_green', - epochs: 100, - }, - { - id: 1073, - activity: 'train', - library: 'samplernn', - dataset: 'bobby_brown_-_every_little_step', - epochs: 6, - }, - ], - files: [ - { id: 2, library: 'samplernn', checkpoint: 'jwcglassbeat', dataset: 'jwcglassbeat', epoch: 18, duration: 30, batch_size: 5, filename: 'jwcglassbeat-ep18.mp3', size: 3 * 1024 * 1024, date: Date.now(), opt: "{}", } - ] } const systemReducer = (state = systemInitialState, action) => { -- cgit v1.2.3-70-g09d2