Removed all requirements for anything but opensearch

This commit is contained in:
Frikky
2023-10-23 00:16:33 +02:00
parent 1a0841453b
commit 729972cbd3
3 changed files with 18 additions and 1163 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
module shuffle-shared module shuffle-shared
//replace github.com/shuffle/shuffle-shared => ../../../shuffle-shared replace github.com/shuffle/shuffle-shared => ../../../shuffle-shared
go 1.19 go 1.19
+4 -1159
View File
File diff suppressed because it is too large Load Diff
+13 -3
View File
@@ -71,6 +71,7 @@ var newWorkerImage = os.Getenv("SHUFFLE_WORKER_IMAGE")
var dockerSwarmBridgeMTU = os.Getenv("SHUFFLE_SWARM_BRIDGE_DEFAULT_MTU") var dockerSwarmBridgeMTU = os.Getenv("SHUFFLE_SWARM_BRIDGE_DEFAULT_MTU")
var dockerSwarmBridgeInterface = os.Getenv("SHUFFLE_SWARM_BRIDGE_DEFAULT_INTERFACE") var dockerSwarmBridgeInterface = os.Getenv("SHUFFLE_SWARM_BRIDGE_DEFAULT_INTERFACE")
var isKubernetes = os.Getenv("IS_KUBERNETES") var isKubernetes = os.Getenv("IS_KUBERNETES")
var maxCPUPercent = 85
// var baseimagename = "docker.pkg.github.com/shuffle/shuffle" // var baseimagename = "docker.pkg.github.com/shuffle/shuffle"
// var baseimagename = "ghcr.io/frikky" // var baseimagename = "ghcr.io/frikky"
@@ -1345,6 +1346,14 @@ func main() {
req.Header.Add("X-Orborus-Runmode", "Docker Swarm") req.Header.Add("X-Orborus-Runmode", "Docker Swarm")
} }
if os.Getenv("SHUFFLE_MAX_CPU") != "" {
// parse
tmpInt, err := strconv.Atoi(os.Getenv("SHUFFLE_MAX_CPU"))
if err == nil {
maxCPUPercent = tmpInt
}
}
log.Printf("[INFO] Waiting for executions at %s with Environment %#v", fullUrl, environment) log.Printf("[INFO] Waiting for executions at %s with Environment %#v", fullUrl, environment)
hasStarted := false hasStarted := false
for { for {
@@ -1364,9 +1373,10 @@ func main() {
log.Printf("[ERROR] Failed marshalling. Maybe max 4 second timeout? %s", err) log.Printf("[ERROR] Failed marshalling. Maybe max 4 second timeout? %s", err)
} }
maxAmount := 80 if orborusStats.CPUPercent > maxCPUPercent {
if orborusStats.CPUPercent > maxAmount { log.Printf("[DEBUG] CPU usage is at %f%%. This is more than the max limit the machine should be running at (%d). Waiting before continue.", orborusStats.CPUPercent, maxCPUPercent)
log.Printf("[DEBUG] CPU usage is at %f%%. This is more than the max limit the machine should be running at (%d).", orborusStats.CPUPercent, maxAmount) time.Sleep(time.Duration(sleepTime) * time.Second)
continue
} }
} }