Skip to content
This repository has been archived by the owner on Apr 7, 2019. It is now read-only.

Commit

Permalink
Merge pull request #276 from h2oai/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
justinloyola authored Dec 5, 2016
2 parents 472949b + 7aefe58 commit a5e7461
Show file tree
Hide file tree
Showing 54 changed files with 718 additions and 473 deletions.
8 changes: 3 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ clean:
rm -rf var
cd $(SSB) && ./gradlew clean

linux:
linux: gui
rm -rf ./dist/$(DIST_LINUX)
env GOOS=linux GOARCH=amd64 go build -ldflags "-X main.VERSION=$(STEAM_RELEASE_VERSION) -X main.BUILD_DATE=`date -u +%Y-%m-%dT%H:%M:%S%z`"
cd $(SLA) && env GOOS=linux GOARCH=amd64 go build
Expand All @@ -126,7 +126,7 @@ linux:
cp -r $(SCRIPTS) ./dist/$(DIST_LINUX)/var/master/
tar czfC ./dist/$(DIST_LINUX).tar.gz dist $(DIST_LINUX)

darwin:
darwin: gui
rm -rf ./dist/$(DIST_DARWIN)
env GOOS=darwin GOARCH=amd64 go build -ldflags "-X main.VERSION=$(STEAM_RELEASE_VERSION) -X main.BUILD_DATE=`date -u +%Y-%m-%dT%H:%M:%S%z`"
cd $(SLA) && env GOOS=darwin GOARCH=amd64 go build
Expand All @@ -140,7 +140,5 @@ darwin:
cp -r $(SCRIPTS) ./dist/$(DIST_DARWIN)/var/master/
tar czfC ./dist/$(DIST_DARWIN).tar.gz dist $(DIST_DARWIN)

release: gui ssb db launcher linux
rm -rf ./dist/$(DIST_LINUX)
# rm -rf ./dist/$(DIST_DARWIN)
release: ssb db launcher linux

7 changes: 7 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ If you're an Open Source community member, you can contact H2O using one of the
- Send an e-mail message directly to <a href="mailto:[email protected]">[email protected]</a>
- Ask your question on the [H2O Community](https://community.h2o.ai/spaces/540/index.html) site (create an account if necessary)

## v1.1.5 Changes

- [STEAM-613] The ``./steam add engine`` command has been replaced with ``./steam upload engine``.
- [STEAM-604] When adding clusters to Steam, node sizes are now only specified in GB.
- [STEAM-619] Adds a confirmation dialog on deletion of a cluster
- [STEAM-601] Optional ability to supply Python dependencies for Anaconda

## v1.1.4 Changes

- [STEAM-496] Early release support for LDAP basic authentication using the ``--authentication-provider`` and ``--authentication-config`` flags when starting Steam.
Expand Down
51 changes: 0 additions & 51 deletions cli2/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import (
func registerGeneratedCommands(c *context, cmd *cobra.Command) {
cmd.AddCommand(
activate(c),
add(c),
build(c),
check(c),
create(c),
Expand Down Expand Up @@ -101,56 +100,6 @@ func activateIdentity(c *context) *cobra.Command {
return cmd
}

var addHelp = `
add [?]
Add entities
Commands:
$ steam add engine ...
`

func add(c *context) *cobra.Command {
cmd := newCmd(c, addHelp, nil)

cmd.AddCommand(addEngine(c))
return cmd
}

var addEngineHelp = `
engine [?]
Add Engine
Examples:
Add an engine
$ steam add engine \
--engine-name=? \
--engine-path=?
`

func addEngine(c *context) *cobra.Command {
var engineName string // No description available
var enginePath string // No description available

cmd := newCmd(c, addEngineHelp, func(c *context, args []string) {

// Add an engine
engineId, err := c.remote.AddEngine(
engineName, // No description available
enginePath, // No description available
)
if err != nil {
log.Fatalln(err)
}
fmt.Printf("EngineId:\t%v\n", engineId)
return
})

cmd.Flags().StringVar(&engineName, "engine-name", engineName, "No description available")
cmd.Flags().StringVar(&enginePath, "engine-path", enginePath, "No description available")
return cmd
}

var buildHelp = `
build [?]
Build entities
Expand Down
181 changes: 83 additions & 98 deletions cli2/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,53 +139,51 @@ Examples:

func serveMaster(c *context) *cobra.Command {
var (
webAddress string
webTLSCertPath string
webTLSKeyPath string
authProvider string
authConfig string
workingDirectory string
clusterProxyAddress string
compilationServiceAddress string
scoringServiceHost string
scoringServicePortsString string
enableProfiler bool
yarnEnableKerberos bool
yarnUserName string
yarnKeytab string
dbName string
dbUserName string
dbPassword string
dbHost string
dbPort string
dbConnectionTimeout string
dbSSLMode string
dbSSLCertPath string
dbSSLKeyPath string
dbSSLRootCertPath string
superuserName string
superuserPassword string
webAddress string
webTLSCertPath string
webTLSKeyPath string
authProvider string
authConfig string
workingDirectory string
clusterProxyAddress string
compilationServiceAddress string
predictionServiceHost string
predictionServicePortsString string
enableProfiler bool
yarnEnableKerberos bool
dbName string
dbUserName string
dbPassword string
dbHost string
dbPort string
dbConnectionTimeout string
dbSSLMode string
dbSSLCertPath string
dbSSLKeyPath string
dbSSLRootCertPath string
superuserName string
superuserPassword string
)

opts := master.DefaultOpts

cmd := newCmd(c, serveMasterHelp, func(c *context, args []string) {
ports := strings.Split(scoringServicePortsString, ":")
ports := strings.Split(predictionServicePortsString, ":")
if len(ports) != 2 {
log.Fatalln("Invalid usage of scoring service ports range. See 'steam help serve master'.")
log.Fatalln("Invalid usage of prediction service ports range. See 'steam help serve master'.")
}
var scoringServicePorts [2]int
var predictionServicePorts [2]int
for i, port := range ports {
var err error
scoringServicePorts[i], err = strconv.Atoi(port)
predictionServicePorts[i], err = strconv.Atoi(port)
if err != nil {
log.Fatalln("Invalid usage of scoring service ports range. See 'steam help serve master'.")
log.Fatalln("Invalid usage of prediction service ports range. See 'steam help serve master'.")
}
if scoringServicePorts[i] < 1025 || scoringServicePorts[i] > 65535 {
if predictionServicePorts[i] < 1025 || predictionServicePorts[i] > 65535 {
log.Fatalln("Invalid port range.")
}
}
if scoringServicePorts[0] > scoringServicePorts[1] {
if predictionServicePorts[0] > predictionServicePorts[1] {
log.Fatalln("Invalid port range.")
}

Expand All @@ -198,13 +196,11 @@ func serveMaster(c *context) *cobra.Command {
workingDirectory,
clusterProxyAddress,
compilationServiceAddress,
scoringServiceHost,
scoringServicePorts,
predictionServiceHost,
predictionServicePorts,
enableProfiler,
master.YarnOpts{
yarnEnableKerberos,
yarnUserName,
yarnKeytab,
},
master.DBOpts{
data.Connection{
Expand All @@ -224,7 +220,6 @@ func serveMaster(c *context) *cobra.Command {
},
})
})

cmd.Flags().StringVar(&webAddress, "web-address", opts.WebAddress, "Web server address (\"<ip>:<port>\" or \":<port>\").")
cmd.Flags().StringVar(&webTLSCertPath, "web-tls-cert-path", opts.WebTLSCertPath, "Web server TLS certificate file path (optional).")
cmd.Flags().StringVar(&webTLSKeyPath, "web-tls-key-path", opts.WebTLSKeyPath, "Web server TLS key file path (optional).")
Expand All @@ -233,73 +228,31 @@ func serveMaster(c *context) *cobra.Command {
cmd.Flags().StringVar(&workingDirectory, "working-directory", opts.WorkingDirectory, "Working directory for application files.")
cmd.Flags().StringVar(&clusterProxyAddress, "cluster-proxy-address", opts.ClusterProxyAddress, "Cluster proxy address (\"<ip>:<port>\" or \":<port>\")")
cmd.Flags().StringVar(&compilationServiceAddress, "compilation-service-address", opts.CompilationServiceAddress, "Model compilation service address (\"<ip>:<port>\")")
cmd.Flags().StringVar(&scoringServiceHost, "scoring-service-address", opts.ScoringServiceHost, "Address to start scoring services on (\"<ip>\")")
// TODO: this uses a hardcoded port range, not the default const
cmd.Flags().StringVar(&scoringServicePortsString, "scoring-service-port-range", "1025:65535", "Specified port range to create scoring services on. (\"<from>:<to>\")")
cmd.Flags().StringVar(&predictionServiceHost, "scoring-service-address", opts.PredictionServiceHost, "Hostname to start prediction services on (\"<ip>\")")
cmd.Flags().MarkDeprecated("scoring-service-address", "please use \"prediction-service-host\"")
cmd.Flags().StringVar(&predictionServiceHost, "prediction-service-host", opts.PredictionServiceHost, "Hostname to start prediction services on (\"<ip>\")")
cmd.Flags().StringVar(&predictionServicePortsString, "scoring-service-port-range", "1025:65535", "Specified port range to create prediction services on. (\"<from>:<to>\")")
cmd.Flags().MarkDeprecated("scoring-service-port-range", "please use \"prediction-service-port-range\"")
cmd.Flags().StringVar(&predictionServicePortsString, "prediction-service-port-range", "1025:65535", "Specified port range to create prediction services on. (\"<from>:<to>\")")
cmd.Flags().BoolVar(&enableProfiler, "profile", opts.EnableProfiler, "Enable Go profiler")
cmd.Flags().BoolVar(&yarnEnableKerberos, "yarn-enable-kerberos", opts.Yarn.KerberosEnabled, "Enable Kerberos authentication. Requires username and keytab.") // FIXME: Kerberos authentication is being passed by admin to all
cmd.Flags().StringVar(&yarnUserName, "yarn-username", opts.Yarn.Username, "Username to enable Kerberos")
cmd.Flags().StringVar(&yarnKeytab, "yarn-keytab", opts.Yarn.Keytab, "Keytab file to be used with Kerberos authentication")
cmd.Flags().StringVar(&dbName, "db-name", opts.DB.Connection.DbName, "Database name to use for application data storage (required)")
cmd.Flags().StringVar(&dbUserName, "db-username", opts.DB.Connection.User, "Database username (required)")
cmd.Flags().StringVar(&dbPassword, "db-password", opts.DB.Connection.Password, "Database password (optional)")
cmd.Flags().StringVar(&dbHost, "db-host", opts.DB.Connection.Host, "Database host (optional, defaults to localhost")
cmd.Flags().StringVar(&dbPort, "db-port", opts.DB.Connection.Port, "Database port (optional, defaults to 5432)")
cmd.Flags().StringVar(&dbConnectionTimeout, "db-connection-timeout", opts.DB.Connection.ConnectionTimeout, "Database connection timeout (optional)")
cmd.Flags().StringVar(&dbSSLMode, "db-ssl-mode", opts.DB.Connection.SSLMode, "Database connection SSL mode: one of 'disable', 'require', 'verify-ca', 'verify-full'")
cmd.Flags().StringVar(&dbSSLCertPath, "db-ssl-cert-path", opts.DB.Connection.SSLCert, "Database connection SSL certificate path (optional)")
cmd.Flags().StringVar(&dbSSLKeyPath, "db-ssl-key-path", opts.DB.Connection.SSLKey, "Database connection SSL key path (optional)")
cmd.Flags().StringVar(&dbSSLRootCertPath, "db-ssl-root-cert-path", opts.DB.Connection.SSLRootCert, "Database connection SSL root certificate path (optional)")
// cmd.Flags().StringVar(&dbName, "db-name", opts.DB.Connection.DbName, "Database name to use for application data storage (required)")
// cmd.Flags().StringVar(&dbUserName, "db-username", opts.DB.Connection.User, "Database username (required)")
// cmd.Flags().StringVar(&dbPassword, "db-password", opts.DB.Connection.Password, "Database password (optional)")
// cmd.Flags().StringVar(&dbHost, "db-host", opts.DB.Connection.Host, "Database host (optional, defaults to localhost")
// cmd.Flags().StringVar(&dbPort, "db-port", opts.DB.Connection.Port, "Database port (optional, defaults to 5432)")
// cmd.Flags().StringVar(&dbConnectionTimeout, "db-connection-timeout", opts.DB.Connection.ConnectionTimeout, "Database connection timeout (optional)")
// cmd.Flags().StringVar(&dbSSLMode, "db-ssl-mode", opts.DB.Connection.SSLMode, "Database connection SSL mode: one of 'disable', 'require', 'verify-ca', 'verify-full'")
// cmd.Flags().StringVar(&dbSSLCertPath, "db-ssl-cert-path", opts.DB.Connection.SSLCert, "Database connection SSL certificate path (optional)")
// cmd.Flags().StringVar(&dbSSLKeyPath, "db-ssl-key-path", opts.DB.Connection.SSLKey, "Database connection SSL key path (optional)")
// cmd.Flags().StringVar(&dbSSLRootCertPath, "db-ssl-root-cert-path", opts.DB.Connection.SSLRootCert, "Database connection SSL root certificate path (optional)")
cmd.Flags().StringVar(&superuserName, "superuser-name", opts.DB.SuperuserName, "Set superuser username (required for first-time-use only)")
cmd.Flags().StringVar(&superuserPassword, "superuser-password", opts.DB.SuperuserPassword, "Set superuser password (required for first-time-use only)")

return cmd

}

var deployHelp = `
deploy [resource-type]
Deploy a resource of the specified type.
Examples:
$ steam deploy engine
`

func deploy(c *context) *cobra.Command {
cmd := newCmd(c, deployHelp, nil)
cmd.AddCommand(deployEngine(c))
return cmd
}

var deployEngineHelp = `
engine [enginePath]
Deploy an H2O engine to Steam.
Examples:
$ steam deploy engine --file-path=path/to/engine
`

func deployEngine(c *context) *cobra.Command {
var (
filePath string
)
cmd := newCmd(c, deployEngineHelp, func(c *context, args []string) {
attrs := map[string]string{
"type": fs.KindEngine,
}

if err := c.transmitFile(filePath, attrs); err != nil {
log.Fatalln(err)
}

log.Println("Engine deployed:", path.Base(filePath))
})

cmd.Flags().StringVar(&filePath, "file-path", "", "Path to engine")

return cmd
}

var uploadHelp = `
upload [resource-type]
Upload a resource of the specified type.
Expand All @@ -311,15 +264,18 @@ Examples:
func upload(c *context) *cobra.Command {
cmd := newCmd(c, uploadHelp, nil)
cmd.AddCommand(uploadFile(c))
cmd.AddCommand(uploadEngine(c))
return cmd
}

var uploadFileHelp = `
file [path]
Upload an H2O engine to Steam.
Upload an asset to Steam.
Examples:
$ steam upload engine path/to/engine
$ steam upload file \
--file-path=? \
--project-id=?
`

func uploadFile(c *context) *cobra.Command {
Expand Down Expand Up @@ -359,3 +315,32 @@ func uploadFile(c *context) *cobra.Command {

return cmd
}

var uploadEngineHelp = `
engine [path]
Upload an engine to Steam.
Examples:
$ steam upload engine \
--file-path=?
`

func uploadEngine(c *context) *cobra.Command {
var (
filePath string
)
cmd := newCmd(c, uploadEngineHelp, func(c *context, args []string) {
attrs := map[string]string{
"type": fs.KindEngine,
}
if err := c.transmitFile(filePath, attrs); err != nil {
log.Fatalln(err)
}

log.Println("Engine uploaded:", path.Base(filePath))
})

cmd.Flags().StringVar(&filePath, "file-path", "", "File to be uploaded")

return cmd
}
1 change: 0 additions & 1 deletion cli2/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ func Steam(version, buildDate string, stdout, stderr, trace io.Writer) *cobra.Co
login(c),
reset(c),
serve(c),
deploy(c),
upload(c),
)
registerGeneratedCommands(c, cmd)
Expand Down
Loading

0 comments on commit a5e7461

Please sign in to comment.