Skip to content

Commit

Permalink
Merge branch 'feat/add-dataset-automatic-task-distribution' into feat…
Browse files Browse the repository at this point in the history
…/create-datasets-with-distribution
  • Loading branch information
jfcalvo committed Jun 19, 2024
2 parents abc3693 + 955d967 commit acce365
Show file tree
Hide file tree
Showing 792 changed files with 6,286 additions and 5,860 deletions.
4 changes: 3 additions & 1 deletion .github/actions/generate-credentials/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ def generate_credentials() -> Dict[str, Any]:
credentials = {}
for user in ["owner", "admin", "annotator"]:
logging.info(f"Generating random credential for user '{user}'")
password = generate_password_from_secret(secret=SECRET, salt=f"{GITHUB_REF}/{user}", length=32)
password = generate_password_from_secret(
secret=SECRET, salt=f"{GITHUB_REF}/{user}", length=32
)
credentials[user] = password
return credentials

Expand Down
16 changes: 12 additions & 4 deletions .github/actions/slack-post-credentials/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ def get_slack_channel_id(client: WebClient) -> Union[str, None]:
for channel in result["channels"]:
if channel["name"] == SLACK_CHANNEL_NAME:
channel_id = channel["id"]
logging.info(f"Found channel id for '{SLACK_CHANNEL_NAME}' channel: '{channel_id}'")
logging.info(
f"Found channel id for '{SLACK_CHANNEL_NAME}' channel: '{channel_id}'"
)
return channel_id


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


def get_thread_ts_pr_message(client: WebClient, channel_id: str, pr_number: int) -> Union[str, None]:
def get_thread_ts_pr_message(
client: WebClient, channel_id: str, pr_number: int
) -> Union[str, None]:
response = client.conversations_history(channel=channel_id, limit=1000)
response.validate()

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


def reply_thread_with_credentials(client: WebClient, channel_id: str, thread_ts: str) -> None:
def reply_thread_with_credentials(
client: WebClient, channel_id: str, thread_ts: str
) -> None:
client.chat_postMessage(
channel=channel_id,
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}'",
Expand Down Expand Up @@ -153,7 +159,9 @@ def reply_thread_with_credentials(client: WebClient, channel_id: str, thread_ts:
pr_number = get_pull_request_number()
if pr_number is None:
logging.error(f"Could not parse `GITHUB_REF` ({GITHUB_REF}) to get PR number")
raise ValueError(f"Could not parse `GITHUB_REF` ({GITHUB_REF}) to get PR number")
raise ValueError(
f"Could not parse `GITHUB_REF` ({GITHUB_REF}) to get PR number"
)

client = get_slack_client()

Expand Down
15 changes: 3 additions & 12 deletions .github/workflows/argilla-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,13 @@ concurrency:
cancel-in-progress: true

on:

workflow_call:

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

jobs:

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

steps:

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

Expand Down Expand Up @@ -61,7 +52,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 +66,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 +75,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.

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

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

jobs:
build:
Expand Down
Loading

0 comments on commit acce365

Please sign in to comment.