Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRAFT: Enable Air-gapped open-balena deployment #241

Open
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

compiaffe
Copy link

DRAFT This MR enables air-gapped installation of open-balena

This very much builds on https://forums.balena.io/t/supported-devices-in-open-balena/357665

We have this working in production. I would appreciate feedback on how to best integrate this into open-balena. I expect there a changes to be made. My bandwidth is limited, so don't expect this to go fast.

Overview of changes:

  • Add a docker-compose-airgapped.yml
  • Fix dependencies in containers such that they do not run apk add or equivalent during runtime
  • Add (gitlab and currently on our gitlab repo ) cicd to build all containers, rather than relying on docker compose build
  • Add a api-contracts container which contains the contracts github repo and bind mounts into the api container as a CONTRACTS_PRIVATE_REPO_...
  • Add a s3-device-types which contains a subset of the s3 bucket and pushes this into the s3 container (this is still on our repo solely for cicd ease of use, will move in here)
  • Fixes to the env.tmpl file used by the api container to respect a few more env set in docker-compose (e.g. DEVICE_TYPES_CACHE_LOCAL_TIMEOUT to fix a caching problem)

.gitlab-ci.yml Outdated Show resolved Hide resolved
@@ -59,6 +59,14 @@ up: config ## Start all services
@$(MAKE) showenv
@$(MAKE) showpass

.PHONY: agup
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we parameterise up and down instead, along the lines of https://stackoverflow.com/a/2214793/1559300:

(e.g. make up composition=docker-compose-ag.yml and the default if not provided being docker-compose.yml)

Copy link
Contributor

@ab77 ab77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initial quick pass through the PR and some comments/actions..

@@ -0,0 +1,462 @@
---
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am hesitant to keep a separate composition - can the original and AG compositions be a single file, with any changes being passed via environment?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how to do that. Have you got any pointers?

What I can certainly see is turning the docker-compose-airgapped.yml into an "overlay" that just modifies the original docker-compose.yml

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI I'm working on using the docker compose profiles to keep it a single file.

@compiaffe compiaffe force-pushed the air-gapped-fixes branch 2 times, most recently from 3df502e to 7d809cd Compare June 17, 2024 09:28
@ab77 ab77 requested review from cmfcruz, thgreasi and dfunckt June 18, 2024 21:40
@ab77
Copy link
Contributor

ab77 commented Jun 18, 2024

@thgreasi @dfunckt @cmfcruz you may want to take a look at this PR, there are some good ideas in here, which can be potentially distributed/incorporated in the relevant repos to make it all work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants