Git Product home page Git Product logo

search.cocoapods.org's Introduction

Search Engine Notes

Developing

Installation

  • bundle install
  • gem install foreman
  • Create a trunk_cocoapods_org_test table in a Postgres DB.

Run locally with foreman

  • bundle exec foreman check
  • bundle exec foreman start

Run tests

Disclaimer:
Currently, the integration tests depend on a specific production DB dump.
To download these, you currently need id/secret keys for an S3 instance, which only the CP team has access to.
However, you can run specific specs which only require spec_helper_without_db.
For example: bundle exec bacon spec/lib/models/pod_spec.rb

  • All tests: bundle exec rake
  • A single test: LOAD_TEST_DB=absolutely bundle exec bacon spec/...../.._spec.rb

Deploying to Heroku

  • git push heroku master

ENV variables

You need to set the HOOK_PATH env variable for the Github post-receive-hook (see below for more detail).

heroku config:set HOOK_PATH=...

We also do not load test or development.

heroku config:add BUNDLE_WITHOUT="development:test"

We tune some GC variables.

heroku config:add RUBY_GC_HEAP_INIT_SLOTS=600000

heroku config:add RUBY_GC_HEAP_FREE_SLOTS=600000

heroku config:add RUBY_GC_HEAP_GROWTH_FACTOR=1

heroku config:add RUBY_GC_HEAP_GROWTH_MAX_SLOTS=300000

HOOK_PATH

We use one ENV variable (HOOK_PATH) to set the hook path we use in Trunk’s post-receive-hook to update the search engine’s index: heroku config:add HOOK_PATH=some_garbled_hook_path.
This calls an URL on the app which causes it to update the search engine index for the updated pod from the Trunk database.
(Note: It’s not secure against brute force, man-in-the-middle etc., but a simple security to discourage DoS)

To change HOOK_PATH:

  1. heroku config:set HOOK_PATH=some_other_garbled_hook_path
  2. Update the post-receive-hook in the Specs repo to the new garbled path.

Notes

We have enabled memory logging using the instructions from:

  • https://devcenter.heroku.com/articles/log-runtime-metrics

Current Heroku Labs Features

=== App Features (search-cocoapods-org)
[ ] http-end-to-end-continue Send 100-continue headers to the backend
[ ] http-session-affinity Enable session affinity for all requests
[ ] http-shard-header Turn shard headers on
[+] log-runtime-metrics Emit dyno resource usage information into app logs

search.cocoapods.org's People

Contributors

floere avatar orta avatar alloy avatar segiddins avatar philippamarkovics avatar kylef avatar dev4dev avatar fabiopelosin avatar mk avatar keith avatar teameh avatar codeblooded avatar blakevanlan avatar endocrimes avatar mmorearty avatar seivan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.