Modules with .git folder are ignored

Hey, we are thinking of employing garden for our multiservice platform.
We stumbled upon some fundamental usage issues/questions and couldn’t find solutions in docs or forum/issues yet.

Q1. Given the following file structure

.
├── garden.yaml  -- project root config
└── services
    ├── addresses-gen   -- module
    ├── email-service   -- module
    ├── redis           -- module
    └── redis-consumer  -- module

Each directory inside the services folder is cloned git repo (not submodule) and has its corresponding garden.yaml module config.
Running garden dev from the root folder tells that “no modules found.”
But if you delete .git directory from module folder, the module will be detected.
So how do we use modules with .git directories inside?

Q2. Is it possible to launch specific modules/services? Imagine having 50 services, but you need only 5 to operate.


garden version - 0.12.34

Hi @boo1ean

A single Garden project always maps to a single git repo. (In fact we rely heavily on git internally).

Garden however supports “remote” repositories via the remote sources functionality.

So if every service is its own git repo, you’d need to make each service into a Garden project.

Something like:

kind: Project
name: addresses-gen-project
#...
---

kind: Module
name: addresses-gen
#...

You can then have a “parent” project at the root which references all the other projects.

kind: Project
name: my-project
sources:
  - name: addresses-gen
    repositoryUrl: https://github.com/my-org/addresses-gen.git#master
# ....

To make sure that Garden picks up changes to the remote source when iterating on it you can link it with the link command.

You can use custom commands simplify common dev workflows such as linking or updating sources (landing in our next release).

(Note that you can also use the “remote module” but I’d recommend the former approach since it makes each module a standalone unit and will work better with functionality we have on the roadmap.)

To answer your second question, you can deploy individual services with:

garden deploy service-a,service-b

You can use the --skip-dependencies flag to avoid deploying upstream dependencies if you need to.

Thank you!
Everything is clear now!

Happy to hear that!

Let us know if you bump into anything else.