Ancient Hindus divided life into four parts, the earliest was called "Brahmacharya" - core tenet of it was celibacy, but sons of kings and rich merchants lived ascetic lives in the teacher's house who was also an ascetic and a sage - no rich clothes, no luxury foods or comfort.
This was supposed to last till the age of 16, going as high as 21 for some.
The Buddhist monastery-universities of India also kept students under similar conditions - celibate, ascetic, and far from luxury.