Skip to content
This repository
Browse code

Merge "ccng support for fog gem (aka s3)"

  • Loading branch information...
commit e609a8efb7f7a8a4e0080ec5a6c4368d0f419352 2 parents 0e37287 + 9868648
authored Gerrit Code Review committed
40  jobs/cloud_controller_ng/spec
@@ -136,6 +136,46 @@ properties:
136 136
   default: 204800 # 200 GB
137 137
  ccng.default_quota_definition:
138 138
   default: free
  139
+  description: "Local to use a local (NFS) file system.  AWS to use AWS."
  140
+ ccng.resource_pool.resource_directory_key:
  141
+  description: "Directory (bucket) used store app resources.  It does not have be pre-created."
  142
+  default: "cc-resources"
  143
+ ccng.resource_pool.fog_connection.provider:
  144
+  description: "Local for shared resources on NFS.  AWS to place them in S3."
  145
+  default: "Local"
  146
+ ccng.resource_pool.fog_connection.aws_access_key_id:
  147
+  description: "AWS access key used to access the resources bucket"
  148
+ ccng.resource_pool.fog_connection.aws_secret_access_key:
  149
+  description: "AWS secret key used to access the resources bucket"
  150
+ ccng.resource_pool.fog_connection.local_root:
  151
+  description: "The directory used as the root for the Local fog provider"
  152
+  default: "/var/vcap/shared"
  153
+ ccng.packages.app_package_directory_key:
  154
+  description: "Directory (bucket) used store app packages.  It does not have be pre-created."
  155
+  default: "cc-packages"
  156
+ ccng.packages.fog_connection.provider:
  157
+  description: "Local for shared resources on NFS. AWS to place them in S3."
  158
+  default: "Local"
  159
+ ccng.packages.fog_connection.aws_access_key_id:
  160
+  description: "AWS access key used to access the packages bucket"
  161
+ ccng.packages.fog_connection.aws_secret_access_key:
  162
+  description: "AWS secret key used to access the packages bucket"
  163
+ ccng.packages.fog_connection.local_root:
  164
+  description: "The directory used as the root for the Local fog provider"
  165
+  default: "/var/vcap/shared"
  166
+ ccng.droplets.droplet_directory_key:
  167
+  description: "Directory (bucket) used store droplets.  It does not have be pre-created."
  168
+  default: "cc-droplets"
  169
+ ccng.droplets.fog_connection.provider:
  170
+  description: "Local for droplets on NFS. AWS to place them in S3."
  171
+  default: "Local"
  172
+ ccng.droplets.fog_connection.aws_access_key_id:
  173
+  description: "AWS access key used to access the droplets bucket"
  174
+ ccng.droplets.fog_connection.aws_secret_access_key:
  175
+  description: "AWS secret key used to access the droplets bucket"
  176
+ ccng.droplets.fog_connection.local_root:
  177
+  description: "The directory used as the root for the Local fog provider"
  178
+  default: "/var/vcap/shared"
139 179
  ccdb_ng.databases:
140 180
   description:
141 181
  ccdb_ng.roles:
43  jobs/cloud_controller_ng/templates/cloud_controller_ng.yml.erb
@@ -39,12 +39,10 @@ info:
39 39
 # allow_debug: false
40 40
 
41 41
 <% if_p("directories.droplets",
42  
-        "directories.resources",
43 42
         "directories.staging_manifests",
44  
-        "directories.tmpdir") do |droplets, resources, staging_manifests, tmpdir| %>
  43
+        "directories.tmpdir") do |droplets, staging_manifests, tmpdir| %>
45 44
 directories:
46 45
  droplets: <%= droplets %>
47  
- resources: <%= resources %>
48 46
  staging_manifests: <%= staging_manifests %>
49 47
  tmpdir: <%= tmpdir %>
50 48
 <% end %>
@@ -109,3 +107,42 @@ quota_definitions:
109 107
     paid_memory_limit: <%= p("ccng.quota_definitions.yeti.paid_memory_limit") %>
110 108
 
111 109
 default_quota_definition: <%= p("ccng.default_quota_definition") %>
  110
+
  111
+resource_pool:
  112
+  resource_directory_key: <%= p("ccng.resource_pool.resource_directory_key") %>
  113
+  fog_connection:
  114
+<% if_p("ccng.resource_pool.fog_connection.provider") do |provider| %>
  115
+    provider: <%= provider %>
  116
+  <% if provider.downcase == "local" %>
  117
+    local_root: <%= p("ccng.resource_pool.fog_connection.local_root") %>
  118
+  <% else %>
  119
+    aws_access_key_id: <%= p("ccng.resource_pool.fog_connection.aws_access_key_id") %>
  120
+    aws_secret_access_key: <%= p("ccng.resource_pool.fog_connection.aws_secret_access_key") %>
  121
+  <% end %>
  122
+<% end %>
  123
+
  124
+packages:
  125
+  app_package_directory_key: <%= p("ccng.packages.app_package_directory_key") %>
  126
+  fog_connection:
  127
+<% if_p("ccng.packages.fog_connection.provider") do |provider| %>
  128
+    provider: <%= provider %>
  129
+  <% if provider.downcase == "local" %>
  130
+    local_root: <%= p("ccng.packages.fog_connection.local_root") %>
  131
+  <% else %>
  132
+    aws_access_key_id: <%= p("ccng.packages.fog_connection.aws_access_key_id") %>
  133
+    aws_secret_access_key: <%= p("ccng.packages.fog_connection.aws_secret_access_key") %>
  134
+  <% end %>
  135
+<% end %>
  136
+
  137
+droplets:
  138
+  droplet_directory_key: <%= p("ccng.droplets.droplet_directory_key") %>
  139
+  fog_connection:
  140
+<% if_p("ccng.droplets.fog_connection.provider") do |provider| %>
  141
+    provider: <%= provider %>
  142
+  <% if provider.downcase == "local" %>
  143
+    local_root: <%= p("ccng.droplets.fog_connection.local_root") %>
  144
+  <% else %>
  145
+    aws_access_key_id: <%= p("ccng.droplets.fog_connection.aws_access_key_id") %>
  146
+    aws_secret_access_key: <%= p("ccng.droplets.fog_connection.aws_secret_access_key") %>
  147
+  <% end %>
  148
+<% end %>
18  jobs/cloud_controller_ng/templates/nginx.conf.erb
@@ -59,6 +59,24 @@ http {
59 59
       root   /var/vcap/shared;
60 60
     }
61 61
 
  62
+<% if p("ccng.packages.fog_connection.provider").downcase == "local" %>
  63
+    # used for x-accel-redirect uri://location/foo.txt
  64
+    # nginx will serve the file root || location || foo.txt
  65
+    location <%= "/#{p('ccng.packages.app_package_directory_key')}/" %> {
  66
+      internal;
  67
+      root   /var/vcap/shared;
  68
+    }
  69
+<% end %>
  70
+
  71
+<% if p("ccng.droplets.fog_connection.provider").downcase == "local" %>
  72
+    # used for x-accel-redirect uri://location/foo.txt
  73
+    # nginx will serve the file root || location || foo.txt
  74
+    location <%= "/#{p('ccng.droplets.droplet_directory_key')}/" %> {
  75
+      internal;
  76
+      root   /var/vcap/shared;
  77
+    }
  78
+<% end %>
  79
+
62 80
     location ~ (/apps/.*/application|/v2/apps/.*/bits|/services/v\d+/configurations/.*/serialized/data) {
63 81
       # Pass altered request body to this location
64 82
       upload_pass   @cc_uploads;
2  src/cloud_controller_ng
... ...
@@ -1 +1 @@
1  
-Subproject commit 385eb67570c62557263782c105ed70fca294de04
  1
+Subproject commit 3635865ffa3f10cf0eed7c8d49670dd9c4d12b86

0 notes on commit e609a8e

Please sign in to comment.
Something went wrong with that request. Please try again.