Skip to content

Commit 371adf8

Browse files
author
Mike Kozicki
authored
Merge pull request #3059 from catchpoint/develop
Develop to master
2 parents 6ec9ed3 + ba1e2c3 commit 371adf8

File tree

22 files changed

+550
-513
lines changed

22 files changed

+550
-513
lines changed

docker-compose.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,11 @@ services:
6161
build:
6262
context: .
6363
dockerfile: docker/local/Dockerfile-wptagent
64-
command: python3 wptagent.py -vvvv --xvfb --dockerized --server http://web/work/ --location Test --key 123456789
64+
environment:
65+
- SERVER_URL=http://web/work/
66+
- LOCATION=Test
67+
- KEY=123456789
68+
init: true
6569
#### ####
6670

6771
secrets:

docker/local/Dockerfile-php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM alpine:3.13 as build
1+
FROM alpine:3.18 as build
22

33
ARG FFMPEG_VERSION=4.3.2
44
ARG PREFIX=/opt/ffmpeg
@@ -104,11 +104,13 @@ RUN apk add --no-cache supervisor beanstalkd zip libzip python3 libtheora rtmpdu
104104
&& rm -rf /var/cache/apk/*
105105

106106
COPY --from=build /opt/ffmpeg /opt/ffmpeg
107-
COPY --from=build /usr/lib/libfdk-aac.so.2 /usr/lib/libfdk-aac.so.2
108-
COPY --from=build /usr/lib/librav1e.so.0 /usr/lib/librav1e.so.0
109-
COPY --from=build /usr/lib/libx264.so.157 /usr/lib/libx264.so.157
110-
COPY --from=build /usr/lib/libvpx.so.6 /usr/lib/libvpx.so.6
111-
COPY --from=build /usr/lib/libx265.so.192 /usr/lib/libx265.so.192
107+
COPY --from=build /usr/lib/libssl.so* /usr/lib/
108+
COPY --from=build /usr/lib/libcrypto.so* /usr/lib/
109+
COPY --from=build /usr/lib/libfdk-aac.so* /usr/lib/
110+
COPY --from=build /usr/lib/librav1e.so* /usr/lib/
111+
COPY --from=build /usr/lib/libx264.so* /usr/lib/
112+
COPY --from=build /usr/lib/libvpx.so* /usr/lib/
113+
COPY --from=build /usr/lib/libx265.so* /usr/lib/
112114

113115
COPY docker/local/server/config/fpm-pool.conf /etc/php7/php-fpm.d/www.conf
114116
COPY docker/local/server/config/php.ini /usr/local/etc/php/

docker/local/Dockerfile-wptagent

Lines changed: 40 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -17,53 +17,61 @@
1717
### Recommend to install with "docker build <GITHUB-REPO-LINK> -t TAGNAME",
1818
### grabs the latest copy of WPT and build time on average takes 10 minutes.
1919

20-
FROM ubuntu
20+
FROM ubuntu:22.04 as production
21+
22+
### TIMEZONE INSIDE THE CONTAINER ###
23+
ARG TIMEZONE=UTC
2124

2225
### PREVENTs INTERACTIVE PROMPTS WHILE INSTALLING ###
2326
ARG DEBIAN_FRONTEND=noninteractive
2427

25-
### COPYING ENTIRE DIR TO LOCAL DOCKER /wptagent
26-
#COPY / /wptagent
27-
RUN apt-get update
28-
29-
# Install software
30-
RUN apt-get install -y git
31-
RUN git clone -b master https://github.com/WPO-Foundation/wptagent.git
32-
#COPY docker/linux-headless/entrypoint.sh /wptagent/entrypoint.sh
33-
3428
### UPDATE ###
35-
RUN apt-get update
29+
RUN curl -sL https://deb.nodesource.com/setup_16.x | bash -
30+
RUN apt update
3631

3732
### INSTALL APT-GET LIBS ###
38-
RUN xargs -a /wptagent/.github/workflows/docker-apt-get.txt apt-get install --no-install-recommends --yes
33+
# set default timezone beforehand to avoid user interaction for tzdata package
34+
RUN ln -fs /usr/share/zoneinfo/$TIMEZONE /etc/localtime && apt install -y \
35+
git \
36+
python3 python3-pip python3-ujson \
37+
imagemagick dbus-x11 traceroute software-properties-common psmisc libnss3-tools iproute2 net-tools openvpn \
38+
libtiff5-dev libjpeg-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python3-tk \
39+
python3-dev libavutil-dev libmp3lame-dev libx264-dev yasm autoconf automake build-essential libass-dev libfreetype6-dev libtheora-dev \
40+
libtool libvorbis-dev pkg-config texi2html libtext-unidecode-perl python3-numpy python3-scipy perl \
41+
adb ethtool nodejs cmake git-core libsdl2-dev libva-dev libvdpau-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev texinfo wget \
42+
ttf-mscorefonts-installer fonts-noto fonts-roboto fonts-open-sans ffmpeg npm sudo curl xvfb
43+
44+
# Get WPTAgent for dependecies
45+
RUN git clone -b master https://github.com/WPO-Foundation/wptagent.git
3946

40-
### UPGRADING PIP AND INSTALLING REQUIRED PACKAGES ###
41-
RUN python3 -m pip install --upgrade --user pip && \
42-
python3 -m pip install --user -r /wptagent/.github/workflows/requirements.txt
47+
### UPDATE FONT CACHE ###
48+
RUN fc-cache -f -v
4349

4450
### INSTALLING LIGHTHOUSE FROM NPM ###
4551
RUN npm install -g lighthouse
4652

4753
### INSTALLING CHROME BROWSER ###
48-
### Fails to Find all libs needed to run
49-
# RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && \
50-
# dpkg -i google-chrome-stable_current_amd64.deb; exit 0 && \
51-
# apt -f install -y && \
52-
# apt-get install google-chrome-stable
54+
RUN curl -o /tmp/google-chrome-stable_current_amd64.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && \
55+
apt install -y /tmp/google-chrome-stable_current_amd64.deb && rm /tmp/google-chrome-stable_current_amd64.deb
5356

54-
### BETTER INSTALLING CHROME BROWSER METHOD ###
55-
### Better Installing method but would like to change this to something less complex.
56-
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
57-
&& echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list
58-
RUN apt-get update && apt-get -y install google-chrome-stable ; exit 0
59-
RUN apt-get update --fix-missing -y
60-
RUN apt-get install -f -y
57+
### UPGRADING PIP AND INSTALLING REQUIRED PACKAGES ###
58+
RUN python3 -m pip install --upgrade --user pip && \
59+
python3 -m pip install --user -r /wptagent/.github/workflows/requirements.txt
6160

62-
### CLEAN UP ###
63-
# We could add some clean up here but in testing it was negotiable
61+
WORKDIR /wptagent
6462

63+
ENTRYPOINT ["/bin/sh", "/wptagent/docker/linux-headless/entrypoint.sh"]
6564

66-
WORKDIR /wptagent
65+
### DEBUG CONTAINER ###
66+
# To build the debug container add `--target debug` as a build parameter
67+
FROM production as debug
68+
69+
### INSTALLING DEBUG DEPENDENCIES ###
70+
RUN pip install debugpy
71+
72+
### COPY DEBUG AGENT AND MOVE REAL ONE ###
73+
RUN mv wptagent.py wptagent_starter.py
74+
COPY wptagent_debug.py wptagent.py
6775

68-
### /bin/bash LOCATION OF COMMAND EXECUTION ###
69-
#CMD ["python3","wptagent.py", "-vvvv", "--xvfb", "--server", "http://web/work/", "--location", "Test", "--key", "123456789"]
76+
### SETTING PRODUCTION BUILD AS DEFAULT ###
77+
FROM production

docker/local/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,16 @@ Since the Webpagetest container is packaged with an agent, we first need to stop
4040
```docker-compose.yml
4141
#### DOCKER WPTAGENT - comment this out to run a standalone agent ####
4242
agent:
43-
cap_add:
43+
cap_add: #### Allows traffic shapping
4444
- NET_ADMIN
4545
build:
4646
context: .
4747
dockerfile: docker/local/Dockerfile-wptagent
48-
command: python3 wptagent.py -vvvv --xvfb --dockerized --server http://web/work/ --location Test --key 123456789
48+
environment:
49+
- SERVER_URL=http://web/work/
50+
- LOCATION=Test
51+
- KEY=123456789
52+
init: true
4953
#### ####
5054
```
5155

www/assets/css/account.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ body.theme-b {
218218
.modal-open {
219219
visibility: visible;
220220
display: block;
221-
z-index: 1001;
221+
z-index: 10000001;
222222
background: rgb(244, 244, 244);
223223
box-sizing: border-box;
224224
padding: 5vh;

www/assets/css/pagestyle2.css

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4467,7 +4467,6 @@ h2.light {
44674467

44684468
table.history,
44694469
table.checklist {
4470-
border-collapse: collapse;
44714470
font-size: 0.875em;
44724471
margin: 0;
44734472
}
@@ -4525,7 +4524,7 @@ table.checklist td {
45254524

45264525
.history td.location {
45274526
white-space: nowrap;
4528-
max-width: 10vw;
4527+
max-width: 500px;
45294528
overflow: auto;
45304529
}
45314530

@@ -6675,7 +6674,6 @@ table.pretty {
66756674
margin-left: auto;
66766675
margin-right: auto;
66776676
background-color: #fff;
6678-
border-collapse: collapse;
66796677
border: 0;
66806678
}
66816679

www/assets/images/pat.jpg

96.2 KB
Loading

www/assets/js/site.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ function wptLogout(redirectUrl) {
9898
if (t.hasClass("keep_alive_enabled")) {
9999
return "Click the grade to see the requests that did not have keep-alives enabled";
100100
} else if (t.hasClass("security")) {
101-
return "Click the grade to see the full security score detailed report";
101+
return "Security score";
102102
} else if (t.hasClass("compress_text")) {
103103
return "Click the grade to see the requests that should be gzipped but were not";
104104
} else if (t.hasClass("compress_images")) {

www/grades.inc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@
2828
$lighthouse = $urlGenerator->resultPage("lighthouse");
2929
echo "<li class=\"$check\"><a href=\"$lighthouse\"><h2 class=\"{$grade['class']}\">{$grade['grade']}</h2></a>{$grade['description']}</li>";
3030
} elseif ($check == 'security') {
31-
$snykUrl = "https://snyk.io/test/website-scanner/?test={$id}&utm_medium=referral&utm_source=webpagetest&utm_campaign=website-scanner";
32-
echo "<li class=\"$check\"><a href=\"$snykUrl\"><h2 class=\"{$grade['class']}\">{$grade['grade']}</h2></a>{$grade['description']}</li>";
31+
echo "<li class=\"$check\"><a><h2 class=\"{$grade['class']}\">{$grade['grade']}</h2></a>{$grade['description']}</li>";
3332
} else {
3433
echo "<li class=\"$check\"><a href=\"#$check\"><h2 class=\"{$grade['class']}\">{$grade['grade']}</h2></a>{$grade['description']}</li>";
3534
}

0 commit comments

Comments
 (0)