Skip to contentSkip to conversation

publish wic images

PATCH Applied Bill Randle 2 participants 7 messages Jul 6, 2016 – Jul 14, 2016

lore
Share & tools
lore
#0 lore raw

cover publish wic images

QA started testing wic images in Yocto 2.1, but was building them themselves. Have the autobuilder publish the wic images so they are available for testing.

[YOCTO #9397]

Bill Randle (2):
PublishArtifacts.py: create md5sum files in same dir as artifacts publish build artifacts for wic images

 buildset-config.controller/nightly-wic.conf        |  8 ++---
 .../autobuilder/buildsteps/PublishArtifacts.py     | 40 +++++++++++++++-------
 2 files changed, 30 insertions(+), 18 deletions(-)
Signature · 1 line
2.5.5
#1 lore raw

PATCH 1/2 PublishArtifacts.py: create md5sum files in same dir as artifacts

Previously all the md5sum files got put into the top level deploy directory. This patch keeps the md5sum file in the same directory as the file it is hashing. It also limits the traversal depth to five, to avoid hashing the wic components that go into making the wic images.

---
 .../site-packages/autobuilder/buildsteps/PublishArtifacts.py         | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
lib/python2.7/site-packages/autobuilder/buildsteps/PublishArtifacts.py +2 -3
index 111dad7..952a458 100644
@@ -233,9 +233,8 @@ class PublishArtifacts(ShellCommand):
     def generateMD5cmd(self, artifact, deploy_dir):
         cmd = ""
         if os.environ.get('GEN_IMG_MD5') == "True":
-            cmd += "for x in `find " + deploy_dir + " -type f`;"
-            cmd += "do fname=`basename $x`;"
-            cmd += "md5sum $x >> " + deploy_dir + "/$fname.md5sum; done;"
+            cmd += "for x in `find " + deploy_dir + " -type f -maxdepth 5`;"
+            cmd += "do md5sum $x >> " + "$x.md5sum; done;"
         return cmd
 
     def getDeployNames(self, artifact, buildername):
Signature · 1 line
2.5.5
#2 lore raw

PATCH 2/2 publish build artifacts for wic images

In reply to Bill Randle

Publish the wic images created by the nightly-wic build so they are available for QA testing.

[YOCTO #9397]

---
 buildset-config.controller/nightly-wic.conf        |  8 ++---
 .../autobuilder/buildsteps/PublishArtifacts.py     | 35 ++++++++++++++++------
 2 files changed, 28 insertions(+), 15 deletions(-)
buildset-config.controller/nightly-wic.conf +2 -6
index 7d2ae88..27584cb 100644
@@ -19,10 +19,6 @@ steps: [{'SetDest':{}},
         {'BuildImages':{'images':'core-image-sato'}},
         {'CreateWicImages':{'wic_img_type':'directdisk', 'target_img':'core-image-sato'}},
         {'CreateWicImages':{'wic_img_type':'directdisk-gpt', 'target_img':'core-image-sato'}},
-        {'CreateWicImages':{'wic_img_type':'mkefidisk', 'target_img':'core-image-sato'}}]
-
-
-
-
-
+        {'CreateWicImages':{'wic_img_type':'mkefidisk', 'target_img':'core-image-sato'}},
+        {'PublishArtifacts': {'artifacts': ['qemux86-64', 'genericx86-64']}}]
 
lib/python2.7/site-packages/autobuilder/buildsteps/PublishArtifacts.py +26 -9
index 952a458..f9df16c 100644
@@ -174,7 +174,14 @@ class PublishArtifacts(ShellCommand):
                     artifact_name, deploy_image_dir = self.getDeployNames(artifact, buildername)
                     command += self.generateMD5cmd(artifact, deploy_image_dir)
                     command=command+"mkdir -p " + DEST + "/" + QEMU_PUBLISH_DIR + "/" + artifact_name + ";"
-                    command=command+"cp -R --no-dereference --preserve=links " + \
+                    if "-wic" in buildername:
+                        deploy_image_dir += "/*/*/build";
+                        command=command+"cp --no-dereference --preserve=links " + \
+                                    deploy_image_dir + "/*\.direct " + \
+                                    deploy_image_dir + "/*\.direct.md5sum " + \
+                                    DEST + "/" + QEMU_PUBLISH_DIR + "/" + artifact_name + ";"
+                    else:
+                        command=command+"cp -R --no-dereference --preserve=links " + \
                                     deploy_image_dir + \
                                     "/*" + artifact + "* " + DEST + "/" + QEMU_PUBLISH_DIR + "/" + artifact_name + ";"
                 elif "mpc8315e" in artifact:
@@ -213,18 +220,26 @@ class PublishArtifacts(ShellCommand):
                        "genericx86-64" in artifact:
                         command = command+"echo 'Skipping copy of genericx86-64.'; "
                     else:
-                        command=command+"mkdir -p " + DEST + "/"+ MACHINE_PUBLISH_DIR +"/" + artifact_name + ";"
-                        if "beagle" in artifact:
-                            command=command+"cp -R --no-dereference --preserve=links " + \
+                        command += self.generateMD5cmd(artifact, deploy_image_dir)
+                        if "-wic" in buildername:
+                            deploy_image_dir += "/*/*/build";
+                            command=command+"mkdir -p " + DEST + "/" + MACHINE_PUBLISH_DIR + "/" + artifact_name + ";"
+                            command=command+"cp --no-dereference --preserve=links " + \
+                                    deploy_image_dir + "/*\.direct " + \
+                                    deploy_image_dir + "/*\.direct.md5sum " + \
+                                    DEST + "/" + MACHINE_PUBLISH_DIR + "/" + artifact_name + ";"
+                        else:
+                            command=command+"mkdir -p " + DEST + "/"+ MACHINE_PUBLISH_DIR +"/" + artifact_name + ";"
+                            if "beagle" in artifact:
+                                command=command+"cp -R --no-dereference --preserve=links " + \
                                              deploy_image_dir + \
                                              "/*Image* " + DEST + "/" + MACHINE_PUBLISH_DIR +"/" + artifact_name + ";"
-                            command=command+"cp -R --no-dereference --preserve=links " + \
+                                command=command+"cp -R --no-dereference --preserve=links " + \
                                              deploy_image_dir + \
                                              "/u-boot* " + DEST + "/" + MACHINE_PUBLISH_DIR +"/" + artifact_name + ";"
-                        command=command+"cp -R --no-dereference --preserve=links " + \
+                            command=command+"cp -R --no-dereference --preserve=links " + \
                                          deploy_image_dir + \
                                          "/*"+artifact+"* " + DEST + "/" + MACHINE_PUBLISH_DIR +"/" + artifact_name + ";"
-                    command += self.generateMD5cmd(artifact, deploy_image_dir)
             self.command = command
         else:
             self.command = "echo 'Skipping Step.'"
@@ -241,8 +256,10 @@ class PublishArtifacts(ShellCommand):
         artifact_name = artifact
         if "-lsb" in buildername:
             artifact_name = artifact_name + "-lsb"
-        if artifact_name is "md5sums":
-            deploy_dir_image = os.path.join(self.tmpdir, "deploy/images/")
+        if "-wic" in buildername:
+            deploy_dir_image = os.path.join(os.path.join(self.tmpdir, "deploy/wic_images/"), artifact)
+        elif artifact_name is "md5sums":
+            deploy_dir_image = os.path.join(self.tmpdir, "deploy/images/")
         else:
             if self.layerversion_core is not None and int(self.layerversion_core) > 2:
                 deploy_dir_image = os.path.join(os.path.join(self.tmpdir, "deploy/images/"), artifact)
Signature · 1 line
2.5.5
#3 lore raw

Re: [yocto-autobuilder][PATCH 2/2] publish build artifacts for wic images

Quoted 74 lines · Bill Randle

Publish the wic images created by the nightly-wic build so they are available for QA testing.

[YOCTO #9397]

---
 buildset-config.controller/nightly-wic.conf        |  8 ++--- .../autobuilder/buildsteps/PublishArtifacts.py     | 35
++++++++++++++++------

 2 files changed, 28 insertions(+), 15 deletions(-)
buildset- renamed from buildset-config.controller/nightly-wic.conf +0 -0

config.controller/nightly-wic.conf
index 7d2ae88..27584cb 100644

buildset-config.controller/nightly-wic.conf +0 -1
@@ -19,10 +19,6 @@ steps: [{'SetDest':{}},
          {'BuildImages':{'images':'core-image-sato'}},
          {'CreateWicImages':{'wic_img_type':'directdisk',
 'target_img':'core-image-sato'}},
          {'CreateWicImages':{'wic_img_type':'directdisk-gpt',
 'target_img':'core-image-sato'}},
-        {'CreateWicImages':{'wic_img_type':'mkefidisk',

'target_img':'core-image-sato'}}]

buildset-config.controller/nightly-wic.conf +1 -5
-
-
-
-
-
+        {'CreateWicImages':{'wic_img_type':'mkefidisk',

'target_img':'core-image-sato'}},
+        {'PublishArtifacts': {'artifacts': ['qemux86-64', 'genericx86-64']}}]

(quoted diff) +0 -0

packages/autobuilder/buildsteps/PublishArtifacts.py b/lib/python2.7/site- packages/autobuilder/buildsteps/PublishArtifacts.py index 952a458..f9df16c 100644
--- a/lib/python2.7/site- packages/autobuilder/buildsteps/PublishArtifacts.py +++ b/lib/python2.7/site- packages/autobuilder/buildsteps/PublishArtifacts.py

buildset-config.controller/nightly-wic.conf +0 -0
@@ -174,7 +174,14 @@ class PublishArtifacts(ShellCommand):

                     artifact_name, deploy_image_dir = self.getDeployNames(artifact, buildername)
                     command += self.generateMD5cmd(artifact, deploy_image_dir)
                     command=command+"mkdir -p " + DEST + "/" + QEMU_PUBLISH_DIR + "/" + artifact_name + ";"
-                    command=command+"cp -R --no-dereference -- preserve=links " + \
+                    if "-wic" in buildername:
+                        deploy_image_dir += "/*/*/build"; +                        command=command+"cp --no-dereference -- preserve=links " + \
+                                    deploy_image_dir + "/*\.direct "
+ \
+                                    deploy_image_dir + "/*\.direct.md5sum " + \
+                                    DEST + "/" + QEMU_PUBLISH_DIR + "/" + artifact_name + ";"
+                    else:
+                        command=command+"cp -R --no-dereference -- preserve=links " + \
                                     deploy_image_dir + \
                                     "/*" + artifact + "* " + DEST + "/" + QEMU_PUBLISH_DIR + "/" + artifact_name + ";"
                 elif "mpc8315e" in artifact:

buildset-config.controller/nightly-wic.conf +0 -0
@@ -213,18 +220,26 @@ class PublishArtifacts(ShellCommand):

                        "genericx86-64" in artifact:
                         command = command+"echo 'Skipping copy of genericx86-64.'; "

Quoted 8 lines

                     else:
-                        command=command+"mkdir -p " + DEST + "/"+ MACHINE_PUBLISH_DIR +"/" + artifact_name + ";"
-                        if "beagle" in artifact:
-                            command=command+"cp -R --no-dereference --preserve=links " + \
+                        command += self.generateMD5cmd(artifact, deploy_image_dir)

If I'm reading this patch correctly this change moves the addition of generateMD5cmd() to the command string into the else block of the "layerversion_yoctobsp < 2" check, whereas before it was appended regardless after the if/else statement. Was that change intentional?

Regards,

Joshua

Quoted 59 lines

+                        if "-wic" in buildername:
+                            deploy_image_dir += "/*/*/build"; +                            command=command+"mkdir -p " + DEST + "/"
+ MACHINE_PUBLISH_DIR + "/" + artifact_name + ";"
+                            command=command+"cp --no-dereference -- preserve=links " + \
+                                    deploy_image_dir + "/*\.direct "
+ \
+                                    deploy_image_dir + "/*\.direct.md5sum " + \
+                                    DEST + "/" + MACHINE_PUBLISH_DIR
+ "/" + artifact_name + ";"
+                        else:
+                            command=command+"mkdir -p " + DEST + "/"+ MACHINE_PUBLISH_DIR +"/" + artifact_name + ";"
+                            if "beagle" in artifact:
+                                command=command+"cp -R --no- dereference --preserve=links " + \
                                              deploy_image_dir + \
                                              "/*Image* " + DEST + "/" + MACHINE_PUBLISH_DIR +"/" + artifact_name + ";"
-                            command=command+"cp -R --no-dereference --preserve=links " + \
+                                command=command+"cp -R --no- dereference --preserve=links " + \
                                              deploy_image_dir + \
                                              "/u-boot* " + DEST + "/" + MACHINE_PUBLISH_DIR +"/" + artifact_name + ";"
-                        command=command+"cp -R --no-dereference -- preserve=links " + \
+                            command=command+"cp -R --no-dereference --preserve=links " + \
                                          deploy_image_dir + \
                                          "/*"+artifact+"* " + DEST + "/" + MACHINE_PUBLISH_DIR +"/" + artifact_name + ";"
-                    command += self.generateMD5cmd(artifact, deploy_image_dir)
             self.command = command
         else:
             self.command = "echo 'Skipping Step.'"

buildset-config.controller/nightly-wic.conf +0 -0
@@ -241,8 +256,10 @@ class PublishArtifacts(ShellCommand):

         artifact_name = artifact
         if "-lsb" in buildername:
             artifact_name = artifact_name + "-lsb"
-        if artifact_name is "md5sums":
-            deploy_dir_image = os.path.join(self.tmpdir, "deploy/images/")
+        if "-wic" in buildername:
+            deploy_dir_image = os.path.join(os.path.join(self.tmpdir, "deploy/wic_images/"), artifact)
+        elif artifact_name is "md5sums":
+            deploy_dir_image = os.path.join(self.tmpdir, "deploy/images/")
         else:
             if self.layerversion_core is not None and int(self.layerversion_core) > 2:
                 deploy_dir_image = os.path.join(os.path.join(self.tmpdir, "deploy/images/"), artifact)

#4 lore raw

Re: [yocto-autobuilder][PATCH 2/2] publish build artifacts for wic images

On Thu, 2016-07-14 at 10:38 +0100, Joshua G Lock wrote:

On Wed, 2016-07-06 at 13:16 -0700, Bill Randle wrote:

Publish the wic images created by the nightly-wic build so they are available for QA testing.

[YOCTO #9397]

---
 buildset-config.controller/nightly-wic.conf        |  8 ++---
 .../autobuilder/buildsteps/PublishArtifacts.py     | 35
++++++++++++++++------
 2 files changed, 28 insertions(+), 15 deletions(-)
buildset- renamed from buildset-config.controller/nightly-wic.conf +0 -0

config.controller/nightly-wic.conf
index 7d2ae88..27584cb 100644

buildset-config.controller/nightly-wic.conf +0 -0
@@ -19,10 +19,6 @@ steps: [{'SetDest':{}},
         {'BuildImages':{'images':'core-image-sato'}},
         {'CreateWicImages':{'wic_img_type':'directdisk',

'target_img':'core-image-sato'}},

         {'CreateWicImages':{'wic_img_type':'directdisk-gpt',

'target_img':'core-image-sato'}},
- {'CreateWicImages':{'wic_img_type':'mkefidisk',
'target_img':'core-image-sato'}}]
-
-
-
-
-
+ {'CreateWicImages':{'wic_img_type':'mkefidisk',
'target_img':'core-image-sato'}},
+ {'PublishArtifacts': {'artifacts': ['qemux86-64',
'genericx86-64']}}]

(quoted diff) +0 -0

packages/autobuilder/buildsteps/PublishArtifacts.py b/lib/python2.7/site- packages/autobuilder/buildsteps/PublishArtifacts.py index 952a458..f9df16c 100644
--- a/lib/python2.7/site- packages/autobuilder/buildsteps/PublishArtifacts.py +++ b/lib/python2.7/site- packages/autobuilder/buildsteps/PublishArtifacts.py @@ -174,7 +174,14 @@ class PublishArtifacts(ShellCommand):
artifact_name, deploy_image_dir =
self.getDeployNames(artifact, buildername)

                     command += self.generateMD5cmd(artifact,
deploy_image_dir)
                     command=command+"mkdir -p " + DEST + "/" +

QEMU_PUBLISH_DIR + "/" + artifact_name + ";"
- command=command+"cp -R --no-dereference --
preserve=links " + \
+ if "-wic" in buildername:
+ deploy_image_dir += "/*/*/build";
+ command=command+"cp --no-dereference --
preserve=links " + \
+ deploy_image_dir + "/*\.direct "
+ \
+ deploy_image_dir +
"/*\.direct.md5sum " + \
+ DEST + "/" + QEMU_PUBLISH_DIR +
"/" + artifact_name + ";"
+ else:
+ command=command+"cp -R --no-dereference --

preserve=links " + \
                                     deploy_image_dir + \
                                     "/*" + artifact + "* " + DEST +

"/" + QEMU_PUBLISH_DIR + "/" + artifact_name + ";"
elif "mpc8315e" in artifact:
@@ -213,18 +220,26 @@ class PublishArtifacts(ShellCommand):
"genericx86-64" in artifact:
command = command+"echo 'Skipping copy of
genericx86-64.'; "
else:
- command=command+"mkdir -p " + DEST + "/"+
MACHINE_PUBLISH_DIR +"/" + artifact_name + ";"
- if "beagle" in artifact:
- command=command+"cp -R --no-dereference
--preserve=links " + \
+ command += self.generateMD5cmd(artifact,
deploy_image_dir)

If I'm reading this patch correctly this change moves the addition of generateMD5cmd() to the command string into the else block of the "layerversion_yoctobsp < 2" check, whereas before it was appended regardless after the if/else statement. Was that change intentional?

Regards,

Joshua

Yes, it was intentional. If the layerversion is < 2 and you're expecting genericx86_64, that's not a supported configuration, so there is no image to run a md5sum on. We also want to run the md5sum calculation before we copy artifacts, rather than after, so that the md5sum files are included in the copy.

-Bill

+ if "-wic" in buildername:
+ deploy_image_dir += "/*/*/build";
+ command=command+"mkdir -p " + DEST + "/"
+ MACHINE_PUBLISH_DIR + "/" + artifact_name + ";"
+ command=command+"cp --no-dereference --
preserve=links " + \
+ deploy_image_dir + "/*\.direct "
+ \
+ deploy_image_dir +
"/*\.direct.md5sum " + \
+ DEST + "/" + MACHINE_PUBLISH_DIR
+ "/" + artifact_name + ";"
+ else:
+ command=command+"mkdir -p " + DEST +
"/"+ MACHINE_PUBLISH_DIR +"/" + artifact_name + ";"
+ if "beagle" in artifact:
+ command=command+"cp -R --no-

dereference --preserve=links " + \
                                              deploy_image_dir + \
                                              "/*Image* " + DEST +

"/" + MACHINE_PUBLISH_DIR +"/" + artifact_name + ";"
- command=command+"cp -R --no-dereference
--preserve=links " + \
+ command=command+"cp -R --no-

dereference --preserve=links " + \
                                              deploy_image_dir + \
                                              "/u-boot* " + DEST +

"/" + MACHINE_PUBLISH_DIR +"/" + artifact_name + ";"
- command=command+"cp -R --no-dereference --
preserve=links " + \
+ command=command+"cp -R --no-dereference

--preserve=links " + \
                                          deploy_image_dir + \
                                          "/*"+artifact+"* " + DEST +

"/" + MACHINE_PUBLISH_DIR +"/" + artifact_name + ";"
- command += self.generateMD5cmd(artifact,
deploy_image_dir)
self.command = command
else:
self.command = "echo 'Skipping Step.'"
@@ -241,8 +256,10 @@ class PublishArtifacts(ShellCommand):
artifact_name = artifact
if "-lsb" in buildername:
artifact_name = artifact_name + "-lsb"
- if artifact_name is "md5sums":
- deploy_dir_image = os.path.join(self.tmpdir,
"deploy/images/")
+ if "-wic" in buildername:
+ deploy_dir_image =
os.path.join(os.path.join(self.tmpdir, "deploy/wic_images/"), artifact)
+ elif artifact_name is "md5sums":
+ deploy_dir_image = os.path.join(self.tmpdir,
"deploy/images/")
else:
if self.layerversion_core is not None and
int(self.layerversion_core) > 2:
deploy_dir_image =
os.path.join(os.path.join(self.tmpdir, "deploy/images/"), artifact)

#5 lore raw
In reply to Bill Randle

ping...

On Wed, 2016-07-06 at 13:16 -0700, Bill Randle wrote:

QA started testing wic images in Yocto 2.1, but was building them themselves. Have the autobuilder publish the wic images so they are available for testing.

[YOCTO #9397]

Bill Randle (2):
PublishArtifacts.py: create md5sum files in same dir as artifacts publish build artifacts for wic images

 buildset-config.controller/nightly-wic.conf        |  8 ++---
 .../autobuilder/buildsteps/PublishArtifacts.py     | 40 +++++++++++++++-------
 2 files changed, 30 insertions(+), 18 deletions(-)
#6 lore raw
In reply to Bill Randle
Quoted 4 lines · Bill Randle

QA started testing wic images in Yocto 2.1, but was building them themselves. Have the autobuilder publish the wic images so they are available for testing.

Merged to master, thanks.

Joshua

Quoted 11 lines

[YOCTO #9397]

Bill Randle (2):
  PublishArtifacts.py: create md5sum files in same dir as artifacts publish build artifacts for wic images

 buildset-config.controller/nightly-wic.conf        |  8 ++--- .../autobuilder/buildsteps/PublishArtifacts.py     | 40
+++++++++++++++-------

 2 files changed, 30 insertions(+), 18 deletions(-)