With the technology and discoveries available to humans I cannot see many things making us extinct; a very unpleasant life yes, but not extinction.
It would be possible to build accommodation and food within airtight spheres, the kind you do see in most typical sci-fi series/ films.
We are moving forward on the indoor farming-
Vertical farming is fast-expanding but the costs are high and the food range is limited - for now.
www.bbc.com
We are using blue/ white light procedures-
A closer look at a lighting debate from the crop production perspective
www.producegrower.com