build master & agent