- Newest
- Most votes
- Most comments
Hi clogwog. When the install has succeeded once, the subsequent calls to the Install lifecycle should be quick (seconds) since all packages are already installed. The apt-get should be reporting that python3 and python-pip are already the newest version and likewise the pip3 operation should report Requirement already satisfied. Is that not the case?
The installation of awsiotsdk creates files on disk of course, so you could use SkipIf to check for the existence of these files. However, if your component creates some other kind of file on disk after a successful Install or Run, you could check for the existence of that as a proxy (you could perhaps even do a touch at the end of an Install or start of a Run). Massimiliano previously suggested using Python virtual environments for this, and helping to prevent conflicts between components. I think this is a good option.
In regards to apt-get, if these packages are required by multiple components, I suggest you do one of the following:
- consider installing these packages as part of your base installation and setup of the device, rather than install them from a component, OR
- create a new component that brings this shared package management in to one place, and setup your component dependencies to make your existing components depend on this new component.
Or you could go further and containerize your components.
Relevant content
- asked 5 years ago
