diff options
Diffstat (limited to 'app/client/system')
| -rw-r--r-- | app/client/system/system.actions.js | 2 | ||||
| -rw-r--r-- | app/client/system/system.component.js | 79 | ||||
| -rw-r--r-- | app/client/system/system.reducer.js | 90 |
3 files changed, 56 insertions, 115 deletions
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 { </div> <div className='row params'> - <Group title="Status"> - <Param title='Server'>{server.status}</Param> - {server.error && - <Param title='Server error'>{server.error.message}</Param> - } - <Param title='Relay'>{relay.status}</Param> - <Param title='RPC'>{rpc.status}</Param> - <Param title='CPU'>{rpc.cpu_cmd}</Param> - <Param title='GPU'>{rpc.gpu_cmd}</Param> - <Param title='Current Task'>train samplernn</Param> - </Group> - <Group title="Diagnostics"> - <Param title='Check GPU'> - <button onClick={() => actions.run('nvidia-smi')}>nvidia-smi</button> - </Param> - <Param title='List processes'> - <button onClick={() => actions.run('ps')}>ps</button> - </Param> - <Param title='List users'> - <button onClick={() => actions.run('w')}>w</button> - </Param> - </Group> + <div className='column'> + <Group title="Status"> + <Param title='Server'>{server.status}</Param> + {server.error && + <Param title='Server error'>{server.error.message}</Param> + } + <Param title='Relay'>{relay.status}</Param> + <Param title='RPC'>{rpc.status}</Param> + <Param title='CPU'>{rpc.cpu_cmd}</Param> + <Param title='GPU'>{rpc.gpu_cmd}</Param> + <Param title='Current Task'>train samplernn</Param> + </Group> + <Group title="Diagnostics"> + <Param title='Check GPU'> + <button onClick={() => actions.system.run('nvidia-smi')}>nvidia-smi</button> + </Param> + <Param title='List processes'> + <button onClick={() => actions.system.run('ps')}>ps</button> + </Param> + <Param title='List users'> + <button onClick={() => actions.system.run('w')}>w</button> + </Param> + <Param title='Disk free space'> + <button onClick={() => actions.system.run('df')}>df</button> + </Param> + </Group> + <Group title="Test"> + <Param title='CPU Test Task'> + <button onClick={() => actions.task.start_task(cpu_test_task)}>Start</button> + <button onClick={() => actions.task.stop_task(cpu_test_task)}>Stop</button> + </Param> + <Param title='GPU Test Task'> + <button onClick={() => actions.task.start_task(gpu_test_task)}>Start</button> + <button onClick={() => actions.task.stop_task(gpu_test_task)}>Stop</button> + </Param> + </Group> + </div> + {this.renderCommandOutput()} </div> - {this.renderCommandOutput()} </div> ) } @@ -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) => { |
