Containers outside Containers
What is a container? Most will probably answer something related to Docker. That’s a good guess, but docker only one, of many, wrappers that enables the illusion of what we call container.
Continue readingWhat is a container? Most will probably answer something related to Docker. That’s a good guess, but docker only one, of many, wrappers that enables the illusion of what we call container.
Continue readingI’ve posted before about how to setup a private gemserver using geminabox, but I’ve just released a docker image that does the all the job:
Continue readingIf you think your bundle install takes too long, or have a distributed team around the globe, this may help you.
It’s possible to have a cloudfront server pointing to rubygems, and using it as your gems source server. (If you are not aware of what cloudfront is give a look at it)
On this configuration, cloudfront will fetch requests from rubygems.org, and keep
them cached on the CDN, so you should expect the first bundle install
to take
very close time of using rubygems.org, but the second one and forward should have
some performance increase. You can also manually set the cache time there.
On a new cloudfront server, at the AWS console, add rubygems.org as origin:
I’m not a rubygems api expert, I’ve captured bundler requests and tried to cache them with “behaviours” on cloudfront. I’m also caching everything else for 10 minutes. These configurations probably can be tuned, drop a comment if you have suggestions :)
Things to have in mind:
On the Gemfile, you need to change the source to the new proxy server:
# Gemfile
source 'http://mycfdomain.cloudfront.net'
...
note: Theoretically https should work, but due some redirection it didn’t work for me.
I’m using rvm gemset to reset scenarios between tests.
Using a rails 4 default gemfile:
bundle 6.37s user 1.59s system 21% cpu 37.840 total
bundle 6.50s user 1.77s system 22% cpu 37.578 total
bundle 6.35s user 1.60s system 30% cpu 25.664 total
Using “real-world” project Gemfile:
bundle 116.22s user 29.68s system 45% cpu 5:20.03 total
bundle 112.99s user 29.69s system 44% cpu 5:23.24 total
bundle 111.52s user 29.86s system 58% cpu 4:03.12 total
I think the difference on cached content is significative. It’s up to you to decide if it’s enough reason to pay a CF server for this.
There are some situations that you found your build broken and need to know at what revision the “brokeness” was introduced.
git bisect
is a great tool for that, basically you tell git at which revision
the build was good (assuming HEAD is broken), and it does a binary search for the revision where
the bug was introduced.
With Bundler/Gemfile it’s easy to link gems directly to it’s git repository. But some times it’s not ideal. Revisions are not versions, and comparing them is tedious.
Luckly It’s easy to setup a private gem server!
Continue readingIt’s possible to use a custom class as a constraint for your routes. For example:
Continue readingHere is some simple steps to access the phone camera and image gallery. This will be a very simple app. There is only one view, it will hold 2 buttons for selecting the image (one from camera and another from the gallery) and a ImageView that will show the selected image. I’ll not talk about the layout here, what I did is ugly and looks like this:
Continue reading