4

Not sure if this is the best place for the question but I have multiple development projects with different dependencies.. I want to know what the best practice is to isolate each project?

I have many unrelated projects that a designed and updated on my laptop but I typically push them to a rPi or VMs (esxi). I would like to isolate the various projects so its easier to track which dependencies belong to which project and to stop the OS from having libs and other deps that aren't needed after a project is 'completed'. I do code some for work but its largely a hobby helping neighbors and the local SPCA.

What I use: I typically program on a Debian box or Windows 10 depending on what I need to accomplish. I program in Java, Python, and the typical web stuff (jscript, html, css).. Bash and Powershell if you consider either programming too. Version control is done via Gitlab.

blah
  • 43
  • 4

2 Answers2

1

A more generic approach would be use a separate virtualized environment for each project, see . That could be either:

  • a container image - more lightweight, faster and definitely more popular these days, see
  • a virtual machine (VM) image, slower and a bit more heavier to maintain than containers

You'd have all the project dependencies (IDEs, libraries, tools, etc) installed inside the virtualized environment, not on your system itself.

You'd need to create/bring the project's corresponding image on your machine when you start working on it and you can delete or save it for later re-use on some external storage when done. A shared artifact respository would be recommended as storage if more than one developer can work on these projects.

A huge advantage of this approach is that such virtualized environments play really well with automated CI/CD pipelines, in true DevOps spirit, helping to minimize/eliminate the differences between the development and staging/production environments.

Depending on the programming language and/or the supporting development tools being used on a particular project you may have some more specific approaches/alternatives. For example Pipenv or Virtualenv/ can be used to obtain such isolation for Python projects. But these solutions are typically not usable in other contextes.

Dan Cornilescu
  • 6,780
  • 2
  • 21
  • 45
0

http://microservices.io/

This website explains that microservices are not the holy grail but gives an impression how it could be implemented and how it could be useful.

Regarding the question:

Best way to isolate programming projects?

there is no one-size-fits-all. It depends on the goal. If your company is commercial then the most important thing is that new features while be added. So a monolith would be good first. If issues occur one could apply the cheese-slicer method and extract the problematic functions into microservices. The most important thing is to get it to the customer as soon as possible.

030
  • 13,383
  • 17
  • 76
  • 178