Resource Allocation for Service Chaining in Multi-layer Edge-Cloud Networks