dashboard

package
v0.8.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2020 License: MIT Imports: 15 Imported by: 0

README

Dashboard

Running dashboard

Pre-built JavaScript files are embedded using rakyll/statik. So it's ok you just run goptuna dashboard command like this:

$ go build cmd/main.go -o goptuna
$ ./goptuna dashboard --storage sqlite:///example.db --host 127.0.0.1 --port 8000
more command line options
$ ./bin/goptuna --help
A command line interface for Goptuna

Usage:
  goptuna [command]

Available Commands:
  create-study Create a study in your relational database storage.
  dashboard    Launch web dashboard
  delete-study Delete a study in your relational database storage.
  help         Help about any command

Flags:
  -h, --help      help for goptuna
      --version   version for goptuna

Use "goptuna [command] --help" for more information about a command.

How to compile TypeScript files

Compiling TypeScript files and embedding to Go using Docker

You just run to make build-dashboard to compile TypeScript files and embedding to Go.

$ docker build -t Hikely/goptuna-dashboard ./dashboard
$ docker run -it --rm -v `PWD`/dashboard/statik:/usr/src/statik Hikely/goptuna-dashboard
Compiling TypeScript files manually

Node.js v14.14.0 is required to compile TypeScript files.

$ npm install
$ npm run build:dev
Watch for files changes
$ npm run watch
Production builds
$ npm run build:prd
Embeddeing to Go using rakyll/statik
$ statik -src=./public -include=bundle.js,bundle.js.LICENSE.txt

Running Dashboard server for reloading

Please pass -tags=develop the custom build tag to return JS files inside local directory (not embedded files). This is useful while devleopment.

$ go run -tags=develop cmd/main.go dashboard --storage sqlite:///db.sqlite3
Started to serve at http://127.0.0.1:8000

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServer

func NewServer(s goptuna.Storage) (http.Handler, error)

Types

type Attribute

type Attribute struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type FrozenTrial

type FrozenTrial struct {
	ID                 int                 `json:"trial_id"`
	StudyID            int                 `json:"study_id"`
	Number             int                 `json:"number"`
	State              string              `json:"state"`
	Value              float64             `json:"value"`
	IntermediateValues []IntermediateValue `json:"intermediate_values"`
	DatetimeStart      string              `json:"datetime_start"`
	DatetimeComplete   string              `json:"datetime_complete"`
	Params             []TrialParam        `json:"params"`
	UserAttrs          []Attribute         `json:"user_attrs"`
	SystemAttrs        []Attribute         `json:"system_attrs"`
}

type IntermediateValue

type IntermediateValue struct {
	Step  int     `json:"step"`
	Value float64 `json:"value"`
}

type StudySummary

type StudySummary struct {
	ID            int         `json:"study_id"`
	Name          string      `json:"study_name"`
	Direction     string      `json:"direction"`
	BestTrial     FrozenTrial `json:"best_trial"`
	UserAttrs     []Attribute `json:"user_attrs"`
	SystemAttrs   []Attribute `json:"system_attrs"`
	DatetimeStart string      `json:"datetime_start"`
}

StudySummary holds basic attributes and aggregated results of Study.

type TrialParam

type TrialParam struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL