Creating custom boilerplates in Bluemix - ibm-cloud

I created an application on Bluemix and I want to create a private Boilerplate from it in order to automatically deploy them when required through a web interface. Is there any possible way to create that boilerplate?

Boilerplates are not public documented, so not possible to create your own in the catalog.
But you can check "Deploy to Bluemix Button" which perhaps covers your requirement of being able to deploy an app and its runtime and required services.

I think that IBM Containers can be used to achieve that goal. A container is basically an application with all its dependencies, that is stored in a portable, platform-independent module (the container). The structure of a container is explained in an image. From a single image you can then instantiate all the containers you want.
So, if you create an image composed by your application and its dependencies and you push it on Bluemix, you can automatically instantiate and deploy new containers (with your application up and running inside) when required through a Web interface as you requested.
IBM Containers are based on Docker containers, that wrap up a piece of software in a complete filesystem that contains everything it needs to run. This guarantees that it will always run the same, regardless of the environment it is running in.
Please refer to IBM Containers Docs to understand how to use Docker on Bluemix and Docker training to learn the basics.

Related

Keycloak.X (quarkus based) on CloudFoundry

we want to deploy keycloak.X to cloudfoundry. I found older approaches (How to deploy keycloak to cloudfoundry) with two options:
wrapping it as a Spring application (the corresponding stuff on github seems abandoned, guess this is because keycloak switched to quarkus?)
using the docker image (diego_dockeris disabled in my target environment)
So I am stuck with the Quarkus distribution.
Ideally, I dont want to change too much on the application itself (risk assessment ...) but only wrap it for cloud foundry.
The start script targets a class named QuarkusEntryPoint, but I don't know how to put it into a buildpack.

Containers (Kubernetes) vs Web service (REST APIs)

I have a single screen desktop application developed in Java. It is a tool to convert files, given a file in .abc format, the tool converts it to .xyz format. Basically the tool works offline and acts as a translator to convert file from one form to another.
So now, to improve the infrastructure, there are discussions to move the tool to Kubernetes or to provide REST services for the file conversion. I completely have no idea about the containers nor the REST APIs as I am a front-end developer.
More about the tool, as I told earlier, the tool is a single page application, very light doing very minimal job, totally used by 200 users approximately. So, this being the shape and size of the application, which one would be the best approach to go with and why? Basically, I am looking for a short evaluation report of Kubernetes vs REST service and architecture recommendation with reasons.
Currently your application is a standalone application which is quite an old concept.
I can mention high-level changes needs to be done when your file conversion logic would be exposed over Rest Api in Kubernetes world.
you can go through one by one following mentioned areas to get a better understanding design-wise:
java code would be a backend code and its public methods that take inputs from UI actions will be exposed over rest API.
There are multiple rest API's (jersey, rest easy, etc or spring/spring-boot framework also provides rest API support) that you can go through any of them to get an understanding.
once your backend is exposed over the rest API then it needs to be containerized means your backend will be running under the container. Can go through docker documentation and can build one sample containerized app. There is huge material present in this area.
once your backend is containerized then it will be installed in a Kubernetes cluster
Kubernetes is basically a container orchestration tool and it's quite a wide thing. you can through its official documentation for basic understanding.
SPA will be running on a client machine like today also you are able to launch from your desktop but it will communicate with the Kubernetes cluster where your application is presently packaged in a container.
References:
docker :
https://docs.docker.com/
Kubernetes :
https://kubernetes.io/

Start Kubernetes job with http request

What is most simple way to start Kubernetes job with the http request (webhook)? I need to build docker image after push to github and have to do it inside cluster.
I think you are looking for KNative. Mainly the Build part of it.
KNative is still on early stages, but is pretty much what you need. If the build features does not attend your needs, you can still use the other features like Serving to trigger the container image from http calls and run the tools you need.
Here is the description from the Build Docs:
A Knative Build extends Kubernetes and utilizes existing Kubernetes
primitives to provide you with the ability to run on-cluster container
builds from source. For example, you can write a build that uses
Kubernetes-native resources to obtain your source code from a
repository, build a container image, then run that image.
While Knative builds are optimized for building, testing, and
deploying source code, you are still responsible for developing the
corresponding components that:
Retrieve source code from repositories.
Run multiple sequential jobs against a shared filesystem, for example:
Install dependencies.
Run unit and integration tests.
Build container images.
Push container images to an image registry, or deploy them to a cluster.
The goal of a Knative build is to provide a standard, portable,
reusable, and performance optimized method for defining and running
on-cluster container image builds. By providing the “boring but
difficult” task of running builds on Kubernetes, Knative saves you
from having to independently develop and reproduce these common
Kubernetes-based development processes.

Material on Building a REST api from within a docker container

I'm looking to build an api on a application that is going to run its own docker container. It needs to work with some applications via its REST apis. I'm new to development and dont understand the process very well. Can you share the broad steps necessary to build and release the APIs so that my application runs safely within the docker but externally whatever communication needs to happen they work out well.
For context: I'm going to be working on a Google Compute VM instance and the application I'm building is a HyperLedger Fabric program written in GoLang.
Links to reference material and code would also be appreciated.
REST API implementation is very easy in Go. You can use the inbuilt net/http package. Here's a tutorial which will help you understand its usage. https://tutorialedge.net/golang/creating-restful-api-with-golang/
Note : If you are planning on developing a production server, the default HTTP client is not recommended. It will knock down the server on heavy frequency calls. In that case, you have to use a custom HTTP client as described here, https://medium.com/#nate510/don-t-use-go-s-default-http-client-4804cb19f779
For learning docker I would recommend the docker docs they're very good and cover a handful of stuff. Docker swarm and orchestration are useful things to learn but most people aren't using docker swarm anymore and use things like kubernetes instead. Same principles, but different tech. I would definitely go through this website: https://docs.docker.com/ and implemented on your own computer. Then just practice by looking at other peoples dockerfiles and building your own. A good understanding a linux will definitely help with installing packages and so on.
I haven't used go myself but I suspect it shouldn't be too hard to deploy into a docker container.
The last production step of deployment will be similar for whatever your using if it's docker or no docker. The VM will need an webserver like apache or nginx to expose the ports you wish to use to the public and then you will run the docker container or the go server independently and then you'll have your system!
Hope this helps!

Docker deployment options

I'm wondering which options are there for docker container deployment in production. Given I have separate APP and DB server containers and data-only containers holding deployables and other holding database files.
I just have one server for now, which I would like to "docker enable", but what is the best way to deploy there(remotely will be the best option)
I just want to hit a button and some tool will take care of stopping, starting, exchanging all needed docker containers.
There is myriad of tools(Fleet, Flocker, Docker Compose etc.), I'm overwhelmed by the choices.
Only thing I'm clear is, I don't want to build images with codes from git repo. I would like to have docker images as wrappers for my releases. Have I grasped the docker ideas from wrong end?
My team recently built a Docker continuous deployment system and I thought I'd share it here since you seem to have the same questions we had. It pretty much does what you asked:
"hit a button and some tool will take care of stopping, starting, exchanging all needed docker containers"
We had the challenge that our Docker deployment scripts were getting too complex. Our containers depend on each other in various ways to make the full system so when we deployed, we'd often have dependency issues crop up.
We built a system called "Skopos" to resolve these issues. Skopos detects the current state of your running system and detects any changes being made and then automatically plans out and deploys the update into production. It creates deployment plans dynamically for each deployment based on a comparison of current state and desired state.
It can help you continuously deploy your application or service to production using tags in your repository to automatically roll out the right version to the right platform while removing the need for manual procedures or scripts.
It's free, check it out: http://datagridsys.com/getstarted/
You can import your system in 3 ways:
1. if you have a Docker Compose, we can suck that in and start working iwth it.
2. If your app is running, we can scan it and then start working with it.
3. If you have neither, you can create a quick descriptor file in YAML and then we can understand your current state.
I think most people start their container journey using tools from Docker Toolbox. Those tools provide a good start and work as promised, but you'll end up wanting more. With these tools, you are missing for example integrated overlay networking, DNS, load balancing, aggregated logging, VPN access and private image repository which are crucial for most container workloads.
To solve these problems we started to develop Kontena - Docker Container Orchestration Platform. While Kontena works great for all types of businesses and may be used to run containerized workloads at any scale, it's best suited for start-ups and small to medium sized business who require worry-free and simple to use platform to run containerized workloads.
Kontena is an open source project and you can view it on GitHub.