forked from wandb/weave
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.test
46 lines (36 loc) · 1.75 KB
/
Dockerfile.test
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Should match version in integration_test/package.json
FROM cypress/included:10.11.0 as builder
RUN apt update
RUN apt -y install python3-venv python3-dev gcc g++ xz-utils
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
COPY requirements.* /root/
WORKDIR /root
RUN python3 -m venv venv
RUN --mount=type=cache,target=/root/.cache /bin/bash -c "source venv/bin/activate && \
pip install -r requirements.test.txt -r requirements.dev.txt && \
pip install \"spacy>=3.0.0,<4.0.0\" && python3 -m spacy download en_core_web_sm"
ENTRYPOINT "/bin/bash"
FROM node:18 as js_builder
RUN apt update && apt install -y gcc g++ make libcairo2-dev libjpeg-dev libgif-dev libpango1.0-dev
COPY weave-js /root/weave-js
COPY wb_schema.gql /root/wb_schema.gql
WORKDIR /root/weave-js
RUN --mount=type=cache,target=/usr/local/share/.cache \
SHA1=$(find $JS_DIR -not -path "*/.vite-cache/*" -not -path "*/node_modules/*" -not -path "*/build/*" -type f -print0 | sort -z | xargs -0 sha1sum | sha1sum | cut -d " " -f1) && \
yarn install --frozen-lockfile && \
yarn build && \
echo $SHA1 > ./build/sha1.txt && \
rm -rf node_modules
# final stage
FROM builder
WORKDIR /root
COPY requirements.ecosystem.txt /root
RUN --mount=type=cache,target=/root/.cache /bin/bash -c "source venv/bin/activate && \
pip install -r requirements.ecosystem.txt"
ENV RECORD_REPLAY_DIRECTORY=/root/.replay/
RUN mkdir -p $RECORD_REPLAY_DIRECTORY
COPY integration_test/package.json integration_test/yarn.lock /root/integration_test/
RUN --mount=type=cache,target=/usr/local/share/.cache cd integration_test && yarn install --frozen-lockfile && npx @replayio/cypress install
# TODO, currently builder doesn't support --link
COPY --from=js_builder /root/weave-js/build /root/weave-js-build
ENTRYPOINT "/bin/bash"