Publish nightlies to {app}/nightly/YYYY/MM

RESOLVED FIXED

Status

P2
normal
RESOLVED FIXED
11 years ago
5 years ago

People

(Reporter: nthomas, Assigned: nthomas)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 1 obsolete attachment)

(Assignee)

Description

11 years ago
We're going to re-organize the way the nightly dirs are set out (bug 360397), and should start publishing directly into this new structure. Then we symlink back to {app}/nightly/ and keep a month of these links around.

This doesn't really block 394069 but it would be really nice to have (and we need to track the bugs somehow).
Priority: -- → P3
(Assignee)

Comment 1

11 years ago
Created attachment 282592 [details] [diff] [review]
Tinderbox changes

The patch does the following:
* if we're pushing a nightly (clobber) build, then insert a YYYY/MM/ into the path we've normally used and symlink back to the traditional location ($remote_path). Don't do insert anything for an hourly ($cachebuild=0)
* cleanup of repeated definition of paths by creating $complete_remote_path
* allow us to define $ssh_key in tinder-config, which paves the way for uploading with the role keys on boxes building more than one app (this is the first fragment). We don't need this change immediately.

This patch is applied on tboldref-linux-tbox, which is the recently retired machine for Thunderbird trunk (tb-linux-tbox-idled in the VMI). There are also changes on disk to 
* use the tbirdbld key for cvs, and in the tinder-config for pushing to ftp,
* to publish to the new staging box,
* to publish into thunderbird/nightly/experimental/stage-migration/
* to use $ReleaseGroup to set the group on the files (like Seamonkey & Calendar do)

I'm doing ./build-seamonkey --once to avoid wiping those changes with multi-tinderbox. It's doing a clobber builds at the moment and should finish in 30 mins or so. It'll probably fail to push bits up, but you play with
  /builds/tinderbox/Tb-Trunk/Lin.../2007092712/upload-package.sh
manually.

Was planning to do an hourly build to check that the script for that is ok too.
Assignee: build → nrthomas
Status: NEW → ASSIGNED
Attachment #282592 - Flags: review?(preed)
(Assignee)

Updated

11 years ago
Attachment #282592 - Attachment is obsolete: true
Attachment #282592 - Flags: review?(preed)
(Assignee)

Comment 2

11 years ago
Created attachment 282596 [details] [diff] [review]
Updated version

Same as before but use $cachebuild as the nightly/hourly trigger as elsewhere in the code, and only symlink in the nightly case.

Dunno if we want to make this whole YYYY/MM/ change optional, and if you think the quoting on the symlink location is durable enough. I've only had a chance to test the latter on linux.
Attachment #282596 - Flags: review?(preed)
(Assignee)

Updated

11 years ago
Priority: P3 → P2

Comment 3

11 years ago
Comment on attachment 282596 [details] [diff] [review]
Updated version

>Index: post-mozilla-rel.pl
>===================================================================
>RCS file: /cvsroot/mozilla/tools/tinderbox/post-mozilla-rel.pl,v

>+  if (defined($Settings::ssh_key) && $Settings::ssh_key ne '') {
>+    $ssh_opts .= " -i ".$Settings::ssh_key;
>+    $scp_opts .= " -i ".$Settings::ssh_key;
>+  }

I'd make this if (defined($Settings::ssh_key) && $Settings::ssh_key !~ /^\s*$/) {

Otherwise, looks good. I don't see anything weird, but I agree, we'll have to do some testing, since... well... there's always gotchas with Tinderbox. :-)
Attachment #282596 - Flags: review?(preed) → review+
(Assignee)

Comment 4

11 years ago
Checking in post-mozilla-rel.pl;
/cvsroot/mozilla/tools/tinderbox/post-mozilla-rel.pl,v  <--  post-mozilla-rel.pl
new revision: 1.132; previous revision: 1.131
done

Then I realized I hadn't included #3, so I fixed that and landed

Checking in post-mozilla-rel.pl;
/cvsroot/mozilla/tools/tinderbox/post-mozilla-rel.pl,v  <--  post-mozilla-rel.pl
new revision: 1.133; previous revision: 1.132
done
(Assignee)

Comment 5

11 years ago
As a temporary workaround, I checked this in:

--- post-mozilla-rel.pl 28 Sep 2007 07:36:06 -0000      1.133
+++ post-mozilla-rel.pl 28 Sep 2007 10:16:51 -0000      1.134
@@ -1078,13 +1078,14 @@
     if ($Settings::ReleaseGroup ne '') {
       push(@cmds,"ssh $ssh_opts -l $Settings::ssh_user $ssh_server chgrp -R $Settings::ReleaseGroup $complete_remote_path");
     }
-    if ( $cachebuild ) {
-      push(@cmds,"ssh $ssh_opts -l $Settings::ssh_user $ssh_server 'cd $remote_path && ln -s $datedir/$short_ud/ .'");
-    }
 
     if ( $cachebuild and $Settings::ReleaseToLatest ) {
       push(@cmds,"ssh $ssh_opts -l $Settings::ssh_user $ssh_server  rsync -avz $complete_remote_path/ $remote_path/latest-$Settings::milestone/");
     }
+
+    if ( $cachebuild ) {
+      push(@cmds,"ssh $ssh_opts -l $Settings::ssh_user $ssh_server 'cd $remote_path && ln -s $datedir/$short_ud/ .'");
+    }
   } elsif ( $Settings::ReleaseToLatest ) {
     push(@cmds,"ssh $ssh_opts -l $Settings::ssh_user $ssh_server mkdir -p $remote_path/latest-$Settings::milestone");
     push(@cmds,"scp $scp_opts -r $upload_directory/. $Settings::ssh_user\@$ssh_

So the symlink will still fail if the dir already exists, but it happens last and tinderbox doesn't care about the exit status of the script. I tidyied up any builds that didn't make it to latest-* because of this.

A better solution will be forthcoming.

Comment 6

11 years ago
Nick, this line:

      push(@cmds,"ssh $ssh_opts -l $Settings::ssh_user $ssh_server 'cd $remote_path && ln -s $datedir/$short_ud/ .'");

results in links being created with targets like:

2007/10//2007-10-11-02-1.0-M1.8.0/

The doubled-up slash and trailing slash are ugly and unnecessary.  $datedir already has a trailing slash if it has anything at all, and if $datedir is empty, the link will reference /$short_ud (in the root directory), which is wrong.  The trailing slash?  Well, that's just ugly.  The command could be, without the extra slashes:

ln -s $datedir$short_ud .
(Assignee)

Comment 7

11 years ago
Created attachment 284841 [details] [diff] [review]
Test for existing symlink first

This patch adds a shell test for the existence of the link before calling ln, and addresses mento's comments. 

I've tested this end-to-end using a linux box, where you get an upload-packages.sh which contains the like of:

echo ssh -2 -l cltbld stage.mozilla.org 'cd /home/ftp/pub/thunderbird/nightly/experimental/stage-migration && if [ ! -h 2007-10-12-12-mozilla1.8 ]; then ln -s 2007/10/2007-10-12-12-mozilla1.8 .; fi'
ssh -2 -l cltbld stage.mozilla.org 'cd /home/ftp/pub/thunderbird/nightly/experimental/stage-migration && if [ ! -h 2007-10-12-12-mozilla1.8 ]; then ln -s 2007/10/2007-10-12-12-mozilla1.8 .; fi'
if [ $? != 0 ]; then
  echo "command failed!"
  exit 1
fi
echo

The adjusted command also works from a prompt on a Windows MSYS box.
Attachment #284841 - Flags: review?(mozbugs)

Comment 8

11 years ago
Comment on attachment 284841 [details] [diff] [review]
Test for existing symlink first


>-    if ( $cachebuild ) {
>-      push(@cmds,"ssh $ssh_opts -l $Settings::ssh_user $ssh_server 'cd $remote_path && ln -s $datedir/$short_ud/ .'");
>+    if ( $cachebuild && $datedir ne '') {
>+      push(@cmds,"ssh $ssh_opts -l $Settings::ssh_user $ssh_server 'cd $remote_path && if [ ! -h $short_ud ]; then ln -s $datedir$short_ud .; fi'");

Bleh. Looks fine, but... bleh. :-)

This is completely a stylistic thing... but "$datedir/$short_ud/" becoming "$datedir$short_ud"... is kinda hard to read.

I know that $datedir has a '/' at the end... so maybe ${datedir}${short_ud}? Or maybe just keep the multiple slashes? I'm torn here... and the answer might be "Get over it," which... would probably be fine. :-)
Attachment #284841 - Flags: review?(mozpreed) → review+
(Assignee)

Comment 9

11 years ago
Landed with the ${datedir}${short_ud} mod. Will verify that builds get to the server before resolving.
Status: ASSIGNED → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → FIXED
(Assignee)

Comment 10

11 years ago
Bah, I'll mark this VERIFIED after the checks instead.
Product: mozilla.org → Release Engineering
You need to log in before you can comment on or make changes to this bug.