The second build is about as good as it gets* with the budget, assuming there's a monitor/keyboard/mouse (but no OS).
You could remove the OS if there's already one that can be transferred, and that'll come in around $1,225.
*Personal preference plays a part in aesthetics etc, but a new i5 + GTX 1070 is a great pairing.