How to build a streamlined development environment for micro-services
Asked Answered
D

1

6

I was thinking about the micro services architecture and wondering if folks have a good best practice for development environments.

My working assumption is that each micro service will live in it's own git repository for isolation and ease of deployment. I'm also assuming that each developer will create a fork of any repo that they are working on.

The issue I'm considering arises where you are working on an issue that involves multiple micro-services. For example, there is a defect that impacts one micro service and how it appropriately consumes another micro-service.

Assuming n projects are involved in the defect, you would have to check out n git repositories and configure them to work together. If they each have a Vagratefile and Dockerfile, you end up running n VMs. Ideally you'd only have 1 Vagrant VM and each serivce would just be a new Docker instance in that same VM.

A master repo/project with git sub modules could work. The problem with that is if we create a generic master repo/project then the sub module will point to the upstream not the fork for the developer.

I'm currently thinking that a master project that had some configs, vagrant and fig might do the trick. I'm currently considering two methods of implementing this approach.

  1. Provide a config with some defaults i.e. project_1 should be located at ../project_id, etc
  2. Provide a script that will create submodules based on the user's github account, this would create the remote for the user's fork as well as the remote for the upstream project.

Has anybody else solved this problem or have a good workflow?

Duque answered 11/1, 2015 at 19:14 Comment(2)
This is a good example of how the master project fig config would be setup. #27409010Duque
Have you come up with a way of dealing with Git? It's an interesting question.Salvucci
D
1

I decided to go with fig.

If a microservice depends on another microservice fig will reference this service using ../

This assumes that all services are checked out as siblings. This can also easily be accomplished using git sub trees.

My dev_ops repro contains my Vagrant file for boot2docker, etc.

Duque answered 27/2, 2015 at 0:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.