-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
V2 Runtime Component Manager #645
Changes from 5 commits
6b66b73
148b1dd
6f0d148
35845b2
a60ae17
a40830c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,11 +19,11 @@ import ( | |
"github.com/elastic/elastic-agent/internal/pkg/agent/program" | ||
"github.com/elastic/elastic-agent/internal/pkg/core/app" | ||
"github.com/elastic/elastic-agent/internal/pkg/core/monitoring" | ||
"github.com/elastic/elastic-agent/internal/pkg/core/process" | ||
"github.com/elastic/elastic-agent/internal/pkg/core/state" | ||
"github.com/elastic/elastic-agent/internal/pkg/core/status" | ||
"github.com/elastic/elastic-agent/internal/pkg/tokenbucket" | ||
"github.com/elastic/elastic-agent/pkg/core/logger" | ||
process2 "github.com/elastic/elastic-agent/pkg/core/process" | ||
"github.com/elastic/elastic-agent/pkg/core/server" | ||
) | ||
|
||
|
@@ -56,7 +56,7 @@ type Application struct { | |
monitor monitoring.Monitor | ||
statusReporter status.Reporter | ||
|
||
processConfig *process.Config | ||
processConfig *process2.Config | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looking at the import above you shouldn't need |
||
logger *logger.Logger | ||
|
||
|
@@ -190,7 +190,7 @@ func (a *Application) SetState(s state.Status, msg string, payload map[string]in | |
a.setState(s, msg, payload) | ||
} | ||
|
||
func (a *Application) watch(ctx context.Context, p app.Taggable, proc *process.Info, cfg map[string]interface{}) { | ||
func (a *Application) watch(ctx context.Context, p app.Taggable, proc *process2.Info, cfg map[string]interface{}) { | ||
go func() { | ||
var procState *os.ProcessState | ||
|
||
|
@@ -235,7 +235,7 @@ func (a *Application) watch(ctx context.Context, p app.Taggable, proc *process.I | |
}() | ||
} | ||
|
||
func (a *Application) stopWatcher(procInfo *process.Info) { | ||
func (a *Application) stopWatcher(procInfo *process2.Info) { | ||
if procInfo != nil { | ||
if closer, ok := a.watchClosers[procInfo.PID]; ok { | ||
closer() | ||
|
@@ -280,7 +280,7 @@ func (a *Application) cleanUp() { | |
a.monitor.Cleanup(a.desc.Spec(), a.pipelineID) | ||
} | ||
|
||
func (a *Application) gracefulKill(proc *process.Info) { | ||
func (a *Application) gracefulKill(proc *process2.Info) { | ||
if proc == nil || proc.Process == nil { | ||
return | ||
} | ||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -269,18 +269,22 @@ func (Build) Clean() { | |
func (Build) TestBinaries() error { | ||
p := filepath.Join("internal", "pkg", "agent", "operation", "tests", "scripts") | ||
p2 := filepath.Join("internal", "pkg", "agent", "transpiler", "tests") | ||
p3 := filepath.Join("pkg", "component") | ||
configurableName := "configurable" | ||
serviceableName := "serviceable" | ||
execName := "exec" | ||
fakeName := "fake" | ||
if runtime.GOOS == "windows" { | ||
configurableName += ".exe" | ||
serviceableName += ".exe" | ||
execName += ".exe" | ||
fakeName += ".exe" | ||
} | ||
return combineErr( | ||
RunGo("build", "-o", filepath.Join(p, configurableName), filepath.Join(p, "configurable-1.0-darwin-x86_64", "main.go")), | ||
RunGo("build", "-o", filepath.Join(p, serviceableName), filepath.Join(p, "serviceable-1.0-darwin-x86_64", "main.go")), | ||
RunGo("build", "-o", filepath.Join(p2, "exec-1.0-darwin-x86_64", execName), filepath.Join(p2, "exec-1.0-darwin-x86_64", "main.go")), | ||
RunGo("build", "-o", filepath.Join(p3, "fake", fakeName), filepath.Join(p3, "fake", "main.go")), | ||
) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we delete the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They will be removed once v2 is being used. |
||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Fake Component | ||
|
||
Controllable through GRPC control protocol with actions. Allows unit tests to simulate control and communication with a running sub-process. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to call it with alias? we dont use this alias in other places so it may be a bit misleading
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
goland did that automatically because the module itself is also named
process
. I will change it back.