From d280647092914ad6094005e9b497eeac0b8999e8 Mon Sep 17 00:00:00 2001 From: Arthur Zucker Date: Tue, 21 May 2024 16:50:18 +0200 Subject: [PATCH] updated --- .circleci/config.yml | 11 +++++------ .circleci/create_circleci_config.py | 4 ++++ .github/workflows/build-ci-docker-images.yml | 14 +++++++++----- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 31866259a80393..14a12f26da6c39 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,7 +13,6 @@ on: workflows: [" Build pr ci-docker"] types: - completed - - skipped jobs: # Ensure running with CircleCI/huggingface @@ -33,11 +32,11 @@ jobs: fetch_tests: working_directory: ~/transformers docker: - - image: | - if [contains(github.event.head_commit.message, '[build-ci-image]')]; then - huggingface/transformers-quality:dev - else - huggingface/transformers-quality + - image: huggingface/transformers-quality + + environment: + GIT_COMMIT_MESSAGE: << pipeline.trigger_parameters.gitlab.repo_name >> + parallelism: 1 steps: - checkout diff --git a/.circleci/create_circleci_config.py b/.circleci/create_circleci_config.py index 8b6a773ee435c0..7d7370c67d3930 100644 --- a/.circleci/create_circleci_config.py +++ b/.circleci/create_circleci_config.py @@ -72,6 +72,10 @@ def __post_init__(self): if self.docker_image is None: # Let's avoid changing the default list and make a copy. self.docker_image = copy.deepcopy(DEFAULT_DOCKER_IMAGE) + else: + # BIG HACK WILL REMOVE ONCE FETCHER IS UPDATED + if "[build-ci-image]" in os.environ.get("GIT_COMMIT_MESSAGE", ""): + self.docker_image += ":dev" if self.install_steps is None: self.install_steps = [] if self.pytest_options is None: diff --git a/.github/workflows/build-ci-docker-images.yml b/.github/workflows/build-ci-docker-images.yml index 9ddc7d2c6f5d69..441a4c25e6664f 100644 --- a/.github/workflows/build-ci-docker-images.yml +++ b/.github/workflows/build-ci-docker-images.yml @@ -30,6 +30,14 @@ jobs: continue-on-error: true steps: + - + name: Set tag + run: | + if [contains(github.event.head_commit.message, '[build-ci-image]')]; then + echo "huggingface/transformers-quality:dev" >> "$GITHUB_ENV" + else + echo "huggingface/transformers-quality" >> "$GITHUB_ENV" + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -51,8 +59,4 @@ jobs: REF=${{ github.sha }} file: "./docker/${{ matrix.file }}.dockerfile" push: ${{ contains(github.event.head_commit.message, '[push-ci-image]') || github.event_name == 'schedule' }} - tags: | - if [contains(github.event.head_commit.message, '[build-ci-image]')]; then - huggingface/transformers-quality:dev - else - huggingface/transformers-quality \ No newline at end of file + tags: ${{ GITHUB_ENV }} \ No newline at end of file