Skip to content
Browse files

Bosh packaging update for multiple versions of redis

 - Add redis 2.4.17 tarball

 - Rename redis package to redis22 package

 - Add redis24 package to install redis 2.4.17

 - Bump src/service submodule pointer:
   git shortlog 7ef9240..3741820
   Frank Lu (2):
      Thorough cleanup after a fail provision
      Merge "Thorough cleanup after a fail provision"

   Harshawardhan Gadgil (4):
      Multiple version support for Redis
      Use provisioned service details for redis instance dump/import
      Merge "Multiple version support for Redis"
      Merge "Use provisioned service details for redis instance dump/import"

   andyzh (1):
      correct the max_clients calculation

Change-Id: I004606cb6b3e5e8b827eedab180ab8a3fdae7cdc
  • Loading branch information...
1 parent 90508d2 commit dd1ea91a84f38d0765af574f0fc9a1e486016350 Harshawardhan Gadgil committed Oct 23, 2012
View
4 config/blobs.yml
@@ -571,6 +571,10 @@ redis/redis-2.2.15.tar.gz:
object_id: eyJvaWQiOiI0ZTRlNzhiY2EzMWUxMjEwMDRlNGU3ZDUxNDc0NWYwNGZmZjRh%0AZjYxYjY5ZSIsInNpZyI6InA3Mkl4MVBKYWdGZnNYb0xjcGlDczY1QnJKRT0i%0AfQ==%0A
sha: aa6758590363556e73f8d36bdfccb429011da331
size: 456185
+redis/redis-2.4.17.tar.gz:
+ object_id: eyJvaWQiOiI0ZTRlNzhiY2ExMWUxMjIyMDRlNGU5ODYzOGI3NjMwNTA3ODc2%0ANDFhMDQ3NCIsInNpZyI6IkgxVGtzZUVzdnJUT0kxMTBsU1ZTTkUveU5icz0i%0AfQ==%0A
+ sha: 3d540531b3d7103a511d29661c2ae666dac60522
+ size: 656155
hadoop/hadoop-0.20.2-cdh3u4.tar.gz:
object_id: eyJvaWQiOiI0ZTRlNzhiY2E1MWUxMjIyMDRlNGU5ODYzZjI4ZjMwNGZiZDAx%0AODQwN2YwYiIsInNpZyI6ImtrWDA3SXVFVzNiTmNPSHhqMGNhd0Nmb2I0RT0i%0AfQ==%0A
sha: 1a9e6437b4b7f0bdbfdd3bd9170a33238e151f12
View
3 jobs/redis_node/spec
@@ -18,7 +18,8 @@ templates:
packages:
- common
- redis_node
- - redis
+ - redis22
+ - redis24
- ruby
- sqlite
- syslog_aggregator
View
10 jobs/redis_node/templates/redis_node.yml.erb
@@ -5,8 +5,11 @@ plan_enabled = properties.service_plans && properties.service_plans.send(service
plan = properties.plan || "free"
plan_conf = plan_enabled && properties.service_plans.send(service.to_sym).send(plan.to_sym).configuration
node = properties.redis_node
-supported_versions = node.supported_versions
+supported_versions = node.supported_versions || ["2.2"]
default_version = node.default_version
+packages = {}
+# convention, package contains redis 2.2 is redis22
+supported_versions.each{|v| packages[v] = v.sub(".","")}
%>
capacity: <%= plan_enabled && plan_conf.capacity || 200 %>
plan: <%= plan %>
@@ -28,7 +31,10 @@ default_version: <%= "'#{default_version}'"%>
max_memory: <%= plan_enabled && plan_conf.max_memory || 16 %>
max_swap: <%= plan_enabled && plan_conf.max_swap || 32 %>
max_clients: <%= plan_enabled && plan_conf.max_clients || 500 %>
-redis_server_path: /var/vcap/packages/redis/bin/redis-server
+redis_server_path:
+<% for version in supported_versions %>
+ <%= "'#{version}': /var/vcap/packages/redis#{packages[version]}/bin/redis-server" %>
+<% end %>
port_range:
first: 5000
last: 25000
View
9 jobs/redis_node/templates/redis_worker.yml.erb
@@ -5,6 +5,10 @@ plan_enabled = properties.service_plans && properties.service_plans.send(service
plan = properties.plan || "free"
plan_conf = plan_enabled && properties.service_plans.send(service.to_sym).send(plan.to_sym).configuration
lifecycle = properties.service_lifecycle
+supported_versions = properties.redis_node.supported_versions || ["2.2"]
+packages = {}
+# convention, package contains redis 2.2 is redis22
+supported_versions.each{|v| packages[v] = v.sub(".","")}
%>
<% if lifecycle and lifecycle.resque %>
<% snapshot_dir = lifecycle.mount_point || "/var/vcap/services_snapshot" %>
@@ -35,5 +39,8 @@ serialization:
# addtional options
command_rename_prefix: <%= properties.redis_node.command_rename_prefix || "magic-protect-command-prefix" %>
gzip_bin: /bin/gzip
-redis_server_path: /var/vcap/packages/redis/bin/redis-server
+redis_server_path:
+<% for version in supported_versions %>
+ <%= "'#{version}': /var/vcap/packages/redis#{packages[version]}/bin/redis-server" %>
+<% end %>
<% end %>
View
3 jobs/redis_node_ng/spec
@@ -23,7 +23,8 @@ templates:
packages:
- common
- redis_node_ng
- - redis
+ - redis22
+ - redis24
- ruby
- sqlite
- syslog_aggregator
View
2 jobs/redis_node_ng/templates/redis_node.yml.erb
@@ -24,12 +24,10 @@ pid: /var/vcap/sys/run/redis_node/redis_node.pid
node_id: <%= "#{service}_node#{'_' + plan if plan != 'free'}_#{spec.index.to_i + 1}" %>
supported_versions: <%= "['#{supported_versions.join("' , '")}']" %>
default_version: <%= "'#{default_version}'"%>
-
max_memory: <%= plan_enabled && plan_conf.max_memory || 16 %>
memory_overhead: <%= plan_enabled && plan_conf.memory_overhead || 20 %>
max_swap: <%= plan_enabled && plan_conf.max_swap || 32 %>
max_clients: <%= plan_enabled && plan_conf.max_clients || 500 %>
-redis_server_path: /var/vcap/packages/redis/bin/redis-server
port_range:
first: 5000
last: 25000
View
6 jobs/redis_node_ng/templates/redis_startup.sh
@@ -5,4 +5,8 @@ for n in `seq 1 100`; do
sleep 0.1
done
-exec start-stop-daemon --start --quiet --chuid vcap --exec /usr/bin/redis-server /store/instance/redis.conf
+# redis_startup.sh 2.2 - start redis 2.2.x
+# redis_startup.sh 2.4 - start redis 2.4.x
+version=$1
+shift
+exec start-stop-daemon --start --quiet --chuid vcap --exec /usr/share/redis/redis-$version/redis-server /store/instance/redis.conf
View
12 jobs/redis_node_ng/templates/redis_worker.yml.erb
@@ -5,6 +5,12 @@ plan_enabled = properties.service_plans && properties.service_plans.send(service
plan = properties.plan || "free"
plan_conf = plan_enabled && properties.service_plans.send(service.to_sym).send(plan.to_sym).configuration
lifecycle = properties.service_lifecycle
+
+supported_versions = properties.redis_node.supported_versions || ["2.2"]
+
+packages = {}
+# convention, package contains redis 2.2 is redis22
+supported_versions.each{|v| packages[v] = v.sub(".","")}
%>
<% if lifecycle and lifecycle.resque %>
<% snapshot_dir = lifecycle.mount_point || "/var/vcap/services_snapshot" %>
@@ -36,7 +42,11 @@ serialization:
command_rename_prefix: <%= properties.redis_node.command_rename_prefix || "magic-protect-command-prefix" %>
gzip_bin: /bin/gzip
redis_log_dir: /var/vcap/sys/service-log/redis
-redis_server_path: /var/vcap/packages/redis/bin/redis-server
+redis_server_path:
++<% for version in supported_versions %>
++ <%= "'#{version}': /var/vcap/packages/redis#{packages[version]}/bin/redis-server" %>
++<% end %>
+
image_dir: /var/vcap/store/redis_image
max_disk: <%= plan_enabled && plan_conf.max_disk || 128 %>
<% end %>
View
11 jobs/redis_node_ng/templates/warden_ctl
@@ -2,7 +2,9 @@
JOB_DIR=/var/vcap/jobs/redis_node_ng
PKG_DIR=/var/vcap/packages/redis_node_ng
-BIN_DIR=/var/vcap/packages/redis/bin
+
+REDIS22_BIN_DIR=/var/vcap/packages/redis22/bin
+REDIS24_BIN_DIR=/var/vcap/packages/redis24/bin
source /var/vcap/packages/redis_node_ng/common/services/utils.sh
@@ -11,8 +13,13 @@ case $1 in
start)
setup_warden
+ mkdir -p $ROOT_DIR/usr/share/redis/redis-2.2
+ mkdir -p $ROOT_DIR/usr/share/redis/redis-2.4
+
# Copy redis binaries and configuration files to warden base file system
- install -m 0755 -t $ROOT_DIR/usr/bin $JOB_DIR/bin/redis_startup.sh $BIN_DIR/*
+ install -m 0755 -t $ROOT_DIR/usr/bin $JOB_DIR/bin/redis_startup.sh
+ install -m 0755 -t $ROOT_DIR/usr/share/redis/redis-2.2 $REDIS22_BIN_DIR/*
+ install -m 0755 -t $ROOT_DIR/usr/share/redis/redis-2.4 $REDIS24_BIN_DIR/*
install -m 0644 -t $ROOT_DIR/etc/init $JOB_DIR/config/services.conf
start_warden
View
2 jobs/vcap_redis/spec
@@ -7,4 +7,4 @@ templates:
packages:
- common
- - redis
+ - redis22
View
7 jobs/vcap_redis/templates/vcap_redis_ctl
@@ -5,6 +5,11 @@ LOG_DIR=/var/vcap/sys/log/vcap_redis
<% if properties.vcap_redis.persistence %>
PERSISTENCE_DIR=<%= properties.vcap_redis.persistence.dir || "/vcar/vcap/store/vcap_redis/" %>
<% end %>
+
+<%
+ redis_version = properties.vcap_redis.redis_version || "2.2"
+%>
+REDIS_INSTALL_DIR=/var/vcap/packages/redis<%= redis_version.sub(".", "") %>
PIDFILE=$RUN_DIR/vcap_redis.pid
source /var/vcap/packages/common/utils.sh
@@ -23,7 +28,7 @@ case $1 in
<% end %>
echo $$ > $PIDFILE
- exec /var/vcap/packages/redis/bin/redis-server /var/vcap/jobs/vcap_redis/config/vcap_redis.conf
+ exec $REDIS_INSTALL_DIR/bin/redis-server /var/vcap/jobs/vcap_redis/config/vcap_redis.conf
;;
View
0 packages/redis/packaging → packages/redis22/packaging
File renamed without changes.
View
2 packages/redis/spec → packages/redis22/spec
@@ -1,4 +1,4 @@
---
-name: redis
+name: redis22
files:
- redis/redis-2.2.15.tar.gz
View
10 packages/redis24/packaging
@@ -0,0 +1,10 @@
+# abort script on any command that exit with a non zero value
+set -e
+
+tar zxf redis/redis-2.4.17.tar.gz
+
+(
+ cd redis-2.4.17
+ make
+ make PREFIX=$BOSH_INSTALL_TARGET install
+)
View
4 packages/redis24/spec
@@ -0,0 +1,4 @@
+---
+name: redis24
+files:
+- redis/redis-2.4.17.tar.gz
2 src/services
@@ -1 +1 @@
-Subproject commit 7ef924042d47030a72ca9d4a98bcb261ae2b99e1
+Subproject commit 3741820f1a2204758a6d0b6bae226f2553d73ec6

0 comments on commit dd1ea91

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