Is there a fix/hack to get the stackdriver agents running on Amazon linux 2? - google-cloud-stackdriver

Although the official documentation does not list Amazon Linux 2 among the supported OS', was wondering if there is a hacky way to get the agents running?

Related

What is the best practice to manage EC2 instance up/down/hibernate scheduler?

We have 2 - 3 EC2 c5.9xlarge instances for research.
Besides the option to shut them down on a particular hour according to a scheduler please advise what is the best way to keep them up and running when I "touch" them by connecting/clicking them or any other wake up policy?
My goal is to save expenses and I am trying to find a best practice to manage these instances wisely.
Please advise from your professional experience.
You can utilize the EC2 Hibernation feature via which you can pause/resume your instances. This would give you the convenience of resuming your instances with all the processes running just like the way you had left the instance saving you a lot of time and effort in setting up the environment and reach your productive state faster.
Currently, EC2 Hibernation is available for Amazon Linux 2, Amazon Linux and Ubuntu 18.04. It is supported for your instance type which you use.
More details can be viewed here: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html
If you have Jenkins or other CI/CD tool available you can create a job there that would enable/disable particular EC2 instances. If you want something smaller then you can use aws-cli with cron and do the same. Some of my customers turn their VMs on at 7 AM and turn them off at 7 PM (mostly for testing/staging environments).

Heroku: how does "log-runtime-metrics" collect statistics,under the hood?

I'm looking into Heroku performance monitoring.
In particular I found "log-runtime-metrics", and was wondering how it collects statistics under the hood? Is there some heroku API that exposes the state of each dyno (memory, cpu etc)? Or is it some Amazon API? Linux API?
Thanks
I've recently asked the same question to Heroku directly.
Check out http://log2viz.herokuapp.com/
You should see your App(s) available in in a list and can view real-time metrics there. This link isn't documented from the lab page https://devcenter.heroku.com/articles/log-runtime-metrics

How to install/configure new software in newly created amazon instances using Amazon SDK in java?

My team is developing an application which will enable end users to easily create, configure and destroy amazon instances without having to use Amazon SDKs themselves. The process at our end comprises of 3 steps.
1. Create / Destroy VMs in the amazon cloud using Amazon SDK (Done)
2. Configure/Install new software in the newly created instance.
3. Track usage/command and control.
We are currently in the second step. I just realized that Amazon SDK does not provide APIs for installing new software in the remote machine. I am not talking about AmazonCloudFormation APIs because those APIs are used to create and manage AWS resources rather a software like, say, a browser.
Has anyone installed new software in an amazon instance? If yes, did you use one of a)Amazon SDK, b) Any third party APIs and c) custom solution?
Also, is it even possible to install new software in an amazon instance through java code?
The Amazon API primarily controls infrastructure. It does not have any control as to what happens inside the instance.
There are a couple of ways you can bootstrap your instance and install software. You can use user-data to pass a script that will run on first launch. You could use a provisioning system like chef or puppet. You could roll your own if it works better for you.
What you are describing sounds a lot like a Platform-as-a-Service (PaaS).
A PaaS would allow you to submit an application to the PaaS and let it start the machines and set up your software on them. A PaaS would also give you additional features like monitoring, cross-cloud support and updating the application on the fly.
There are a several PaaS vendors mentioned here: Looking for Paas Recommendations
Disclaimer: I work for Cloudify, an open-source PaaS.

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.

Heroku-like Amazon EC2

Is there anything that I can install on my EC2 instances that make AWS Heroku-like?
e.g:
heroku create app
git push
But for AWS.
Well, now there is! It's called AWS Elastic Beanstalk (still in beta, as of March 2013)
After running the initial setup, further deployments should be as simple as git aws.push
EDIT: Just a nice and broad overview of deployment possibilities at AWS, by Werner Vogels (AWS CTO):
There are few topics I need to touch on before I can answer your question thoroughly; so please, bear with me.
A bit of insight
With respects to your two examples, Heroku utilizes a number of different technologies in order to achieve the level of simplicity it provides as a service platform. One of these technologies include: Heroku's proprietary toolbelt, which offers a set of command-line tools —that allows developers to interface with their applications— and an interact with many of the tools Heroku provides —such as terminal access for a number of different languages. The toolbelt itself relies on two other technologies: Ruby and Git; which come prepackaged with the install.
In a nutshell
Now, when you create a Heroku app you are effectively creating a git repository on the celedon cedar runtime stack (by default); this repository is then added as a remote repo. This allows you to immediately run git push heroku master. There is a lot more happening behind the scenes: for instance, when you push, your commits get intercepted by a git pre-receive hook which runs your app through a slug compiler and prepackages it for distribution across the dyno manifold; yet, I digress. For more information on more advance topics, check-out: https://devcenter.heroku.com/; there is a wealth of information here to read.
The stack
Now, let me explain the cedar stack as this is mainly what your question concerns. The Celedon cedar is one of many; however, this is the current default (for many reasons). This polyglot runtime stack currently provides six web languages (at the time of writing,) running on Ubuntu (11.04 stable, I belive). All of these technologies are operating on top of the AWS EC2 computing environment.
So to finally answer your question: You will need to install a suitable operating system such like: Ubuntu; a set of languages such like: Ruby, Python, Node.js, etc; Git (for deployment) and the rest is up to you.
If you have fixed number of instances make sense instead of usage Elastic Beanstalk use custom git deployment, like described in the article: http://www.jeffhoefs.com/2012/09/setup-git-deploy-for-aws-ec2-ubuntu-instance/.
Main idea to setup GIT repository on EC2 instance. When you want to deploy something just push your changes to remote repository, installed on EC2 instance.
I think this approach have next benefits in comparison with Elastic Beanstalk:
You don't pay for S3 buckets for storing application versions;
You have full control on application deployment steps.

Resources