Skip to content

Commit 63689e3

Browse files
authored
devops: prepare buildbots to the introduction of Ubuntu 20.04 builder (#3116)
This patch: - specializes "linux" scripts into "Ubuntu 18.04" scripts - renames all future linux blobs on CDN: * `firefox-linux.zip => firefox-ubuntu-18.04.zip` * `minibrowser-gtk.zip => minibrowser-gtk-ubuntu-18.04.zip` * `minibrowser-wpe.zip => minibrowser-wpe-ubuntu-18.04.zip` * `minibrowser-gtk-wpe.zip => minibrowser-gtk-wpe-ubuntu-18.04.zip` - updates downloader to deal with the new names References #2745
1 parent 2bed312 commit 63689e3

File tree

5 files changed

+74
-39
lines changed

5 files changed

+74
-39
lines changed

browser_patches/buildbots/buildbot-linux.sh renamed to browser_patches/buildbots/buildbot-ubuntu-18.04.sh

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ if [[ $(uname) != "Linux" ]]; then
77
exit 1
88
fi
99

10+
CURRENT_HOST_OS="$(bash -c 'source /etc/os-release && echo $NAME')"
11+
CURRENT_HOST_OS_VERSION="$(bash -c 'source /etc/os-release && echo $VERSION_ID')"
12+
13+
if [[ "$CURRENT_HOST_OS" != "Ubuntu" || "$CURRENT_HOST_OS_VERSION" != "18.04" ]]; then
14+
echo "ERROR: this script is designed to be run on Ubuntu 18.04. Can't run on $CURRENT_HOST_OS $CURRENT_HOST_OS_VERSION"
15+
exit 1
16+
fi
17+
1018
if [[ ($1 == '--help') || ($1 == '-h') ]]; then
1119
echo "usage: $(basename $0)"
1220
echo
@@ -55,9 +63,9 @@ if [[ -n $(git status -s) ]]; then
5563
fi
5664

5765
git pull origin master
58-
../checkout_build_archive_upload.sh firefox-linux >/tmp/$(basename $0)--firefox-linux.log || true
66+
../checkout_build_archive_upload.sh firefox-ubuntu-18.04 >/tmp/$(basename $0)--firefox.log || true
5967

6068
git pull origin master
61-
../checkout_build_archive_upload.sh webkit-gtk >/tmp/$(basename $0)--webkit-gtk.log || true
62-
../checkout_build_archive_upload.sh webkit-wpe >/tmp/$(basename $0)--webkit-wpe.log || true
63-
../checkout_build_archive_upload.sh webkit-gtk-wpe >/tmp/$(basename $0)--webkit-gtk-wpe.log || true
69+
../checkout_build_archive_upload.sh webkit-gtk-ubuntu-18.04 >/tmp/$(basename $0)--webkit-gtk.log || true
70+
../checkout_build_archive_upload.sh webkit-wpe-ubuntu-18.04 >/tmp/$(basename $0)--webkit-wpe.log || true
71+
../checkout_build_archive_upload.sh webkit-gtk-wpe-ubuntu-18.04 >/tmp/$(basename $0)--webkit-gtk-wpe.log || true

browser_patches/checkout_build_archive_upload.sh

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ CURRENT_HOST_OS="$(uname)"
2525
CURRENT_HOST_OS_VERSION=""
2626
if [[ "$CURRENT_HOST_OS" == "Darwin" ]]; then
2727
CURRENT_HOST_OS_VERSION=$(sw_vers -productVersion | grep -o '^\d\+.\d\+')
28+
elif [[ "$CURRENT_HOST_OS" == "Linux" ]]; then
29+
CURRENT_HOST_OS="$(bash -c 'source /etc/os-release && echo $NAME')"
30+
CURRENT_HOST_OS_VERSION="$(bash -c 'source /etc/os-release && echo $VERSION_ID')"
2831
fi
2932

3033
BROWSER_NAME=""
@@ -34,10 +37,11 @@ BUILD_FLAVOR="$1"
3437
BUILD_BLOB_NAME=""
3538
EXPECTED_HOST_OS=""
3639
EXPECTED_HOST_OS_VERSION=""
37-
if [[ "$BUILD_FLAVOR" == "firefox-linux" ]]; then
40+
if [[ "$BUILD_FLAVOR" == "firefox-ubuntu-18.04" ]]; then
3841
BROWSER_NAME="firefox"
39-
EXPECTED_HOST_OS="Linux"
40-
BUILD_BLOB_NAME="firefox-linux.zip"
42+
EXPECTED_HOST_OS="Ubuntu"
43+
EXPECTED_HOST_OS_VERSION="18.04"
44+
BUILD_BLOB_NAME="firefox-ubuntu-18.04.zip"
4145
elif [[ "$BUILD_FLAVOR" == "firefox-mac" ]]; then
4246
BROWSER_NAME="firefox"
4347
EXPECTED_HOST_OS="Darwin"
@@ -52,22 +56,25 @@ elif [[ "$BUILD_FLAVOR" == "firefox-win64" ]]; then
5256
EXTRA_BUILD_ARGS="--win64"
5357
EXPECTED_HOST_OS="MINGW"
5458
BUILD_BLOB_NAME="firefox-win64.zip"
55-
elif [[ "$BUILD_FLAVOR" == "webkit-gtk" ]]; then
59+
elif [[ "$BUILD_FLAVOR" == "webkit-gtk-ubuntu-18.04" ]]; then
5660
BROWSER_NAME="webkit"
5761
EXTRA_BUILD_ARGS="--gtk"
5862
EXTRA_ARCHIVE_ARGS="--gtk"
59-
EXPECTED_HOST_OS="Linux"
60-
BUILD_BLOB_NAME="minibrowser-gtk.zip"
61-
elif [[ "$BUILD_FLAVOR" == "webkit-wpe" ]]; then
63+
EXPECTED_HOST_OS="Ubuntu"
64+
EXPECTED_HOST_OS_VERSION="18.04"
65+
BUILD_BLOB_NAME="minibrowser-gtk-ubuntu-18.04.zip"
66+
elif [[ "$BUILD_FLAVOR" == "webkit-wpe-ubuntu-18.04" ]]; then
6267
BROWSER_NAME="webkit"
6368
EXTRA_BUILD_ARGS="--wpe"
6469
EXTRA_ARCHIVE_ARGS="--wpe"
65-
EXPECTED_HOST_OS="Linux"
66-
BUILD_BLOB_NAME="minibrowser-wpe.zip"
67-
elif [[ "$BUILD_FLAVOR" == "webkit-gtk-wpe" ]]; then
70+
EXPECTED_HOST_OS="Ubuntu"
71+
EXPECTED_HOST_OS_VERSION="18.04"
72+
BUILD_BLOB_NAME="minibrowser-wpe-ubuntu-18.04.zip"
73+
elif [[ "$BUILD_FLAVOR" == "webkit-gtk-wpe-ubuntu-18.04" ]]; then
6874
BROWSER_NAME="webkit"
69-
EXPECTED_HOST_OS="Linux"
70-
BUILD_BLOB_NAME="minibrowser-gtk-wpe.zip"
75+
EXPECTED_HOST_OS="Ubuntu"
76+
EXPECTED_HOST_OS_VERSION="18.04"
77+
BUILD_BLOB_NAME="minibrowser-gtk-wpe-ubuntu-18.04.zip"
7178
elif [[ "$BUILD_FLAVOR" == "webkit-win64" ]]; then
7279
BROWSER_NAME="webkit"
7380
EXPECTED_HOST_OS="MINGW"
@@ -136,7 +143,7 @@ fi
136143

137144
function generate_and_upload_browser_build {
138145
# webkit-gtk-wpe is a special build doesn't need to be built.
139-
if [[ "$BUILD_FLAVOR" == "webkit-gtk-wpe" ]]; then
146+
if [[ "$BUILD_FLAVOR" == webkit-gtk-wpe-* ]]; then
140147
echo "-- combining binaries together"
141148
if ! ./webkit/download_gtk_and_wpe_and_zip_together.sh $ZIP_PATH; then
142149
return 10

browser_patches/firefox/BUILD_NUMBER

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
1138
2-
Changed: yurys@chromium.org Wed Jul 22 18:07:07 PDT 2020
1+
1139
2+
Changed: lushnikov@chromium.org Thu Jul 23 09:56:07 PDT 2020

browser_patches/webkit/BUILD_NUMBER

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
1314
2-
Changed: yurys@chromium.org Thu Jul 23 09:31:18 PDT 2020
1+
1315
2+
Changed: lushnikov@chromium.org Thu Jul 23 09:56:07 PDT 2020

src/install/browserFetcher.ts

Lines changed: 38 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const ENV_DOWNLOAD_HOSTS: { [key: string]: string } = {
5555
webkit: 'PLAYWRIGHT_WEBKIT_DOWNLOAD_HOST',
5656
};
5757

58-
function getDownloadUrl(browserName: BrowserName, platform: BrowserPlatform): string | undefined {
58+
function getDownloadUrl(browserName: BrowserName, revision: number, platform: BrowserPlatform): string | undefined {
5959
if (browserName === 'chromium') {
6060
return new Map<BrowserPlatform, string>([
6161
['linux', '%s/chromium-browser-snapshots/Linux_x64/%d/chrome-linux.zip'],
@@ -68,31 +68,51 @@ function getDownloadUrl(browserName: BrowserName, platform: BrowserPlatform): st
6868
}
6969

7070
if (browserName === 'firefox') {
71-
return new Map<BrowserPlatform, string>([
72-
['linux', '%s/builds/firefox/%s/firefox-linux.zip'],
73-
['mac10.13', '%s/builds/firefox/%s/firefox-mac.zip'],
74-
['mac10.14', '%s/builds/firefox/%s/firefox-mac.zip'],
75-
['mac10.15', '%s/builds/firefox/%s/firefox-mac.zip'],
76-
['win32', '%s/builds/firefox/%s/firefox-win32.zip'],
77-
['win64', '%s/builds/firefox/%s/firefox-win64.zip'],
78-
]).get(platform);
71+
const FIREFOX_RENAME_LINUX_TO_UBUNTU_REVISION = 1139;
72+
return revision < FIREFOX_RENAME_LINUX_TO_UBUNTU_REVISION ?
73+
new Map<BrowserPlatform, string>([
74+
['linux', '%s/builds/firefox/%s/firefox-linux.zip'],
75+
['mac10.13', '%s/builds/firefox/%s/firefox-mac.zip'],
76+
['mac10.14', '%s/builds/firefox/%s/firefox-mac.zip'],
77+
['mac10.15', '%s/builds/firefox/%s/firefox-mac.zip'],
78+
['win32', '%s/builds/firefox/%s/firefox-win32.zip'],
79+
['win64', '%s/builds/firefox/%s/firefox-win64.zip'],
80+
]).get(platform) :
81+
new Map<BrowserPlatform, string>([
82+
['linux', '%s/builds/firefox/%s/firefox-ubuntu-18.04.zip'],
83+
['mac10.13', '%s/builds/firefox/%s/firefox-mac.zip'],
84+
['mac10.14', '%s/builds/firefox/%s/firefox-mac.zip'],
85+
['mac10.15', '%s/builds/firefox/%s/firefox-mac.zip'],
86+
['win32', '%s/builds/firefox/%s/firefox-win32.zip'],
87+
['win64', '%s/builds/firefox/%s/firefox-win64.zip'],
88+
]).get(platform);
7989
}
8090

8191
if (browserName === 'webkit') {
82-
return new Map<BrowserPlatform, string | undefined>([
83-
['linux', '%s/builds/webkit/%s/minibrowser-gtk-wpe.zip'],
84-
['mac10.13', undefined],
85-
['mac10.14', '%s/builds/webkit/%s/minibrowser-mac-10.14.zip'],
86-
['mac10.15', '%s/builds/webkit/%s/minibrowser-mac-10.15.zip'],
87-
['win32', '%s/builds/webkit/%s/minibrowser-win64.zip'],
88-
['win64', '%s/builds/webkit/%s/minibrowser-win64.zip'],
89-
]).get(platform);
92+
const WEBKIT_RENAME_LINUX_TO_UBUNTU_REVISION = 1315;
93+
return revision < WEBKIT_RENAME_LINUX_TO_UBUNTU_REVISION ?
94+
new Map<BrowserPlatform, string | undefined>([
95+
['linux', '%s/builds/webkit/%s/minibrowser-gtk-wpe.zip'],
96+
['mac10.13', undefined],
97+
['mac10.14', '%s/builds/webkit/%s/minibrowser-mac-10.14.zip'],
98+
['mac10.15', '%s/builds/webkit/%s/minibrowser-mac-10.15.zip'],
99+
['win32', '%s/builds/webkit/%s/minibrowser-win64.zip'],
100+
['win64', '%s/builds/webkit/%s/minibrowser-win64.zip'],
101+
]).get(platform) :
102+
new Map<BrowserPlatform, string | undefined>([
103+
['linux', '%s/builds/webkit/%s/minibrowser-gtk-wpe-ubuntu-18.04.zip'],
104+
['mac10.13', undefined],
105+
['mac10.14', '%s/builds/webkit/%s/minibrowser-mac-10.14.zip'],
106+
['mac10.15', '%s/builds/webkit/%s/minibrowser-mac-10.15.zip'],
107+
['win32', '%s/builds/webkit/%s/minibrowser-win64.zip'],
108+
['win64', '%s/builds/webkit/%s/minibrowser-win64.zip'],
109+
]).get(platform);
90110
}
91111
}
92112

93113
function revisionURL(browser: BrowserDescriptor, platform = browserPaths.hostPlatform): string {
94114
const serverHost = getFromENV(ENV_DOWNLOAD_HOSTS[browser.name]) || getFromENV(ENV_DOWNLOAD_HOSTS.default) || DEFAULT_DOWNLOAD_HOSTS[browser.name];
95-
const urlTemplate = getDownloadUrl(browser.name, platform);
115+
const urlTemplate = getDownloadUrl(browser.name, parseInt(browser.revision, 10), platform);
96116
assert(urlTemplate, `ERROR: Playwright does not support ${browser.name} on ${platform}`);
97117
return util.format(urlTemplate, serverHost, browser.revision);
98118
}

0 commit comments

Comments
 (0)