On Attack, Initiative is Started Before the Attack Actually Occurs.
Rules As Written, when the rogue is about to make his attack, everybody rolls initiative.
Any person unaware of the threat has the surprised condition. There is no "surprise round" in 5e, only characters being surprised -- it is like a condition, except the designers didn't take make it a formal condition.
Goblins, all unaware of the threat are surprised, and can't take action. The goblins are no longer surprised at the end of turn.
Now, party members likely Ready an Action until the Rogue goes, if they want. If they don't want, they can move and act (including attacking) on their turn. If sorcerer wants to fireball them here, they can, and it would be the dex save, arguably the DM could add disadvantage for being caught unaware.
On the rogues initiative count, he rolls his sneak attack. The conditions that make this sneak attack is the advantage gained from him still being hidden.
If any party member held their called action until the rogue attacks, there attack would happen here.
Back to the top, and it goes: Goblins, Sorcerer, Cleric, Rogue until combat ends.
Likewise, On Spell Casting
In the case of the opening action being the fireball -- when the player declares his intent, initiative is rolled. The goblins would again start with the surprised condition.
Perception and Stealth
As written, looking around to get a perception roll is an action. Hiding to get a stealth roll is also an action. If a character does stealth, unless someone is actively searching you compare the stealth roll from when the character hid, to the passive perception of nearby characters to know who, if anyone, sees the stealth-ing character. If a character is actively watching, spending their action watching, every round they are spending their action to roll perception check. Hiding also requires some form of cover -- you can't hide in a bright empty room (like you can in Skyrim :p ).
Some DMs allow the first attack to happen outside initiative, this isn't rules as written, but is a fairly common house rule. The effect is typically one extra attack against one enemy, and if by a rogue basically means a bunch of free sneak attack damage. It's an alright house rule, and it is common, but it isn't the standard rules as they are written.
Contested Rolls When it "Makes Sense"
The rules also don't support extra contested stealth v. perception rolls, but some DMs might give them when certain factors change. Like, if a player moves "close enough" or takes certain actions while hidden.