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.
#Architecture
# Architecture
![](docs/ElekArch.png)
#Usage
# Usage
* [Pluggable Scheduling Policies](docs/SchedulingPolicies.md)
* [Pluggable Power-Capping strategies](docs/PowerCappingStrategies.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.
#Data
# Data
* [Cluster Resource Consumption](docs/data/ClusterResourceConsumption.md)
* [Schedule Trace](docs/data/ScheduledTrace.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 Window](docs/data/withSpsEnabled/SchedulingWindow.md)
#Software Requirements
# Software Requirements
**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
on the Mesos Agents**
@ -35,7 +35,7 @@ Compatible with the following versions:
* Mesos 1.5.0
* Go 1.9.7
#Build and Run
# Build and Run
Compile the source code using the `go build` tool as shown below.
```commandline
go build -o elektron

View file

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

View file

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

View file

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

View file

@ -1,16 +1,17 @@
package pcp
import (
elecLogDef "gitlab.com/spdf/elektron/logging/def"
"gitlab.com/spdf/elektron/schedulers"
"bufio"
"fmt"
"github.com/mesos/mesos-go/api/v0/scheduler"
"github.com/montanaflynn/stats"
"log"
"os/exec"
"syscall"
"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) {

View file

@ -1,9 +1,6 @@
package pcp
import (
elecLogDef "gitlab.com/spdf/elektron/logging/def"
"gitlab.com/spdf/elektron/pcp"
"gitlab.com/spdf/elektron/rapl"
"bufio"
"container/ring"
"fmt"
@ -14,6 +11,10 @@ import (
"strings"
"syscall"
"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,

View file

@ -1,11 +1,6 @@
package pcp
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"
"container/ring"
"fmt"
@ -17,6 +12,12 @@ import (
"strings"
"syscall"
"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 {

View file

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

View file

@ -1,20 +1,21 @@
package main
import (
"gitlab.com/spdf/elektron/def"
elecLogDef "gitlab.com/spdf/elektron/logging/def"
"gitlab.com/spdf/elektron/pcp"
"gitlab.com/spdf/elektron/schedulers"
"flag"
"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"
"os"
"os/signal"
"strings"
"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>")

View file

@ -1,12 +1,13 @@
package schedulers
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/utilities/mesosUtils"
"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

View file

@ -1,12 +1,13 @@
package schedulers
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/utilities/mesosUtils"
"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

View file

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

View file

@ -1,12 +1,13 @@
package schedulers
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/utilities/mesosUtils"
"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

View file

@ -1,11 +1,12 @@
package schedulers
import (
"gitlab.com/spdf/elektron/def"
elecLogDef "gitlab.com/spdf/elektron/logging/def"
"time"
mesos "github.com/mesos/mesos-go/api/v0/mesosproto"
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.

View file

@ -1,11 +1,11 @@
package schedulers
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/utilities/mesosUtils"
"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

View file

@ -1,14 +1,14 @@
package schedulers
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/def"
elecLogDef "gitlab.com/spdf/elektron/logging/def"
"gitlab.com/spdf/elektron/utilities"
"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) {

View file

@ -1,13 +1,14 @@
package schedulers
import (
"gitlab.com/spdf/elektron/def"
elecLogDef "gitlab.com/spdf/elektron/logging/def"
"fmt"
mesos "github.com/mesos/mesos-go/api/v0/mesosproto"
sched "github.com/mesos/mesos-go/api/v0/scheduler"
"log"
"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 {

View file

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

View file

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

View file

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

View file

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

View file

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