Production Source Maps now live


(Sam Saffron) #1

Discourse now ships with production source maps thanks to this patch:

https://github.com/discourse/discourse/commit/f8fb823924b4827500e9796bc8c0f0986957faa9

This means you can debug through JavaScript in production without seeing mangled source code:

This feature is not built into Rails quite yet with no target release date quite yet, so as developers you are getting a taste of what will be in all apps in 6 months to a year hopefully.

This feature is very important for me cause it paves the road for js frame resolution in logster

Which means that we will easily be able to understand what is going on in errors like this, once we integrate GitHub - mozilla/source-map: Parse and consume source maps. into logster

Cause we can make logster resolve this stuff for us and give us clean backtraces.

I find this very exciting as it makes it much easier to debug Discourse in production

:confetti_ball: :gift:


In other news I discovered an optimisation that makes asset precompilation 5 times faster, which will be rolling into the docker image in a week or so. uglify ruby wrapper is real slow. I just measured and moving to nodejs for compilation halves our precompile duration.


(Dean Taylor) #2

Hi @sam has this rolled out yet?

Currently I am doing my first build since the production source maps kicked in and I’m seeing gzip compressing taking minutes per file.

I’m not even 50% of the way though and I’m 15 minutes though
Usually builds are done by now for me.


Strip locales from Docker install
(Dean Taylor) #3

Finished update…
Started ~23:08 finished ~23:57 taking approximately 49 minutes on Digitial Ocean 2GB + swap.

Is this to be the norm now for build times?


How do I manually update Discourse and Docker image to latest?
(Jeff Atwood) #4

I was noticing this too. @sam I think your change made updates much slower…


(Sam Saffron) #5

I’ll get the new image out first thing next week. I disabled redis caching cause it becomes pointless with new image, state is temporary


(Sam Saffron) #6

New image is up now. To update

cd /var/discourse
git pull
./launcher rebuild app

The new node js uglifier is way faster.


(Dean Taylor) #7

Thanks @sam - just ran the sequence:

Where my previous time was (via Docker Manager) ~49 minutes, the git pull and rebuild only took ~11 minutes.
Looks like a good improvement in the recent updates.


How do I manually update Discourse and Docker image to latest?
(Dean Taylor) #8

I just completed another run of the cd, pull, rebuild - this time the was ~20 minutes.

Things that seemed to take time where:

~3 minutes here:

I, [2015-01-07T01:50:53.662157 #38]  INFO -- : > cd /var/www/discourse && su discourse -c 'bundle install --deployment --verbose --without test --without development'
I, [2015-01-07T01:54:37.207340 #38]  INFO -- : HTTP GET https://bundler.rubygems.org/api/v1/dependencies

And compressing (uglifyjs) ~4 minutes:

I, [2015-01-07T01:55:45.070112 #3446] (just before)
--- Lots of Compressing:...
I, [2015-01-07T01:59:35.358020 #38]  INFO -- : Purging temp files
Bundling assets
Compiling css for default
desktop_119a7891c8c1b6ed5c87011d0cd6ed22dc9ba586.css
mobile_119a7891c8c1b6ed5c87011d0cd6ed22dc9ba586.css
Compressing Javascript and Generating Source Maps

I, [2015-01-07T01:59:35.368603 #38]  INFO -- : File > /usr/local/bin/discourse  chmod: +x

Note that in this output seemed odd that Compressing Javascript and Generating Source Maps came after the generating and compressing actually occured.