Commit Graph

4001 Commits

Author SHA1 Message Date
Alexandru Costache
36544b7d6e Add custom DTB support for imx8mm-var-som
Change-type: patch
Signed-off-by: Alexandru Costache <alexandru@balena.io>
2022-09-06 16:33:35 +02:00
Balena CI
ba66b10c0e v14.0.15 2022-08-24 17:33:20 -04:00
bulldozer-balena[bot]
222c097d4b
Merge pull request #1997 from balena-os/unit-integr
Split test suite into unit and integration tests
2022-08-24 21:30:37 +00:00
Felipe Lalanne
e0e1eacc6e Migrate lockfile tests to testfs
Since tests are ran in a container, lockfile tests no longer need to
mock the behavior of the `lockfile` binary.
2022-08-24 16:07:25 -04:00
Felipe Lalanne
6d004f0994 Setup docker-compose.test
This allows to run integration tests during development and on CI
with the right dependencies. There are several changes that this
involves, but the gist of it is that a test environment is setup using
`docker-compose.test.yml`. This file is loaded by `resin-ci` during the
build, and ensures that integration tests are ran after setting up all
requirements. This commit also defines a test environment command that
can be setup using `npm run test:env` in order to run tests in a local
development machine.
2022-08-24 16:07:20 -04:00
Felipe Lalanne
ba51ca5fc0 Add mocha-pod for running integration tests
This ensure that whenever integration tests are ran, they
are executed in a containerized environment.
2022-08-24 14:29:17 -04:00
Felipe Lalanne
44f3e9ccdb Add command to spawn a development environment
For development, now doing `npm run dev` will spawn containers with the
necessary dependencies for developing and testing the supervisor.
2022-08-24 14:29:17 -04:00
Felipe Lalanne
c1e6dadeb4 Create test/unit and test/integration folders
This sets up the new `test/unit` and `test/integration` folders
and starts classification of some of the test files.

Note that unit tests include, `fs-utils` and `system-info` tests.

While these tests interact with the filesystem, the implementation
of these modules is simple enough, and the tests are fast enough to
allow these tests to fall under the `unit` test category (according to
test/README)

Change-type: patch
2022-08-24 14:28:36 -04:00
Felipe Lalanne
e1e35eb83b Move the current test suite under test/legacy
We are refactoring the supervisor test suite into unit tests (for
algorithms an domain model tests) and integration
tests (for interaction with out-of-process dependencies).
This means the current test suite needs to be classified into
these two categories, and fixed whenever possible.

This commit moves the test suite under the `test/legacy` folder, this
folder should be progressively migrated and eventually removed.
Subsequent commits will begin to split these files into unit and
integration whenever possible.

Depends-on: #1996
Change-type: patch
2022-08-22 17:21:51 -04:00
Balena CI
0d42ec5698 v14.0.14 2022-08-23 00:02:38 +03:00
bulldozer-balena[bot]
b092fa9cb0
Merge pull request #1996 from balena-os/test-in-docker
Refactor test suite to use tsconfig paths instead of relative paths
2022-08-22 21:00:05 +00:00
Felipe Lalanne
c9667f81f0 Update README 2022-08-22 16:22:11 -04:00
Felipe Lalanne
382cdb0cfa Refactor test suite to use tsconfig paths
This replaces all relative paths in the test suite  (e.g
`../src/compose/service.ts`) with the aliased path configured through
tsconfig.

This is a big change but it doesn't affect any functionality
2022-08-18 13:05:10 -04:00
Felipe Lalanne
71eaa3327e Use tsconfig-paths for easier access to the source
Currently, tests only can import source code modules through relative
paths `../../`. This makes it very difficult to refactor and organize
tests in folders as the paths change.

[tsconfig-paths](https://www.npmjs.com/package/tsconfig-paths) allows to
reference the source through an alias defined in the "paths" section of
tsconfig.json
2022-08-18 12:23:31 -04:00
Felipe Lalanne
1439ee30f2 Move sinon to dev dependencies
Sinon was added to the production dependencies by mistake in a previous
build. This is a module only used for testing so this fixes that error.
2022-08-18 12:23:31 -04:00
Felipe Lalanne
274503feb3 Simplify test commands in package.json
The supervisor used to perform tests both for the transpiled code (after
tsc) and one for the typescript code (using
ts-node/register/transpile-only). There is not really a reason for this
and this added complexity to the test configuration. This used to make
testing harder, as the built code didn't include source maps, meaning
the tests did not point to the right code.

Since we want to split tests in unit and integration tests as the next
test improvement, it makes sense to simplify these commands before
adding more complexity.

Change-type: patch
2022-08-18 12:23:20 -04:00
Balena CI
d83a37e6fd v14.0.13 2022-08-03 02:59:36 +04:00
bulldozer-balena[bot]
1c7110badb
Merge pull request #1992 from balena-os/1991-wait-for-stopping-services-in-funnel
Wait for Stopping services to stop before target apply success
2022-08-02 22:57:43 +00:00
Christina Wang
12b67742c8 Wait for Stopping services to stop before target apply success
This mitigates an edge case bug introduced in v13.1.3 where services that
are slow to exit may get stuck in a state of Downloaded if a service var is
changed then reverted rapidly. More detailed description in linked issue.

Change-type: patch
Closes: #1991
Signed-off-by: Christina Wang <christina@balena.io>
2022-08-02 14:34:25 -07:00
Balena CI
936ada7f64 v14.0.12 2022-07-19 00:34:22 +03:00
bulldozer-balena[bot]
944d76fde0
Merge pull request #1987 from balena-os/prevent-restart-on-report-error
Disable healthchecks failing on report errors
2022-07-18 20:47:19 +00:00
Felipe Lalanne
0c4e6ce421 Disable healthchecks failing on report errors
State report errors contribute to the supervisor failing healthchecks
and being restarted by the engine. There is not evidence of this
improving the connectivity situation and it is likely to make things
worst for the API as the first report is much more expensive than
subsequent partial reports.

Change-type: patch
Closes: #1986
2022-07-18 15:53:26 -04:00
Balena CI
86112e59bf v14.0.11 2022-07-18 22:20:48 +03:00
bulldozer-balena[bot]
6945f61a24
Merge pull request #1981 from balena-os/sv-base-image
Refactor supervisor Dockerfile to remove custom dependencies
2022-07-18 18:33:18 +00:00
Felipe Lalanne
1722286a87 Refactor supervisor Dockerfile to remove custom dependencies
Restructure the supervisor image to remove the dependency on the custom `alpine-supervisor-base`
image and the custom node build. The dockerfile is now a multi-stage
build that splits the process into two build stages and two runtime
stages.

Here is the full list of changes

- The node binary is now copied from  `balenalib/${ARCH}-alpine-node:12-run`, the node binary
now supports running with a debugger.
- The runtime image now inherits from the official `alpine:3.16` image
- Tests are ran within the runtime image configuration instead of the
  build image
- Livepush is ran within the runtime image context
- Unnecessary packages have been removed
- Removed avahi-daemon.conf as that service is not being used
- Fix livepush to work with a multi-stage image. This also deprecates the `image-tag` argument to npm run sync as
`SUPERVISOR_TAG` is no longer used by new OSs
- Fix livepush build on old rpi devices. Allows passing a 'PREFIX'
  argument to let the builder pull images directly from docker hub arch
  repositories. Relates to https://github.com/balena-os/balena-engine/issues/269

Change-type: patch
2022-07-18 12:31:23 -04:00
Balena CI
ac933ad3ef v14.0.10 2022-07-14 01:16:48 +03:00
bulldozer-balena[bot]
a7f4f24696
Merge pull request #1985 from balena-os/remove-legacy-build-methods
Remove legacy build methods
2022-07-13 20:58:35 +00:00
Felipe Lalanne
515b6297a0 Remove legacy build methods
Removes dindctl and `tools/sync.js` in favor of balenaos-in-container
and SSH tunneling respectively.

Change-type: patch
2022-07-13 16:14:30 -04:00
bulldozer-balena[bot]
175d14258b
Merge pull request #1984 from balena-os/lockdir
Allow directories to be used as lockfiles
2022-07-13 20:01:36 +00:00
Felipe Lalanne
861e902d7f Allow directories to be used as lockfiles
Some libraries, like [proper-lockfile](https://www.npmjs.com/package/proper-lockfile)
use directories instead of files for locking. This PR allows the supervisor to be able to
work with those types of locks when lock override is requested.

Closes: #1978
Change-type: patch
2022-07-13 13:05:38 -04:00
Balena CI
d11d4fba91 v14.0.9 2022-07-07 00:27:14 +03:00
bulldozer-balena[bot]
39a3deed4b
Merge pull request #1980 from balena-os/host-config-patch-should-ignore-apps-present
Allow host config patch regardless of running applications
2022-07-06 20:42:21 +00:00
Christina Wang
0fc79e87d9 Allow host config patch regardless of running applications
Host config shouldn't be tied to applications in the first place, but
needs to be done so because it uses update locks to determine when it's
safe to patch host config, and update locks are tied to apps.

Change-type: patch
Signed-off-by: Christina Wang <christina@balena.io>
2022-07-06 12:41:51 -07:00
Balena CI
dc8b75485c v14.0.8 2022-06-27 19:38:31 +03:00
bulldozer-balena[bot]
4963473a1d
Merge pull request #1979 from balena-os/docs/override-update-lock-correction
Specify that Supervisor will not restore previous lock status from user containers
2022-06-27 15:51:31 +00:00
Christina Wang
ca140639c6 Specify that Supervisor will not restore previous lock status from user containers
There is no functionality which 1) stores the filesystem lock status when toggling override
to on, and 2) restore the system to that status when toggling override to off.

Change-type: patch
Signed-off-by: Christina Wang <christina@balena.io>
2022-06-27 08:11:01 -07:00
Balena CI
7e5a06d3f8 v14.0.7 2022-06-22 23:12:46 +03:00
bulldozer-balena[bot]
418ee269e1
Merge pull request #1976 from balena-os/v2-journal-logs-containerId-docs
Add missing docs for the containerId param of the journal-logs endpoint
2022-06-22 18:55:02 +00:00
Thodoris Greasidis
ff526c18d8 Add missing docs for the containerId param of the journal-logs endpoint
Resolves: #1975
Change-type: patch
2022-06-22 20:41:11 +03:00
Balena CI
2de0d5901d v14.0.6 2022-06-16 02:33:49 +03:00
bulldozer-balena[bot]
6d6f09eb59
Merge pull request #1970 from balena-os/1968-read-hostname-from-config-or-container-etc
Read hostname from config.json with container /etc/hostname as backup
2022-06-15 23:31:20 +00:00
Christina Wang
a7a0821a3e Read hostname from config.json with container /etc/hostname as backup
We don't need to read the host's hostname through /mnt/root/etc/hostname,
because the hostname is written to config.json on a change. When the hostname
has never changed, it won't be found in config.json, so we can default to
the Supervisor container's /etc/hostname as it will match the host's
/etc/hostname, the network mode being `host`.

Closes: #1968
Change-type: patch
Signed-off-by: Christina Wang <christina@balena.io>
2022-06-15 11:31:36 -07:00
Balena CI
c1bfbd5f3d v14.0.5 2022-06-14 23:37:58 +03:00
bulldozer-balena[bot]
d34c4a3b4f
Merge pull request #1964 from balena-os/1963-variscite-dart-dt-custom-dtb
Add custom DTB support for Variscite Dart DT family
2022-06-14 19:30:53 +00:00
Christina Wang
dfb6bcf0e6 Add custom DTB support for Variscite Dart DT family
Closes: #1963
Relates-to: https://github.com/balena-os/balena-variscite-mx8/pull/134
Relates-to: https://github.com/balena-io/open-balena-api/issues/1033
Change-type: patch
Signed-off-by: Christina Wang <christina@balena.io>
2022-06-14 11:26:45 -07:00
Balena CI
51c5456af9 v14.0.4 2022-06-14 00:58:34 +03:00
bulldozer-balena[bot]
8a740a596c
Merge pull request #1961 from balena-os/streamline-mock-dbus
Better document mocked-dbus, add missing test methods
2022-06-13 21:05:52 +00:00
Christina Wang
ffa1c73418 Better document mocked-dbus, add missing dbus interface methods
Change-type: patch
Signed-off-by: Christina Wang <christina@balena.io>
2022-06-09 11:41:50 -07:00
Balena CI
c0fee7839b v14.0.3 2022-06-07 23:12:14 +03:00
bulldozer-balena[bot]
5db9cd07e4
Merge pull request #1960 from balena-os/dont-send-current-name
Do not send name as part of the current state
2022-06-07 20:00:10 +00:00