Skip to content

Commit

Permalink
[FEATURE] Prepare new argilla package (#5006)
Browse files Browse the repository at this point in the history
<!-- Thanks for your contribution! As part of our Community Growers
initiative 🌱, we're donating Justdiggit bunds in your name to reforest
sub-Saharan Africa. To claim your Community Growers certificate, please
contact David Berenstein in our Slack community or fill in this form
https://tally.so/r/n9XrxK once your PR has been merged. -->

# Description

This PR applies several changes to achieve the new argilla project
structure:
- The `argilla-sdk` becomes the new `argilla` project.
- The old `argilla` project has been moved to `argilla-v1` (and its
package)
- The github actions have been renamed conforming the new repo
structure.

Closes #4889
Closes #4888
Closes #4828

**Type of change**

(Please delete options that are not relevant. Remember to title the PR
according to the type of change)

- [] New feature (non-breaking change which adds functionality)
- [X] Refactor (change restructuring the codebase without changing
functionality)
- [X] Improvement (change adding some improvement to an existing
functionality)

**How Has This Been Tested**

(Please describe the tests that you ran to verify your changes. And
ideally, reference `tests`)

- [ ] Test A
- [ ] Test B

**Checklist**

- [ ] I added relevant documentation
- [ ] I followed the style guidelines of this project
- [ ] I did a self-review of my code
- [ ] I made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] I filled out [the contributor form](https://tally.so/r/n9XrxK)
(see text above)
- [ ] I have added relevant notes to the `CHANGELOG.md` file (See
https://keepachangelog.com/)
  • Loading branch information
frascuchon authored Jun 13, 2024
1 parent 8e9f42b commit da23ea9
Show file tree
Hide file tree
Showing 657 changed files with 4,551 additions and 4,574 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/argilla-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ concurrency:
cancel-in-progress: true

on:

workflow_call:

pull_request:
Expand All @@ -19,7 +18,6 @@ on:
- ready_for_review

jobs:

build:
name: Build argilla-frontend
runs-on: ubuntu-latest
Expand All @@ -28,7 +26,6 @@ jobs:
working-directory: argilla-frontend

steps:

- name: Checkout Code 🛎
uses: actions/checkout@v4

Expand Down Expand Up @@ -61,7 +58,7 @@ jobs:
build_dev_docker_image:
name: Build development argilla-fronted docker image
needs: build
uses: ./.github/workflows/argilla.build-push-dev-frontend-docker.yml
uses: ./.github/workflows/argilla-frontend.build-push-dev-frontend-docker.yml
if: |
!cancelled() &&
github.event_name == 'pull_request' && github.event.pull_request.draft == false
Expand All @@ -75,7 +72,7 @@ jobs:

deploy:
name: Deploy pr environment
uses: ./.github/workflows/argilla.deploy-environment.yml
uses: ./.github/workflows/argilla-frontend.deploy-environment.yml
needs: build_dev_docker_image
if: |
!cancelled() &&
Expand All @@ -84,4 +81,4 @@ jobs:
with:
image-name: argilla/argilla-frontend-for-dev
image-version: ${{ needs.build_dev_docker_image.outputs.version }}
secrets: inherit
secrets: inherit
152 changes: 0 additions & 152 deletions .github/workflows/argilla-sdk.yml

This file was deleted.

11 changes: 4 additions & 7 deletions .github/workflows/argilla-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,20 @@ defaults:
on:
workflow_dispatch:
push:
paths:
- argilla-server/**
tags:
- "*"
branches:
- main
- develop
- "feat/**"
- feat/**
- releases/**

pull_request:
paths:
- argilla-server/**
types:
- opened
- edited
- reopened
- synchronize
- ready_for_review

release:
types:
- published
Expand Down
145 changes: 145 additions & 0 deletions .github/workflows/argilla-v1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
name: Build Argilla (v1) package

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
workflow_dispatch:
workflow_call:

push:
paths:
- argilla-v1/**
tags:
- "*"
branches:
- main
- develop
- feat/**
- releases/**

pull_request:
paths:
- argilla-v1/**

release:
types:
- "published"
- "released"

jobs:
build:
runs-on: ubuntu-latest

defaults:
run:
shell: bash -l {0}
working-directory: argilla-v1

steps:
- name: Checkout Code 🛎
uses: actions/checkout@v4

- name: Setup Conda Env 🐍
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
miniforge-version: latest
use-mamba: true
activate-environment: argilla

- name: Get date for conda cache
id: get-date
run: echo "::set-output name=today::$(/bin/date -u '+%Y%m%d')"
shell: bash

- name: Cache Conda env
uses: actions/cache@v3
id: cache
with:
path: ${{ env.CONDA }}/envs
key: conda-${{ runner.os }}--${{ runner.arch }}--${{ steps.get-date.outputs.today }}-${{ hashFiles('argilla-v1/environment_dev.yml') }}-${{ env.CACHE_NUMBER }}

- name: Update environment
if: steps.cache.outputs.cache-hit != 'true'
run: mamba env update -n argilla -f environment_dev.yml

- name: Cache pip 👜
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ env.CACHE_NUMBER }}-${{ hashFiles('pyproject.toml') }}

- name: Set huggingface hub credentials
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/heads/releases')
run: |
echo "HF_HUB_ACCESS_TOKEN=${{ secrets.HF_HUB_ACCESS_TOKEN }}" >> "$GITHUB_ENV"
echo "Enable HF access token"
- name: Run unit tests 📈
run: |
pip install -e ".[server,listeners]"
pytest tests/unit -vs
- name: Run tests with pandas v2 📈
run: |
pip install "pandas~=2.0" pytest-custom_exit_code
pytest --suppress-no-test-exit-code tests/unit -vs
- name: Run tests with pydantic v2 📈
run: |
pip install "pydantic~=2.0" pytest-custom_exit_code
pytest --suppress-no-test-exit-code tests/unit -vs
- name: Build Package 🍟
run: |
pip install -U build
rm -rf dist && python -m build
- name: Upload package artifact
uses: actions/upload-artifact@v4
with:
name: argilla-v1
path: argilla-v1/dist

# This job will upload a Python Package using Twine when a release is created
# For more information see:
# https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
publish_release:
name: Publish Release
runs-on: ubuntu-latest
if: ${{ github.event_name == 'release' }}

needs:
- build

defaults:
run:
shell: bash -l {0}
working-directory: argilla-v1

steps:
- name: Checkout Code 🛎
uses: actions/checkout@v4
- name: Download python package
uses: actions/download-artifact@v4
with:
name: argilla-v1
path: dist
- name: Publish Package to TestPyPI 🥪
uses: pypa/gh-action-pypi-publish@release/v1
continue-on-error: true
with:
user: __token__
password: ${{ secrets.AR_TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- name: Test Installing 🍿
continue-on-error: true
run: pip install --index-url https://test.pypi.org/simple --no-deps argilla==${GITHUB_REF#refs/*/v}

- name: Publish Package to PyPI 🥩
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.AR_PYPI_API_TOKEN }}
Loading

0 comments on commit da23ea9

Please sign in to comment.