Whats difference between heroku and github - heroku

What does it mean production in rails , whats the difference between using github and heroku at the same time . I used github for like a backup / how all of us gonna use heroku . Is it necessary ??

First I need to explain GIT
Git is a distributed version control and source code management (SCM) system with an emphasis on speed. Initially designed and developed by Linus Torvalds for Linux kernel development in 2005. Every Git working directory is a full-fledged repository with complete history and full version tracking capabilities, not dependent on network access or a central server.
GitHub is a web-based hosting service for software development projects that use the Git revision control system. The site provides social networking functionality such as feeds, followers and the social network graph to display how developers work on their versions of a repository.
Heroku (pronounced her-OH-koo) is a web host that uses the Git revision control system. When you push your code to Heroku using git it then builds your server just like you do when you use locate host but for everyone to see.
Heroku is a cloud application platform – a new way of building and deploying web apps. The service lets app developers spend their time on their application code, not managing servers, deployment, ongoing operations, or scaling.

GitHub is a web-based hosting service for projects which uses Git version control system(VCS) It's a code repository where you can store code for better collaboration & contribution. Anybody can contribute to your open source code via cloning it & github will make a branch of code. You can also purchase $9/mth to create private repositories for private collaboration. You can deploy code with Git but you need your own server to host that code.
Visit https://github.com/about
heroku is a PaaS(Platform as a service) web apps hosting service where you can build & deploy web apps. Build great web apps, collaborate & deploy as well with heroku.
Visit https://www.heroku.com/about
Heroku comes with it's own server so you can purchase hosting plan & deploy you web apps easily. In case of Github you need to purchase a separate server to host your web apps.
Github is well known for contribution & collaboration & Heroku is for backend stack available for collaboration & deploying easily.

Related

How do I manage micro services with DevOps?

Say I have a front end node and three backed nodes tools, blog, and store. Each node communicates with the other. Each of these nodes have their own set of languages and libraries, and have their own Dockerfile.
I understand the DevOps lifecycle of a single monolithic web application, but cannot workout how a DevOps pipeline would work for microservices.
Would each micro-service get its own github repo and CI/CD pipeline?
How do I keep the versions in sync? Let's say the tools microservice uses blog version 2.3. But blog just got pushed to version 2.4, which is incompatible with tools. How do I keep the staging and production environments in sync onto which version they are supposed to rely on?
If I'm deploying the service tools to multiple different servers, whose IP's may change, how do the other services find the nearest location of this service?
For a monolithic application, I can run one command and simply navigate to a site to interact with my code. What are good practices for developing locally with several different services?
Where can I go to learn more?
Would each micro-service get its own github repo and CI/CD pipeline?
From my experience you can do both. I saw some teams putting multiple micro-services in one Repository.
We where putting each micro-service in a separate repository as the Jenkins pipeline was build in a generic
way to build them that way. This included having some configuration files in specific directories like
"/Scripts/microserviceConf.json"
This was helping us in some cases. In general you should also consider the Cost as GitHub has a pricing model
which does take into account how many private repositories you have.
How do I keep the versions in sync? Let's say the tools micro-service uses blog version 2.3. But blog just got pushed to version 2.4, which
is incompatible with tools. How do I keep the staging and production
environments in sync onto which version they are supposed to rely on?
You need to be backwards compatible. Means if your blogs 2.4 version is not compatible with tools version 2.3 you will have high dependency
and coupling which is going again one of the key benefits of micro-services. There are many ways how you get around this.
You can introduce a versioning system to your micro-services. If you have a braking change to lets say an api you need to support
the old version for some time still and create a new v2 of the new api. Like POST "blogs/api/blog" would then have a new api
POST "blogs/api/v2/blog" which would have the new features and tools micro-service will have some brige time in which you support
bot api's so it can migrate to v2.
Also take a look at Semantic versioning here.
If I'm deploying the service tools to multiple different servers, whose IP's may change, how do the other services find the nearest
location of this service?
I am not quite sure what you mean here. But this goes in the direction of micro-service orchestration. Usually your Cloud provider specific
service has tools to deal with this. You can take a look at AWS ECS and/or AWS EKS Kubernetes service and how they do it.
For a monolithic application, I can run one command and simply navigate to a site to interact with my code. What are good practices
for developing locally with several different services?
I would suggest to use docker and docker-compose to create your development setup. You would create a local development network of docker
containers which would represent your whole system. This would include: your micro-services, infrastructure(database, cache, helpers) and others. You can read about it more in this answer here. It is described in the section "Considering the Development Setup".
Where can I go to learn more?
There are multiple sources for learning this. Some are:
https://microservices.io/
https://www.datamation.com/applications/devops-and-microservices.html
https://www.mindtree.com/blog/look-devops-microservices
https://learn.microsoft.com/en-us/dotnet/standard/microservices-architecture/multi-container-microservice-net-applications/multi-container-applications-docker-compose

what is Cloud foundry ? and how to integrate with amazon services

Hi i am new to understanding the concept and necessity of Cloud foundry?
what is cloud foundry is it a free server. what type of services it offering that are beneficial for my amazon cloud application?
how to Setup on EC2 instance
Comment with developer perspective because we have git Hub for source code versing control system. i found cloud foundry provides load balancing deployment directly feature ? what about my multiple project deployment like PHP, Java, Mobile and what about User management to restrict developer only update code to deploye?
Providers of Cloud Foundry (like Bluemix) give the developer the ability to push their application, and have the platform handle setting up the environment to run your application. Each of your projects can be deployed as a new application (multiple languages are supported). You can deploy one or many instances of each application - a load balancer is built in to the platform. Unlike EC2 (Infrastructure as a Service), Cloud Foundry is a Platform as a Service. Users are not managing VM's, but instead are more focused on their application.
Applications can be deployed into organizations and spaces to manage collaborative development. There are a lot of videos on youtube that demo this in action.
Cloud Foundry is an open source cloud platform as a service (PaaS) on which developers can build, deploy, run and scale applications.
Cloud platforms let anyone deploy network apps or services and make them available to the world in a few minutes. When an app becomes popular, the cloud scales it to handle more traffic, replacing build-out and migration efforts that once took months with a few keystrokes.

Creating pages with Nesta on Heroku

I am looking to roll a simple CMS with Ruby and preferably Sinatra. www.nestacms.com looks like a terrific candidate.
Some key objectives:
Allow business users to add/edit/remove pages (not via git but via app functionality)
Deploy on Heroku
As I understand, Nesta pages are generated by static page files in your deployment. Which is fine if you add via git and push to Heroku.
But if you're wanting to create pages (files) in a Heroku web app, this isn't possible due to Heroku's read-only file system.
Looking for help around:
Achieving objectives with Nesta and Heroku
Alternative approaches
Github has an editor to manipulate files and buttons to create/merge branches in browser.
You may want store your content related media on a cloud storage services (such as dropbox, google drive, cloudflare etc.) You also can connect/mount these storages like drives via WebDAV or some other tools depending on your prefered service provider & OS.
snap-ci offers free and easy to use integration service for automated tests and/or deployment (heroku or your VPS/server). When master branch changed github webhook triggers snap-ci and your website will deploy in average 1 minute.

Heroku-like Amazon EC2

Is there anything that I can install on my EC2 instances that make AWS Heroku-like?
e.g:
heroku create app
git push
But for AWS.
Well, now there is! It's called AWS Elastic Beanstalk (still in beta, as of March 2013)
After running the initial setup, further deployments should be as simple as git aws.push
EDIT: Just a nice and broad overview of deployment possibilities at AWS, by Werner Vogels (AWS CTO):
There are few topics I need to touch on before I can answer your question thoroughly; so please, bear with me.
A bit of insight
With respects to your two examples, Heroku utilizes a number of different technologies in order to achieve the level of simplicity it provides as a service platform. One of these technologies include: Heroku's proprietary toolbelt, which offers a set of command-line tools —that allows developers to interface with their applications— and an interact with many of the tools Heroku provides —such as terminal access for a number of different languages. The toolbelt itself relies on two other technologies: Ruby and Git; which come prepackaged with the install.
In a nutshell
Now, when you create a Heroku app you are effectively creating a git repository on the celedon cedar runtime stack (by default); this repository is then added as a remote repo. This allows you to immediately run git push heroku master. There is a lot more happening behind the scenes: for instance, when you push, your commits get intercepted by a git pre-receive hook which runs your app through a slug compiler and prepackages it for distribution across the dyno manifold; yet, I digress. For more information on more advance topics, check-out: https://devcenter.heroku.com/; there is a wealth of information here to read.
The stack
Now, let me explain the cedar stack as this is mainly what your question concerns. The Celedon cedar is one of many; however, this is the current default (for many reasons). This polyglot runtime stack currently provides six web languages (at the time of writing,) running on Ubuntu (11.04 stable, I belive). All of these technologies are operating on top of the AWS EC2 computing environment.
So to finally answer your question: You will need to install a suitable operating system such like: Ubuntu; a set of languages such like: Ruby, Python, Node.js, etc; Git (for deployment) and the rest is up to you.
If you have fixed number of instances make sense instead of usage Elastic Beanstalk use custom git deployment, like described in the article: http://www.jeffhoefs.com/2012/09/setup-git-deploy-for-aws-ec2-ubuntu-instance/.
Main idea to setup GIT repository on EC2 instance. When you want to deploy something just push your changes to remote repository, installed on EC2 instance.
I think this approach have next benefits in comparison with Elastic Beanstalk:
You don't pay for S3 buckets for storing application versions;
You have full control on application deployment steps.

How do you run utility services on Heroku?

Heroku is fantastic for prototyping ideas and running simple web services, I often use it to run Python web services like Flask and Django and try out ideas. However I've always struggled to understand how you can use the infrastricture to run those amazingly powerful support or utility services every startup needs in its stack. 4 exmaples of services I can't live without and would recommend to any startup.
Jenkins
Statsd
Graphite
Graylog
How would you run these on Heroku? Would it be best just getting dedicated boxes (Rackspace, e.t.c) with these support services installed.
Has anyone one run utility deamons (services) on Heroku?
There are two basic options. The first is to find or create a Heroku addon to accomplish the task. For example, there are many hosted logging solutions you can use instead of Graylog; Rails on Fire or Travis can be used instead of Jenkins. If an appropriate addon doesn't exist, you can effectively make your own by just running the service on an AWS EC2 instance.
The other alternative is to push the service into being a 12factor application so that it can run on Heroku as well. For example, you could stub out whisper's filesystem calls so that they store in a backing service instead. This is often pretty painful and brittle, though, unless you can get your changes accepted by the upstream maintainers.
you could also use another free service in conjunction with it. OpenShift has a lot of Java related build services and tools that can be added.
I am using a mix of heroku, openshift, mongolab and my own web hosting. Throw in dropbox and box for some space...

Resources