Skip to content

Commit a29d0fb

Browse files
committed
docker updates
1 parent 3f09f79 commit a29d0fb

File tree

3 files changed

+43
-21
lines changed

3 files changed

+43
-21
lines changed

docs/13-docker.mdx

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,12 @@ RUN apk update \
104104
&& apk add curl \
105105
&& apk add tzdata \
106106
&& apk add openjdk17-jre
107+
108+
# Run as a non root gwen user
109+
RUN addgroup -S gwen && adduser -S gwen -G gwen -u 4936
110+
USER gwen
111+
RUN mkdir -p ~/Downloads
112+
RUN mkdir -p ~/.assets
107113
```
108114

109115
### Docker compose file
@@ -123,8 +129,8 @@ services:
123129
node-docker:
124130
image: selenium/node-docker:4
125131
volumes:
126-
- $PWD/gwen/output/.assets:/opt/selenium/assets
127-
- $PWD/gwen/output/downloads:/home/seluser/Downloads
132+
- assets:/opt/selenium/assets
133+
- downloads:/home/seluser/Downloads
128134
- $PWD/gwen/conf/browsers/grid.toml:/opt/selenium/docker.toml
129135
- /var/run/docker.sock:/var/run/docker.sock
130136
depends_on:
@@ -166,7 +172,9 @@ services:
166172
- NO_COLOR
167173
- TZ
168174
volumes:
169-
- "$PWD:/project"
175+
- $PWD:/project
176+
- assets:/home/gwen/.assets
177+
- downloads:/home/gwen/Downloads
170178
working_dir: /project
171179
command: bash -c "yarn install && yarn gwen -b -c gwen/conf/browsers/grid.conf gwen/features"
172180

@@ -183,6 +191,10 @@ services:
183191
- "$PWD:/project"
184192
working_dir: /project
185193
command: bash -c "yarn install && yarn gwen -bn --parallel gwen/features"
194+
195+
volumes:
196+
assets:
197+
downloads:
186198
```
187199
188200
It will also create a `gwen/docker-compose-arm.toml` file for ARMs, with the only difference being the toml file mapping.
@@ -245,7 +257,7 @@ host-config-keys = ["Dns", "DnsOptions", "DnsSearch", "ExtraHosts", "Binds", "Mo
245257
url = "http://127.0.0.1:2375"
246258

247259
# Docker image used for video recording
248-
video-image = "selenium/video:ffmpeg-6.1-20231219"
260+
video-image = "selenium/video:ffmpeg-7.1-20250101"
249261

250262
# Uncomment the following section if you are running the node on a separate VM
251263
# Fill out the placeholders with appropriate values
@@ -293,6 +305,10 @@ gwen {
293305
}
294306
}
295307
}
308+
video {
309+
dir = "$<user.home>/.assets/$<gwen.web.sessionId>"
310+
timeoutSecs = 10
311+
}
296312
}
297313
```
298314

docs/32-jenkins.mdx

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ pipeline {
8080
choice(name: 'process', choices: [''], description: 'Target process')
8181
choice(name: 'browser', choices: ['chrome', 'firefox', 'edge'], description: 'Target web browser')
8282
booleanParam(name: 'dry_run', defaultValue: false, description: 'Validate without executing')
83-
booleanParam(name: 'parallel', defaultValue: false, description: 'Enable parallel execution')
83+
booleanParam(name: 'parallel', defaultValue: false, description: 'Enable parallel batch execution across cores')
8484
choice(name: 'threads', choices: ['auto', '2', '4', '8', '12', '16', '24', '32', '48', '64'], description: 'Number of parallel threads (auto = one thread per available core)')
8585
booleanParam(name: 'headless', defaultValue: false, description: 'Enable headless browser')
86-
booleanParam(name: 'video', defaultValue: true, description: 'Enable video capture (not available with parallel or headless)')
86+
booleanParam(name: 'video', defaultValue: false, description: 'Enable video recording')
8787
}
8888
environment {
8989
GWEN_ENV = "${params.env}"
@@ -99,37 +99,43 @@ pipeline {
9999
stage("Prepare") {
100100
steps {
101101
script {
102+
// Clean up docker
103+
sh 'docker rm -f $(docker ps -a -q) || true'
104+
sh 'docker volume rm gwen_assets gwen_downloads || true'
102105
// Prepare output dir
103-
sh 'mkdir -p gwen/output'
104106
sh 'rm -rf gwen/output/**'
107+
sh 'mkdir -p gwen/output'
105108
}
106109
}
107110
}
108111
stage("Gwen") {
109112
steps {
110-
try {
111-
// Spin up environment and execute Gwen in docker
112-
sh "docker-compose -p ${env.BUILD_TAG.toLowerCase()} -f gwen/docker-compose.yml run gwen"
113-
if (!fileExists('gwen/output/reports/html/index.html')) {
114-
error 'Evaluation report not generated'
115-
}
116-
} catch(err) {
117-
if (fileExists('gwen/output/reports/html/index.html')) {
118-
unstable 'Gwen completed with failure(s) reported.'
119-
} else {
120-
error "Gwen failed to execute or complete: ${err.getMessage()}"
113+
script {
114+
try {
115+
// Spin up environment and execute Gwen in docker
116+
sh "docker-compose -f gwen/docker-compose.yml -p ${env.BUILD_TAG.toLowerCase()} run gwen"
117+
if (!fileExists('gwen/output/reports/html/index.html')) {
118+
error 'Evaluation report not generated'
119+
}
120+
} catch(err) {
121+
if (fileExists('gwen/output/reports/html/index.html')) {
122+
unstable 'Gwen completed with failure(s) reported.'
123+
} else {
124+
error "Gwen failed to execute or complete: ${err.getMessage()}"
125+
}
121126
}
122127
}
123128
}
124129
post {
125130
always {
126-
sh "docker-compose -p ${env.BUILD_TAG.toLowerCase()} -f gwen/docker-compose.yml down || true"
127-
archiveArtifacts artifacts: 'gwen/output/reports/**'
131+
sh "docker-compose -f gwen/docker-compose.yml -p ${env.BUILD_TAG.toLowerCase()} down || true"
132+
sh 'docker rm -f $(docker ps -a -q) || true'
133+
sh 'docker volume rm gwen_assets gwen_downloads || true'
128134
publishHTML(target: [
129135
allowMissing : true,
130136
alwaysLinkToLastBuild : false,
131137
keepAll : true,
132-
reportDir : "gwen/output/reports/html",
138+
reportDir : 'gwen/output/reports/html',
133139
reportFiles : 'index.html',
134140
reportName : "Gwen-Report"
135141
])

static/videos/features-todo.mp4

-4.59 KB
Binary file not shown.

0 commit comments

Comments
 (0)