[CI][BE] Move docker forlder to .ci (#93104)

Follow up after https://github.com/pytorch/pytorch/pull/92569

Pull Request resolved: https://github.com/pytorch/pytorch/pull/93104
Approved by: https://github.com/huydhn, https://github.com/seemethere, https://github.com/ZainRizvi
This commit is contained in:
Nikita Shulga
2023-02-03 12:25:30 +00:00
committed by PyTorch MergeBot
parent 6e1cfcdf4b
commit 6c4dc98b9d
49 changed files with 28 additions and 28 deletions

View File

@ -10,7 +10,7 @@ it is very easy to run these tests yourself:
``registry.pytorch.org/pytorch/pytorch-$BUILD_ENVIRONMENT:$DOCKER_VERSION``,
where ``$BUILD_ENVIRONMENT`` is one of the build environments
enumerated in
[pytorch-dockerfiles](https://github.com/pytorch/pytorch/blob/master/.circleci/docker/build.sh). The dockerfile used by jenkins can be found under the `.circle` [directory](https://github.com/pytorch/pytorch/blob/master/.circleci/docker)
[pytorch-dockerfiles](https://github.com/pytorch/pytorch/blob/master/.ci/docker/build.sh). The dockerfile used by jenkins can be found under the `.ci` [directory](https://github.com/pytorch/pytorch/blob/master/.ci/docker)
2. Run ``docker run -it -u jenkins $DOCKER_IMAGE``, clone PyTorch and
run one of the scripts in this directory.

12
.circleci/config.yml generated
View File

@ -47,7 +47,7 @@ commands:
- run:
name: "Calculate docker image hash"
command: |
DOCKER_TAG=$(git rev-parse HEAD:.circleci/docker)
DOCKER_TAG=$(git rev-parse HEAD:.ci/docker)
echo "DOCKER_TAG=${DOCKER_TAG}" >> "${BASH_ENV}"
designate_upload_channel:
@ -1322,12 +1322,12 @@ jobs:
exit 0
fi
# Covers the case where a previous tag doesn't exist for the tree
# this is only really applicable on trees that don't have `.circleci/docker` at its merge base, i.e. nightly
if ! git rev-parse "$(git merge-base HEAD << pipeline.git.base_revision >>):.circleci/docker"; then
echo "Directory '.circleci/docker' not found in tree << pipeline.git.base_revision >>, you should probably rebase onto a more recent commit"
# this is only really applicable on trees that don't have `.ci/docker` at its merge base, i.e. nightly
if ! git rev-parse "$(git merge-base HEAD << pipeline.git.base_revision >>):.ci/docker"; then
echo "Directory '.ci/docker' not found in tree << pipeline.git.base_revision >>, you should probably rebase onto a more recent commit"
exit 1
fi
PREVIOUS_DOCKER_TAG=$(git rev-parse "$(git merge-base HEAD << pipeline.git.base_revision >>):.circleci/docker")
PREVIOUS_DOCKER_TAG=$(git rev-parse "$(git merge-base HEAD << pipeline.git.base_revision >>):ci/docker")
# If no image exists but the hash is the same as the previous hash then we should error out here
if [[ "${PREVIOUS_DOCKER_TAG}" = "${DOCKER_TAG}" ]]; then
echo "ERROR: Something has gone wrong and the previous image isn't available for the merge-base of your branch"
@ -1342,7 +1342,7 @@ jobs:
export AWS_ACCESS_KEY_ID=${CIRCLECI_AWS_ACCESS_KEY_FOR_DOCKER_BUILDER_V1}
export AWS_SECRET_ACCESS_KEY=${CIRCLECI_AWS_SECRET_KEY_FOR_DOCKER_BUILDER_V1}
set -x
cd .circleci/docker && ./build_docker.sh
cd .ci/docker && ./build_docker.sh
##############################################################################
# Workflows
##############################################################################

View File

@ -6,7 +6,7 @@ commands:
- run:
name: "Calculate docker image hash"
command: |
DOCKER_TAG=$(git rev-parse HEAD:.circleci/docker)
DOCKER_TAG=$(git rev-parse HEAD:.ci/docker)
echo "DOCKER_TAG=${DOCKER_TAG}" >> "${BASH_ENV}"
designate_upload_channel:

View File

@ -33,12 +33,12 @@
exit 0
fi
# Covers the case where a previous tag doesn't exist for the tree
# this is only really applicable on trees that don't have `.circleci/docker` at its merge base, i.e. nightly
if ! git rev-parse "$(git merge-base HEAD << pipeline.git.base_revision >>):.circleci/docker"; then
echo "Directory '.circleci/docker' not found in tree << pipeline.git.base_revision >>, you should probably rebase onto a more recent commit"
# this is only really applicable on trees that don't have `.ci/docker` at its merge base, i.e. nightly
if ! git rev-parse "$(git merge-base HEAD << pipeline.git.base_revision >>):.ci/docker"; then
echo "Directory '.ci/docker' not found in tree << pipeline.git.base_revision >>, you should probably rebase onto a more recent commit"
exit 1
fi
PREVIOUS_DOCKER_TAG=$(git rev-parse "$(git merge-base HEAD << pipeline.git.base_revision >>):.circleci/docker")
PREVIOUS_DOCKER_TAG=$(git rev-parse "$(git merge-base HEAD << pipeline.git.base_revision >>):ci/docker")
# If no image exists but the hash is the same as the previous hash then we should error out here
if [[ "${PREVIOUS_DOCKER_TAG}" = "${DOCKER_TAG}" ]]; then
echo "ERROR: Something has gone wrong and the previous image isn't available for the merge-base of your branch"
@ -53,4 +53,4 @@
export AWS_ACCESS_KEY_ID=${CIRCLECI_AWS_ACCESS_KEY_FOR_DOCKER_BUILDER_V1}
export AWS_SECRET_ACCESS_KEY=${CIRCLECI_AWS_SECRET_KEY_FOR_DOCKER_BUILDER_V1}
set -x
cd .circleci/docker && ./build_docker.sh
cd .ci/docker && ./build_docker.sh

View File

@ -43,11 +43,11 @@ runs:
run: |
if [ -n "${IS_XLA}" ]; then
echo "XLA workflow uses pre-built test image at ${XLA_IMAGE_TAG}"
DOCKER_TAG=$(git rev-parse HEAD:.circleci/docker)
DOCKER_TAG=$(git rev-parse HEAD:.ci/docker)
echo "docker-tag=${DOCKER_TAG}" >> "${GITHUB_OUTPUT}"
echo "docker-image=${DOCKER_IMAGE_BASE}:${XLA_IMAGE_TAG}" >> "${GITHUB_OUTPUT}"
else
DOCKER_TAG=$(git rev-parse HEAD:.circleci/docker)
DOCKER_TAG=$(git rev-parse HEAD:.ci/docker)
echo "docker-tag=${DOCKER_TAG}" >> "${GITHUB_OUTPUT}"
echo "docker-image=${DOCKER_IMAGE_BASE}:${DOCKER_TAG}" >> "${GITHUB_OUTPUT}"
fi
@ -75,12 +75,12 @@ runs:
MERGE_BASE=$(git merge-base HEAD "$BASE_REVISION")
fi
# Covers the case where a previous tag doesn't exist for the tree
# this is only really applicable on trees that don't have `.circleci/docker` at its merge base, i.e. nightly
if ! git rev-parse "$MERGE_BASE:.circleci/docker"; then
echo "Directory '.circleci/docker' not found in commit $MERGE_BASE, you should probably rebase onto a more recent commit"
# this is only really applicable on trees that don't have `.ci/docker` at its merge base, i.e. nightly
if ! git rev-parse "$MERGE_BASE:.ci/docker"; then
echo "Directory '.ci/docker' not found in commit $MERGE_BASE, you should probably rebase onto a more recent commit"
exit 1
fi
PREVIOUS_DOCKER_TAG=$(git rev-parse "$MERGE_BASE:.circleci/docker")
PREVIOUS_DOCKER_TAG=$(git rev-parse "$MERGE_BASE:.ci/docker")
# If no image exists but the hash is the same as the previous hash then we should error out here
if [[ "${PREVIOUS_DOCKER_TAG}" = "${DOCKER_TAG}" ]]; then
echo "WARNING: Something has gone wrong and the previous image isn't available for the merge-base of your branch"
@ -103,7 +103,7 @@ runs:
# Skip push if we don't need it, or if specified in the inputs
DOCKER_SKIP_PUSH: ${{ steps.check.outputs.skip_push || inputs.skip_push }}
DOCKER_TAG: ${{ steps.calculate-tag.outputs.docker-tag }}
working-directory: .circleci/docker
working-directory: .ci/docker
shell: bash
run: |
./build_docker.sh

View File

@ -4,7 +4,7 @@
# docs/requirements.txt
# docs/cpp/requirements.txt
# functorch/docs/requirements.txt
# .circleci/docker/requirements-ci.txt
# .ci/docker/requirements-ci.txt
boto3==1.19.12
jinja2==3.0.1
lintrunner==0.9.2

View File

@ -4,7 +4,7 @@ on:
workflow_dispatch:
pull_request:
paths:
- .circleci/docker/**
- .ci/docker/**
- .github/workflows/docker-builds.yml
push:
branches:
@ -13,7 +13,7 @@ on:
- release/*
- landchecks/*
paths:
- .circleci/docker/**
- .ci/docker/**
- .github/workflows/docker-builds.yml
schedule:
- cron: 1 3 * * 3

View File

@ -249,11 +249,11 @@ jobs:
cache-dependency-path: |
**/requirements.txt
**/requirements-flake8.txt
**/.circleci/docker/requirements-ci.txt
**/.ci/docker/requirements-ci.txt
**/.github/requirements-gha-cache.txt
- name: Install dependencies
# mypy and boto3 versions copied from
# .circleci/docker/common/install_conda.sh
# .ci/docker/common/install_conda.sh
run: |
set -eux
pip install -r requirements.txt

View File

@ -27,7 +27,7 @@ jobs:
check-latest: false
cache: pip
cache-dependency-path: |
**/.circleci/docker/requirements-ci.txt
**/.ci/docker/requirements-ci.txt
**/.github/requirements-gha-cache.txt
- name: Install Python Packages

View File

@ -64,7 +64,7 @@ nn/qat/ @jerryzh168
/test/onnx/ @bowenbao @abock
# Docker
/.circleci/docker/ @jeffdaily
/.ci/docker/ @jeffdaily
# Github Actions
# This list is for people wanting to be notified every time there's a change

View File

@ -9,7 +9,7 @@ def get_correct_mypy_version():
# there's probably a more elegant way to do this
match, = re.finditer(
r'mypy==(\d+(?:\.\d+)*)',
(Path(__file__).parent.parent / '.circleci' / 'docker' / 'requirements-ci.txt').read_text(),
(Path(__file__).parent.parent / '.ci' / 'docker' / 'requirements-ci.txt').read_text(),
)
version, = match.groups()
return version