Local development, events and ruby on jets - ruby

I'm trying out ruby on jets since we'd like to reuse rails code but we are deploying on AWS lately.
We'd like to have a smooth offline development experience such as the one provided by Serverless.
Has anyone managed to test events such as S3 or SNS in RubyOnJets without deploying the lambda?

I'm not familiar with RybyOnJets but it seems to be using AWS. It might be possible to use localstack:
https://github.com/localstack/localstack
to simulate AWS services on local machine.

Related

How to debug or run locally GCP serverless application in nodejs?

As this link, the serverless offline is only supporting to AWS. And I want to know that is there any library similar to serverless offline which support GCP or is there any other way of running locally? If there is a way please provide a reference.
You have the Functions Framework, which allows you to spin up a local development server for quick Cloud Functions testing, but AFAIK, there is nothing for emulating GCP's API Gateway locally

How to use Stackato

I have part of my team using komodo, and so I have looked into Stackato. At first Stackato looked nice, but I can not figure out how to use it. It is available for download as a VM image. You can also deploy it to an existing infrastructure. But what is the point of this. Most cloud platforms I've used(Bluemix, PWS, Openshift, etc...) are in a cloud instance, but Stackato does not seem to do this. Do I have to use Stackato with some infrastructure, or can I get a in-cloud version?
If by "in a cloud instance" you mean offered as a hosted service (like Heroku, Engine Yard, and Google App Engine) then you could try the Stackato Sandbox which is a hosted trial environment.
That said, the real benefit of Stackato is that it's PaaS software that you can run yourself (i.e. "Private PaaS"), so to really get a feel for it from an Admin/Provider's perspective, you should deploy a small cluster in a public cloud like HP Helion Public Cloud or Amazon EC2.
Yes, you can run it on your own servers, but I think the cloud hosted option what you're looking for. You can run a cluster of around 5 Stackato nodes with a free license from ActiveState, but the cloud hosting costs still apply.

How to do automated functional testing of AWS components?

In my project we have implemented custom auto scaling module. This module takes advantage of AWS CloudWatch API and uses its custom logic to auto scale up/down the cluster. All this code is in written in Java + Shell scripts. We have written unit test cases using JUnit.
Now we want to automate the functional testing but I do not know how other people do automated functional/integration testing of AWS components and best practices for AWS component functional testing.
Consider the following scenario and expected output:
Scenario : HDFS utilization of EC2 based Hadoop cluster goes above given threshold.
Expected result : Attach new EBS volume to one of the EC2 instance in the cluster.
I would like to know which technology, language can be used to do functional testing of this scenarios.
Take a look at LocalStack. It provides an easy-to-use test/mocking framework for developing AWS-related applications by spinnin up the AWS-compatible APIs on your local machine or in Docker. It supports two dozen of AWS APIs and EC2 and CloudWatch are among them. It is really a great tool for functional testing without using a separate environment in AWS for that.
As for the language: you can use any language has AWS SDK. Even the AWS CLI works with LocalStack.
If you are a lucky user of Java/Kotlin and JUnit 5 I would like to recommend you to use aws-junit5, a set of JUnit 5 extensions for AWS. And, yes, I am it's author. These extensions can be used to inject clients for AWS services provided by tools like localstack or any other AWS-compatible API (including the real AWS, of course). Both AWS Java SDK v 2.x and v 1.x are supported. You can use aws-junit5 to inject clients for S3, DynamoDB, Kinesis, SES, SNS and SQS.

Heroku Applications within AWS VPC

I have a small Rails app which I'm keen to deploy through Heroku (as I do with other clients) however this is not intended to be a publicly available application and they need to deploy it within their AWS VPC as if it is accessible within their internal network.
Is this something which is possible? I know that Heroku is built on top of EC2 but wasn't sure quite how flexible it was and haven't been able to find anything documented.
If not possible would anyone be able to offer experiences of pre-built Rails AMIs that I might be able to use in order to replicate some for the Heroku deployment simplicity without having to worry too much about configuring and managing my own infrastructure for the app.
Sounds like git-deploy might be what you need for git-style deployment.
I also found quite an interesting blog post by Giles Bowkett that might be interesting to you.

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