Commit Graph

4404 Commits

Author SHA1 Message Date
Felipe Lalanne
c88d557aaf Update README
Add the new dependency on RUST, reorganize the documentation

Change-type: patch
2023-08-16 15:59:04 -04:00
Felipe Lalanne
327dc31ef0 Replace node-dbus with @balena/systemd
The node-dbus module is unmaintained and a blocker for the update to
Node 18. Switching to our own node bindings for systemd solves this
issue

Relates-to: Shouqun/node-dbus#241
Change-type: patch
2023-08-16 15:58:52 -04:00
Felipe Lalanne
8f17c30de6 Replace dbus test service with mock-systemd-bus
This avoids unnecessary mocking and tests against the real systemd API

Change-type: patch
2023-08-16 14:46:58 -04:00
Pagan Gazzard
2da691bcd5 Update to nodejs 18
Change-type: minor
2023-08-16 14:46:58 -04:00
flowzone-app[bot]
eb69295ca3
v14.11.14 2023-08-14 23:47:13 +00:00
flowzone-app[bot]
f245ddf5f2
Merge pull request #2187 from balena-os/renovate/balena-io-deploy-to-balena-action-0.x
Update balena-io/deploy-to-balena-action action to v0.28.0
2023-08-14 23:46:14 +00:00
Self-hosted Renovate Bot
4f54395be2 Update balena-io/deploy-to-balena-action action to v0.28.0
Update balena-io/deploy-to-balena-action
Changelog-entry: Update balena-io/deploy-to-balena-action to v0.28.0
Change-type: patch
2023-08-14 16:18:34 -07:00
flowzone-app[bot]
011dc30028
v14.11.13 2023-08-10 16:51:28 +00:00
flowzone-app[bot]
b59ded5a00
Merge pull request #2188 from balena-os/vipul/remove-override-ref
patch: Remove reference of override_lock variable
2023-08-10 16:50:29 +00:00
Vipul Gupta
7560c70a08
patch: Remove reference of override_lock variable
This is being done to keep the source of truth for this variable in one place and reduce confusion since it's better for dashboard users to reference the dashboard option rather than the actual variable name
2023-08-10 12:21:24 +05:30
flowzone-app[bot]
e4e48136ba
v14.11.12 2023-07-19 07:55:57 +00:00
Alex Gonzalez
11e24a8abb
Merge pull request #2185 from balena-os/alexgg/fix-mounts
mount-partitions: do not hardcode partition types
2023-07-19 09:55:03 +02:00
Alex Gonzalez
cc2ca84448 mount-partitions: do not hardcode partition types
Query instead the device for its filesystem type before mounting.

Change-type: patch
Signed-off-by: Alex Gonzalez <alexg@balena.io>
2023-07-18 11:53:38 +02:00
flowzone-app[bot]
325075b528
v14.11.11 2023-07-12 08:35:30 +00:00
flowzone-app[bot]
2b1ee55390
Merge pull request #2184 from balena-os/add_orin_nano_nvme
backends: Add Jetson Orin NANO custom device-tree support
2023-07-12 08:34:20 +00:00
Alexandru Costache
512240c544 backends: Add Jetson Orin NANO custom device-tree support
Signed-off-by: Alexandru Costache <alexandru@balena.io>
Change-type: patch
2023-07-11 18:11:32 +03:00
flowzone-app[bot]
833e02567b
v14.11.10 2023-07-05 19:00:47 +00:00
Florin Sarbu
5658d1b712
Merge pull request #2182 from balena-os/add_revpi-connect-s
Add revpi-connect-s to Raspberry Pi variants
2023-07-05 21:59:40 +03:00
Florin Sarbu
8d2b310af8 Add revpi-connect-s to Raspberry Pi variants
We need the supervisor to be able to manage config.txt changes for the
Revolution Pi Connect S.

Change-type: patch
Signed-off-by: Florin Sarbu <florin@balena.io>
2023-07-05 13:55:29 +02:00
flowzone-app[bot]
f905c80a40
v14.11.9 2023-06-28 21:01:09 +00:00
flowzone-app[bot]
00436ea160
Merge pull request #2180 from balena-os/remove-stopped-service-status
Remove the 'Stopped' status for services
2023-06-28 21:00:11 +00:00
Christina Ying Wang
38fe8dae75 Remove the 'Stopped' status for services
It's not an official status from container inspects, and the Supervisor
doesn't set it internally anywhere. It's better to remove it entirely as the
method by which Supervisor sets internal service statuses is by using a global
event emitter (reportNewStatus) which makes things difficult to test.

Change-type: patch
Signed-off-by: Christina Ying Wang <christina@balena.io>
2023-06-28 11:17:13 -04:00
flowzone-app[bot]
098494d6f4
v14.11.8 2023-06-23 18:46:29 +00:00
flowzone-app[bot]
a0effca2c2
Merge pull request #2179 from balena-os/parse-exit-message-for-engine-host-race
Parse container exit error message instead of status to fix Engine-host race
2023-06-23 18:45:27 +00:00
Christina W
71d24d6e33 Parse container exit error message instead of status
The previous implementation in #2170 of parsing the container status was too general,
because it relied on the mistaken assumption that a container would have a status of
`Stopped` if it was manually stopped. This turned out to be untrue, as manually stopped
containers were also getting restarted by the Supervisor due to their inspect status of
`exited`. With this, parsing the exit message became unavoidable as there are no other
clear ways to discern a container that has been manually stopped and shouldn't be started
from a container experiencing the Engine-host race condition issue (again, see #2170).

Since we're just parsing the exit error message, we don't need to worry about different behaviors
amongst restart policies, as any container with the error message on exit should be started.

Change-type: patch
Closes: #2178
Signed-off-by: Christina Ying Wang <christina@balena.io>
2023-06-22 14:43:17 -07:00
flowzone-app[bot]
60e39e929c
v14.11.7 2023-06-19 21:55:02 +00:00
flowzone-app[bot]
934ff67ce4
Merge pull request #2175 from balena-os/download-progress
Fix /v2/applications/state endpoint
2023-06-19 21:53:58 +00:00
Felipe Lalanne
12eac04484 Fix /v2/applications/state endpoint
It was returning stale information, particularly the download progress
of the target release images never got updated.

Change-type: patch
Closes: #2174
2023-06-19 17:16:36 -04:00
flowzone-app[bot]
5cbd1149f1
v14.11.6 2023-06-19 20:53:38 +00:00
flowzone-app[bot]
02e07186e0
Merge pull request #2149 from balena-os/multi-arch-v2
Use multi-arch in dockerfile (again)
2023-06-19 20:52:45 +00:00
Felipe Lalanne
1cf325d5c5 Add fail-safe to test the image architecture
Verify that the target image architecture matches what is expected
according to the balena app architecture.

Change-type: patch
2023-06-19 15:36:39 -04:00
Felipe Lalanne
c1b157971d 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-06-19 15:36:39 -04:00
flowzone-app[bot]
e95a26c37c
v14.11.5 2023-06-19 19:01:23 +00:00
flowzone-app[bot]
2ddacb6b44
Merge pull request #2176 from balena-os/improve-engine-host-race-fix-implementation
Improve engine host race fix implementation
2023-06-19 19:00:29 +00:00
Christina Ying Wang
7eba48f8b8 Improve tests surrounding Engine-host race patch
See: #2170
Change-type: patch
Signed-off-by: Christina Ying Wang <christina@balena.io>
2023-06-19 11:11:26 -07:00
Christina Ying Wang
9e249e6ae8 Remove unnecessary async/await from method
Signed-off-by: Christina Ying Wang <christina@balena.io>
2023-06-19 11:11:26 -07:00
Christina Ying Wang
6e6f79c71d Decrease wait time before start from 60s to 30s
60 seconds to wait may be excessively long.

Signed-off-by: Christina Ying Wang <christina@balena.io>
2023-06-19 11:11:26 -07:00
Christina Ying Wang
ace642ea0f Improve naming of a util function & add unit test
isOlderThan -> isValidDateAndOlderThan

See: https://github.com/balena-os/balena-supervisor/pull/2170#discussion_r1226809686
Signed-off-by: Christina Ying Wang <christina@balena.io>
2023-06-19 11:11:26 -07:00
Christina Ying Wang
ab80f198d8 Add exitCode property to Service class
Since we need to conditionally query the service's exit code
during step inference, adding the exitCode property keeps the
step inference function pure.

See: https://github.com/balena-os/balena-supervisor/pull/2170#discussion_r1226805153
Signed-off-by: Christina Ying Wang <christina@balena.io>
2023-06-19 11:11:26 -07:00
flowzone-app[bot]
7e24f095cc
v14.11.4 2023-06-19 07:56:46 +00:00
flowzone-app[bot]
96d2c6af64
Merge pull request #2177 from balena-os/specify-fs-type-when-mounting-partitions
Specify fs type when mounting partitions to prevent "Can't open blockdev" warnings
2023-06-19 07:55:21 +00:00
Christina Ying Wang
e6662f664c Specify fs type when mounting partitions to prevent "Can't open blockdev" warnings
Change-type: patch
Signed-off-by: Christina Ying Wang <christina@balena.io>
2023-06-16 13:46:41 -07:00
flowzone-app[bot]
0521d97c96
v14.11.3 2023-06-15 19:49:47 +00:00
flowzone-app[bot]
51ad257e7f
Merge pull request #2173 from balena-os/renovate/balena-io-deploy-to-balena-action-0.x
Update balena-io/deploy-to-balena-action action to v0.27.0
2023-06-15 19:48:57 +00:00
Self-hosted Renovate Bot
1675c16622 Update balena-io/deploy-to-balena-action action to v0.27.0
Update balena-io/deploy-to-balena-action

Change-type: patch
Changelog-entry: Update balena-io/deploy-to-balena-action to v0.27.0
2023-06-08 11:15:42 -07:00
Balena CI
d3f9821895
v14.11.2 2023-06-05 18:53:19 +00:00
flowzone-app[bot]
ce9ba9aac1
Merge pull request #2170 from balena-os/handle-engine-host-resource-race-condition
Handle Engine-host race condition
2023-06-05 18:52:38 +00:00
Christina Ying Wang
2537eb8189 Handle the case of 'on-failure' restart policy
As explained in the comments of this commit, a container with the restart policy
of 'on-failure' with a non-zero exit code matches the conditions for the race, so
the Supervisor will also attempt to start it. A container with the 'no' restart
policy that has been started once will not be started again. If a container with
'no' has never been started, its service status will be 'Installed' and the Supervisor
will already try to start it until success, so the service with 'no' doesn't require
special handling.

Signed-off-by: Christina Ying Wang <christina@balena.io>
2023-06-05 11:05:58 -07:00
Christina Ying Wang
95f3e13d50 Add extra delay after state engine integration tests
This ensures target state has settled (since it seems that the 'applied' status
that's reported isn't 100% accurate and the actual Engine state may lag behind slightly)

Signed-off-by: Christina Ying Wang <christina@balena.io>
2023-05-31 11:33:27 -07:00
Christina Ying Wang
7f32141958 Handle Engine-host race condition for "always" and "unless-stopped" restart policy
There exists a race condition between Engine and a host resource that may not
be immediately created. In this race condition, if a container's compose config
depends on the existence of that host resource, such as a network interface, and the
Engine tries to create & start the container before the host resource is created, the
Engine will not reattempt to start the container, regardless of the restart policy.
This is undesireable behavior but seems to be the behavior as implemented by Docker.

To rectify this, the Supervisor state funnel noops for a grace period of 1 minute
after starting a container to see that the container's status has become 'running`.
If the container exits because of the race condition, the status becomes 'exited' and the
Supervisor will attempt to generate another start step. This noop-wait-start step loop
will repeat until the container is able to start.

If the container is never able to start, there was a problem in the host in the creation of the
host resource, and that should be fixed at the host level.

This commit does not handle the case of services with restart policies "no" or "on-failure"
which encounter this host race, as metadata from container inspects needs to be introduced
during step calculation in order to figure out whether services with those restart policies
need to be started. This will be fixed in a future PR.

Change-type: patch
Signed-off-by: Christina Ying Wang <christina@balena.io>
2023-05-31 11:32:19 -07:00