From 8456b84287ffd11b595288dd37b72f4b2d23891b Mon Sep 17 00:00:00 2001 From: Francisco Aranda Date: Tue, 30 Apr 2024 10:42:35 +0200 Subject: [PATCH] ci: Clean and organize workflows --- .../{package.yml => argilla-workflow.yml} | 16 +- .../build-push-dev-frontend-docker.yml | 0 .../{ => argilla}/build-python-package.yml | 0 .../{ => argilla}/check-repo-files.yml | 0 .../{ => argilla}/deploy-environment.yml | 0 .../{ => argilla}/end2end-examples.yml | 2 +- .../{ => argilla}/run-python-tests.yml | 0 .github/workflows/codeql-analysis.yml | 71 -------- .github/workflows/dependency-review.yml | 27 --- ...ose-pr.yml => teardown-pr-environment.yml} | 2 +- .github/workflows/tutorials.yml | 167 ------------------ 11 files changed, 10 insertions(+), 275 deletions(-) rename .github/workflows/{package.yml => argilla-workflow.yml} (92%) rename .github/workflows/{ => argilla}/build-push-dev-frontend-docker.yml (100%) rename .github/workflows/{ => argilla}/build-python-package.yml (100%) rename .github/workflows/{ => argilla}/check-repo-files.yml (100%) rename .github/workflows/{ => argilla}/deploy-environment.yml (100%) rename .github/workflows/{ => argilla}/end2end-examples.yml (98%) rename .github/workflows/{ => argilla}/run-python-tests.yml (100%) delete mode 100644 .github/workflows/codeql-analysis.yml delete mode 100644 .github/workflows/dependency-review.yml rename .github/workflows/{close-pr.yml => teardown-pr-environment.yml} (97%) delete mode 100644 .github/workflows/tutorials.yml diff --git a/.github/workflows/package.yml b/.github/workflows/argilla-workflow.yml similarity index 92% rename from .github/workflows/package.yml rename to .github/workflows/argilla-workflow.yml index 17af47cdd6..330b70af13 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/argilla-workflow.yml @@ -1,4 +1,4 @@ -name: Build package +name: Build Argilla package concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} @@ -34,7 +34,7 @@ jobs: check_repo_files: name: Check source changes if: ${{ !github.event.pull_request.draft }} - uses: ./.github/workflows/check-repo-files.yml + uses: ./.github/workflows/argilla/check-repo-files.yml deployable_check: name: Check if must build & deploy from environment @@ -52,7 +52,7 @@ jobs: run_unit_tests: name: Run unit tests - uses: ./.github/workflows/run-python-tests.yml + uses: ./.github/workflows/argilla/run-python-tests.yml needs: check_repo_files if: needs.check_repo_files.outputs.pythonChanges == 'true' with: @@ -71,7 +71,7 @@ jobs: runsOn: extended-runner name: Run end2end tests - uses: ./.github/workflows/end2end-examples.yml + uses: ./.github/workflows/argilla/end2end-examples.yml needs: check_repo_files if: needs.check_repo_files.outputs.end2endChanges == 'true' with: @@ -82,7 +82,7 @@ jobs: run_integration_tests: name: Run integration tests - uses: ./.github/workflows/run-python-tests.yml + uses: ./.github/workflows/argilla/run-python-tests.yml needs: - check_repo_files - run_unit_tests @@ -138,7 +138,7 @@ jobs: build_python_package: name: Build Argilla python package - uses: ./.github/workflows/build-python-package.yml + uses: ./.github/workflows/argilla/build-python-package.yml needs: - run_unit_tests - run_integration_tests @@ -148,7 +148,7 @@ jobs: build_quickstart_for_develop_docker_image: name: Build Quickstart For Develop docker image - uses: ./.github/workflows/build-push-dev-frontend-docker.yml + uses: ./.github/workflows/argilla/build-push-dev-frontend-docker.yml needs: deployable_check if: needs.deployable_check.outputs.isDeployable == 'true' with: @@ -161,7 +161,7 @@ jobs: deploy_environment: name: Deploy branch environment - uses: ./.github/workflows/deploy-environment.yml + uses: ./.github/workflows/argilla/deploy-environment.yml needs: build_quickstart_for_develop_docker_image if: | !cancelled() && diff --git a/.github/workflows/build-push-dev-frontend-docker.yml b/.github/workflows/argilla/build-push-dev-frontend-docker.yml similarity index 100% rename from .github/workflows/build-push-dev-frontend-docker.yml rename to .github/workflows/argilla/build-push-dev-frontend-docker.yml diff --git a/.github/workflows/build-python-package.yml b/.github/workflows/argilla/build-python-package.yml similarity index 100% rename from .github/workflows/build-python-package.yml rename to .github/workflows/argilla/build-python-package.yml diff --git a/.github/workflows/check-repo-files.yml b/.github/workflows/argilla/check-repo-files.yml similarity index 100% rename from .github/workflows/check-repo-files.yml rename to .github/workflows/argilla/check-repo-files.yml diff --git a/.github/workflows/deploy-environment.yml b/.github/workflows/argilla/deploy-environment.yml similarity index 100% rename from .github/workflows/deploy-environment.yml rename to .github/workflows/argilla/deploy-environment.yml diff --git a/.github/workflows/end2end-examples.yml b/.github/workflows/argilla/end2end-examples.yml similarity index 98% rename from .github/workflows/end2end-examples.yml rename to .github/workflows/argilla/end2end-examples.yml index 7f65d2d5f2..115386a09f 100644 --- a/.github/workflows/end2end-examples.yml +++ b/.github/workflows/argilla/end2end-examples.yml @@ -24,7 +24,7 @@ env: jobs: # Runs depending on the result from the check-repo-files.yml call-check-repo-files: - uses: ./.github/workflows/check-repo-files.yml + uses: ./.github/workflows/argilla/check-repo-files.yml end2end-examples: name: end2end notebook examples, FeedbackDataset for text-classification diff --git a/.github/workflows/run-python-tests.yml b/.github/workflows/argilla/run-python-tests.yml similarity index 100% rename from .github/workflows/run-python-tests.yml rename to .github/workflows/argilla/run-python-tests.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 5e7c22c266..0000000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,71 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL" - -on: - push: - branches: [main, master, releases/*] - pull_request: - # The branches below must be a subset of the branches above - branches: [main, master, releases/*] - schedule: - - cron: "33 6 * * 3" - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: ["javascript", "python"] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] - # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - - # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs - # queries: security-extended,security-and-quality - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v2 - - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun - - # If the Autobuild fails above, remove it and uncomment the following three lines. - # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. - - # - run: | - # echo "Run, Build Application using script" - # ./location_of_script_within_repo/buildscript.sh - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml deleted file mode 100644 index b6d7a8e072..0000000000 --- a/.github/workflows/dependency-review.yml +++ /dev/null @@ -1,27 +0,0 @@ -# Dependency Review Action -# -# This Action will scan dependency manifest files that change as part of a Pull Request, surfacing known-vulnerable versions of the packages declared or updated in the PR. Once installed, if the workflow run is marked as required, PRs introducing known-vulnerable packages will be blocked from merging. -# -# Source repository: https://github.com/actions/dependency-review-action -# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement -name: "Dependency Review" -on: - pull_request: - types: - - opened - - reopened - - synchronize - - ready_for_review - -permissions: - contents: read - -jobs: - dependency-review: - runs-on: ubuntu-latest - if: ${{ !github.event.pull_request.draft }} - steps: - - name: "Checkout Repository" - uses: actions/checkout@v3 - - name: "Dependency Review" - uses: actions/dependency-review-action@v1 diff --git a/.github/workflows/close-pr.yml b/.github/workflows/teardown-pr-environment.yml similarity index 97% rename from .github/workflows/close-pr.yml rename to .github/workflows/teardown-pr-environment.yml index 2d7b2af8eb..3a12d6cdc2 100644 --- a/.github/workflows/close-pr.yml +++ b/.github/workflows/teardown-pr-environment.yml @@ -1,4 +1,4 @@ -name: Close Pull Request +name: Teardown the PR environment on: pull_request: diff --git a/.github/workflows/tutorials.yml b/.github/workflows/tutorials.yml deleted file mode 100644 index 856e331483..0000000000 --- a/.github/workflows/tutorials.yml +++ /dev/null @@ -1,167 +0,0 @@ -name: Tutorials - -on: - workflow_dispatch: - -jobs: - tut1: - name: Active Learning with ModAL - runs-on: ubuntu-latest - defaults: - run: - shell: bash -l {0} - steps: - - name: Checkout Code 🛎 - uses: actions/checkout@v3 - - name: Setup Rubrix - run: | - sed -i 's/rubrix:latest/rubrix:master/' docker-compose.yaml - docker-compose -f "docker-compose.yaml" up -d --build - - name: Setup Conda Env 🐍 - uses: conda-incubator/setup-miniconda@v2 - with: - python-version: 3.8.10 - - name: Install pytest and nbmake - run: pip install pytest nbmake ipywidgets - - name: Install Rubrix - run: pip install -U git+https://github.com/recognai/rubrix.git - - name: Run tutorial - run: pytest --nbmake docs/tutorials/05-active_learning.ipynb - - name: Stop containers - if: always() - run: docker-compose -f "docker-compose.yaml" down - - tut2: - name: News classifier with weak supervision - runs-on: ubuntu-latest - defaults: - run: - shell: bash -l {0} - steps: - - name: Checkout Code 🛎 - uses: actions/checkout@v3 - - name: Setup Rubrix - run: | - sed -i 's/rubrix:latest/rubrix:master/' docker-compose.yaml - docker-compose -f "docker-compose.yaml" up -d --build - - name: Setup Conda Env 🐍 - uses: conda-incubator/setup-miniconda@v2 - with: - python-version: 3.8.10 - - name: Install pytest and nbmake - run: pip install pytest nbmake ipywidgets - - name: Install Rubrix - run: pip install -U git+https://github.com/recognai/rubrix.git - - name: Run tutorial - run: pytest --nbmake docs/tutorials/weak-supervision-with-rubrix.ipynb - - name: Stop containers - if: always() - run: docker-compose -f "docker-compose.yaml" down - - tut3: - name: Find label errors with cleanlab - runs-on: ubuntu-latest - defaults: - run: - shell: bash -l {0} - steps: - - name: Checkout Code 🛎 - uses: actions/checkout@v3 - - name: Setup Rubrix - run: | - sed -i 's/rubrix:latest/rubrix:master/' docker-compose.yaml - docker-compose -f "docker-compose.yaml" up -d --build - - name: Setup Conda Env 🐍 - uses: conda-incubator/setup-miniconda@v2 - with: - python-version: 3.8.10 - - name: Install pytest and nbmake - run: pip install pytest nbmake ipywidgets - - name: Install Rubrix - run: pip install -U git+https://github.com/recognai/rubrix.git - - name: Run tutorial - run: pytest --nbmake docs/tutorials/find_label_errors.ipynb - - name: Stop containers - if: always() - run: docker-compose -f "docker-compose.yaml" down - - tut4: - name: Zero-shot NER with Flair - runs-on: ubuntu-latest - defaults: - run: - shell: bash -l {0} - steps: - - name: Checkout Code 🛎 - uses: actions/checkout@v3 - - name: Setup Rubrix - run: | - sed -i 's/rubrix:latest/rubrix:master/' docker-compose.yaml - docker-compose -f "docker-compose.yaml" up -d --build - - name: Setup Conda Env 🐍 - uses: conda-incubator/setup-miniconda@v2 - with: - python-version: 3.8.10 - - name: Install pytest and nbmake - run: pip install pytest nbmake ipywidgets - - name: Install Rubrix - run: pip install -U git+https://github.com/recognai/rubrix.git - - name: Run tutorial - run: pytest --nbmake docs/tutorials/07-zeroshot_ner.ipynb - - name: Stop containers - if: always() - run: docker-compose -f "docker-compose.yaml" down - - tut5: - name: Clean labels using your model loss - runs-on: ubuntu-latest - defaults: - run: - shell: bash -l {0} - steps: - - name: Checkout Code 🛎 - uses: actions/checkout@v3 - - name: Setup Rubrix - run: | - sed -i 's/rubrix:latest/rubrix:master/' docker-compose.yaml - docker-compose -f "docker-compose.yaml" up -d --build - - name: Setup Conda Env 🐍 - uses: conda-incubator/setup-miniconda@v2 - with: - python-version: 3.8.10 - - name: Install pytest and nbmake - run: pip install pytest nbmake ipywidgets - - name: Install Rubrix - run: pip install -U git+https://github.com/recognai/rubrix.git - - name: Run tutorial - run: pytest --nbmake docs/tutorials/08-error_analysis_using_loss.ipynb - - name: Stop containers - if: always() - run: docker-compose -f "docker-compose.yaml" down - - tut6: - name: Monitor predictions in HTTP API endpoints - runs-on: ubuntu-latest - defaults: - run: - shell: bash -l {0} - steps: - - name: Checkout Code 🛎 - uses: actions/checkout@v3 - - name: Setup Rubrix - run: | - sed -i 's/rubrix:latest/rubrix:master/' docker-compose.yaml - docker-compose -f "docker-compose.yaml" up -d --build - - name: Setup Conda Env 🐍 - uses: conda-incubator/setup-miniconda@v2 - with: - python-version: 3.8.10 - - name: Install pytest and nbmake - run: pip install pytest nbmake ipywidgets - - name: Install Rubrix - run: pip install -U git+https://github.com/recognai/rubrix.git - - name: Run tutorial - run: pytest --nbmake docs/tutorials/09-automatic_fastapi_log.ipynb - - name: Stop containers - if: always() - run: docker-compose -f "docker-compose.yaml" down