How do you deploy your play 2 scala applications? - deployment

I am interested how do you (scala play2 devs) deploy in cloud? Which cloud provider and so on. Because I am not sure I am doing it in easiest way. I used heroku and it was good. Trying now digitalocean and for now deploying by ssh manually(or jenkins). I did not use docker or dokku for now.

If you're on AWS, CodeDeploy could be a good start for automatic deployments. (http://docs.aws.amazon.com/codedeploy/latest/userguide/getting-started.html)

Related

Google Compute Engine Automated Load Test VM Instance?

I have a simple web server application in a docker container that I have pinned to a vm instance in GCP Compute Engine.
I am wondering how to set up automated load testing (Locust load testing via GKE) on the web server application running on my VM instance?
I saw a tutorial here: https://cloud.google.com/solutions/distributed-load-testing-using-gke. But this involves using App Engine. I am not able to find a GCP tutorial to auto load test vm instances in Compute Engine.
Any links or ideas?
The tutorial comprises of a project that you clone from github. from that project you deploy a sample-webapp to Google Compute Engine, with a domain such as test1.appspot.com.
This test1.appspot.com is the target for the Locust cluster.
This sample-webapp is a simple Flask app that you can copy and deploy in your instance in GCP (there are several ways of accomplishing this). Once the app is deployed and reachable from the internet, you need supply its address/domain as the target for the Locust cluster.

The best practice for developing app locally which then be deployed to Kubernetes

Let's say I have a flask app, a PostgreSQL, and a Redis app. what is the best practice way to develop those apps locally which then later be deployed to Kubernetes.
Because, I have tried to develop in minikube with ksync, but I get difficulties in getting detailed debug log information.
Any ideas?
What we do with our systems is that we develop and test them locally. I am not very knowledgeable with Flask and ksyncy, but say for example, you are using Lagom Microservices Framework in Java, you run you app locally using the SBT shell where you can view all your logs. We then automate the deployment using LightBend Orchestration.
When you then decide to test the app on Kubernetes, you can choose to use minikube, but you have to configure the logging properly. You can configure centralised logging for Kubernetes using the EFK stack. This will collect all the logs from the various components of your app and store them in Elastic Search. You can then view these logs using The Kibana Dashboard. You can do a lot with the dashboard, you can view logs for a given period, or search logs by k8s namespace, or by container.
There are multiple solutions for this (aka GitOps with Kubernetes):
Skaffold
Draft
Flux - IMO the most mature.
Ksonnet
GitKube
Argo - A bit more of a workflow engine.
Metaparticle - Deploy with actual code.
I think the solution is using skaffold

Scala and Play framework Web Application hosting

I`m looking for a hosting package for scala and play in Amazon elastic servers. If there is anybody here is done it before? what are the ideal solution for a small ERP application?
you can easily deploy playframework web application on elastic beanstalk using docker container.
Create environment on EBS using docker container.
package your app using sbt docker:stage
make a zip of target/docker/stage/*
deploy this zip on EBS environment.
you can explore docker # https://www.docker.com/

Play framework in Scala deployment

I'm a Ruby developer, but I like Scala very much as well.
For Rails framework we have awesome tools that supports deployments like Capistrano automation tool and Puma/Unicorn servers. With simple cookbooks using Chef or Ansible I can easily setup my VPS and deploy Rails application there.
How does automatic deployment look like in Play framework? What is minimal required stack for developing and deploying Play applications? Are there any tools for automatic deployment? What are recommended application servers?
All you need to run a Play app is a JVM. Play is container-less. So deploying your Play app in production is as simple as running a script that invokes a fat jar with all the other required jars in the classpath.
$play dist should generate a zip file that contains everything you need to run the app.
You can use Ansbile to automate.
http://code.hootsuite.com/automating-our-scala-deploys-with-ansible-case-study/
http://www.ansible.com/press-release/ansibleworks-typesafe
To deploy Play Framework apps in AWS (Amazon) ec2 using Ansible playbook
As well as Chef.
https://github.com/gildegoma/chef-typesafe-stack
If you are happy to run on AWS, Boxfuse comes with native Play 2 support.
You can now simply execute boxfuse run my-play-app-1.0.zip -env=prod and this will automatically:
create a minimal AMI tailor-made for your Play 2 app
create an elastic IP
create a security group with the correct permissions
launch an instance of your app
All future updates are performed as blue/green deployments with zero downtime.
This also works with Elastic Load Balancers and Auto-Scaling Groups and the Boxfuse free tier is designed to fit the AWS free tier.
You can read more about it here: https://boxfuse.com/blog/playframework-aws
Disclaimer: I'm the founder and CEO of Boxfuse

Heroku-like services for Scala?

I love Heroku but I would prefer to develop in Scala rather than Ruby on Rails.
Does anyone know of any services like Heroku that work with Scala?
UPDATE: Heroku now officially supports Scala - see answers below for links
As of October 3rd 2011, Heroku officially supports Scala, Akka and sbt.
http://blog.heroku.com/archives/2011/10/3/scala/
Update
Heroku has just announced support for Java.
Update 2
Heroku has just announced support for Scala
Also
Check out Amazon Elastic Beanstalk.
To deploy Java applications using
Elastic Beanstalk, you simply:
Create your application as you
normally would using any editor or IDE
(e.g. Eclipse).
Package your
deployable code into a standard Java
Web Application Archive (WAR file).
Upload your WAR file to Elastic
Beanstalk using the AWS Management
Console, the AWS Toolkit for Eclipse,
the web service APIs, or the Command
Line Tools.
Deploy your application.
Behind the scenes, Elastic Beanstalk
handles the provisioning of a load
balancer and the deployment of your
WAR file to one or more EC2 instances
running the Apache Tomcat application
server.
Within a few minutes you will
be able to access your application at
a customized URL (e.g.
http://myapp.elasticbeanstalk.com/).
Once an application is running,
Elastic Beanstalk provides several
management features such as:
Easily deploy new application versions
to running environments (or rollback
to a previous version).
Access
built-in CloudWatch monitoring metrics
such as average CPU utilization,
request count, and average latency.
Receive e-mail notifications through
Amazon Simple Notification Service
when application health changes or
application servers are added or
removed.
Access Tomcat server log
files without needing to login to the
application servers.
Quickly restart
the application servers on all EC2
instances with a single command.
Another strong contender is Cloud Foundry. One of the nice features of Cloud Foundry is the ability to have a local version of "the cloud" running on your laptop so you can deploy and test offline.
I started working on the exact same thing as what you said a few weeks ago. I use Lift, which is a great framework and has a lot of potential, on top of Linux chroot environment.
I'm done with a demo version, but Linux chroot is not that stable (nor secure), so I'm now switching to FreeBSD jail on Amazon EC2, and hopefully it'll be done soon.
http://lifthub.net/
There are also other Java hosting environment including VMForce mentioned above.
If you are looking for a custom setup which also has the ease of deployment that heroku offers: http://dotcloud.com. They are invite only right now but I was given access in under three days. I am working on a Lift/MongoDB project there and it works well.
Off the top of my head, only VMForce comes to mind, but its not available yet. This will be a Java-oriented service, so that probably means you'll have to spend a wee bit of time figuring out how to package the app.
For more discussion, there was a debate about this in 2008.
I'm not entirely sure if it's really suitable or not, but people have deployed Scala applications to Google App Engine, for example http://mawson.wordpress.com/2009/04/10/first-steps-with-scala-on-google-app-engine/
Actually you can run scala on heroku right now. You don't believe it?
https://github.com/lstoll/heroku-playframework-scala
I'm not sure the tricks lstoll has used are legit but using the
new cedar platform where you can run custom processes and some
ingenious Gemfile hacking he has managed to bootstrap the Java
play platform into a process. Seems to work as he has a live
site running a test page.
Stax cloud service offers preconfigured lift project skeleton. Also, there is a tutorial on how to deploy lift project to appengine.