Как внедрить сборку jemalloc во время выполнения в окружности? - PullRequest
0 голосов
/ 01 января 2019

У меня проблема с памятью приложения rails, и я решил использовать jemalloc, это хорошо для локальных, но не для circleci.В моей сборке есть ошибки, и я не могу понять, как внедрить jemalloc в сборку cirleci ruby.

Вот мой конфиг:

version: 2
 jobs:
  build:
   docker:
     - image: circleci/ruby:2.5.0
     - image: circleci/postgres:9.5-alpine
     - image: docker.elastic.co/elasticsearch/elasticsearch:5.6.2
     - image: redis
working_directory: ~/app
steps:
  - checkout

  - run:
      name: Install dependencies
      command: sudo apt-get update && sudo apt-get install libjemalloc-dev

  - run:
      name: Inject jemalloc
      command: LD_PRELOAD=`jemalloc-config --libdir`/libjemalloc.so.`jemalloc-config --revision` app

  # Which version of bundler?
  - run:
      name: Which bundler?
      command: bundle -v

  # Restore bundle cache
  - restore_cache:
      keys:
        - app-bundle-v2-{{ checksum "Gemfile.lock" }}
        - app-bundle-v2-

  - run:
      name: Bundle Install
      command: bundle check || bundle install

  # Store bundle cache
  - save_cache:
      key: app-bundle-v2-{{ checksum "Gemfile.lock" }}
      paths:
        - vendor/bundle

  - run:
      name: Wait for DB
      command: dockerize -wait tcp://localhost:5432 -timeout 1m

  - run:
      name: Database setup
      command: bundle exec rake db:drop db:create db:migrate

  # Run rspec in parallel
  - run:
      name: Run rspec in parallel
      command: bundle exec rake
...