Commit Graph

4461 Commits

Author SHA1 Message Date
Christina Wang
31e80f8c60
Merge pull request #2158 from balena-os/remove-anon-build-volume-plus-misc-docker-test-command-changes
Remove anon build volume plus misc docker test command changes
2023-04-13 14:00:29 -07:00
Christina Ying Wang
9431ffc780 Use simpler command for docker compose test volume removal
Signed-off-by: Christina Ying Wang <christina@balena.io>
2023-04-11 13:05:44 -07:00
Christina Ying Wang
6a2ccf4007 Remove dind tmpfs in test env
It wasn't changing anything in the test process, so this was a mistake to add.

Signed-off-by: Christina Ying Wang <christina@balena.io>
2023-04-11 13:05:20 -07:00
Christina Ying Wang
a367565189 Remove anonymous build volume from Dockerfile
We don't need this anonymous volume as /data is bind mounted into
the container from host (legacy), and will soon be mounted by the
Supervisor itself on startup.

Change-type: patch
Signed-off-by: Christina Ying Wang <christina@balena.io>
2023-04-11 13:04:36 -07:00
Balena CI
66cbe53b03
v14.10.4 2023-04-10 18:15:44 +00:00
flowzone-app[bot]
8259dae691
Merge pull request #2154 from balena-os/log-uncaught-exceptions
Log uncaught promise exceptions on the app entry
2023-04-10 18:14:37 +00:00
Felipe Lalanne
6764641426 Log uncaught promise exceptions on the app entry
Node 15 [changed the way it treats unhandled promise rejections](https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V15.md#throw-on-unhandled-rejections---33021) from a warning to a throw.
For this reason errors like a corrupt migration directory, that happens when trying to
roll back to a previous supervisor version were no longer showing a
message but dumping the full minimized code into the journal logs.

This PR adds a catchall on app.ts to log the exception and throw an exit
code of 1.

Change-type: patch
2023-04-10 11:18:35 -04:00
Balena CI
447cb0109b
v14.10.3 2023-04-10 15:18:01 +00:00
Felipe Lalanne
06f764ad77
Merge pull request #2157 from balena-os/api-integration-test-restart-timeout-fix
Fix assertion error in restart-service
2023-04-10 10:17:06 -05:00
Christina Ying Wang
b9e1464d96 Fix assertion error in restart-service
From: c0b4fafe84
Restart-service checks that both services have restarted in its test assertion, which is
incorrect as restart-service should only restart one service.

Change-type: patch
Signed-off-by: Christina Ying Wang <christina@balena.io>
2023-04-07 14:40:15 -07:00
Balena CI
5e0509910f
v14.10.2 2023-04-07 18:35:19 +00:00
flowzone-app[bot]
e468eed4c5
Merge pull request #2155 from balena-os/add_orin_nx_custom_dtb
backends: Add Jetson Orin NX custom device-tree support
2023-04-07 18:34:37 +00:00
Alexandru Costache
6b67db98e5 backends: Add Jetson Orin NX custom device-tree support
Signed-off-by: Alexandru Costache <alexandru@balena.io>
Change-type: patch
2023-04-07 18:12:31 +03:00
Balena CI
da15bc3c63
v14.10.1 2023-04-07 00:16:01 +00:00
flowzone-app[bot]
d0d726ceb5
Merge pull request #2151 from balena-os/2150-mount-partitions-gpt-fix
Fix partition mounting for GPT partitioned disks
2023-04-07 00:15:14 +00:00
Christina Ying Wang
4ab8250c97 Use dbus-send to get current boot block device instead of fdisk
Closes: #2150
Change-type: patch
Signed-off-by: Christina Ying Wang <christina@balena.io>
2023-04-06 12:34:00 -07:00
Balena CI
980c838e44
v14.10.0 2023-03-28 19:13:51 +00:00
Christina Wang
bd351a273e
Merge pull request #2120 from balena-os/mount-host-partitions-in-entry
Mount host partitions into container on Supervisor start
2023-03-28 12:13:03 -07:00
Christina Ying Wang
4c948c8854 Mount data and state partitions on container startup
Signed-off-by: Christina Ying Wang <christina@balena.io>
2023-03-27 12:07:01 -07:00
Christina Ying Wang
49ee1042a8 Mount boot partition into container on Supervisor start
As the Supervisor is a privileged container, it has access to host /dev, and therefore has access
to boot, data, and state balenaOS partitions. This commit sets up the framework for the following:

- Finds the /dev partition that corresponds to each partition based on partition label
- Mounts the partitions into set mountpoints in the device
- Removes reliance on env vars and mountpoints provided by host's start-balena-supervisor script
- Simplifies host path querying by centralizing these queries through methods in lib/host-utils.ts

This particular changes env vars for and mounts the boot partition.

Since the Supervisor would no longer rely on container `run` arguments provided by a host script,
this change moves Supervisor closer to being able to start itself (Supervisor-as-an-app).

Change-type: minor
Signed-off-by: Christina Ying Wang <christina@balena.io>
2023-03-27 12:07:01 -07:00
Christina Ying Wang
9522c15ecd Change constants imports to remove 'require'
Signed-off-by: Christina Ying Wang <christina@balena.io>
2023-03-27 12:07:01 -07:00
Balena CI
07b8d44545
v14.9.8 2023-03-27 08:05:46 +00:00
Christina Wang
912a2eccbd
Merge pull request #2147 from balena-os/supervisor-revert-multiarch
Revert "Use multi-arch in dockerfile"
2023-03-27 01:04:54 -07:00
Felipe Lalanne
75eeac5ed4 Revert "Use multi-arch in dockerfile"
This reverts commit 00e389e5f5.

Images generated using this dockerfile still don't have the right
architecture. More testing is needed

Change-type: patch
2023-03-24 18:27:58 -03:00
Balena CI
9304a9215d
v14.9.7 2023-03-23 21:40:33 +00:00
Christina Wang
1d8844c4a6
Merge pull request #2145 from balena-os/add-missing-log-backend-reference
Add missing log backend field assignment in logger init
2023-03-23 14:39:48 -07:00
Christina Ying Wang
37371d89dc Add missing log backend field assignment in logger init
Change-type: patch
Signed-off-by: Christina Ying Wang <christina@balena.io>
2023-03-23 14:07:35 -07:00
Balena CI
7bc89faf12
v14.9.6 2023-03-23 20:18:33 +00:00
Felipe Lalanne
375087ee42
Merge pull request #2141 from balena-os/dockerfile-platform
Use multi-arch in dockerfile
2023-03-23 15:17:49 -05:00
Felipe Lalanne
7cde98d7f7 Update deploy-to-balena action to 0.26.2
Change-type: patch
2023-03-22 21:47:48 -03:00
Felipe Lalanne
00e389e5f5 Use multi-arch in dockerfile
This is necessary since the builder no longer passes the platform flag
to the build. This would lead to dockerfiles that are mixing multi and single
arch stages to pull the wrong architecture images, particularly when
trying to build images in emulated builds (e.g. armv7hf built on aarch64).

Moving the full build to multi-arch solves this as the docker engine is
capable of chosing the right architecture from the manifest.

Relatest-to: balena-io/balena-builder#1010
Change-type: patch
2023-03-22 19:50:31 -03:00
Balena CI
b55964e207
v14.9.5 2023-03-20 19:21:49 +00:00
Christina Wang
4c369785e7
Merge pull request #2140 from balena-os/move-log-stream-to-subdomain
Use log endpoint subdomain if it exists in config.json
2023-03-20 12:21:01 -07:00
Christina Ying Wang
36e46d80a6 Use log endpoint subdomain if it exists in config.json
See: https://github.com/balena-io/open-balena-api/pull/1288
Change-type: patch
Signed-off-by: Christina Ying Wang <christina@balena.io>
2023-03-14 12:56:32 -07:00
Balena CI
d0061e426b
v14.9.4 2023-03-13 20:49:33 +00:00
Felipe Lalanne
cd268d8b48
Merge pull request #2139 from balena-os/pin-device
Skip pin device step if release was deleted
2023-03-13 15:48:36 -05:00
Felipe Lalanne
f6435814cd Skip pin device step if release was deleted
Preloaded devices can require that the device is pinned to the preloaded
release on provisioning. However if the provisioned release gets
released in the future, that would lead to the device remaining in "VPN
only" state forever as the provisioning process could not finish due to
pinning failure.

This commit changes the behavior so if the release does not exist, the
pinning step is skipped and the device follows the fleet pinning state.

Closes: #2133
Change-type: patch
2023-03-13 10:03:00 -03:00
Balena CI
2e81eb1abf
v14.9.3 2023-03-10 22:26:09 +00:00
Felipe Lalanne
9b1ad62f7b
Merge pull request #2142 from balena-os/dockerfile-single-arch
Use single-arch in dockerfile
2023-03-10 17:25:20 -05:00
Felipe Lalanne
17aa625d3b Use single-arch in dockerfile
This is necessary since the builder no longer passes the platform flag
to the build. This would lead to dockerfiles that are mixing multi and single
arch stages to pull the wrong architecture images, particularly when
trying to build images in emulated builds (e.g. armv7hf built on aarch64).

Moving the full build to single-arch solves this as the docker engine is
capable of chosing the right architecture from the manifest. Once some
of the builder issues are fixed, we should move to #2141

Relates-to: balena-io/balena-builder#1010
Change-type: patch
2023-03-10 17:30:22 -03:00
Balena CI
4411f4f074
v14.9.2 2023-03-02 21:48:08 +00:00
Christina Wang
d06b8b7de8
Merge pull request #2135 from balena-os/fix-iptables-input-flush
Replace BALENA-FIREWALL rule in INPUT chain instead of flushing
2023-03-02 13:47:25 -08:00
Christina Ying Wang
84a9e7e9ac Replace BALENA-FIREWALL rule in INPUT chain instead of flushing
The issue with the original Supervisor implementation of the firewall is that
on Supervisor start, the Supervisor flushes the INPUT chain of the filter table.
This doesn't play well with services that add to the INPUT chain on startup that
may start up before the Supervisor, such as certain NetworkManager connection
profiles. This change only replaces the BALENA-FIREWALL rule in the INPUT chain,
preserving the other rules as well as their order.

Closes: #1482
Change-type: patch
Signed-off-by: Christina Ying Wang <christina@balena.io>
2023-03-01 13:42:07 -08:00
Balena CI
935a4fba59
v14.9.1 2023-02-15 14:13:58 +00:00
Page-
1b210d4fa6
Merge pull request #2132 from balena-os/lower-case-cpu-id
Always lower case the cpu id to avoid bouncing between casing when reporting
2023-02-15 14:13:12 +00:00
Pagan Gazzard
d356f979d3 Always lower case the cpu id to avoid bouncing between casing when reporting
Change-type: patch
2023-02-15 13:54:40 +00:00
Balena CI
5b0c8e6743
v14.9.0 2023-02-14 17:10:10 +00:00
Felipe Lalanne
f834c551a4
Merge pull request #2130 from balena-os/duplicate-networks
Find and remove duplicate networks
2023-02-14 12:09:22 -05:00
Felipe Lalanne
89175432af Find and remove duplicate networks
We have seen a few times devices with duplicated network names for some
reason. While we don't know the cause the networks get duplicates, this
can be disruptive for updates as trying to create a container referencing a duplicate
network results in a 400 error from the engine.

This commit finds and removes duplicate networks via the state engine,
this means that even if somehow a container could be referencing a
network that has been duplicated later somehow, this will remove the
container first.

While thies doesn't solve the problem of duplicate networks being
created in the first place, it will fix the state of the system to
correct the inconsistency.

Change-type: minor
Closes: #590
2023-02-10 20:24:36 -05:00
Felipe Lalanne
180c4ff31a Reference networks by Id instead of by name
We have seen a few times devices with duplicated network names for some
reason. While we don't know the cause the networks get duplicates,
this is disruptive of updates, as the supervisor usually queries
resource by name, resulting in a 400 error from the engine because of
the ambiguity.

This replaces those queries by name to queries by id. This includes
network removal. If a `removeNetwork` step is generated, the supervisor
opts to remove all instances of the network with the same name as it
cannot easily resolve the ambiguity.

This doesn't solve the problem of ambiguous networks, because even if
networks are referenced by id when creating a container, the engine will
throw an error (see https://github.com/balena-os/balena-supervisor/issues/590#issuecomment-1423557871)

Change-type: patch
Relates-to: #590
2023-02-10 20:24:36 -05:00