39 views
Skip to first unread message

Dr Nic Williams

unread,
Mar 30, 2013, 10:16:32 PM3/30/13
to vcap...@cloudfoundry.org
I've been trying to run a web app (ruby19/rails) & a background worker (ruby19/standalone command) and I think I currently need two manifest.yml files to do it since both want the same path (.)

I like the Heroku/foreman Procfile format; though I know its too simplistic for what we can do with Cloud Foundry.

So here is a proposal for an extension to the manifest.yml format that would support 2+ processes running from the same path:

https://gist.github.com/drnic/5279191

Like it?

If this is unnecessary and someone can educate me how to deploy 2+ processes/apps from the same path using one manifest.yml (and one "vmc push") then I'd be very happy!

Nic

--
Dr Nic Williams
Stark & Wayne LLC - consultancy for Cloud Foundry users
twitter @drnic

Dr Nic Williams

unread,
Mar 30, 2013, 10:17:00 PM3/30/13
to vcap...@cloudfoundry.org
Sorry for forgetting a subject!

Matthew Kocher

unread,
Mar 30, 2013, 11:53:45 PM3/30/13
to vcap...@cloudfoundry.org
Making changes in the cf gem and the manifest file are good, but really fixing this is going to require rethinking the models in the cloud controller.

There's a one to one mapping between apps and droplets right now.  In the long run I think there needs to be many apps to a single droplet, each with different start commands.  Otherwise you've got to push and stage the bits for every process type.

Dr Nic Williams

unread,
Mar 31, 2013, 11:02:15 AM3/31/13
to vcap...@cloudfoundry.org

Multiple apps reusing a droplet would be a good extra optimisation - heck they'd all have the same files so perhaps it should notice that there is an existing droplet. In my understanding of implementation (which isn't good for v2), this would be independent of changing how vmc works with manifests to deploy multiple apps?

--
Dr Nic Williams
Stark & Wayne LLC - the consultancy for Cloud Foundry
http://starkandwayne.com
+1 415 860 2185
twitter: drnic

Dan Higham

unread,
Mar 31, 2013, 12:50:32 PM3/31/13
to vcap...@cloudfoundry.org
Are you actually talking about deploying two separate applications? or do you want to have two processes running under the same application?

If it's the former then you could just write a deploy script like this;

https://github.com/danhigham/service_stash/blob/master/deploy.rb although this will only really work against v1

if it's the latter then surely you could manage the worker process from within the Rails app? (pid = Proc.new 'bundle exec rake blah') although I am not sure why you would ever do this as its not scalable at all.


--
Dan Higham 
CloudFoundry Support
@danhigham

Dr Nic Williams

unread,
Mar 31, 2013, 3:29:37 PM3/31/13
to vcap...@cloudfoundry.org

It's the latter. I think the user would want to scale them independently (say a big backlog of jobs to clear)

--
Dr Nic Williams

Stark & Wayne LLC - the consultancy for Cloud Foundry
http://starkandwayne.com
+1 415 860 2185
twitter: drnic

Matt Reider

unread,
Apr 1, 2013, 12:41:35 AM4/1/13
to vcap...@cloudfoundry.org
It's one reason why we started to conceptualize the notion of a 'space' as more of an app space, which could have one "app" but many processes. The naming led us to a number of debates, which pretty much ended with "let's ship this thing" rather than overhaul the Cloud Controller in the 9th inning.

Baseball analogy. Australian. Head scratching ensues.

Jesse Zhang

unread,
Apr 1, 2013, 3:30:23 AM4/1/13
to vcap...@cloudfoundry.org
What does that Heroku Procefile approach get you that a space with two apps doesn't, besides the convenience of one push command?

Jesse

Dr Nic Williams

unread,
Apr 1, 2013, 10:52:06 AM4/1/13
to vcap...@cloudfoundry.org, vcap...@cloudfoundry.org

Jesse, I don't think I understand spaces and how it applies to me running one app with multiple parts. I've never seen it running yet. 


What is an example single manifest with one app with multiple processes running in a space?

Nic
--
Dr Nic Williams

Stark & Wayne LLC - the consultancy for Cloud Foundry
http://starkandwayne.com
+1 415 860 2185
twitter: drnic

Matt Reider

unread,
Apr 1, 2013, 11:24:15 AM4/1/13
to vcap...@cloudfoundry.org
Here are our manifests for the web console we are writing (NG) but the same idea can be used for v1.

---
inherit: base-manifest.yml

properties:
  rails-env: staging
  app-host: console-staging

#Base Manifest follows...

---
properties:
  app-host: ${name}

path: .
env:
  RAILS_ENV: ${rails-env}
  RACK_ENV: ${rails-env}
  BUNDLE_WITHOUT: test:development
services:
  portal-db:
    type: postgresql
    plan: 200
  portal-redis:
    type: redis
    plan: 200
mem: 256M
disk: 1G
instances: 1
host: none
domain: none

# app-specific configuration
applications:
- name: console
  host: ${app-host}
  domain: ${target-base}
  mem: 512M
  instances: 4
  command: bundle exec rake db:migrate && bundle exec rails server -p $PORT
- name: console-resque-worker
  command: bundle exec rake VERBOSE=true QUEUE=* resque:work
- name: console-resque-scheduler
  command: bundle exec rake VERBOSE=true resque:scheduler

Dr Nic Williams

unread,
Apr 1, 2013, 11:42:14 AM4/1/13
to vcap...@cloudfoundry.org

Is the applications[] list supported in vmc 0.3? Currently the manifest we use has the relative path "." as the key. Can I provide an array of hashes instead of a hash to "applications:"? When we this added?

--
Dr Nic Williams
Stark & Wayne LLC - the consultancy for Cloud Foundry
http://starkandwayne.com
+1 415 860 2185
twitter: drnic


Matt Reider

unread,
Apr 1, 2013, 11:47:28 AM4/1/13
to vcap...@cloudfoundry.org
It's been out for at least a year.


I am pretty sure you have to have 'applications' as the top level key of your hash.

Dr Nic Williams

unread,
Apr 1, 2013, 12:06:44 PM4/1/13
to vcap...@cloudfoundry.org

The example manifest in that post (which matches the schema of manifest.yml generated by vmc) is different from Matt's example. The blog post has a hash value for "applications" key (where the key is a relative path); Matt's had an array of hashes for the application key (like my initial email request I think)


When did vmc start supporting the array of hashes? Is this what is now generated by latest vmc/cf?
--
Dr Nic Williams
Stark & Wayne LLC - the consultancy for Cloud Foundry
http://starkandwayne.com
+1 415 860 2185
twitter: drnic


Dr Nic Williams

unread,
Apr 1, 2013, 12:07:30 PM4/1/13
to vcap...@cloudfoundry.org

Haha. I thought (someone other than Matt) wrote the email with the blog post. So my references to two emails might be confusing :)

--
Dr Nic Williams
Stark & Wayne LLC - the consultancy for Cloud Foundry
http://starkandwayne.com
+1 415 860 2185
twitter: drnic


Matt Reider

unread,
Apr 1, 2013, 12:10:41 PM4/1/13
to vcap...@cloudfoundry.org
Nope. That's me all along. My Google Group neglect (and vacation) is over.

Dr Nic Williams

unread,
Apr 1, 2013, 12:31:58 PM4/1/13
to vcap...@cloudfoundry.org

:)


Thoughts on the questions?
--
Dr Nic Williams
Stark & Wayne LLC - the consultancy for Cloud Foundry
http://starkandwayne.com
+1 415 860 2185
twitter: drnic


Matt Reider

unread,
Apr 1, 2013, 12:37:44 PM4/1/13
to vcap...@cloudfoundry.org
D'oh. Right - there is an array of hashes!

Alex Suraci reports that is in 0.4 but not 0.3.

Dr Nic Williams

unread,
Apr 1, 2013, 12:38:43 PM4/1/13
to vcap...@cloudfoundry.org

Thanks. I'll check it out when I finish today's leg of our driving holiday :)

--
Dr Nic Williams
Stark & Wayne LLC - the consultancy for Cloud Foundry
http://starkandwayne.com
+1 415 860 2185
twitter: drnic


Matt Reider

unread,
Apr 1, 2013, 12:38:50 PM4/1/13
to vcap...@cloudfoundry.org
And current vmc will generate an array of hashes. (with one entry).

Dr Nic Williams

unread,
Apr 1, 2013, 12:41:53 PM4/1/13
to vcap...@cloudfoundry.org

That's great. Theoretically it answers my original email.


I wish I remembered why we stuck to 0.3.X gems; but since cf gem no longer supports CF v1 I guess it's not a bug you want fixes for :)

Should vmc itself always support v1? If I figure out what's not working in vmc 0.5.x do you want fixes?
--
Dr Nic Williams
Stark & Wayne LLC - the consultancy for Cloud Foundry
http://starkandwayne.com
+1 415 860 2185
twitter: drnic


Reply all
Reply to author
Forward
0 new messages