Skip to content

Commit

Permalink
fix(agent): fixing agent image for playwrightt
Browse files Browse the repository at this point in the history
  • Loading branch information
xoscar committed Jul 8, 2024
1 parent 90116ff commit 5cd3fd6
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 11 deletions.
23 changes: 23 additions & 0 deletions Dockerfile.agent
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,29 @@ COPY ./tracetest /app/tracetest
COPY ./agent/entrypoint.sh /app/entrypoint.sh
RUN chmod +x /app/entrypoint.sh

USER root
RUN echo "https://dl-cdn.alpinelinux.org/alpine/edge/main" > /etc/apk/repositories \
&& echo "https://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories \
&& echo "https://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \
&& echo "https://dl-cdn.alpinelinux.org/alpine/v3.16/main" >> /etc/apk/repositories \
&& echo "https://dl-cdn.alpinelinux.org/alpine/v3.16/community" \
&& apk upgrade -U -a \
&& apk add \
libstdc++ \
chromium \
harfbuzz \
nss \
freetype \
ttf-freefont \
font-noto-emoji \
wqy-zenhei \
&& rm -rf /var/cache/* \
&& mkdir /var/cache/apk

# Playwright
ENV PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH=/usr/lib/chromium/chromium \
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1

# Setup additional runtimes used by triggers
RUN apk add nodejs npm

Expand Down
13 changes: 2 additions & 11 deletions agent/workers/trigger/playwrightengine.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,23 +81,14 @@ func start(traceId, spanId, url, method string) (string, error) {
return "", err
}

res, err := execCommand(
app,
"playwright",
"install",
)

if err != nil {
return "", fmt.Errorf("error installing playwright: %s, %w", res, err)
}

path, err := filepath.Abs(fmt.Sprintf("%s/%s", wd, scriptPath))
if err != nil {
return "", err
}

res, err = execCommand(
res, err := execCommand(
app,
"--yes",
libName,
"--scriptPath",
path,
Expand Down

0 comments on commit 5cd3fd6

Please sign in to comment.