This repository has been archived by the owner on May 7, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from Max-Meldrum/dev
Add cgroups prototype, connect kompact-ext and add logging for executors
- Loading branch information
Showing
55 changed files
with
1,234 additions
and
333 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,4 +19,5 @@ native/ | |
build/ | ||
.idea/ | ||
weldrunner | ||
executor | ||
hadoop* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
# TaskManager | ||
sudo mkdir -p /sys/fs/cgroup/cpu/taskmanager | ||
sudo mkdir -p /sys/fs/cgroup/memory/taskmanager | ||
|
||
# Containers | ||
sudo mkdir -p /sys/fs/cgroup/cpu/containers | ||
sudo mkdir -p /sys/fs/cgroup/memory/containers | ||
|
||
|
||
# Set User rights to the directories | ||
|
||
sudo chown -R ${USER}: /sys/fs/cgroup/cpu/taskmanager | ||
sudo chown -R ${USER}: /sys/fs/cgroup/cpu/containers | ||
|
||
sudo chown -R ${USER}: /sys/fs/cgroup/memory/taskmanager | ||
sudo chown -R ${USER}: /sys/fs/cgroup/memory/containers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
...ndalone/src/main/scala/clustermanager/standalone/taskmanager/actors/MetricsReporter.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package clustermanager.standalone.taskmanager.actors | ||
|
||
import akka.actor.{Actor, ActorLogging, Cancellable, Props} | ||
import clustermanager.standalone.taskmanager.isolation.ContainerMetrics | ||
import runtime.protobuf.messages.Container | ||
|
||
import scala.concurrent.duration._ | ||
|
||
object MetricsReporter { | ||
case object Tick | ||
case object StartReporting | ||
def apply(container: Container, metrics: ContainerMetrics): Props = | ||
Props(new MetricsReporter(container, metrics)) | ||
} | ||
|
||
class MetricsReporter(container: Container, metrics: ContainerMetrics) extends Actor with ActorLogging { | ||
import MetricsReporter._ | ||
|
||
private var ticker: Option[Cancellable] = None | ||
private implicit val ec = context.dispatcher | ||
|
||
override def postStop(): Unit = | ||
ticker.map(_.cancel()) | ||
|
||
|
||
def receive = { | ||
case Tick => | ||
log.info(s"Logging metrics for container ${container.jobId}") | ||
log.info(s"Memory fail count: " + metrics.getContainerMemFailcount) | ||
log.info("Memory limit for whole container: " + metrics.getMemoryLimit(container.jobId)) | ||
log.info("Memory Usage for whole container: " + metrics.getContainerMemoryUsage) | ||
case StartReporting => | ||
ticker = startTicker() | ||
case _ => | ||
} | ||
|
||
private def startTicker(): Option[Cancellable] = { | ||
Some(context.system.scheduler.schedule( | ||
500.milliseconds, | ||
500.milliseconds, | ||
self, | ||
Tick | ||
)) | ||
} | ||
} |
Oops, something went wrong.