I have a Ruby script that I want to run every few minutes using Google App Engine. I don't want to run a web service, just that script. Any ideas how to do that with JRuby?
Checkout cron support on GAE:
http://code.google.com/appengine/docs/java/config/cron.html
Not sure what you mean by "don't want to run a web service," but this is the way to do it on GAE.
Related
I'm in the process of deploying my Rails app (it also uses redux, react, as well as some Ruby and Javascript). And I'm on the step in the official Heroku guide where it specifies to add a Procfile.
I assume that these are the commands that will run once the apps starts up; what exactly do I need to put in here for a Rails app that uses a database?
Locally, I know that to start my app I run rails s, as well as setting up the database beforehand; do I need to do something like that in the Procfile?
I want to run Django-Rest application as a windows service. Just to keep it simple. i want to know a way to deploy my Django-Rest application in a windows server and run in the background. Can anyone please let me know if they have come across this situation.
Django-Rest application is the instance of Django. So, you need to run Django on your Windows server first (installing all dependencies and so on). The you can try Apache
For my PHP Web App I am using the PHP Buildpack. Now I would like to schedule a Tasks that should be triggered every month. Normally I would use CronJobs for that.
How can I achieve that within the Swisscom Application Cloud?
Swisscom App Cloud is based on Open Source Cloud Foundry
Upstream Cloud Foundry doesn’t have a feature equivalent to cron jobs (task scheduler). Stay tuned, I guess this feature will be soon implemented, because lots of people migrating from Heroku to CF. Heroku offers a cron job feature. Subscribe to Swisscom App Cloud Newsletter to read announcements.
There are workarounds for scheduling tasks, see Scheduling tasks on Cloud Foundry on blog.pivotal.io for a Ruby/Rake based example. Sorry for PHP I didn't found example code. There is no elegant solution! You need to implement yourself some kind of workaround. Would be great if you publish your code to GitHub.
If you need cron jobs only in data store, for example MariaDB offers Events.
Events are named database objects containing SQL statements that are
to be executed at a later stage, either once off, or at regular
intervals.
They function very similarly to the Windows Task Scheduler or Unix
cron jobs.
We had a simular issue. As written by #Fyodor, there is no native solution in Cloud Foundry. We did some research and found vendors like https://www.iron.io/.
Finally, we ended up with a very simple solution.
We expose all our background jobs via an https interface.
As we anyhow use Jenkins for CI/CD and it has lots of scheduling capabilities, we use our existing Jenkins to trigger these jobs via a simple cURL call to the HTTP endpoints.
Is there a way to run command "heroku ps" via the Heroku API? I am interested in knowing how long a particular worker has been running.
For example I want to get this output: urgent.1: up for 2h
You can use Heroku's RESTful JSON API or one of the many API wrapper libraries: Ruby, Java, Python. There are also a few others created by the community.
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...