Usage of Cloud Foundry Spaces in the development chain - cloud-foundry

I am currently evaluating the possibility of introducing a private Java PAAS cloud. So far I am quite excited about the whole solution, especially combining the foundry with openstack.
What I am wondering though, is how this can be combined with development. I obviously want the developer to run the developed code on the cloud and no longer on his unmanaged workstation.
Is it possible to do the following:
Developer develops his application code on the local host OS. A virtual machine is used to build and run the application. I have seen this in vagrant and liked this alot. Ideally the local vagrant box is a cloud foundry space.
If the developer is OK with his code, he should push his application out of the local vm to a developer specific acceptance space run by cloud foundry on the network. Here the application is a more production like environment and automated acceptance / disaster recovery tests can be executed.
If the developer decides this is OK and merges his changes to the trunk (SVN/GIT) a CI tool should deploy the application to the "global" test, acceptance and production spaces.
I assume the last point is no problem. I just cannot find a way, how the first steps can be achieved.
Any ideas?

are you actually looking for a complete cf deployment on top of openstack?
That can be achieved using BOSH cloud foundry deployment for openstack.
http://docs.cloudfoundry.com/docs/running/deploying-cf/openstack/
you can have different spaces in the cf deployment: test , production etc. and can move application from one space to another after testing is done.

Related

What is the differnce between a Cloud Foundry and A Web Server

So being an SAP consultant , I am trying to understand the SAP cloud foundry .
As per understanding till now , Cloud Foundry is a runtime engine provider (on the cloud ) .
There are many Cloud Foundry like SUSE , IBM , SAP Cloud Foundry .
Doubt:-
I develop an application for Android ,
I deploy the application in a Web Server ,
Now everybody can download it from Google Play and use it .
I deploy the same application in one of the Cloud Foundry .
Now everybody can download it from Google Play and use it .
Is there any difference between a Cloud Foundry and A Web Server ? Or both are same
EDIT :- Question Clarification
What is the difference between products like SUSE , IBM , SAP Cloud Foundry and Cloud services like AWS , Google Cloud , AZURE
So being an SAP consultant , I am trying to understand the SAP cloud foundry .
I can't talk to anything specific that SAP is doing, but to be called Cloud Foundry you need to be certified which tests compatibility and interoperability (and prohibits lock-in). SAP is certified so there's a base set of functionalty that is common with it and any other provider. I'll only be referencing that here.
There are many Cloud Foundry like SUSE , IBM , SAP Cloud Foundry .
Correct, just a minor terminology note. Each vendor with a certified Cloud Foundry offering is called a provider. Cloud Foundry is the service, the company offering it is the provider.
Oh, you can also run your own, if you or your company prefers that route.
Doubt:- I develop an application for Android , I deploy the application in a Web Server , Now everybody can download it from Google Play and use it .
I deploy the same application in one of the Cloud Foundry . Now everybody can download it from Google Play and use it .
Is there any difference between a Cloud Foundry and A Web Server ? Or both are same
Let's say that you have an Android app. It talks to some services.
For example:
Android Phones 1..X (possibly millions) talking to Servers 1..Y (hopefully not millions).
Each Android phone runs a client, the client talks to the server to perform work
The server provides some functionality, like storing data or performing expensive calculations you wouldn't/can't do on the phone
There's no difference when it comes to the Android app. You're building that. It's running on someone's phone. It's talking over HTTP (or some other protocol) to a service. It's installed through the Play Store (not from your servers).
The main difference is with the services to which your Android app communicates. Specifically, between how you deploy your app on a server/VM directly or on Cloud Foundry and the amount of work required to do so.
For a server you might:
need to request hardware or request a VM from IT, if you're lucky you can provision this on-demand
you need to install an OS, if you're doing this right you have a tool to install this for you, but that tool might need some configuration/tuning
you need to install any software required to run your app (JVM, Dotnet, Python, etc...), including servers like Nginx, Tomcat, Apache Web Server, etc...
you need to configure software and servers (again if you're doing it right you have a tool that helps you manage this, which may require some configuration)
then you build your app (or perhaps take bits from a CI server)
last you set up your app to run, including some sort of watcher/service management software to make sure that when your app crashes it is automatically restarted
There could be more (network/firewall/service work) or less (like if you deploy to a public cloud IaaS) tasks here depending on what it takes to deploy an app in your environment.
This also doesn't touch on the fact that you need to maintain all this. Ensure that you're updating software and the OS in a timely fashion.
For Cloud Foundry:
You do a cf push which takes your code and automatically adds and configures the software needed to run your app (through buildpacks).
Your app is then run on Cloud Foundry.
You're back to writing code.
Other benefits:
It's watched automatically, so if it crashes it restarts. No intervention required.
Logs are captured and made easily available to you, the developer
Network access & TLS are already set up and managed by your provider.
There's a catalog of on-demand and easy to consume services available to your app.
Software is automatically updated whenever you push code.
You can scale up/down easily with load, no new servers to provision and set up.
There's even an autoscaler to automatically scale up/down based on provided rules to save resources/money.
tl;dr - it is an easy button for developers. You just write code and push. All the other stuff you don't want to worry about is done for you.

Local cloud stack for Azure similar to LocalStack for AWS?

Is there a mocking framework for Azure similar to LocalStack for AWS? Please understand that I am not looking for a SDK mock but a resource stack mock.
So much so, that I could replace the configurations of my local Azure stack with actual Azure resources in my project and the functionality would remain just the same. Quite like how it works with Localstack.
I have found Azure Cloud Fabric to come closest to this, but it is tightly coupled with Visual Studio IDE.
Although there is not an equivalent of LocalStack for Azure, Microsoft publish three emulators you can run locally to help with integration testing:
Azure Functions Core Tools, a local version of the Azure Functions Runtime, allowing you to execute your Azure functions locally without deploying them.
Azure Storage Emulator, a local emulator of Azure storage.
Cosmos DB Emulator, a local emulator of CosmosDB.
The above three can get you a lot of integration test coverage, however since Azure Functions, AWS Lambda and most modern web stacks even non-serverless have moved to consuming services rather than just consuming software modules, the only way to have complete parity between integration test and production environments is to automate the creation and tear-down of real, paid for services.
A recipe for End to End/Integration testing on Azure:
Use Azure DevOps Piplines to automate the entire CI process
Add tasks to the pipeline for creating and tearing down (real) text fixture resources with persistent state (databases, file storage etc) using the Azure command line tools.
Provide the test application access to real, stateless services (such as Azure Cognitive Services etc.) as you would for production.
Use Azure Variable Groups to store names, connection strings etc. for the test fixture resources. You can store a different set for production in a different group, allowing easy switching between them in YAML for different stages. These variables can also be templated in their own YAML file.
Use the Azure Functions Core Tools emulator to host and run functions within the CI agent rather than deploying, with a unit test framework giving them requests. The functions will be using the non-emulated, services stood up as test fixtures.
Or create a deploy for test stage, publishing the API for real, then write API tests that make raw HTTP requests, or use this as a backend for Selenium web driver testing a UI/frontend.
The above approach relies on real services to provide testing rather than emulated ones, testing something that's pretty close to what you deploy in production. It will incur usage fees each time you run your tests. If this is a problem, use unit testing and emulator integration testing first in the pipeline and add a human check/different pipeline for this level of testing which you only perform before pushing to production.
Azure Slots may also be worth looking up.
There is now https://github.com/azure/azurite providing also a docker
https://hub.docker.com/_/microsoft-azure-storage-azurite

Continuous deployment without cloning whole repository

I am searching for a solution to do continuous deployment in a cloud environment, more specific, in an Amazon AWS environment.
The code to be deployed are mainly Microsoft's ASP and PHP, so this framework should work on both platforms. As I have an auto-scale environment, this framework will work if it pulls the new code, like Puppet does.
My first thought was to deploy direct from the VCS, but I ended in a problem where all repository information was mirrored to the servers, as GIT, for instance, works. This is a problem because the repository keeps growing and the servers will demand more and more space.
I found Ansible, that works the way I need, but does not work on Windows environment. It only sends to the servers the production code, not the VCS repository, and keeps track which servers are updated.
Without using an easy-to-setup framework like this, I will need to create a Puppet + Jenkins + a VCS framework, where Jenkins creates the package from a VCS source code and Puppet delivers it.
Does anybody know any small framework for my needs or the Puppet + Jenkins + VCS is the way to go?
Consider CloudMunch (www.cloudmunch.com) for this. The platform is built exactly to solve this kind of polyglot requirements.
Disclaimer: I work for CloudMunch

Continuous integration with AWS and Django

I'm looking at setting up a continuous integration solution for a Django framework project hosted in AWS. Their are client and server tests. The client tests will fire up a headless browser, but it would also be good if it could fire up real browsers like Chrome and Firefox.
Repo hosted on BitBucket. What would be great is if code is committed to a branch, then the CI setup will pull the changes and run the tests in an environment that closely matches production.
Can you help me set up the best possible stack given the above constraints?
I think Fabric would be suitable for this. Fabric allows you to run code on your local machine and the server. Once you learn the basics of Fabric, you will see that you can run a command like 'fab deploy' and Fabric will commit your changes to a branch, then pull the changes onto the server.
You could have steps in between to launch a new server, prepare the environment, then run tests against the code. I have been using Fabric to simplify some deployments and have found it a great experience. Because of the flexibility fabric gives you, you can pretty much deploy however you want, whether it's onto a test server, QA, live etc...

How does cloud foundry handle process isolation?

Let's say that I setup my own cloud using the open source cloud foundry implementation provided on cloudfoundry.org. Will each app that I deploy be run as a separate user? Or is there any of VMWare's virtualization technology in use here? E.g. would each app run in a separate virtual machine or anything like that? How can I configure the memory, cpu, and disk resource limits for each app?
I asked this on the mailing list. Here's the response I got:
If your DEA is configured to run in secure mode, then each app runs as its own user and process isolation is used to protect them. We are moving toward a model of using linux cgroups http://en.wikipedia.org/wiki/Cgroups when on linux, using the warden cgroup wrappers that are already in our source tree.
VM based isolation for a single app is pretty heavy weight, but we have long term plans to provide this for apps that need/desire it. (As opposed to the warden/cgroup work which is a near term project)
Since this is related to the open source for cloud foundry, you can try asking your question on https://groups.google.com/a/cloudfoundry.org/group/vcap-dev
You should get a quick response there!