HiveBrain v1.2.0
Get Started
← Back to all entries
patternpythonMinor

Best way to isolate programming projects?

Submitted by: @import:stackexchange-devops··
0
Viewed 0 times
projectsprogrammingwayisolatebest

Problem

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.

Solution

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

  • a container image - more lightweight, faster and definitely more popular these days, see containers



  • 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/virtualenv can be used to obtain such isolation for Python projects. But these solutions are typically not usable in other contextes.

Context

StackExchange DevOps Q#4002, answer score: 1

Revisions (0)

No revisions yet.