Skip to content

Commit

Permalink
Disable concurrent when precompile the assets
Browse files Browse the repository at this point in the history
Concurrency are raising failure during the precompile.
There is an issue on sprocket related to this issue
rails/sprockets#581.
  • Loading branch information
David Kang committed Mar 20, 2020
1 parent a6cf72d commit 361a3a3
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/api/config/initializers/assets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,8 @@
# Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
Rails.application.config.assets.precompile += ['webui2/webui2.css', 'webui2/application.js', 'webui/obs_factory/application.css', 'webui2/cm2/*.js']

# FIXME: concurrency are raising failure during the precompile.
# For more information https://github.com/rails/sprockets/issues/581
# and https://github.com/sass/sassc-ruby/pull/138
Rails.application.config.assets.export_concurrent = false
29 changes: 29 additions & 0 deletions src/api/docker-files/Dockerfile.minitest
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This is just a thin layer on top of the frontend-backend container that makes
# sure different users can run it without the contained rails app generating
# files in the git checkout with some strange user...

FROM registry.opensuse.org/obs/server/unstable/container/leap151/containers/openbuildservice/frontend-backend

# Configure our user
ARG CONTAINER_USERID
RUN usermod -u 1000 frontend

# We copy the Gemfiles into this intermediate build stage so it's checksum
# changes and all the subsequent stages (a.k.a. the bundle install call below)
# have to be rebuild. Otherwise, after the first build of this image,
# docker would use it's cache for this and the following stages.
ADD Gemfile /obs/src/api/Gemfile
ADD Gemfile.lock /obs/src/api/Gemfile.lock
RUN chown -R frontend /obs/src/api

# Now do the rest as the user with the same ID as the user who
# builds this container
USER frontend
WORKDIR /obs/src/api

# Refresh our bundle
RUN export NOKOGIRI_USE_SYSTEM_LIBRARIES=1; bundle install --jobs=3 --retry=3 || bundle install --jobs=3 --retry=3

CMD ["/bin/bash", "-l"]


0 comments on commit 361a3a3

Please sign in to comment.