Hello. I would like to understand why Mender allows me to deploy with the same artifacts. Let me explain better with an example:
Suppose we have two modules which I will call mod_a and mod_b, and 2 artifacts, one for mod_a called depl_a and one for mod_b called depl_b.
Mender allows me to perform the following operations:
- Deploy depl_a
- Deploy depl_b
- Repeat operation 1
Hi @PinoRinaudo,
I would love to answer, but some essential pieces of information are missing. Are we talking about two different update modules? Two different kinds of devices? Generally a deployment:artifact is a 0…n:1 relation, an artifact can be used in an arbitrary number of deployments. A common use case is rolling out to different fleet parts, for example.
Greetz,
Josef
First of all, thank you for your prompt response.
The device is the same. There are two different modules, both of which are in the same device.
@PinoRinaudo
Ok, and what do you mean exactly by “module”? An update module as described in the documentation?
Greetz,
Josef
By module, I mean a custom script that is executed when I perform a deployment
Hi @PinoRinaudo
so one of these? Create a custom Update Module | Mender documentation
Ok, so I think I understood the setup. What is the actual problem then? Unless you add the force installation flag, the artifact won’t be reinstalled. Just because something is in a deployment, it does not necessarily mean that it is always installed on all matching devices: the usual dependency and state checks still apply.
Greetz,
Josef
The issue is that I can reinstall the same artifact twice on the same device. After installing artifact x_v1 (module A) and then y_v1 (module B), I can reinstall artifact x_v1. This could be a big problem. Mender should, and perhaps does, keep track of the last installed artifact but for each module.
In practice, I can deploy the same artifact multiple times on the same device.
@PinoRinaudo no, the client will not accept the artifact unless “force install” is selected. Just being able to have the same device/artifact combination in two deployments die not necessarily mean that the artifact is installed twice.
Beyond that, there are valid use cases for installing an artifact twice. That’s what the “force installation” flag in a deployment is for.
Greets,
Josef
The following examples refer to the same device, therefore the same IP, MAC, etc…
If I create a deployment twice with the same artifact, the second deployment is skipped, with the message “already installed”. For example:
- Deploying artifact example_v1.0
- Deploying artifact example_v1.0 ← this is skipped
Note that the artifact example_1.0 is taken care of by script s1. So far, everything is normal.
The problem arises when I create two deployments of identical artifacts but there is another deployment of an artifact in between that is taken care of by another script/module. For example:
- Deploying artifact example_v1.0
- Deploying artifact example_2_v1.0
- Deploying artifact example_v1.0 ← this is NOT skipped
the “forced install” flag is not set.
Hi @PinoRinaudo,
After talking to the devs, it seems that this is a side effect of this ticket, and it should be rolled out soon with the 3.5.2 release.
Greetz,
Josef
Hello @TheYoctoJester,
has this been included in the 3.6 release cycle? I did look at the release notes for mender 3.6+ but could not find any mention to it…