FlowFuse / FlowFuse/device-agent

Reduce time taken to deploy a new snapshot

Open
#74 0 comments 0 reactions 0 assignees View on GitHub
area:remote-instance
Dominant language
JavaScript
Stars
20
Forks
10
Avg merge
9d 4h
Merged PRs (30d)
9

Description

When deploying a new snapshot we currently stop the existing flows, npm install the dependencies, then start the new flows.
Depending on how much work npm has to do, this can lead to prolonged downtime of the flows. We want to look at strategies for reducing this downtime to a minimum.

The npm cache work recently added is one way to skip the npm step - but that assumes you know ahead of time exactly what needs to be installed on the device and you lose some flexibility.

Other options we should consider:

1. compare the new package.json with what's already there and skip the npm install step if everything appears in order. Need to assess how risky this is - we rely on npm to ensure everything is in order even though that takes a bit of time.
2. look at what flags we passing to npm to minimise what its doing (production-only, skip audit etc)
3. do not stop the existing flows until after npm install has completed and we're ready to run the new flows. This will require running the install in a clean directory (thereby losing some of efficiencies npm has when rerunning it in an existing dir, unless we clone node_modules first). This will need some investigation.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.