Efficient development flow for Cloud Foundry - docker

The basic flow of making the change to the code and then pushing the code using IDE or CLI to the CF instance seems to be quite inefficient. What other approach exists, preferably with following characteristics:
Ease of setting up the environment on a developer's machine including cases such as on boarding of new team member when the replicability and consistency is important
Seamless development experience - change/deploy/test
Support for local services binding and mocking/stubbing
There was similar question already but it is quite outdated and with the pace of changes in the industry (e.g. Docker explosion) there might be better alternatives to the push.

Related

Does developing using RoboMaker tie me tightly to AWS?

I am in the process of learning ROS and Gazebo for a project and saw that Amazon's Robomaker seems to be a great environment to get something up and working quickly. My concern is if I design and develop my project in Robomaker, that it will be tough to move over to my own servers should the time come.
Has anyone had any experience with this? Is it pretty simple to move over to another solution/infrastructure or are you married to AWS once you go down the rabbit hole?
Do they demand ownership of your IP?
Basically, if it is "normal ROS", there's a robot encoded in an URDF file, there's a bunch of standard ROS libraries (gazebo, controller, robot_localization, amcl, etc.), all strung together by a bunch of launch files (aka xml startup scripts).
They can't stop you from using this on your own system.
What they really offer, if you look at what they're pitching (https://aws.amazon.com/robomaker/), is a bunch of custom software, chiefly useful for running a fleet/multiple of robots in an industrial setting, involving human interaction / voice, data analytics and monitoring.
For most people learning, if you were to even touch this (you can get entirely on your own on a native ubuntu or ubuntu virtualbox), their simulation environment may be nicer out-of-the-box (I haven't played with it). The rest of the benefits, to translate them, is to have robots with data analytics and fancy AI+web tools, and then to do fleet lifecycle management.
You are most certainly not locked in - just make sure you want what they offer before shelling out anything.
In general, is it also a good idea to put your application in containers using docker o AWS ECR. So you can deploy your app in any other environment using a CI/CD pipeline, including the edge computer.

What could be changed for service designer / developer / operating manager when a company implement DevOps Approach?

I study DevOps now and just understand the difference between waterfall and devops, its effect and benefits.
My question is What could be changed for service designer / developer / operating manager when a company implement DevOps Approach?
It is saying that when devops approach is implemented, developer group and operation group should have more conversation for CI/CD but I cannot find any more detail information.
I don't have any some kind of project, so please let me know what will be changed for each group of IT department.
If there is a guidance for implementing devops and guidance for desinger/developer/operating manager, it will really be helpful.
thank you so much.
First of all, I would like to turn your attention to "waterfall and devops" comparison - these are apples and oranges.
Waterfall can be compared to agile (scrum, kanban, etc) but not to DevOps.
Waterfall is a code delivery frequencty approach. But DevOps is a culture.
What will be changed for developer:
His code will be executed exactly in the same environment as he expects to. Whether it is dev, test or prod - it will run in the same container within the same environment variables (only physical resources like CPU/RAM/HDD can differ).
Thus, it significantly decreases the risk to fail in production and subsequently decreases the need to connect to production for investigation.
What will be changed for operations (SRE, system admin):
He gets code with described environment [read more about Infrastructure as code (IAC)] and he doesn't care what dependencies, operation system or whatever it has. All he needs to serve: abstract layer beneath the code (like Kubernetes, for example). And this layer does not depend of code state, thus the work scope of operations guys are better planned and do not depend of milestones or whatever.
What will be changed for manager:
He has better predictability in his forecasts, as bugs now appear no that frequently because same container that was in test goes to production. Also troubleshooting takes more predictable time as microservices much easier to troublshoot like electrical chain.

Continuous Integration and Mean Stack

I've been learning Travis CI and I want to use it to help automate tests on a MEAN application, then deploy it. However, there are some ways to go about this.
After reading, I learned I can create two separate repositories, thus maintaining two separate applications: a client application and a backend application. Since they are separate repositories, I can have separate .travis.yml files on each and perform continuous integration on the client application and backend application. However, I need advice on this approach because I have questions:
For the client app, I have to write tests. Since I'll be using angular, I want to test responsiveness and if components are working as intended. The client application also has to communicate with the backend application and I want to see if it is properly getting the correct results (such as clicking a button triggers a GET request and see if I'm getting the correct response body). Since the client app is on a separate repository, and when I build it on TravisCI, how will I connect the client application to the backend application if it exists on a separate repository?
I read around and I can use submodules in git. Thus, the client application and the backend application can be submodules for a 'master repository'. Therefore, how will the trigger in TravisCI work? Will I have separate travis.yml files in each submodule, or will I have to have one in the "master repository"?
If I were to get everything to work properly and have the client application and backend application both successfully deploy and the two are hosted on different servers, how will I fix the cross-domain issue?
The other approach is to host the static files produced by ng build --prod and have the node backend application host them. When Travis CI is triggered, I can first build the node backend application and run the tests on it first and then run the tests on the angular client application. After all of the tests are passed, where do I deploy? I know I have to deploy the node application since it will host the static files, so I how exactly will I deploy the backend application in Travis CI?
I know this is going to push it, but I'll ask it anyway. In the future, I want to learn how to implement microservices, and I want to use Nginx for the purpose of load balancing. How will I go about that? Docker can help me create a production environment where I can see if the Nginx server and node application are working well, but how do I include that in Travis CI?
If my question is a bit vague, please let me know what parts of it are vague so I can edit it that way I can make more sense of what I'm asking for. Thank you, and I look forward to an answer :)
Question is ultra-broad. You should solve one problem at a time, because by the time you solve 1 and 2 I doubt that 3 will be your only concern, and all of these issues are not really related.
try spending a bit of time reading Travis CI documentation, but also how to write tests and what different types of tests will do for you. Your issue is less about Travis than about what are unit tests vs. what are integration tests. So write simple standalone tests for your frontend, simple standalone tests for your backend, maybe run integration tests manually for a while, and when it becomes a real issue, then you will have better knowledge of how everything works together and you will find a way. Long story short: there is no single best way to run integration tests and it mostly depends on many, many things in your app (how does it run, what type of DB do you use, etc.)
you should read about submodules. Perhaps you need them, perhaps not. There is no way to tell. You can use submodules with Travis CI, but you can also not use submodules. Depends on what you want to achieve. Focus on the end goal for your architecture, not on what Travis CI needs!
what cross-domain issue? Again, this is a very different problem, and probably not the most prominent one you will face. Since I have no idea what server technology you will use there is no way I can answer that question properly. If you use express, this may be what you are looking for: https://expressjs.com/en/resources/middleware/cors.html
General bit of advice: all of your questions boil down to experience. Try solving one problem at a time, get started with your project and when you hit a specific issue, it's much much easier to solve than asking about "microservices". There are many ways to do microservices right, each solving a different issue. Without any knowledge of what your application is about and what issues you want to solve, microservices may or may not be what you are looking for, but there are also many other components that can affect your stack. Just get started and don't think about all of this too much for now - it's better to have something soon that you can test and learn upon, than think for weeks about something that you will never get because it is only theory.

Server Environment

I am trying to develop an iOS application that stores and loads data to and from a server. The data needs of the client can be pretty much narrowed down to REST. MY question is, is REST something widely used for data/server driven iOS applications? is there a paradigm proven better or more suitable for iOS apps?
if REST is the way to go, what server environment would you choose? what server side Technology? PHP? Java? something else? We'd set up a test/dev environment at first, but eventually we are going to deploy on services like Amazon cloud or any other hosting/cloud service.
Any insight will be most welcome.
So are you writing the backend too?
Most projects that I've worked with in the past few years use REST. It's made little difference in the implementation of the iOS app (I think...). I'm more concerned about the type of data I'm consuming, which is usually JSON - and ensuring that it is as lean as possible. People writing web services should be concerned about REST.
I've also worked with projects this year that use different technologies on the backend. Java on one, and Ruby on Rails on the other.
I know another guy who uses PHP on one project, and Ruby on another.
If I was to do a backend, I'd probably use Java - solely because I know it. Not the best excuse to pick a technology - but as a full time iOS developer, I don't have time to learn something new that I won't use very often.
If you are going to deploy on a cloud based service, see what technologies they support. Maybe picking the common denominator would be a wise choice to keep your options open. Some languages tend to have more expensive server hosting costs. Java is usually more expensive than PHP to host, I guess due to the complexities of running shared java VM's instead of PHP interpreter.

Cloud-aware programming and help choosing a good framework

How can i write a cloud-aware application? e.g. an application that takes benefit of being deployed on cloud. Is it same as an application that runs or a vps/dedicated server? if not then what are the differences? are there any design changes? What are the procedures that i need to take if i am to migrate an application to cloud-aware?
Also i am about to implement a web application idea which would need features like security, performance, caching, and more importantly free. I have been comparing some frameworks and found that django has least RAM/CPU usage and works great in prefork+threaded mode, but i have also read that django based sites stop to respond with huge load of connections. Other frameworks that i have seen/know are Zend, CakePHP, Lithium/Cake3, CodeIgnitor, Symfony, Ruby on Rails....
So i would leave this to your opinion as well, suggest me a good free framework based on my needs.
Finally thanks for reading the essay ;)
I feel a matrix moment coming on... "what is the cloud? The cloud is all around us, a prison for your program..." (what? the FAQ said bring your sense of humour...)
Ok so seriously, what is the cloud? It depends on the implementation but usual features include scalable computing resource and a charge per cpu-hour, storage area etc. So yes, it is a bit like developing on your VPS/a normal server.
As I understand it, Google App Engine allows you to consume as much as you want. The back-end resource management is done by Google and billed to you and you pay for what you use. I believe there's even a free threshold.
Amazon EC2 exposes an API that actually allows you to add virtual machine instances (someone correct me please if I'm wrong) having pre-configured them, deploy another instance of your web app, talk between private IP ranges if you wish (slicehost definitely allow this). As such, EC2 can allow you to act like a giant load balancer on the front-end passing work off to a whole number of VMs on the back end, or expose all that publicly, take your pick. I'm not sure on the exact detail because I didn't build the system but that's how I understand it.
I have a feeling (but I know least about Azure) that on Azure, resource management is done automatically, for you, by Microsoft, based on what your app uses.
So, in summary, the cloud is different things depending on which particular cloud you choose. EC2 seems to expose an API for managing resource, GAE and Azure appear to be environments which grow and shrink in the background based on your use.
Note: I am aware there are certain constraints developing in GAE, particularly with Java. In a minute, I'll edit in another thread where someone made an excellent comment on one of my posts to this effect.
Edit as promised, see this thread: Cloud Agnostic Architecture?
As for a choice of framework, it really doesn't matter as far as I'm concerned. If you are planning on deploying to one of these platforms you might want to check framework/language availability. I personally have just started Django and love it, having learnt python a while ago, so, in my totally unbiased opinion, use Django. Other developers will probably recommend other things, based on their preferences. What do you know? What are you most comfortable with? What do you like the most? I'd go with that. I chose Django purely because I'm not such a big fan of PHP, I like Python and I was comfortable with the framework when I initially played around with it.
Edit: So how do you write cloud-aware code? You design your software in such a way it fits on one of these architectures. Again, see the cloud-agnostic thread for some really good discussion on ways of doing this. For example, you might talk to some services on GAE which scale. That they are on GAE (example) doesn't really matter, you use loose coupling ideas. In essence, this is just a step up from the web service idea.
Also, another feature of the cloud I forgot to mention is the idea of CDN's being provided for you - some cloud implementations might move your data around the globe to make it more efficient to serve, or just because that's where they've got space. If that's an issue, don't use the cloud.
I cannot answer your question - I'm not experienced in such projects - but I can tell you one thing... both CakePHP and CodeIgniter are designed for PHP4 - in other words: for really old technology. And it seems nothing is going to change in their case. Symfony (especially 2.0 version which is still in heavy beta) is worth considering, but as I said on the very beginning - I can not support this with my own experience.
For designing applications for deployment for the cloud, the main thing to consider if recoverability. If your server is terminated, you may lose all of your data. If you're deploying on Amazon, I'd recommend putting all data that you need persisted onto an Elastic Block Storage (EBS) device. This would be data like user generated content/files, the database files and logs. I also use the EBS snapshot on a 5 day rotation so that's backed up itself. That said, I've had a cloud server up on AWS for over a year without any issues.
As for frameworks, I'm giving Grails a try at the minute and I'm quite enjoying it. Built to be syntactically similar to Rails but runs on the JVM. It means you can take advantage of all the Java goodness, like threading, concurrency and all the great libraries out there to build your web application.

Resources