<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>7981</bug_id>
          
          <creation_ts>2015-07-09 16:48:57 +0000</creation_ts>
          <short_desc>Set up procedure for layer index database upgrades</short_desc>
          <delta_ts>2016-07-14 17:10:21 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>6</classification_id>
          <classification>Yocto Project Subprojects</classification>
          <product>Layer Index</product>
          <component>Layer Index Metadata</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>2.2 M1</target_milestone>
          
          <blocked>6618</blocked>
    
    <blocked>7855</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Paul Eggleton">bluelightning</reporter>
          <assigned_to name="Michael Halstead">mhalstead</assigned_to>
          <cc>belen.barros.pena</cc>
    
    <cc>benjamin.esquivel</cc>
    
    <cc>mhalstead</cc>
    
    <cc>michael.g.wood</cc>
          
          <qa_contact name="Libertad">libertad.gonzalez.de.la.cruz</qa_contact>
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>52252</commentid>
    <comment_count>0</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2015-07-09 16:48:57 +0000</bug_when>
    <thetext>When we make changes to the layer index we usually have to upgrade the database; there is a risk that the upgrade will fail and thus we need to do a backup of the database first, then do the upgrade, and then restore the backup if it fails. There&apos;s the added complication that the database user used by the layer index application normally has restricted access to the database, which is not sufficient for the upgrade.

What we need is a documented procedure to follow for doing the upgrade on our own instance (this is not really user documentation because it&apos;s specific to our setup).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>52333</commentid>
    <comment_count>1</comment_count>
    <who name="Belen Barros Pena">belen.barros.pena</who>
    <bug_when>2015-07-14 09:39:56 +0000</bug_when>
    <thetext>This kind of blocks the Toaster image customisation feature ... Paul disagrees, but I still think it does ;)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53295</commentid>
    <comment_count>2</comment_count>
      <attachid>2670</attachid>
    <who name="Alex Franco">alejandro.franco</who>
    <bug_when>2015-08-20 20:01:26 +0000</bug_when>
    <thetext>Created attachment 2670
Update process outline

For the full document contact Alex Franco</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53296</commentid>
    <comment_count>3</comment_count>
    <who name="Alex Franco">alejandro.franco</who>
    <bug_when>2015-08-20 20:04:04 +0000</bug_when>
    <thetext>Need more info from Michael Halstead: (1) production set up using docker, (2) feedback on update process - stripped down version attached.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54562</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Wood">michael.g.wood</who>
    <bug_when>2015-09-23 16:01:53 +0000</bug_when>
    <thetext>Any update on this, we&apos;re getting close to requiring the blocking bug #7575 fixed for information needed in live toaster instances. Is there an intermediate / less complicated solution that can be done in the mean time to unblock this bug?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54980</commentid>
    <comment_count>5</comment_count>
    <who name="Michael Halstead">mhalstead</who>
    <bug_when>2015-10-06 03:45:09 +0000</bug_when>
    <thetext>We are very close currently the migration fails. I&apos;ve been in touch with Alex Franco about this. 

I see that the update script is currently run with just the -q switch while the update also uses the -r switch to reload the data.

Does -r only needs to be set on the first update or is this required on all calls to update.py now?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55005</commentid>
    <comment_count>6</comment_count>
    <who name="Alex Franco">alejandro.franco</who>
    <bug_when>2015-10-06 22:59:39 +0000</bug_when>
    <thetext>Been in touch with Michael about this, now since this is an enhancement it probably won&apos;t go into 2.0 so I am moving this to 2.1 as we continue working on it</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55013</commentid>
    <comment_count>7</comment_count>
    <who name="Belen Barros Pena">belen.barros.pena</who>
    <bug_when>2015-10-07 08:14:19 +0000</bug_when>
    <thetext>(In reply to comment #6)
&gt; Been in touch with Michael about this, now since this is an enhancement it
&gt; probably won&apos;t go into 2.0 so I am moving this to 2.1 as we continue working
&gt; on it

We really need this in Toaster for 2.0. We have split the image recipes from all other recipes as a usability enhancement and in preparation for image customisation. But Toaster&apos;s ability to properly identify image recipes is severely flawed without the parsing information the layer index provides.

We have been asking for this since the beginning of this release. Can we please (please, please) get this done within 2.0?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55015</commentid>
    <comment_count>8</comment_count>
    <who name="Michael Halstead">mhalstead</who>
    <bug_when>2015-10-07 09:15:47 +0000</bug_when>
    <thetext>I sat down with Paul and he fixed out the fix. The migration revision history is missing on production so we ran the following commands to set the versions manually. Now we&apos;re moving forward again.

python /opt/layerindex/manage.py migrate captcha 0001 --fake
python /opt/layerindex/manage.py migrate reversion 0005 --fake

If all goes well we should have this done today.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55016</commentid>
    <comment_count>9</comment_count>
    <who name="Belen Barros Pena">belen.barros.pena</who>
    <bug_when>2015-10-07 09:30:36 +0000</bug_when>
    <thetext> 
&gt; If all goes well we should have this done today.

Remind me to buy you a drink when I get to Dublin :)

Thank you!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55105</commentid>
    <comment_count>10</comment_count>
    <who name="Michael Halstead">mhalstead</who>
    <bug_when>2015-10-09 11:28:15 +0000</bug_when>
    <thetext>The new version based on the paule/inherits2 layer is now running in production. Please review the site and report any errors.

I did have to make several changes to the Dockerfile and support files to make it production ready. I&apos;ll push these to my own branch soon if that&apos;s acceptable.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55107</commentid>
    <comment_count>11</comment_count>
    <who name="Belen Barros Pena">belen.barros.pena</who>
    <bug_when>2015-10-09 11:39:12 +0000</bug_when>
    <thetext>The layer index looked ok to me and just tested with Toaster, and things seem to be working as expected.

Once again, thank you so much for getting this done!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55465</commentid>
    <comment_count>12</comment_count>
    <who name="Alex Franco">alejandro.franco</who>
    <bug_when>2015-10-19 22:58:20 +0000</bug_when>
    <thetext>7575 was closed, so for this we are now discussing a public DB snapshot, beyond that it can probably be closed unless Dockerfile changes need to happen as well, discussion ongoing with Michael and Paul.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62517</commentid>
    <comment_count>13</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2016-05-30 02:05:45 +0000</bug_when>
    <thetext>I think this one is now resolved - Michael has put in place procedures for upgrades and we&apos;ve been through at least two upgrades with that now.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>2670</attachid>
            <date>2015-08-20 20:01:26 +0000</date>
            <delta_ts>2015-08-20 20:01:26 +0000</delta_ts>
            <desc>Update process outline</desc>
            <filename>file_7981.txt</filename>
            <type>text/plain</type>
            <size>2465</size>
            <attacher name="Alex Franco">alejandro.franco</attacher>
            
              <data encoding="base64">WW9jdG8gdXBkYXRlIHByb2Nlc3MgZm9yIGxheWVyaW5kZXgtd2ViIChzZW5zaXRpdmUvaW50ZXJu
YWwvc3BlY2lmaWMgaW5mbyByZW1vdmVkKQ0KDQpJbnRybw0KDQpVcGRhdGluZyB0aGUgbGF5ZXIg
aW5kZXggcmVxdWlyZXMgaW4gZ2VuZXJhbCB0aGUgZm9sbG93aW5nIHN0ZXBzOg0KLSBQdWxsIGxh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