-
Notifications
You must be signed in to change notification settings - Fork 186
Open
Description
As originally reported in:
- https://forums.balena.io/t/balena-create-app-fails-without-internet/342575
- [openBalena, balenaMachine] User would like to run
balena fleet createin an air-gapped (no internet) environment balena-cli#2322
When users run the balena CLI command balena fleet create, regardless of whether or not they specify the device type with the --type flag, I understand that the CLI calls the balena SDK's models.application.create() method that retrieves the device manifest from S3 as coded in the following lines:
- https://github.com/balena-io/balena-sdk/blob/v15.48.3/lib/models/application.ts#L693-L713
- https://github.com/balena-io/balena-sdk/blob/v15.48.3/lib/models/device.ts#L1395
- https://github.com/balena-io/balena-sdk/blob/v15.48.3/lib/models/config.ts#L146-L151
const deviceTypeIdPromise = deviceModel()
.getManifestBySlug(deviceType) const deviceTypes = await configModel().getDeviceTypes(); const { body: deviceTypes } = await request.send({
method: 'GET',
url: '/device-types/v1',
baseUrl: apiUrl,
});In turn, the SDK queries the /device-types/v1 endpoint from openbalena-api:
- https://github.com/balena-io/open-balena-api/blob/v0.155.5/src/features/device-types/index.ts#L11
- https://github.com/balena-io/open-balena-api/blob/v0.155.5/src/features/device-types/device-types.ts#L84
- https://github.com/balena-io/open-balena-api/blob/v0.155.5/src/features/device-types/storage/s3.ts#L79
- https://github.com/balena-io/open-balena-api/blob/v0.155.5/src/features/device-types/storage/s3.ts#L7
- https://github.com/balena-io/open-balena-api/blob/v0.155.5/src/lib/config.ts#L172
Where the S3 bucket URL / hostname comes from environment variable IMAGE_STORAGE_BUCKET which, as I understand, open-balena hardcodes as s3.amazonaws.com:
IMAGE_STORAGE_ENDPOINT: s3.amazonaws.comHence accessing the internet.
Metadata
Metadata
Assignees
Labels
No labels