Skip to content
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

feat: Feature parity with Rust launcher #2

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

ivov
Copy link
Collaborator

@ivov ivov commented Nov 15, 2024

README.md Show resolved Hide resolved
cmd/launcher/main.go Outdated Show resolved Hide resolved
internal/auth/auth.go Outdated Show resolved Hide resolved
internal/commands/launch.go Outdated Show resolved Hide resolved
internal/commands/launch.go Show resolved Hide resolved
cfgNum := len(cfg.TaskRunners)

if cfgNum == 1 {
log.Print("Loaded config file loaded with a single runner config")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logger writes to stderr by default, which is not what we would want here. Also could we enable these logs only if certain env var is set, similar to RUST_LOG in the rust launcher

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also could we enable these logs only if certain env var is set, similar to RUST_LOG in the rust launcher

Why do we want to allow hiding the launcher logs by default? n8n main, worker, webhook, etc. all show at least info logs by default. As a user I'd like to always have a few informative lines to know the runner is working as expected.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would consider most of these logs to be debug logs, like for example the loading of the config here. Sure we can keep one or two to know the runner is working, (tho it can also be interpreted from the log from n8n that runner has connected), but we don't need all of these. This would be in quite contrast compared to what we log in the n8n app itself, which is very minimal

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, let's do this division of info/debug logs as a follow up 👍🏻

internal/commands/launch.go Show resolved Hide resolved
internal/config/config.go Outdated Show resolved Hide resolved
@ivov
Copy link
Collaborator Author

ivov commented Nov 18, 2024

Thanks for the feedback! 🙏🏻 Addressed, let me know what you think

@ivov ivov requested a review from tomi November 18, 2024 10:14
Copy link

@tomi tomi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more thing about the launch command, otherwise looking good 👏

)

func main() {
if len(os.Args) < 2 {
log.Fatal("Missing argument. Expected `launch` or `kill` subcommand")
logs.Logger.Fatal("Missing argument. Expected `launch` or `kill` subcommand")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this only does "launch" now, we don't need the launch command when starting this. It can do that by default. Instead we could take the runner type as the first arg:

./bin/main javascript

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -7,6 +7,8 @@ import (
"os"
)

const configPath = "/etc/n8n-task-runners.json"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would still be nice to test this locally without having to write to /etc/. We can do that later on tho

@ivov ivov requested a review from tomi November 18, 2024 11:49
Copy link

@tomi tomi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants