The BCs are that u_i-\epsilon_{ij}x_j should be equal on the corresponding edges. This type of boundary conditions can be applied using coupled equations constraints. This requires that one creates a mesh with corresponding nodes on periodic edges. For real, complex microstructures, this could be a challenge.
A recently developed general-purpose multiscale constitutive modeling code called SwiftComp based on Mechanics of Structure Genome, can be used for micromechanics which is essentially a RVE analysis for dummies. The user does not have to specify the boundary conditions and periodic mesh is not required. All the user has to do is to provide the finite element mesh as input. Another unique feature of SwiftComp is that it can compute complete set of 3D properties from a 2D RVE if the material features 2D periodicity such as unidirectional fiber reinforced composites. All the properties are computed within one analysis and thus it is at least six times more efficient than traditional 3D RVE analysis. The code can be launched freely in the cloud at https://cdmhub.org/resources/scstandard or used as a plugin for ABAQUS or ANSYS. You are welcome to try it to see the difference from the RVE analysis you are familiar with.