-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[Heartbeat] NPM-less default behavior for browser #28749
Comments
Pinging @elastic/uptime (Team:Uptime) |
Can we have some sort of Removing npm install altogether does limit the selling point of ability to use raw js/ts in the test, in a sense that we are limiting the eco system on which js depends. |
More discussion needed to handle supporting just Synthetics and offline, as well as the flexibility of allowing external deps (without hammering NPM, or dealing with NPM being unavailable). Also, the option of it being disabled in the service, but available on prem. |
An alternative is to expose specific modules through Synthetics like we do with jest/expect |
As we discussed during refinement yesterday, I agree that simply not running In case we want to elaborate on this, however, I thought it would be useful to list the dilemmas involved here. I believe that in this case, there are three main characteristics we'd like our product to have. It should be:
Considering these three characteristics, my descending rank of the most important ones would be:
I also believe that item (1) is, by far, the most important of these. Using that ranked list to scope out desired behaviour, IMO:
On another note, I particularly don't like the |
A related issue reported by one of our users: elastic/synthetics#445 Worth keeping track of it here too as there's a min-repro there and a good amount of info. Also relates to: https://discuss.elastic.co/t/synthetics-failing-silently/295443/9 |
Baking a container with a pre-filled npm cache is a work-around for now, but the cost of npm install is still too high. Preferably, this is something that should be executed exactly once, probably during suite development, certainly not in a running container. |
I've thought the fastest thing we could do would be to replace the user's |
@vigneshshanmugam does this go away as a requirement to implement based on the new project ( i.e. with |
In theory it should work as we are not pulling the source of the synthetics package from the local path instead of fetching from the NPM registry. The exception being, users will not be able to use any external libraries other than our package itself. We could do some validation in our end to make sure it behaves this way. |
If a user has a need for a non internet connected agent to run tests from, it's logical that they can't have any external dependencies (i.e. as expected). Out of interest, would this also be true for anything they may host themselves? E.g. on an air gapped agent, could they include something from a private NPM registry (accessible on that agent), which would be included in a (cc @andrewvc) |
We dont support external libraries with push anyway for now, We could indeed add a set of libraries that we could bake inside the HB image like we have On the private NPM registry part, Users can override it by having a |
Hmmmm, it would be good to be able to bundle some simple external deps, like |
Closing as not relevant as we'll be deprecating ZIP URLs |
Currently, by default, heartbeat will run
npm install
onzip_url
andfolder
directories before executing their contents. This is fragile and difficult to support for operators because:npm
is availableFor a future service this is also not great because it's just slow.
We should add a new mode of operation where the user's
package.json
is ignored, and only the system libraries are used.I'm not certain what the best way to do this is, but one way would be to use this
npm-pack-all
tool: http://www.leanpro.cn/docs/leanrunner/en/shared/npm_offline , then runnpm install
with that.Another way would be to just create a suitable
node_modules
folder as part of the docker image build, and just exec anln -s
to that from the user's project. to 'fill in' any deps. I assume that approach would be faster / simpler, so I sort of prefer it.The text was updated successfully, but these errors were encountered: