Ezek 38-39 happen before the peace treaty is signed.
Ezekiel 38 and 39 will probably be the catalyst for the signing of the seven year peace treaty.