BBlack has submitted this change and it was merged.

Change subject: varnish+jessie filesystem stuff
......................................................................


varnish+jessie filesystem stuff

Switches rootfs to ext4
Switches varnish filesystems to ext4 w/ data=writeback,discard
  and maximizes their free space with a custom mke2fs post-partman
Kills swap while keeping varnish disks at /dev/sd[ab]3

Change-Id: If7de89e1d94dfaa197a18d4c378f5d18cbf0415c
---
M manifests/role/cache.pp
M modules/install-server/files/autoinstall/netboot.cfg
A modules/install-server/files/autoinstall/partman/raid1-varnish-jessie.cfg
M modules/varnish/manifests/setup_filesystem.pp
4 files changed, 83 insertions(+), 4 deletions(-)

Approvals:
  BBlack: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/manifests/role/cache.pp b/manifests/role/cache.pp
index bb29c12..9f9bfe4 100644
--- a/manifests/role/cache.pp
+++ b/manifests/role/cache.pp
@@ -806,6 +806,17 @@
                 varnish_instances => [ '', 'frontend' ],
             }
         }
+
+        if $::realm == 'production' and os_version('debian >= jessie') {
+            # set discard for ext4 rootfs on nodes using SSD backend storage
+            mount { '/':
+                ensure   => mounted,
+                fstype   => 'ext4',
+                options  => 'errors=remount-ro,discard',
+                pass     => 1,
+                remounts => true,
+            }
+        }
     }
 
     class text inherits role::cache::varnish::2layer {
diff --git a/modules/install-server/files/autoinstall/netboot.cfg 
b/modules/install-server/files/autoinstall/netboot.cfg
index cf5a4cd..ba96e2f 100755
--- a/modules/install-server/files/autoinstall/netboot.cfg
+++ b/modules/install-server/files/autoinstall/netboot.cfg
@@ -58,7 +58,7 @@
                calcium|helium|potassium|tmh1001|tmh1002) echo 
partman/raid1-1partition.cfg ;; \
                acamar|achernar|baham|cobalt|lead|lithium|polonium) echo 
partman/raid1-lvm.cfg ;; \
                
cp102[1-9]|cp10[3-6][0-9]|cp1070|cp[34]0[0-9][0-9]|sq6[7-9]|sq70|dysprosium) 
echo partman/raid1-varnish.cfg ;; \
-               cp1008) echo partman/raid1-varnish.cfg ;; \
+               cp1008) echo partman/raid1-varnish-jessie.cfg ;; \
                d-i-test) echo partman/flat.cfg ;; \
                
antimony|arsenic|caesium|erbium|gadolinium|heze|magnesium|neodymium|palladium|promethium|rubidium|strontium|terbium)
 echo partman/lvm.cfg ;; \
                graphite[12]001) echo partman/graphite.cfg ;; \
diff --git 
a/modules/install-server/files/autoinstall/partman/raid1-varnish-jessie.cfg 
b/modules/install-server/files/autoinstall/partman/raid1-varnish-jessie.cfg
new file mode 100644
index 0000000..3523162
--- /dev/null
+++ b/modules/install-server/files/autoinstall/partman/raid1-varnish-jessie.cfg
@@ -0,0 +1,56 @@
+# Automatic software RAID partitioning
+#
+# * two disks, sda & sdb
+# * primary partitions, no LVM
+# * layout:
+#   /dev/sdX1 - root fs: ext4, RAID1, 10GB
+#   /dev/sdX2 - 15% of remainder as unused area for SSD perf/endurance
+#   /dev/sdX3 - 85% of remainder as ext4 for varnish disk cache
+
+d-i    partman-auto/method             string  raid
+d-i    partman-md/device_remove_md     boolean true
+d-i    partman-lvm/device_remove_lvm   boolean true
+
+# Use the first two disks
+d-i    partman-auto/disk       string  /dev/sda /dev/sdb
+
+# Define physical partitions
+d-i    partman-auto/expert_recipe      string  \
+               multiraid ::    \
+                       10000   10000   10000   raid            \
+                               $primary{ } method{ raid }      \
+                       .                                       \
+                       0       75      200000000       linux-swap      \
+                               $primary{ } method{ keep }      \
+                       .
+                       0       425     1000000000      ext4            \
+                               $primary{ } method{ format }    \
+                               format{ } use_filesystem{ }     \
+                               filesystem{ ext4 }              \
+                       .                                       \
+
+# Parameters are:
+# <raidtype> <devcount> <sparecount> <fstype> <mountpoint> \
+#      <devices> <sparedevices>
+d-i    partman-auto-raid/recipe        string          \
+               1       2       0       ext4    /       \
+                       /dev/sda1#/dev/sdb1             \
+               .                                       \
+
+d-i    partman-md/confirm              boolean true
+d-i    partman-md/confirm_nooverwrite  boolean true
+d-i    partman/confirm_write_new_label boolean true
+d-i    partman/choose_partition        select  finish
+d-i    partman/confirm                 boolean true
+d-i    partman/confirm_nooverwrite     boolean true
+d-i    partman-basicfilesystems/no_mount_point boolean false
+
+# method{ keep } on a partition that has no known filesystem
+# produces a "No file system is specified for partition" prompt; silence it
+d-i    partman-basicmethods/method_only        boolean false
+
+# re-make the varnish ext4 filesystems with appropriate options to
+# maximize free space given we only have a few inodes and we intend
+# to fill the filesystem with only a few very large files.
+d-i    preseed/late_command string in-target mke2fs -F -F -t ext4 -T huge -O 
sparse_super2 -m 0 /dev/sda3
+d-i    preseed/late_command string in-target mke2fs -F -F -t ext4 -T huge -O 
sparse_super2 -m 0 /dev/sdb3
diff --git a/modules/varnish/manifests/setup_filesystem.pp 
b/modules/varnish/manifests/setup_filesystem.pp
index 779179d..e972cb5 100644
--- a/modules/varnish/manifests/setup_filesystem.pp
+++ b/modules/varnish/manifests/setup_filesystem.pp
@@ -1,8 +1,20 @@
 define varnish::setup_filesystem() {
-    $mount_options = $::realm ? {
-        'production' => 'noatime,nodiratime,nobarrier,logbufs=8',
-        'labs'       => 'noatime,nodiratime,nobarrier,comment=cloudconfig',
+    if $::realm == 'labs' {
+        $custom_mount_opts = ',comment=cloudconfig'
     }
+    elsif os_version('debian >= jessie') {
+        # setup_filesystem is only used on the non-bits caches,
+        #  which are all set up as ext4-on-SSD...
+        $custom_mount_opts = ',nobarrier,data=writeback,discard'
+    }
+    else {
+        # nodiratime is redundant, but I'm hoping to avoid
+        #  pointless puppet-triggered remount attempts on
+        #  the legacy boxes here...
+        $custom_mount_opts = ',nodiratime,nobarrier,logbufs=8'
+    }
+
+    $mount_options = "noatime$custom_mount_opts"
 
     if $::realm == 'labs' and $::site == 'eqiad' {
       include labs_lvm

-- 
To view, visit https://gerrit.wikimedia.org/r/190610
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: If7de89e1d94dfaa197a18d4c378f5d18cbf0415c
Gerrit-PatchSet: 5
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: BBlack <[email protected]>
Gerrit-Reviewer: BBlack <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to