Commit Graph

4712 Commits

Author SHA1 Message Date
flowzone-app[bot]
c31cf8c533
Merge pull request #2230 from balena-os/multi-container-state-apply
Apply update strategies app-wide
2024-02-01 19:30:30 +00:00
Christina Ying Wang
3afcef2969 Respect update strategies app-wide instead of at the service level
Fixes behavior for release updates which removes a service in current state
and adds a new service in target state.

Change-type: patch
Closes: #2095
Signed-off-by: Christina Ying Wang <christina@balena.io>
2024-01-29 12:26:28 -08:00
Felipe Lalanne
87b195685a Use the state-helper functions in app module tests 2024-01-29 12:25:55 -08:00
flowzone-app[bot]
963f43cf0d
v15.3.0 2024-01-26 14:51:03 +00:00
flowzone-app[bot]
1346527ec9
Merge pull request #2235 from balena-os/prettierrc
Supervisor Developer experience improvements
2024-01-26 14:50:14 +00:00
Felipe Lalanne
0500fe10bb Pin docker version to v24 for tests
Moby v25 adds the dynamically generated MAC address to the Config field,
which breaks the state engine, preventing the state from settling as the
current state never matches the target state (empty mac address). This
seems to be a bug in Moby that we reported in moby/moby#47228

The issue won't affect Balena devices until balenaEngine is updated, and this
change fixes testing for now.

Change-type: patch
2024-01-25 16:43:00 -03:00
Felipe Lalanne
6ee606806d Fix docker utils tests for docker v25
From docker 25, the engine will validate IPAM config. This would cause
the docker utils test to fail since the network/subnet configuration was
incorrect.

Change-type: patch
2024-01-25 15:05:12 -03:00
Felipe Lalanne
23fae633ca Enable nodemon when using test:env
This avoids the need to rebuild the environment when making code changes
and running integration tests

Change-type: minor
2024-01-25 15:05:12 -03:00
Felipe Lalanne
2f3e3d2e61 Improve test:compose and test:env commands
The commands now use docker-compose run instead of docker compose up
for simplicity and also to match what flowzone does.

Change-type: patch
2024-01-25 15:05:02 -03:00
Felipe Lalanne
e2f54e29fa Add prettierrc for editor compatibility
The tsserver lsp doesn't seem to work well with .editorconfig. Using
prettierrc will allow formatting to work correctly with editor plugins

This also updates editorconfig to work well with json

Change-type: patch
2024-01-25 15:04:33 -03:00
flowzone-app[bot]
d32987ab1f
v15.2.0 2024-01-08 13:25:40 +00:00
flowzone-app[bot]
48d288b715
Merge pull request #2231 from balena-os/mdns-improvements
Try MDNS lookup only if regular DNS lookup fails
2024-01-08 13:24:53 +00:00
Felipe Lalanne
dec39a35d4 Try MDNS lookup only if regular DNS lookup fails
This is meant to allow users to configure their device to
resolve `.local` queries via dnsmasq by modifying config.json, e.g. `dnsServers":
"/bob.local/172.17.0.33`.

This would fail before as MDNS lookups would always come first

Change-type: minor
2024-01-03 14:42:23 -03:00
Felipe Lalanne
7a39da92b7 Refactor mdns lookup code in app entry
Change-type: patch
2024-01-03 14:42:23 -03:00
flowzone-app[bot]
66c35cfd4a
v15.1.1 2024-01-02 18:35:28 +00:00
flowzone-app[bot]
c969f87673
Merge pull request #2232 from balena-os/alexgg/start-stop-service
docs: api: start-service: specify this endpoint affects the device
2024-01-02 18:34:38 +00:00
Alex Gonzalez
096fdbc74a docs: api: start-service: specify this endpoint affects the device
The description incorrectly states the endpoint would start a service
in the whole fleet while it only affects the device.

Change-type: patch
Signed-off-by: Alex Gonzalez <alexg@balena.io>
2023-12-29 17:53:14 +01:00
flowzone-app[bot]
df027248fd
v15.1.0 2023-11-22 20:12:21 +00:00
flowzone-app[bot]
698b8159ff
Merge pull request #2226 from balena-os/sandbox-error
Force remove container if updateMetadata fails
2023-11-22 20:10:41 +00:00
Felipe Lalanne
3ea8d4727a Force remove container if updateMetadata fails
The `updateMetadata` step renames the container to match the target
release when the service doesn't change between releases. We have seen
this step fail because of an engine bug that seems to relate to the
engine keeping stale references after container restarts. The only way
around this issue is to remove the old container and create it again.
This implements that workaround during the updateMetadata step to deal
with that issue.

Change-type: minor
Relates-to: balena-os/balena-engine#261
2023-11-22 14:16:44 -03:00
flowzone-app[bot]
6acd04a01b
v15.0.4 2023-11-22 17:10:59 +00:00
flowzone-app[bot]
b6aa75b4ee
Merge pull request #2227 from balena-os/update-systemd-0.5.0
Update @balena/systemd to 0.5.0
2023-11-22 17:10:08 +00:00
Christina Ying Wang
fd3b6f6961 Include target-state-config dump file in testfs
Signed-off-by: Christina Ying Wang <christina@balena.io>
2023-11-22 11:09:26 -03:00
Felipe Lalanne
d18292f68e Only build sqlite3 from source
Change-type: patch
2023-11-22 11:09:26 -03:00
Christina Ying Wang
7981e6becd Update @balena/systemd to 0.5.0
Change-type: patch
Signed-off-by: Christina Ying Wang <christina@balena.io>
2023-11-22 11:09:26 -03:00
flowzone-app[bot]
55433a88cd
v15.0.3 2023-11-22 00:32:56 +00:00
flowzone-app[bot]
b53bd31332
Merge pull request #2225 from balena-os/cache-last-reported-current-state
Cache last reported current state
2023-11-22 00:31:26 +00:00
Christina Ying Wang
eb8ad11cd7 Cache last reported current state to /mnt/root/tmp
Whenever the Supervisor reports current state, it diffs the current state
with its last reported current state. However, when the Supervisor starts
up, there is no last reported state, since that last report is stored in
process memory. Caching the last report in a location that survives
Supervisor restarts will reduce the current report bandwidth used on startup.

Change-type: patch
Signed-off-by: Christina Ying Wang <christina@balena.io>
2023-11-14 16:15:36 -08:00
Christina Ying Wang
d440776881 Convert current state types to io-ts
Signed-off-by: Christina Ying Wang <christina@balena.io>
2023-11-08 16:00:54 -08:00
flowzone-app[bot]
dd5f9c8558
v15.0.2 2023-11-01 22:17:08 +00:00
Christina Wang
7c6b5d0fa0
Merge pull request #2220 from balena-os/apply-in-progress-intermediate-state
Set applyInProgress to true while applying intermediate state
2023-11-01 15:15:58 -07:00
Christina Ying Wang
a993b3e7af Set applyInProgress to true while applying intermediate state
Intermediate state is utilized when executing device actions such as a
volume purge. It's a type of state apply, but despite that,
applyInProgress is not true.

Change-type: patch
Signed-off-by: Christina Ying Wang <christina@balena.io>
2023-10-25 10:32:10 -07:00
flowzone-app[bot]
06cf939958
v15.0.1 2023-10-25 13:04:14 +00:00
flowzone-app[bot]
2a078b19b2
Merge pull request #2219 from balena-os/expose-port-mappings
Expose ports from port mappings on services
2023-10-25 13:03:04 +00:00
Felipe Lalanne
9bd216327f Expose ports from port mappings on services
PR #2217 removed the expose configuration but also caused a regresion
where ports set via the `ports` configuration would no longer get
exposed to the host, despite portmappings being set. This fixes that
issue by exposing only those ports comming from port mappings.

Change-type: patch
2023-10-24 15:04:39 -03:00
flowzone-app[bot]
6d2470a686
v15.0.0 2023-10-23 17:31:14 +00:00
flowzone-app[bot]
67dac79476
Merge pull request #2217 from balena-os/v15-ignore-dc-expose
Ignore `expose` service compose configuration
2023-10-23 17:30:10 +00:00
Felipe Lalanne
416170bc05 Ignore expose service compose configuration
The docker EXPOSE directive and corresponding docker-compose `expose`
service configuration serves as documentation/metadata that a container
listens on a certain port that may be used for service discovery but it doesn't
have any real impact on the ability for
other containers on the same network to access the exposed service via
the port. In newer engine implementations, this property may conflict
with other network configurations, and prevent the container from being
started by the docker engine (see #2211).

This PR removes code that would manage the expose property and takes the
property out of the whitelist. A composition with the `expose` property
will result in the log message `Ignoring unsupported or unknown compose fields: expose`.

While this change should not have operational impact, it still removes
a previously supported configuration and as such there is a chance of it
being a breaking change for some applications. For this reason it is
being published as a new major version.

Change-type: major
Closes: #2211
2023-10-23 11:41:32 -03:00
flowzone-app[bot]
2089b3863d
v14.13.14 2023-10-23 13:34:46 +00:00
flowzone-app[bot]
cdec9ca34d
Merge pull request #2156 from balena-os/jitter-docs
Add note regading API jitter on target state poll
2023-10-23 13:33:50 +00:00
Felipe Lalanne
b107868765 Add note regading API jitter on target state poll
Change-type: patch
2023-10-23 14:11:20 +01:00
flowzone-app[bot]
f7396cf335
v14.13.13 2023-10-16 21:43:24 +00:00
flowzone-app[bot]
9145544fda
Merge pull request #2213 from balena-os/reduce-lodash
Reduce lodash usage
2023-10-16 21:42:25 +00:00
Pagan Gazzard
e15205301c Switch some _.includes usage to native versions
Change-type: patch
2023-10-16 14:30:25 -03:00
Pagan Gazzard
a4a9a17c1a Switch _.assign usage to native versions
Change-type: patch
2023-10-16 14:30:25 -03:00
Pagan Gazzard
d0cb54537f Switch _.isNaN usage to native versions
Change-type: patch
2023-10-16 14:30:25 -03:00
Pagan Gazzard
c9f032e13a Switch _.isFunction usage to native versions
Change-type: patch
2023-10-16 14:30:25 -03:00
Pagan Gazzard
3bfdc4454e Switch _.isUndefined usage to native versions
Change-type: patch
2023-10-16 14:30:25 -03:00
Pagan Gazzard
8e23091aa9 Switch _.isNull usage to native versions
Change-type: patch
2023-10-16 14:30:25 -03:00
Pagan Gazzard
ca3faebfc9 Switch _.isNumber usage to native versions
Change-type: patch
2023-10-16 14:30:25 -03:00