At the last scrum we raised the point that when installing a stable version of Aegir you get the core version from the day of the Aegir release.

As making an Aegir release is a process that takes considerable time we're thinking of doing a mini form just for the core updates.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

helmo created an issue. See original summary.

helmo’s picture

Looking at the release.sh script in the provision repo I'm uncertain.

We don't seem to lock a Drupal core version number in our makefiles.
And the Debian package does not contain the full hostmaster platform.

So the case where it fails is when the tar/zip from https://www.drupal.org/project/hostmaster is downloaded.

Lacking support for contrib semantic versioning we would have to call it 3.5. Not a huge issue, but the 7.x-3.x branch has new commits. So would we add a new release tag on a feature branch, to be merged back later?

I've been looking to see if there's an issue about this from other distributions... but have not found it yet.

colan’s picture

According to the documentation for hostmaster-migrate:

The command [...] will fetch the latest stable Drupal release, so it can simply be run again when a new security release of Drupal is made available.

So we shouldn't need to provide minor releases of Aegir (although it would be nice); folks can simply run this command.

However, as per #2607972: How to cleanly update hostmaster ? and the attempt I made yesterday, this doesn't actually work. I was on Drupal 7.42 before, and on 7.42 after, even though the command should have moved me to 7.43.

So either:

  1. This worked previously, but doesn't now, so we have a regression, or
  2. This never worked, and the documentation is wrong.
helmo’s picture

drush @hostmaster hostmaster-migrate --makefile=/var/aegir/src/provision/new.make opc.initfour.nl /var/aegir/hostmaster-7.x-3.4-xxx

custom makefile (based on aegir-dev.make:

core = 7.x
api = 2

projects[drupal][type] = "core"

projects[hostmaster][type] = "profile"
projects[hostmaster][download][type] = "git"
projects[hostmaster][download][url] = "http://git.drupal.org/project/hostmaster.git"
projects[hostmaster][download][tag] = "7.x-3.4"
helmo’s picture

We could update aegir-release.make with this... then a new install won't get the zipped up hostmaster profile from D.o but will download core and all the golden contrib modules separately.

This adds a risk ... when core is updated with something incompatible for us our users find out.
But as we don't depend on core patches it might be a risk we're willing to take.

The advantage is that someone installing the stable version after core has made a new release will get the updated core.

colan’s picture

To answer #3 (thanks helmo), this only works if on unstable. Stable will fetch the original core release.

I don't think #4 is a good solution given that it just broke my system:

[...]
Deploying site from /var/aegir/backups/aegir.dev-trusty.example.com-20160505.175437.tar.gz                                                     [success]
Replacing the existing site at /var/aegir/hostmaster-7.x-3.4-7.43/sites/aegir.dev-trusty.example.com                                           [success]
Created aegirdevtrustyex database                                                                                                              [success]
Successfully extracted the contents of /var/aegir/hostmaster-7.x-3.4-7.43/sites/aegir.dev-trusty.example.com.restore                           [success]
chgrp(): No such file or directory FileSystem.php:448                                                                                          [warning]
filegroup(): stat failed for /var/aegir/hostmaster-7.x-3.4-7.43/sites/aegir.dev-trusty.example.com.restore/files FileSystem.php:227            [warning]
Could not change group ownership of files in /var/aegir/hostmaster-7.x-3.4-7.43/sites/aegir.dev-trusty.example.com.restore/files [warning]
to www-data (chgrp to www-data failed on /var/aegir/hostmaster-7.x-3.4-7.43/sites/aegir.dev-trusty.example.com.restore/files)
chgrp(): No such file or directory FileSystem.php:448                                                                                          [warning]
filegroup(): stat failed for /var/aegir/hostmaster-7.x-3.4-7.43/sites/aegir.dev-trusty.example.com.restore/private/files FileSystem.php:227    [warning]
Could not change group ownership of private files in                                                                                           [warning]
/var/aegir/hostmaster-7.x-3.4-7.43/sites/aegir.dev-trusty.example.com.restore/private/files to www-data (chgrp to www-data failed
on /var/aegir/hostmaster-7.x-3.4-7.43/sites/aegir.dev-trusty.example.com.restore/private/files)
chgrp(): No such file or directory FileSystem.php:448                                                                                          [warning]
filegroup(): stat failed for /var/aegir/hostmaster-7.x-3.4-7.43/sites/aegir.dev-trusty.example.com.restore/private/temp FileSystem.php:227     [warning]
Could not change group ownership of temp files in                                                                                              [warning]
/var/aegir/hostmaster-7.x-3.4-7.43/sites/aegir.dev-trusty.example.com.restore/private/temp to www-data (chgrp to www-data failed
on /var/aegir/hostmaster-7.x-3.4-7.43/sites/aegir.dev-trusty.example.com.restore/private/temp)
Swapping out the /var/aegir/hostmaster-7.x-3.4-7.43/sites/aegir.dev-trusty.example.com.restore and                                             [success]
/var/aegir/hostmaster-7.x-3.4-7.43/sites/aegir.dev-trusty.example.com directories was successful.
[...]
Platforms path /var/aegir/platforms is writable.                                                                                                   [success]
'drush' cache was cleared.                                                                                                                         [success]
The drush command 'hosting-resume' could not be found.  Run `drush cache-clear drush` to clear the commandfile cache if you have installed new     [error]
extensions.
Drush was not able to start (bootstrap) the Drupal database.                                                                                       [error]
Hint: This may occur when Drush is trying to:
 * bootstrap a site that has not been installed or does not have a configured database. In this case you can select another site with a working
database setup by specifying the URI to use with the --uri parameter on the command line. See `drush topic docs-aliases` for details.
 * connect the database through a socket. The socket file may be wrong or the php-cli may have no access to it in a jailed shell. See
http://drupal.org/node/1428638 for details.

Drush was attempting to connect to:
 Drupal version         :  7.43
 Site URI               :  aegir.dev-trusty.example.com
 Database driver        :  mysql
 Database hostname      :  localhost
 Database port          :  3306
 Database username      :  aegirdevtrustyex
 Database name          :  aegirdevtrustyex
 PHP configuration      :  /etc/php5/cli/php.ini
 PHP OS                 :  Linux
 Drush script           :  /usr/local/bin/drush
 Drush version          :  8.1.0
 Drush temp directory   :  /tmp
 Drush configuration    :  /var/aegir/hostmaster-7.x-3.4-7.43/sites/aegir.dev-trusty.example.com/drushrc.php
                           /var/aegir/hostmaster-7.x-3.4-7.43/sites/all/drush/drushrc.php /var/aegir/.drush/drushrc.php
 Drush alias files      :  /var/aegir/.drush/platform_hostmaster.alias.drushrc.php
                           /var/aegir/.drush/test.dev-trusty.example.com.alias.drushrc.php
                           /var/aegir/.drush/test2.dev-trusty.example.com.alias.drushrc.php
                           /var/aegir/.drush/server_localhost.alias.drushrc.php /var/aegir/.drush/hm.alias.drushrc.php
                           /var/aegir/.drush/server_master.alias.drushrc.php /var/aegir/.drush/platform_hostmaster7x34743.alias.drushrc.php
                           /var/aegir/.drush/hostmaster.alias.drushrc.php
 Drupal root            :  /var/aegir/hostmaster-7.x-3.4-7.43
 Drupal Settings File   :  sites/aegir.dev-trusty.example.com/settings.php
 Site path              :  sites/aegir.dev-trusty.example.com

And then if I try surfing to the site, I get:

PDOException: SQLSTATE[28000] [1045] Access denied for user 'aegirdevtrustyex'@'localhost' (using password: YES) in lock_may_be_available() (line 167 of /var/aegir/hostmaster-7.x-3.4-7.43/includes/lock.inc).

Going to try the following instead:

  1. Copy the hostmaster platform to a new directory.
  2. Delete the hostmaster site within it.
  3. drush pm-updatecode drupal
  4. hostmaster-migrate to new platform

Hopefully that'll work better.

colan’s picture

Status: Active » Needs review

Turns out that wasn't necessary. This is what I came up with, and it proved successful:

  • Become the Aegir user.
  • Upgrade Drupal core via Drush.
  • Verify the upgraded platform.
  • Verify the Hostmaster site.

I added the details of this to the docs. Please review the commit.

Maybe we can simply recommend this process instead of pushing out minor updates? It's still a bit risky, but it's less risky than running with a known security vulnerability. And I'm quite sure that Drush maintains its own backups so these can be restored if there's a problem.

helmo’s picture

@colan I only added some styling to your docs commit.

About #6, 'Replacing the existing site at' hints that the new platform already had a sites/aegir.dev-trusty.example.com directory. Which should not be there is it were a new platform that was just build by drush make.

I tried my makefile from #4 manually. And it builds a functional platform, with the core update. However for the Aegir modules such as hosting it takes the latest dev.

In the hostmaster repo we specify 7.x-3.x in hostmaster.make, and no version (thus stable).. in drupal-org.make.

We should probably move to pinning the specific versions in hostmaster.make. E.g. when I would like to install hostmaster 3.1 today I would still get the latest dev version of hosting. And when we were to hostmaster.make to use stable versions it would install hosting 3.4 for a hostmaster 3.1 platform :(

colan’s picture

Agreed. I didn't even realize it worked that way. 3.1 should always be the same!

helmo’s picture

This might be it. It switches the makefile for hostmaster just for the stable release. like we do for aegir.make. With this script change we atleast get stable versions on later buids.

We will have to start pinning versions in drupal-org.make to solve this completely, see patch 2.

helmo’s picture

now a patch with content ;)

ergonlogic’s picture

For reference, here is the issue where we switched to using the distro tarball: https://www.drupal.org/node/2002114. I'm still astonished that distributions need new releases to track each Drupal core release.

ergonlogic’s picture

I've asked for guidance on best practices from the d.o infrastructure team: #2726767: Best practice to update core version in distribution?. Let's see what they have to say.

ergonlogic’s picture

Do note that our distro has a no-core tarball: https://www.drupal.org/node/2665636. This appears to bundle all the contrib components, and so would effectively pin all versions.

I don't see any convenient way to use this in Drush Make, but being a co-maintainer, I could help build out a proper solution for this.

In the mean time, perhaps we could just deploy the no-core tarball as a library, using some combination of download, subdir, and directory_name and/or destination: http://docs.drush.org/en/master/make/#library-options?

ergonlogic’s picture

ergonlogic’s picture

That feature request was simpler to implement than I had thought. The next version of Drush 8 should include it. Basically, it will allow us to do:

core: 7.x
api: '2'
projects:
  drupal:
    type: core
  hostmaster:
    type: profile
    do_recursion: false
    variant: projects

Of course, that's the newer YAML makefile format, but I think that'd be a worthwhile conversion too.

At any rate, that will use the hostmaster-7.x-3.4-no-core.tar.gz tarball, built atop the latest Drupal, which should resolve this issue cleanly.

helmo’s picture

The drush changes you made seem unrelated to yml parsing ... so we could do this without converting to yml.

This could be the new aegir-release.make:

core = 7.x
api = 2

; this makefile fetches the latest release from Drupal.org
; it is maintained through the release.sh script
projects[drupal][type] = "core"
projects[hostmaster][version] = "3.4"
projects[hostmaster][type] = "profile"
projects[hostmaster][do_recursion] = false
projects[hostmaster][variant] = "projects"

Downside is though that with an older drush version then 8.2-dev we get a platform without the profile build. Just the files from the hostmaster repo.

I've created a separate issue for the move to yml makefiles in #2729285: Update makefiles to use yml structure

ergonlogic’s picture

I've updated the change to Drush such that the [do_recursion] = false is implicit when [variant] = "projects". As a result, only the variant parameter is required. Since that'll be ignored by older versions of Drush Make, it should be safe to use it, so long as we don't add do_recursion = false. So:

core = 7.x
api = 2

; This makefile fetches the latest release of Drupal from Drupal.org.
projects[drupal][type] = "core"

; The release.sh script updates the version of hostmaster.
projects[hostmaster][version] = "3.4"
projects[hostmaster][type] = "profile"
projects[hostmaster][variant] = "projects"
helmo’s picture

Here's an updated patch based on #10 with the updated makefile from #18

colan’s picture

I added an issue in the docs repo to fix the documentation for core upgrades before an Aegir release. See https://github.com/aegir-project/documentation/issues/22.

helmo’s picture

Mentioned in the scrum as Issue of the Week .... who's got time to review?

colan’s picture

@helmo: What's a good way to test #19?

  • helmo committed 97c316f on 7.x-3.x
    Issue #2698027 by helmo: Start pinning module versions in D.o releases
    
helmo’s picture

Yesterday I released 3.9-beta1 to test this.

The output from jenkins seems to confirm what we wanted:

==> default: drupal-7.53 downloaded. [ok]
==> default: hostmaster-7.x-3.9-beta1 downloaded. [ok]

Core is downloaded separately, so if tomorrow 7.54 were to come out(I know it's not Wednesday ;) ) a new aegir installation would pickup that core version with all our other modules at our specified version.
In that case we can do a mini 3.9.1 release to get a new Debian package out there to let existing installations update.

The only "risk" here is if a new core version were to have changes that conflict with Aegir... but lets trust the core maintainers with that.

colan’s picture

Status: Needs review » Reviewed & tested by the community

Sounds good to me.

Confirming that the latest Drupal core was installed from the unstable repository.

helmo’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.