Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
64 lines (55 sloc) 2.06 KB
// Copyright 2019 GRAIL, Inc. All rights reserved.
// Use of this source code is governed by the Apache 2.0
// license that can be found in the LICENSE file.
// Package sliceconfig provides a mechanism to create a bigslice
// session from a shared configuration. Sliceconfig uses the
// configuration mechanism in package
//, and reads a default profile from
// $HOME/.bigslice/config. Configurations may be provisioned
// using the bigslice command.
package sliceconfig
import (
// Imported to install pprof http handlers.
_ "net/http/pprof"
// Imported to provide ec2system.System bigmachines.
_ ""
_ ""
// Imported to provide an http server.
_ ""
// Path determines the location of the bigslice profile read
// by Parse.
var Path = os.ExpandEnv("$HOME/.bigslice/config")
// Parse registers configuration flags, bigslice flags, and calls
// flag.Parse. It reads bigslice configuration from Path defined in
// this package. Parse returns session as configured by the
// configuration and any flags provided. Parse panics if session
// creation fails. Parse also instantiates the default http server
// according to the configuration profile, and registers the bigslice
// session status handlers with it.
func Parse() (sess *exec.Session, shutdown func()) {
local := flag.Bool("local", false, "run bigslice in local mode")
config.RegisterFlags("", Path)
if *local {
sess = exec.Start(exec.Local, exec.Status(new(status.Status)))
} else {
config.Must("bigslice", &sess)
http.Handle("/debug/status", status.Handler(sess.Status()))
config.Must("http", nil)
return sess, func() {}
You can’t perform that action at this time.