Runing goimports on project as well as fixing README so that headers render correctly.

This commit is contained in:
Renan DelValle 2018-09-30 18:23:38 -07:00
parent b341c0a0e4
commit 9554bf2666
No known key found for this signature in database
GPG key ID: 3895800E03F17676
22 changed files with 90 additions and 71 deletions

View file

@ -5,18 +5,18 @@ _Elektron_ is a [Mesos](mesos.apache.org) framework that behaves as a playground
However, in addition to being a scheduler, Elektron also takes advantage of tools such as [Performance Co-Pilot](http://pcp.io/) and [RAPL](https://01.org/blogs/2014/running-average-power-limit--rapl) to help contain the power envelope within defined thresholds, reduce peak power consumption, and also reduce total energy consumption. Elektron is able to leverage the Mesos-provided resource abstraction to allow different algorithms to decide how to consume resource offers made by a Mesos Master. However, in addition to being a scheduler, Elektron also takes advantage of tools such as [Performance Co-Pilot](http://pcp.io/) and [RAPL](https://01.org/blogs/2014/running-average-power-limit--rapl) to help contain the power envelope within defined thresholds, reduce peak power consumption, and also reduce total energy consumption. Elektron is able to leverage the Mesos-provided resource abstraction to allow different algorithms to decide how to consume resource offers made by a Mesos Master.
#Architecture # Architecture
![](docs/ElekArch.png) ![](docs/ElekArch.png)
#Usage # Usage
* [Pluggable Scheduling Policies](docs/SchedulingPolicies.md) * [Pluggable Scheduling Policies](docs/SchedulingPolicies.md)
* [Pluggable Power-Capping strategies](docs/PowerCappingStrategies.md) * [Pluggable Power-Capping strategies](docs/PowerCappingStrategies.md)
* [Scheduling Policy Switching](docs/SchedulingPolicySwitching.md) * [Scheduling Policy Switching](docs/SchedulingPolicySwitching.md)
#Logging # Logging
Please go through the [logging library doc](docs/Logging.md) to understand how the logging library has been setup. There are also instructions on how one can add additional loggers. Please go through the [logging library doc](docs/Logging.md) to understand how the logging library has been setup. There are also instructions on how one can add additional loggers.
#Data # Data
* [Cluster Resource Consumption](docs/data/ClusterResourceConsumption.md) * [Cluster Resource Consumption](docs/data/ClusterResourceConsumption.md)
* [Schedule Trace](docs/data/ScheduledTrace.md) * [Schedule Trace](docs/data/ScheduledTrace.md)
* [Degree of Collocation](docs/data/DegreeOfCollocation.md) * [Degree of Collocation](docs/data/DegreeOfCollocation.md)
@ -25,7 +25,7 @@ Please go through the [logging library doc](docs/Logging.md) to understand how t
- [Scheduling Policy Switch Trace](docs/data/withSpsEnabled/SchedulingPolicySwitchTrace.md) - [Scheduling Policy Switch Trace](docs/data/withSpsEnabled/SchedulingPolicySwitchTrace.md)
- [Scheduling Window](docs/data/withSpsEnabled/SchedulingWindow.md) - [Scheduling Window](docs/data/withSpsEnabled/SchedulingWindow.md)
#Software Requirements # Software Requirements
**Requires [Performance Co-Pilot](http://pcp.io/) tool pmdumptext to be installed on the **Requires [Performance Co-Pilot](http://pcp.io/) tool pmdumptext to be installed on the
machine on which electron is launched for logging to work and PCP collector agents installed machine on which electron is launched for logging to work and PCP collector agents installed
on the Mesos Agents** on the Mesos Agents**
@ -35,7 +35,7 @@ Compatible with the following versions:
* Mesos 1.5.0 * Mesos 1.5.0
* Go 1.9.7 * Go 1.9.7
#Build and Run # Build and Run
Compile the source code using the `go build` tool as shown below. Compile the source code using the `go build` tool as shown below.
```commandline ```commandline
go build -o elektron go build -o elektron

View file

@ -1,12 +1,13 @@
package def package def
import ( import (
"gitlab.com/spdf/elektron/constants"
"gitlab.com/spdf/elektron/utilities/offerUtils"
"encoding/json" "encoding/json"
"os"
mesos "github.com/mesos/mesos-go/api/v0/mesosproto" mesos "github.com/mesos/mesos-go/api/v0/mesosproto"
"github.com/pkg/errors" "github.com/pkg/errors"
"os" "gitlab.com/spdf/elektron/constants"
"gitlab.com/spdf/elektron/utilities/offerUtils"
) )
type Task struct { type Task struct {

View file

@ -3,10 +3,11 @@ package def
import ( import (
"errors" "errors"
"fmt" "fmt"
"github.com/mash/gokmeans"
"github.com/montanaflynn/stats"
"log" "log"
"sort" "sort"
"github.com/mash/gokmeans"
"github.com/montanaflynn/stats"
) )
// Information about a cluster of tasks. // Information about a cluster of tasks.

View file

@ -1,9 +1,10 @@
package logging package logging
import ( import (
logUtils "gitlab.com/spdf/elektron/logging/utils"
"strings" "strings"
"time" "time"
logUtils "gitlab.com/spdf/elektron/logging/utils"
) )
// Names of different loggers // Names of different loggers

View file

@ -1,16 +1,17 @@
package pcp package pcp
import ( import (
elecLogDef "gitlab.com/spdf/elektron/logging/def"
"gitlab.com/spdf/elektron/schedulers"
"bufio" "bufio"
"fmt" "fmt"
"github.com/mesos/mesos-go/api/v0/scheduler"
"github.com/montanaflynn/stats"
"log" "log"
"os/exec" "os/exec"
"syscall" "syscall"
"time" "time"
"github.com/mesos/mesos-go/api/v0/scheduler"
"github.com/montanaflynn/stats"
elecLogDef "gitlab.com/spdf/elektron/logging/def"
"gitlab.com/spdf/elektron/schedulers"
) )
func Start(quit chan struct{}, logging *bool, logMType chan elecLogDef.LogMessageType, logMsg chan string, s scheduler.Scheduler) { func Start(quit chan struct{}, logging *bool, logMType chan elecLogDef.LogMessageType, logMsg chan string, s scheduler.Scheduler) {

View file

@ -1,9 +1,6 @@
package pcp package pcp
import ( import (
elecLogDef "gitlab.com/spdf/elektron/logging/def"
"gitlab.com/spdf/elektron/pcp"
"gitlab.com/spdf/elektron/rapl"
"bufio" "bufio"
"container/ring" "container/ring"
"fmt" "fmt"
@ -14,6 +11,10 @@ import (
"strings" "strings"
"syscall" "syscall"
"time" "time"
elecLogDef "gitlab.com/spdf/elektron/logging/def"
"gitlab.com/spdf/elektron/pcp"
"gitlab.com/spdf/elektron/rapl"
) )
func StartPCPLogAndExtremaDynamicCap(quit chan struct{}, logging *bool, hiThreshold, loThreshold float64, func StartPCPLogAndExtremaDynamicCap(quit chan struct{}, logging *bool, hiThreshold, loThreshold float64,

View file

@ -1,11 +1,6 @@
package pcp package pcp
import ( import (
"gitlab.com/spdf/elektron/constants"
elecLogDef "gitlab.com/spdf/elektron/logging/def"
"gitlab.com/spdf/elektron/pcp"
"gitlab.com/spdf/elektron/rapl"
"gitlab.com/spdf/elektron/utilities"
"bufio" "bufio"
"container/ring" "container/ring"
"fmt" "fmt"
@ -17,6 +12,12 @@ import (
"strings" "strings"
"syscall" "syscall"
"time" "time"
"gitlab.com/spdf/elektron/constants"
elecLogDef "gitlab.com/spdf/elektron/logging/def"
"gitlab.com/spdf/elektron/pcp"
"gitlab.com/spdf/elektron/rapl"
"gitlab.com/spdf/elektron/utilities"
) )
func round(num float64) int { func round(num float64) int {

View file

@ -1,11 +1,12 @@
package rapl package rapl
import ( import (
elekEnv "gitlab.com/spdf/elektron/environment"
"github.com/pkg/errors"
"golang.org/x/crypto/ssh"
"os" "os"
"strconv" "strconv"
"github.com/pkg/errors"
elekEnv "gitlab.com/spdf/elektron/environment"
"golang.org/x/crypto/ssh"
) )
func Cap(host, username string, percentage float64) error { func Cap(host, username string, percentage float64) error {

View file

@ -1,20 +1,21 @@
package main package main
import ( import (
"gitlab.com/spdf/elektron/def"
elecLogDef "gitlab.com/spdf/elektron/logging/def"
"gitlab.com/spdf/elektron/pcp"
"gitlab.com/spdf/elektron/schedulers"
"flag" "flag"
"fmt" "fmt"
"github.com/golang/protobuf/proto"
mesos "github.com/mesos/mesos-go/api/v0/mesosproto"
sched "github.com/mesos/mesos-go/api/v0/scheduler"
"log" "log"
"os" "os"
"os/signal" "os/signal"
"strings" "strings"
"time" "time"
"github.com/golang/protobuf/proto"
mesos "github.com/mesos/mesos-go/api/v0/mesosproto"
sched "github.com/mesos/mesos-go/api/v0/scheduler"
"gitlab.com/spdf/elektron/def"
elecLogDef "gitlab.com/spdf/elektron/logging/def"
"gitlab.com/spdf/elektron/pcp"
"gitlab.com/spdf/elektron/schedulers"
) )
var master = flag.String("master", "", "Location of leading Mesos master -- <mesos-master>:<port>") var master = flag.String("master", "", "Location of leading Mesos master -- <mesos-master>:<port>")

View file

@ -1,12 +1,13 @@
package schedulers package schedulers
import ( import (
"log"
mesos "github.com/mesos/mesos-go/api/v0/mesosproto"
sched "github.com/mesos/mesos-go/api/v0/scheduler"
"gitlab.com/spdf/elektron/def" "gitlab.com/spdf/elektron/def"
"gitlab.com/spdf/elektron/utilities/mesosUtils" "gitlab.com/spdf/elektron/utilities/mesosUtils"
"gitlab.com/spdf/elektron/utilities/offerUtils" "gitlab.com/spdf/elektron/utilities/offerUtils"
mesos "github.com/mesos/mesos-go/api/v0/mesosproto"
sched "github.com/mesos/mesos-go/api/v0/scheduler"
"log"
) )
// Decides if to take an offer or not // Decides if to take an offer or not

View file

@ -1,12 +1,13 @@
package schedulers package schedulers
import ( import (
"log"
mesos "github.com/mesos/mesos-go/api/v0/mesosproto"
sched "github.com/mesos/mesos-go/api/v0/scheduler"
"gitlab.com/spdf/elektron/def" "gitlab.com/spdf/elektron/def"
"gitlab.com/spdf/elektron/utilities/mesosUtils" "gitlab.com/spdf/elektron/utilities/mesosUtils"
"gitlab.com/spdf/elektron/utilities/offerUtils" "gitlab.com/spdf/elektron/utilities/offerUtils"
mesos "github.com/mesos/mesos-go/api/v0/mesosproto"
sched "github.com/mesos/mesos-go/api/v0/scheduler"
"log"
) )
// Decides if to take an offer or not // Decides if to take an offer or not

View file

@ -1,19 +1,20 @@
package schedulers package schedulers
import ( import (
"gitlab.com/spdf/elektron/def"
elecLogDef "gitlab.com/spdf/elektron/logging/def"
"gitlab.com/spdf/elektron/utilities"
"gitlab.com/spdf/elektron/utilities/schedUtils"
"bytes" "bytes"
"fmt" "fmt"
"log"
"sync"
"time"
"github.com/golang/protobuf/proto" "github.com/golang/protobuf/proto"
mesos "github.com/mesos/mesos-go/api/v0/mesosproto" mesos "github.com/mesos/mesos-go/api/v0/mesosproto"
"github.com/mesos/mesos-go/api/v0/mesosutil" "github.com/mesos/mesos-go/api/v0/mesosutil"
sched "github.com/mesos/mesos-go/api/v0/scheduler" sched "github.com/mesos/mesos-go/api/v0/scheduler"
"log" "gitlab.com/spdf/elektron/def"
"sync" elecLogDef "gitlab.com/spdf/elektron/logging/def"
"time" "gitlab.com/spdf/elektron/utilities"
"gitlab.com/spdf/elektron/utilities/schedUtils"
) )
type BaseScheduler struct { type BaseScheduler struct {

View file

@ -1,12 +1,13 @@
package schedulers package schedulers
import ( import (
"log"
mesos "github.com/mesos/mesos-go/api/v0/mesosproto"
sched "github.com/mesos/mesos-go/api/v0/scheduler"
"gitlab.com/spdf/elektron/def" "gitlab.com/spdf/elektron/def"
"gitlab.com/spdf/elektron/utilities/mesosUtils" "gitlab.com/spdf/elektron/utilities/mesosUtils"
"gitlab.com/spdf/elektron/utilities/offerUtils" "gitlab.com/spdf/elektron/utilities/offerUtils"
mesos "github.com/mesos/mesos-go/api/v0/mesosproto"
sched "github.com/mesos/mesos-go/api/v0/scheduler"
"log"
) )
// Decides if to take an offer or not // Decides if to take an offer or not

View file

@ -1,11 +1,12 @@
package schedulers package schedulers
import ( import (
"gitlab.com/spdf/elektron/def" "time"
elecLogDef "gitlab.com/spdf/elektron/logging/def"
mesos "github.com/mesos/mesos-go/api/v0/mesosproto" mesos "github.com/mesos/mesos-go/api/v0/mesosproto"
sched "github.com/mesos/mesos-go/api/v0/scheduler" sched "github.com/mesos/mesos-go/api/v0/scheduler"
"time" "gitlab.com/spdf/elektron/def"
elecLogDef "gitlab.com/spdf/elektron/logging/def"
) )
// Implements mesos scheduler. // Implements mesos scheduler.

View file

@ -1,11 +1,11 @@
package schedulers package schedulers
import ( import (
mesos "github.com/mesos/mesos-go/api/v0/mesosproto"
sched "github.com/mesos/mesos-go/api/v0/scheduler"
"gitlab.com/spdf/elektron/def" "gitlab.com/spdf/elektron/def"
"gitlab.com/spdf/elektron/utilities/mesosUtils" "gitlab.com/spdf/elektron/utilities/mesosUtils"
"gitlab.com/spdf/elektron/utilities/offerUtils" "gitlab.com/spdf/elektron/utilities/offerUtils"
mesos "github.com/mesos/mesos-go/api/v0/mesosproto"
sched "github.com/mesos/mesos-go/api/v0/scheduler"
) )
// Decides if to take an offer or not // Decides if to take an offer or not

View file

@ -1,14 +1,14 @@
package schedulers package schedulers
import ( import (
mesos "github.com/mesos/mesos-go/api/v0/mesosproto"
sched "github.com/mesos/mesos-go/api/v0/scheduler"
"github.com/pkg/errors"
"gitlab.com/spdf/elektron/constants" "gitlab.com/spdf/elektron/constants"
"gitlab.com/spdf/elektron/def" "gitlab.com/spdf/elektron/def"
elecLogDef "gitlab.com/spdf/elektron/logging/def" elecLogDef "gitlab.com/spdf/elektron/logging/def"
"gitlab.com/spdf/elektron/utilities" "gitlab.com/spdf/elektron/utilities"
"gitlab.com/spdf/elektron/utilities/mesosUtils" "gitlab.com/spdf/elektron/utilities/mesosUtils"
mesos "github.com/mesos/mesos-go/api/v0/mesosproto"
sched "github.com/mesos/mesos-go/api/v0/scheduler"
"github.com/pkg/errors"
) )
func coLocated(tasks map[string]bool, s BaseScheduler) { func coLocated(tasks map[string]bool, s BaseScheduler) {

View file

@ -1,13 +1,14 @@
package schedulers package schedulers
import ( import (
"gitlab.com/spdf/elektron/def"
elecLogDef "gitlab.com/spdf/elektron/logging/def"
"fmt" "fmt"
mesos "github.com/mesos/mesos-go/api/v0/mesosproto"
sched "github.com/mesos/mesos-go/api/v0/scheduler"
"log" "log"
"time" "time"
mesos "github.com/mesos/mesos-go/api/v0/mesosproto"
sched "github.com/mesos/mesos-go/api/v0/scheduler"
"gitlab.com/spdf/elektron/def"
elecLogDef "gitlab.com/spdf/elektron/logging/def"
) )
type SchedPolicyContext interface { type SchedPolicyContext interface {

View file

@ -2,6 +2,7 @@ package schedulers
import ( import (
"fmt" "fmt"
mesos "github.com/mesos/mesos-go/api/v0/mesosproto" mesos "github.com/mesos/mesos-go/api/v0/mesosproto"
) )

View file

@ -1,12 +1,13 @@
package schedulers package schedulers
import ( import (
"gitlab.com/spdf/elektron/utilities"
"encoding/json" "encoding/json"
sched "github.com/mesos/mesos-go/api/v0/scheduler"
"github.com/pkg/errors"
"os" "os"
"sort" "sort"
sched "github.com/mesos/mesos-go/api/v0/scheduler"
"github.com/pkg/errors"
"gitlab.com/spdf/elektron/utilities"
) )
// Names of different scheduling policies. // Names of different scheduling policies.

View file

@ -1,10 +1,11 @@
package offerUtils package offerUtils
import ( import (
"gitlab.com/spdf/elektron/constants"
mesos "github.com/mesos/mesos-go/api/v0/mesosproto"
"log" "log"
"strings" "strings"
mesos "github.com/mesos/mesos-go/api/v0/mesosproto"
"gitlab.com/spdf/elektron/constants"
) )
func OfferAgg(offer *mesos.Offer) (float64, float64, float64) { func OfferAgg(offer *mesos.Offer) (float64, float64, float64) {

View file

@ -1,9 +1,10 @@
package schedUtils package schedUtils
import ( import (
"log"
"gitlab.com/spdf/elektron/def" "gitlab.com/spdf/elektron/def"
"gitlab.com/spdf/elektron/utilities" "gitlab.com/spdf/elektron/utilities"
"log"
) )
// Criteria for resizing the scheduling window. // Criteria for resizing the scheduling window.

View file

@ -1,11 +1,12 @@
package utilities package utilities
import ( import (
"errors"
"sync"
mesos "github.com/mesos/mesos-go/api/v0/mesosproto"
"gitlab.com/spdf/elektron/def" "gitlab.com/spdf/elektron/def"
"gitlab.com/spdf/elektron/utilities/offerUtils" "gitlab.com/spdf/elektron/utilities/offerUtils"
"errors"
mesos "github.com/mesos/mesos-go/api/v0/mesosproto"
"sync"
) )
type TrackResourceUsage struct { type TrackResourceUsage struct {