-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy pathDockerfile.ecosystem
34 lines (32 loc) · 1.6 KB
/
Dockerfile.ecosystem
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
# [crater](https://github.com/rust-lang/crater)-inspired check that tests against a large number of
# projects, mainly from https://github.com/akx/ruff-usage-aggregate.
#
# We run this in a Docker container as Ruff isn't designed for untrusted inputs.
#
# Either download https://github.com/akx/ruff-usage-aggregate/blob/master/data/known-github-tomls.jsonl as
# `github_search.jsonl` or follow the instructions in the README to scrape your own dataset.
#
# Setup:
# ```
# apt-get install musl-tools # or corresponding command to install musl on your platform, e.g. `yay musl`
# rustup target add x86_64-unknown-linux-musl
# ```
# From the project root:
# ```
# cargo build --target x86_64-unknown-linux-musl
# docker buildx build -f scripts/Dockerfile.ecosystem -t ruff-ecosystem-checker --load .
# docker run --rm -v ./target/x86_64-unknown-linux-musl/debug/ruff:/app/ruff-new -v ./ruff-old:/app/ruff-old ruff-ecosystem-checker
# ```
# You can customize this, e.g. cache the git checkouts, a custom json file and a glibc build:
# ```
# docker run -v ./target/debug/ruff:/app/ruff-new -v ./ruff-old:/app/ruff-old -v ./target/checkouts:/app/checkouts \
# -v ./github_search.jsonl:/app/github_search.jsonl --rm ruff-ecosystem-checker \
# python check_ecosystem.py --verbose ruff-new ruff-old --projects github_search.jsonl --checkouts checkouts \
# > target/ecosystem-ci.txt
# ```
FROM python:3.11
RUN mkdir /app
WORKDIR /app
ADD scripts/check_ecosystem.py check_ecosystem.py
ADD github_search.jsonl github_search.jsonl
CMD ["python", "check_ecosystem.py", "--verbose", "--projects", "github_search.jsonl", "ruff-new", "ruff-old"]