The Food Computer by the MIT OpenAg group is all about producing food in a computer controlled fully automated way. I think we'll gain a lot of insight from their work.
From their site:
"A Food Computer is a controlled-environment agriculture technology platform that uses robotic systems to control and monitor climate, energy, and plant growth inside of a specialized growing chamber. Climate variables such as carbon dioxide, air temperature, humidity, dissolved oxygen, potential hydrogen, electrical conductivity, and root-zone temperature are among the many conditions that can be controlled and monitored within the growing chamber. Operational energy, water, and mineral consumption are monitored (and adjusted) through electrical meters, flow sensors, and controllable chemical doses throughout the growth period."
This TED talk gives some background.