mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-02-12 22:15:33 +00:00
Merge pull request #320 from resin-io/255-aufs-support
AUFS support and dependent app assets improvement
This commit is contained in:
commit
d505a5f3cc
@ -1,3 +1,5 @@
|
|||||||
|
* Use appId in dependent app assets tar path, and only create the tar if it doesn't exist [Pablo]
|
||||||
|
* Support AUFS by upgrading node-docker-delta to 1.0.0 and docker-toolbelt to 1.3.0 [Pablo]
|
||||||
* Send the uuid as distinct_id for mixpanel events [Pablo]
|
* Send the uuid as distinct_id for mixpanel events [Pablo]
|
||||||
* gosuper: support i386 platforms without MMX instructions [petrosagg]
|
* gosuper: support i386 platforms without MMX instructions [petrosagg]
|
||||||
|
|
||||||
|
@ -12,9 +12,9 @@
|
|||||||
"bluebird": "^3.0.0",
|
"bluebird": "^3.0.0",
|
||||||
"body-parser": "^1.12.0",
|
"body-parser": "^1.12.0",
|
||||||
"buffer-equal-constant-time": "^1.0.1",
|
"buffer-equal-constant-time": "^1.0.1",
|
||||||
"docker-delta": "0.0.12",
|
"docker-delta": "1.0.0",
|
||||||
"docker-progress": "^2.1.0",
|
"docker-progress": "^2.1.0",
|
||||||
"docker-toolbelt": "^1.2.0",
|
"docker-toolbelt": "^1.3.0",
|
||||||
"dockerode": "~2.2.9",
|
"dockerode": "~2.2.9",
|
||||||
"event-stream": "^3.0.20",
|
"event-stream": "^3.0.20",
|
||||||
"express": "^4.0.0",
|
"express": "^4.0.0",
|
||||||
|
@ -202,8 +202,7 @@ fetch = (app, setDeviceUpdateState = true) ->
|
|||||||
throw err
|
throw err
|
||||||
|
|
||||||
shouldMountKmod = (image) ->
|
shouldMountKmod = (image) ->
|
||||||
docker.imageRootDir(image)
|
Promise.using docker.imageRootDirMounted(image), (rootDir) ->
|
||||||
.then (rootDir) ->
|
|
||||||
utils.getOSVersion(rootDir + '/etc/os-release')
|
utils.getOSVersion(rootDir + '/etc/os-release')
|
||||||
.then (version) ->
|
.then (version) ->
|
||||||
return version? and (version.match(/^Debian/i) or version.match(/^Raspbian/i))
|
return version? and (version.match(/^Debian/i) or version.match(/^Raspbian/i))
|
||||||
|
@ -18,11 +18,6 @@ url = require 'url'
|
|||||||
|
|
||||||
pubnub = PUBNUB.init(appConfig.pubnub)
|
pubnub = PUBNUB.init(appConfig.pubnub)
|
||||||
|
|
||||||
getAssetsPath = (image) ->
|
|
||||||
docker.imageRootDir(image)
|
|
||||||
.then (rootDir) ->
|
|
||||||
return rootDir + '/assets'
|
|
||||||
|
|
||||||
isDefined = _.negate(_.isUndefined)
|
isDefined = _.negate(_.isUndefined)
|
||||||
|
|
||||||
exports.router = router = express.Router()
|
exports.router = router = express.Router()
|
||||||
@ -182,17 +177,18 @@ router.put '/v1/devices/:uuid', (req, res) ->
|
|||||||
console.error("Error on #{req.method} #{url.parse(req.url).pathname}", err, err.stack)
|
console.error("Error on #{req.method} #{url.parse(req.url).pathname}", err, err.stack)
|
||||||
res.status(503).send(err?.message or err or 'Unknown error')
|
res.status(503).send(err?.message or err or 'Unknown error')
|
||||||
|
|
||||||
tarPath = ({ commit }) ->
|
tarPath = ({ appId, commit }) ->
|
||||||
return '/tmp/' + commit + '.tar'
|
return '/tmp/' + appId + '-' + commit + '.tar'
|
||||||
|
|
||||||
router.get '/v1/dependent-apps/:appId/assets/:commit', (req, res) ->
|
router.get '/v1/dependent-apps/:appId/assets/:commit', (req, res) ->
|
||||||
knex('dependentApp').select().where(_.pick(req.params, 'appId', 'commit'))
|
knex('dependentApp').select().where(_.pick(req.params, 'appId', 'commit'))
|
||||||
.then ([ app ]) ->
|
.then ([ app ]) ->
|
||||||
return res.status(404).send('Not found') if !app
|
return res.status(404).send('Not found') if !app
|
||||||
dest = tarPath(app)
|
dest = tarPath(app)
|
||||||
getAssetsPath(app.imageId)
|
fs.lstatAsync(dest)
|
||||||
.then (path) ->
|
.catch ->
|
||||||
getTarArchive(path, dest)
|
Promise.using docker.imageRootDirMounted(app.imageId), (rootDir) ->
|
||||||
|
getTarArchive(rootDir + '/assets', dest)
|
||||||
.then ->
|
.then ->
|
||||||
res.sendFile(dest)
|
res.sendFile(dest)
|
||||||
.catch (err) ->
|
.catch (err) ->
|
||||||
|
Loading…
x
Reference in New Issue
Block a user