-
Notifications
You must be signed in to change notification settings - Fork 46
Dockerize WPT runs & add Jenkins k8s specs #153
Conversation
42eb5c3
to
e39e1f9
Compare
889b7b2
to
ef904ad
Compare
@mdittmer has ramped up on Docker recently - will get him to eyeball this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly requests for documentation and admissions of ignorance on my part.
ci_container.sh
Outdated
@@ -0,0 +1,8 @@ | |||
IMAGE_NAME=wptd-testrun-jenkins | |||
|
|||
docker build -t $IMAGE_NAME . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: "${IMAGE_NAME}"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Why is the bare $IMAGE_NAME
undesirable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it ever contained spaces or special characters, then the meaning of the command would change.
ci_container.sh
Outdated
|
||
docker run \ | ||
-p 4445:4445 \ | ||
--entrypoint "/bin/bash" $IMAGE_NAME \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
libdbus-glib-1-2 | ||
|
||
RUN mkdir /wptdashboard | ||
ADD . /wptdashboard |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think our base image should only include dependency installation and possibly some general environment setup (i.e., exclude ADD
here and RUN
below). Could we have a Dockerfile.jenkins
or something for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would the base image be used for other than test runs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To test our code, to run a dev server for compiling protos, and/or to deploy modules to other environments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Splitting into multiple Dockerfiles sounds reasonable, but for the sake of simplicity let's start with this one and as the scope is expanded with each PR we can split them up as necessary.
ci_container.sh
Outdated
@@ -0,0 +1,8 @@ | |||
IMAGE_NAME=wptd-testrun-jenkins | |||
|
|||
docker build -t $IMAGE_NAME . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May need more flags if we want to build from Dockerfile.jenkins
or similar.
ci_container.sh
Outdated
@@ -0,0 +1,8 @@ | |||
IMAGE_NAME=wptd-testrun-jenkins | |||
|
|||
docker build -t $IMAGE_NAME . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we incorporate a version number here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The image we push for the Jenkins bots to pull needs to have a constant name (otherwise updating the image will require changing the version in Jenkins).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the standard practice for this is to version images, and then use a :latest
version/tag for use cases such as that. We could also use a version name like :jenkins
if we want.
p.communicate(input=patch) | ||
|
||
|
||
def get_and_validate_platform(wptd_path): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documentation plz 😸
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
run/jenkins.py
Outdated
|
||
|
||
def report_to_summary(wpt_report): | ||
test_files = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto: Show me the docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
run/jenkins.py
Outdated
|
||
|
||
def report_to_summary(wpt_report): | ||
test_files = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should there be code sharing between this file and run.py
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(see above - this file is meant to replace run.py)
run/jenkins.py
Outdated
for result in wpt_report['results']: | ||
test_file = result['test'] | ||
assert test_file not in test_files, ( | ||
'Assumption that each test_file only shows up once broken!') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More context? Which key showed up twice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My apologies; my comment wasn't clear. My intention was that the assertion error message should contain more context (such as the value of test_file
).
run/jenkins.py
Outdated
assert test_file not in test_files, ( | ||
'Assumption that each test_file only shows up once broken!') | ||
|
||
if result['status'] in ('OK', 'PASS'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a schema somewhere we could lift legitimate values from? (I'm assuming not, but on the off chance there is...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A schema for the possible test results? I'm not sure. This line in particular should probably have a discussion bug filed for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that is what I was asking: does WPT define the data format for its results (including this particular bit of the results).
Addressed your feedback, thanks for taking a look @mdittmer |
util/ci_container_inner.sh
Outdated
@@ -6,6 +6,8 @@ export WPT_PATH=/web-platform-tests | |||
|
|||
git clone --depth 1 https://github.com/w3c/web-platform-tests $WPT_PATH | |||
|
|||
sudo chown -R $(whoami):$(whoami) $HOME |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer $(id -u $USER):$(id -g $USER)
in case group not named after user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, thanks
Ok - I addressed the latest round of feedback. I'm going to go ahead and land this so we have something common to build off of. This is a massive change to our running infra and I think landing this now and following up with incremental improvement PRs is the way to go. 💯 |
This reverts commit 17eb327. Conflicts in run/jenkins.py resolved by deleting it (some commits touching jenkins.py after the reverted commit not reverted.)
This PR introduces a number of big changes:
Dockerfile
for generating a container capable of running any browser of WPT we currently run--install-browser
k8s/
) for setting up a Jenkins instance (https://ci.wpt.fyi)Future work after this lands (I will make bugs for these):
--install-browser
for Chrome)run/run.py
once Chrome support landsMore context around this work is described in this comment: #164 (comment)