balena-io / balena-cli

The official balena CLI tool.
Apache License 2.0
452 stars 138 forks source link

[openBalena, balenaMachine] User would like to run `balena fleet create` in an air-gapped (no internet) environment #2322

Open jellyfish-bot opened 3 years ago

jellyfish-bot commented 3 years ago

[rahul-thakoor] There may be cases where users have an openBalena instance or balena on prem instance in an air-gapped network. There are commands that error in such cases since they require contacting services external to the instance. One example is balena fleet create command which calls our s3 repo to get a list of supported devices if the --type option is not specified.

jellyfish-bot commented 3 years ago

[rahul-thakoor] This issue has attached support thread https://jel.ly.fish/fd47d0d2-9a53-43c8-9453-e906d7791e46

jellyfish-bot commented 3 years ago

[pdcastro] This issue has attached support thread https://jel.ly.fish/ce70c1de-e821-4f10-8912-d55af99bbcab

pdcastro commented 3 years ago

Re balena fleet create, I gather that the balena CLI uses the balena SDK's models.application.create() method, and that SDK method retrieves the device manifest from S3 (regardless of the --type flag being used) as coded in the following lines:

I understand that the SDK retrieves the device type manifest with 2 purposes:

In turn, the SDK queries the /device-types/v1 endpoint from openbalena-api:

Where the S3 bucket URL / hostname comes from environment variable IMAGE_STORAGE_BUCKET, which open-balena hardcodes as s3.amazonaws.com:

Hence accessing the internet.

I don't think it is a case of documenting how to run balena fleet create (the balena CLI) in an air-gapped environment, as I understand open-balena relies on the AWS S3 endpoint (s3.amazonaws.com) as per configuration above. Rather, it is a case of recording that this scenario is required by some users and not currently offered by balena. Accordingly, I am changing this issue's title, I have created open-balena issue balena-io/open-balena/issues/129 and will also record the feature request in balena's support system (JF pattern) for discussion in the product improvement loop.