mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Remove conda usage from the linter docker images Handles part of https://github.com/pytorch/pytorch/issues/148110 Pull Request resolved: https://github.com/pytorch/pytorch/pull/147789 Approved by: https://github.com/atalman
28 lines
597 B
Bash
28 lines
597 B
Bash
#!/bin/bash
|
|
|
|
set -ex
|
|
|
|
if [ -n "${UBUNTU_VERSION}" ]; then
|
|
apt update
|
|
apt-get install -y clang doxygen git graphviz nodejs npm libtinfo5
|
|
fi
|
|
|
|
# Do shallow clone of PyTorch so that we can init lintrunner in Docker build context
|
|
git clone https://github.com/pytorch/pytorch.git --depth 1
|
|
chown -R jenkins pytorch
|
|
|
|
pushd pytorch
|
|
# Install all linter dependencies
|
|
pip install -r requirements.txt
|
|
lintrunner init
|
|
|
|
# Cache .lintbin directory as part of the Docker image
|
|
cp -r .lintbin /tmp
|
|
popd
|
|
|
|
# Node dependencies required by toc linter job
|
|
npm install -g markdown-toc
|
|
|
|
# Cleaning up
|
|
rm -rf pytorch
|