-
Notifications
You must be signed in to change notification settings - Fork 117
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
Add warning message to docker boot #599
Add warning message to docker boot #599
Conversation
@@ -41,6 +41,8 @@ func BootUp(options Options) error { | |||
if err != nil { | |||
return errors.Wrap(err, "copying package contents failed") | |||
} | |||
} else { | |||
fmt.Println("WARNING: no custom build packages directory found. Any locally built integrations will not be installed.") |
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.
There is a message logged in L39 informing about used package directories. Do you see this as insufficient/less informative/improvement needed?
The reason I'm asking is that I'm concerned about users booting the stack without the intention of loading any extra integrations. The warning might be confusing for them.
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.
Yeah, I agree with that, it can be confusing for users not developing packages.
Maybe we can still show a message about the content of the registry, but not as a warning.
fmt.Println("WARNING: no custom build packages directory found. Any locally built integrations will not be installed.") | |
fmt.Println("No custom build packages directory found.") |
And the messages below also clarify the packages loaded. I think this would be enough info.
Another thing that could be considered to help in this use case is that when you run elastic-package build
, it somehow detects if the package is being served by the current registry if any is running, and if not, it prints a message there asking to restart the stack from this directory.
And yet another thing we can do to help on these scenarios is to make the registry automatically able to reindex packages without needing to be restarted.
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.
Yah, I think we need something that prints a message in the negative case and actually reports when something isn't working as expected.
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.
It is working as expected as the process wasn't started in the integrations repo. Maybe we should rephrase this warning into something like:
logger.Info("Local packages won't be included as the elastic-package didn't find any built packages.")
.
WDYT?
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.
Oh, I had commented but forgot to submit 🤦
@@ -41,6 +41,8 @@ func BootUp(options Options) error { | |||
if err != nil { | |||
return errors.Wrap(err, "copying package contents failed") | |||
} | |||
} else { | |||
fmt.Println("WARNING: no custom build packages directory found. Any locally built integrations will not be installed.") |
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.
Yeah, I agree with that, it can be confusing for users not developing packages.
Maybe we can still show a message about the content of the registry, but not as a warning.
fmt.Println("WARNING: no custom build packages directory found. Any locally built integrations will not be installed.") | |
fmt.Println("No custom build packages directory found.") |
And the messages below also clarify the packages loaded. I think this would be enough info.
Another thing that could be considered to help in this use case is that when you run elastic-package build
, it somehow detects if the package is being served by the current registry if any is running, and if not, it prints a message there asking to restart the stack from this directory.
And yet another thing we can do to help on these scenarios is to make the registry automatically able to reindex packages without needing to be restarted.
I can give some historical context:
I'm waiting for option 3. to be delivered :) |
++ Everything else are workarounds :D |
So, my concern/paranoia here is mostly about silently bypassing something in the local integrations build, i.e
This is kind of a subtle failure mode, and it leaves more leeway for user oversight than I'd like. Is there a reason why the |
Considering your suggestion, If you want to build 100 packages, does it mean you have to rebuild the Docker image 100 times? Another analogy, when you are building a binary out of a Go code using |
I might be mixing stuff up, but the part of |
No, it does trigger the docker build operation for a custom Package Storage image (see code ref). We considered alternative approaches in the past. For example, mounting a volume resulted in a slow start of the Package Registry, and using a filewatcher to refresh the Package Registry's internal state wasn't stable. As I already said, the flow will be simplified if Kibana allows for installing packages directly without any interaction with Package Registry. |
@mtojek What I'm referring to is the exact copy operation here: elastic-package/internal/stack/boot.go Lines 38 to 44 in 6215ed4
Is there a reason that needs to be in the |
Then, it will be misleading for users who want to build a package, but prefers to boot a clean stack. I don't see an intuitive workaround for this. Do you see any other options, @jsoriano? |
I feel like this behavior should be explicit rather than implicit. If a user wants to boot a clean stack or development stack, there should be a CLI flag that controls that behavior, rather than depending on something more subtle like the development directory. Also keep in mind that if someone runs |
It's implicit as it's natural to stay in the package directory while developing it. If you need to add files to the Git index, you need to be in the working directory.
Would a special logging tag help here? For example: As I said before, this behavior will change when we eventually support direct package installation in Kibana and drop requirement for Package Registry. |
I don't think that we should add more implicit behaviours to I agree with Alex that the current behaviour is confusing: you need to remember to run
This is partially true. There may be many reasons why the terminal where you run Log messages (even big red warnings) are still a partial solution. They may help sometimes, but you can easily overlook them. As mentioned the ideal solution would be to have elastic/kibana#70582, and when we have it, we can probably make Maybe we should think ahead in the UX based on
Then it doesn't matter how the stack was started, the installation is going to install what is expected by the developer. We would replace the steps of running Once elastic/kibana#70582 is available, we use this API instead of restarting the registry, but the developer UX is the same. |
+1 on @jsoriano 's idea, an |
Keep in mind that it will be still confusing as there is a package cache in Kibana. Consider the following scenario:
Unfortunately, there is a bug and user needs to build the package again (same version).
... Kibana installs the same old, cached package and the user is confused now. |
I guess that this problem also exists with current implementation? |
Yes. In such cases, it's recommended to take down the stack or artificially bump up the package version. My point is the solution you proposed won't fix the entire problem. EDIT: With this solution, we may end up with issues like: "install" command doesn't work. |
The PR is stale, let's close it for now. |
So I learned (or forgot, and then remembered) the hard way that if you don't run
elastic-stack
up in an integrations directory, it won't add any custom-built integrations.This just adds a little warning message if it can't find the development directory. However, considering the opportunity for weird silent failures here, I wonder if we should fail out if
found == false
, perhaps with a user override.