TLDR; it depends on what you want to grow, but generally speaking a depth of 20-25 cm (8-10 inches) suffices to grow many vegetables and herbes, but do investigate if your roof supports such a weight because a rooftop garden can become very heavy when it's soaked with water!
Once you are set up, rooftop gardening is similar to container gardening. The main ...
The two are not mutually exclusive, and in fact installing PV panels over a green roof improves PV performance anywhere from 1 to 10% due to the cooling effect of the green roof.
From the presentation "Interaction between PV-systems and extensive green roofs" given at the Fifth Annual Greening Rooftops for Sustainable Communities Conference, Awards ...
Green roofs help reduce heat significantly. For example in this study
Mean daily temperature reductions achieved were 18.0 °C at the soil surface and 27.5 °C below the module
and this EPA study mentions 2 studies:
Chicago compared summertime surface temperatures on a green roof with a
neighboring building. On an August day in the early afternoon, ...
I'd go for a quick green leafy crop, silverbeet, kale or spinach in the winter, lettuce or rocket in the summer. Those are all shallow rooted and will recover from being too hot and dry for a day if you water them well. They do all require watering, preferably daily when it's hot. They will all go to seed if you let them, and easily produce fertile seeds. I ...
Consider less typical methods of gardening.
Strawberries can be grown in rows using suspended plastic rain gutters, either filled with soil (with appropriate drainage) or hydroponically.
Tomatoes can be grown upside-down in "Topsy-Turvy" planters.