Auto-merge for PR #504 via VersionBot

Delta improvements
This commit is contained in:
resin-io-versionbot[bot] 2017-10-17 09:47:44 +00:00 committed by GitHub
commit 8a15091c50
4 changed files with 11 additions and 10 deletions

View File

@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file
automatically by Versionist. DO NOT EDIT THIS FILE MANUALLY!
This project adheres to [Semantic Versioning](http://semver.org/).
## v6.3.4 - 2017-10-17
* Delta improvements #504 [Akis Kesoglou]
## v6.3.3 - 2017-10-17
* Update docker-progress to improve identification of Balena #505 [Akis Kesoglou]

View File

@ -1,7 +1,7 @@
{
"name": "resin-supervisor",
"description": "This is resin.io's Supervisor, a program that runs on IoT devices and has the task of running user Apps (which are Docker containers), and updating them as Resin's API informs it to.",
"version": "6.3.3",
"version": "6.3.4",
"license": "Apache-2.0",
"repository": {
"type": "git",
@ -29,7 +29,7 @@
"buffer-equal-constant-time": "^1.0.1",
"coffee-loader": "^0.7.3",
"coffee-script": "~1.11.0",
"docker-delta": "^2.0.1",
"docker-delta": "^2.0.3",
"docker-progress": "^2.7.2",
"docker-toolbelt": "^3.0.1",
"event-stream": "^3.0.20",
@ -49,7 +49,7 @@
"resin-lint": "^1.3.1",
"resin-register-device": "^3.0.0",
"resin-sync": "^9.1.0",
"resumable-request": "^1.0.0",
"resumable-request": "^1.0.1",
"rimraf": "^2.5.4",
"rwlock": "^5.0.0",
"semver": "^5.3.0",

View File

@ -19,8 +19,6 @@ proxyvisor = require './proxyvisor'
osRelease = require './lib/os-release'
deviceConfig = require './device-config'
DEFAULT_DELTA_APPLY_TIMEOUT = 300 * 1000 # 6 minutes
class UpdatesLockedError extends TypedError
ImageNotFoundError = (err) ->
return "#{err.statusCode}" is '404'
@ -220,13 +218,12 @@ fetch = (app, { deltaSource, setDeviceUpdateState = true } = {}) ->
if conf['RESIN_SUPERVISOR_DELTA'] == '1'
logSystemEvent(logTypes.downloadAppDelta, app)
deltaOpts = {
uuid, apiKey
uuid, apiKey, deltaSource
# use user-defined timeouts, but fallback to defaults if none is provided.
requestTimeout: checkInt(conf['RESIN_SUPERVISOR_DELTA_REQUEST_TIMEOUT'], positive: true)
applyTimeout: checkInt(conf['RESIN_SUPERVISOR_DELTA_APPLY_TIMEOUT'], positive: true) ? DEFAULT_DELTA_APPLY_TIMEOUT
applyTimeout: checkInt(conf['RESIN_SUPERVISOR_DELTA_APPLY_TIMEOUT'], positive: true)
retryCount: checkInt(conf['RESIN_SUPERVISOR_DELTA_RETRY_COUNT'], positive: true)
retryInterval: checkInt(conf['RESIN_SUPERVISOR_DELTA_RETRY_INTERVAL'], positive: true)
deltaSource
}
dockerUtils.rsyncImageWithProgress(app.imageId, deltaOpts, onProgress)
else

View File

@ -25,7 +25,7 @@ getRepoAndTag = (image) ->
applyDelta = (imgSrc, deltaUrl, { requestTimeout, applyTimeout, resumeOpts }, onProgress) ->
new Promise (resolve, reject) ->
resumable(request, { url: deltaUrl, timeout: requestTimeout }, resumeOpts)
req = resumable(request, { url: deltaUrl, timeout: requestTimeout }, resumeOpts)
.on('progress', onProgress)
.on('retry', onProgress)
.on('error', reject)
@ -38,7 +38,7 @@ applyDelta = (imgSrc, deltaUrl, { requestTimeout, applyTimeout, resumeOpts }, on
deltaStream = dockerDelta.applyDelta(imgSrc, timeout: applyTimeout)
res.pipe(deltaStream)
.on('id', resolve)
.on('error', reject)
.on('error', req.destroy.bind(req))
do ->
_lock = new Lock()