If someone is a trouper he or she does what needs to be done without complaining or whining. A trouper is also part of a troupe, or a group of people, usually an acting troupe or theatre troupe.
If someone is a trooper he or she is a soldier at entry level or an officer in the police. In British English it is also a ship used to move troops.
Both words come from the French troupe, which carries the same meaning as today.
Some dictionaries list trooper as a synonym of trouper, however, this seems to be by association and misuse, rather than a valid connection.