Skip to content

Commit a1ead71

Browse files
authored
[FEATURE-BRANCH] v2.0.0 changes (#4869)
# Description This PR includes all the changes related with new Argilla v2.0.0. **Type of change** (Please delete options that are not relevant. Remember to title the PR according to the type of change) - [ ] Bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Refactor (change restructuring the codebase without changing functionality) - [ ] Improvement (change adding some improvement to an existing functionality) - [ ] Documentation update **How Has This Been Tested** (Please describe the tests that you ran to verify your changes. And ideally, reference `tests`) - [x] Adding new tests. **Checklist** - [ ] I added relevant documentation - [ ] follows 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/) --------- # Argilla Community Growers 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. # Pull Request Templates Please go the the `Preview` tab and select the appropriate sub-template: * [🐞-bug](?expand=1&template=bug.md) * [📚-documentation](?expand=1&template=docs.md) * [🆕-features](?expand=1&template=features.md) # Generic Pull Request Template Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change. Closes #<issue_number> **Type of change** (Please delete options that are not relevant. Remember to title the PR according to the type of change) - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Refactor (change restructuring the codebase without changing functionality) - [ ] Improvement (change adding some improvement to an existing functionality) - [ ] Documentation update **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 - [ ] follows 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/)
2 parents 6a0361d + 03c1b28 commit a1ead71

File tree

1,673 files changed

+85836
-108910
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,673 files changed

+85836
-108910
lines changed

.github/actions/generate-credentials/app/main.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ def generate_credentials() -> Dict[str, Any]:
3333
credentials = {}
3434
for user in ["owner", "admin", "annotator"]:
3535
logging.info(f"Generating random credential for user '{user}'")
36-
password = generate_password_from_secret(secret=SECRET, salt=f"{GITHUB_REF}/{user}", length=32)
36+
password = generate_password_from_secret(
37+
secret=SECRET, salt=f"{GITHUB_REF}/{user}", length=32
38+
)
3739
credentials[user] = password
3840
return credentials
3941

.github/actions/slack-post-credentials/app/main.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ def get_slack_channel_id(client: WebClient) -> Union[str, None]:
7474
for channel in result["channels"]:
7575
if channel["name"] == SLACK_CHANNEL_NAME:
7676
channel_id = channel["id"]
77-
logging.info(f"Found channel id for '{SLACK_CHANNEL_NAME}' channel: '{channel_id}'")
77+
logging.info(
78+
f"Found channel id for '{SLACK_CHANNEL_NAME}' channel: '{channel_id}'"
79+
)
7880
return channel_id
7981

8082

@@ -87,7 +89,9 @@ def get_pr_url(pr_number: int) -> str:
8789
return f"https://github.com/argilla-io/argilla/pull/{pr_number}"
8890

8991

90-
def get_thread_ts_pr_message(client: WebClient, channel_id: str, pr_number: int) -> Union[str, None]:
92+
def get_thread_ts_pr_message(
93+
client: WebClient, channel_id: str, pr_number: int
94+
) -> Union[str, None]:
9195
response = client.conversations_history(channel=channel_id, limit=1000)
9296
response.validate()
9397

@@ -119,7 +123,9 @@ def bot_already_replied(client: WebClient, channel_id: str, thread_ts: str) -> b
119123
return False
120124

121125

122-
def reply_thread_with_credentials(client: WebClient, channel_id: str, thread_ts: str) -> None:
126+
def reply_thread_with_credentials(
127+
client: WebClient, channel_id: str, thread_ts: str
128+
) -> None:
123129
client.chat_postMessage(
124130
channel=channel_id,
125131
text=f"Credentials for PR deployed environment (use as password and API key):\n- URL: {URL}\n- owner: '{OWNER}'\n- admin: '{ADMIN}'\n- annotator: '{ANNOTATOR}'",
@@ -153,7 +159,9 @@ def reply_thread_with_credentials(client: WebClient, channel_id: str, thread_ts:
153159
pr_number = get_pull_request_number()
154160
if pr_number is None:
155161
logging.error(f"Could not parse `GITHUB_REF` ({GITHUB_REF}) to get PR number")
156-
raise ValueError(f"Could not parse `GITHUB_REF` ({GITHUB_REF}) to get PR number")
162+
raise ValueError(
163+
f"Could not parse `GITHUB_REF` ({GITHUB_REF}) to get PR number"
164+
)
157165

158166
client = get_slack_client()
159167

.github/workflows/argilla.build-push-dev-frontend-docker.yml renamed to .github/workflows/argilla-frontend.build-push-dev-frontend-docker.yml

File renamed without changes.
File renamed without changes.

.github/workflows/argilla.teardown-all-pr-environments.yml renamed to .github/workflows/argilla-frontend.teardown-all-pr-environments.yml

File renamed without changes.

.github/workflows/argilla.teardown-pr-environment.yml renamed to .github/workflows/argilla-frontend.teardown-pr-environment.yml

File renamed without changes.

.github/workflows/argilla-frontend.yml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,13 @@ concurrency:
55
cancel-in-progress: true
66

77
on:
8-
98
workflow_call:
109

1110
pull_request:
1211
paths:
1312
- "argilla-frontend/**"
14-
types:
15-
- opened
16-
- edited
17-
- reopened
18-
- synchronize
19-
- ready_for_review
2013

2114
jobs:
22-
2315
build:
2416
name: Build argilla-frontend
2517
runs-on: ubuntu-latest
@@ -28,7 +20,6 @@ jobs:
2820
working-directory: argilla-frontend
2921

3022
steps:
31-
3223
- name: Checkout Code 🛎
3324
uses: actions/checkout@v4
3425

@@ -61,7 +52,7 @@ jobs:
6152
build_dev_docker_image:
6253
name: Build development argilla-fronted docker image
6354
needs: build
64-
uses: ./.github/workflows/argilla.build-push-dev-frontend-docker.yml
55+
uses: ./.github/workflows/argilla-frontend.build-push-dev-frontend-docker.yml
6556
if: |
6657
!cancelled() &&
6758
github.event_name == 'pull_request' && github.event.pull_request.draft == false
@@ -75,7 +66,7 @@ jobs:
7566

7667
deploy:
7768
name: Deploy pr environment
78-
uses: ./.github/workflows/argilla.deploy-environment.yml
69+
uses: ./.github/workflows/argilla-frontend.deploy-environment.yml
7970
needs: build_dev_docker_image
8071
if: |
8172
!cancelled() &&
@@ -84,4 +75,4 @@ jobs:
8475
with:
8576
image-name: argilla/argilla-frontend-for-dev
8677
image-version: ${{ needs.build_dev_docker_image.outputs.version }}
87-
secrets: inherit
78+
secrets: inherit

.github/workflows/argilla-server.build-docker-image.yml

Lines changed: 0 additions & 105 deletions
This file was deleted.
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
name: Build Argilla server docker images
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
is_release:
7+
description: "True if the images should be built for release"
8+
required: true
9+
type: boolean
10+
11+
publish_latest:
12+
description: "True if the images should be published as latest"
13+
required: true
14+
type: boolean
15+
16+
jobs:
17+
build:
18+
name: Build Argilla server docker images
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: Setup PDM
25+
uses: pdm-project/setup-pdm@v4
26+
with:
27+
python-version-file: argilla-server/pyproject.toml
28+
cache-dependency-path: argilla-server/pdm.lock
29+
cache: true
30+
31+
- name: Read package info
32+
id: package-info
33+
working-directory: argilla-server
34+
run: |
35+
PACKAGE_VERSION=$(pdm show --version)
36+
PACKAGE_NAME=$(pdm show --name)
37+
echo "PACKAGE_NAME=$PACKAGE_NAME" >> $GITHUB_OUTPUT
38+
echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_OUTPUT
39+
echo "$PACKAGE_NAME==$PACKAGE_VERSION"
40+
41+
- name: Get Docker image tag from GITHUB_REF
42+
if: ${{ !inputs.is_release }}
43+
id: docker-image-tag-from-ref
44+
uses: ./.github/actions/docker-image-tag-from-ref
45+
46+
- name: Setup environment variables
47+
run: |
48+
if [[ $IS_RELEASE == true ]]; then
49+
echo "PLATFORMS=linux/amd64,linux/arm64" >> $GITHUB_ENV
50+
echo "IMAGE_TAG=v$PACKAGE_VERSION" >> $GITHUB_ENV
51+
else
52+
echo "PLATFORMS=linux/amd64" >> $GITHUB_ENV
53+
echo "IMAGE_TAG=$DOCKER_IMAGE_TAG" >> $GITHUB_ENV
54+
fi
55+
env:
56+
IS_RELEASE: ${{ inputs.is_release }}
57+
PACKAGE_VERSION: ${{ steps.package-info.outputs.PACKAGE_VERSION }}
58+
DOCKER_IMAGE_TAG: ${{ steps.docker-image-tag-from-ref.outputs.docker-image-tag }}
59+
60+
- name: Set up QEMU
61+
if: ${{ inputs.is_release }}
62+
uses: docker/setup-qemu-action@v3
63+
64+
- name: Set up Docker Buildx
65+
uses: docker/setup-buildx-action@v3
66+
67+
- name: Login to Docker Hub
68+
uses: docker/login-action@v3
69+
with:
70+
username: ${{ secrets.AR_DOCKER_USERNAME }}
71+
password: ${{ secrets.AR_DOCKER_PASSWORD }}
72+
73+
- name: Download python package
74+
uses: actions/download-artifact@v4
75+
with:
76+
name: argilla-server
77+
path: argilla-server/docker/server/dist
78+
79+
- name: Build and push `argilla-server` image
80+
uses: docker/build-push-action@v5
81+
with:
82+
context: argilla-server/docker/server
83+
file: argilla-server/docker/server/Dockerfile
84+
platforms: ${{ env.PLATFORMS }}
85+
tags: argilla/argilla-server:${{ env.IMAGE_TAG }}
86+
labels: ${{ steps.meta.outputs.labels }}
87+
push: true
88+
89+
- name: Push latest `argilla-server` image
90+
if: ${{ inputs.is_release && inputs.publish_latest }}
91+
uses: docker/build-push-action@v5
92+
with:
93+
context: argilla-server/docker/server
94+
file: argilla-server/docker/server/Dockerfile
95+
platforms: ${{ env.PLATFORMS }}
96+
tags: argilla/argilla-server:latest
97+
labels: ${{ steps.meta.outputs.labels }}
98+
push: true
99+
100+
- name: Build and push `argilla-quickstart` image
101+
uses: docker/build-push-action@v5
102+
with:
103+
context: argilla-server/docker/quickstart
104+
file: argilla-server/docker/quickstart/Dockerfile
105+
platforms: ${{ env.PLATFORMS }}
106+
tags: argilla/argilla-quickstart:${{ env.IMAGE_TAG }}
107+
labels: ${{ steps.meta.outputs.labels }}
108+
build-args: |
109+
ARGILLA_VERSION=${{ env.IMAGE_TAG }}
110+
push: true
111+
112+
- name: Push latest `argilla-quickstart` image
113+
if: ${{ inputs.is_release && inputs.publish_latest }}
114+
uses: docker/build-push-action@v5
115+
with:
116+
context: argilla-server/docker/quickstart
117+
file: argilla-server/docker/quickstart/Dockerfile
118+
platforms: ${{ env.PLATFORMS }}
119+
tags: argilla/argilla-quickstart:latest
120+
labels: ${{ steps.meta.outputs.labels }}
121+
build-args: |
122+
ARGILLA_VERSION=${{ env.IMAGE_TAG }}
123+
push: true
124+
125+
- name: Docker Hub Description for `argilla-server`
126+
uses: peter-evans/dockerhub-description@v4
127+
if: ${{ inputs.is_release && inputs.publish_latest }}
128+
with:
129+
username: ${{ secrets.AR_DOCKER_USERNAME }}
130+
password: ${{ secrets.AR_DOCKER_PASSWORD }}
131+
repository: argilla/argilla-server
132+
readme-filepath: argilla-server/README.md
133+
134+
- name: Docker Hub Description for `argilla-quickstart`
135+
uses: peter-evans/dockerhub-description@v4
136+
if: ${{ inputs.is_release && inputs.publish_latest }}
137+
with:
138+
username: ${{ secrets.AR_DOCKER_USERNAME }}
139+
password: ${{ secrets.AR_DOCKER_PASSWORD }}
140+
repository: argilla/argilla-quickstart
141+
readme-filepath: argilla-server/docker/quickstart/README.md

0 commit comments

Comments
 (0)