forked from HumanSignal/label-studio
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'HumanSignal:master' into master
- Loading branch information
Showing
363 changed files
with
19,671 additions
and
3,480 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: "Docker build & push" | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
paths: | ||
- deploy/** | ||
- label_studio/** | ||
- setup.py | ||
- .github/workflows/docker-build.yml | ||
tags: [ '*' ] | ||
|
||
env: | ||
DOCKER_CLI_EXPERIMENTAL: enabled | ||
IMAGE_NAME: heartexlabs/label-studio | ||
DOCKER_TAG: 'latest' | ||
|
||
jobs: | ||
docker_build_and_push: | ||
name: "Docker build and push" | ||
timeout-minutes: 10 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Override image tag on 'tag' | ||
if: startsWith(github.ref, 'refs/tags/') | ||
run: | | ||
echo "DOCKER_TAG=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_ENV | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/[email protected] | ||
|
||
- name: Login to DockerHub | ||
uses: docker/[email protected] | ||
with: | ||
username: heartexlabs | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.8' | ||
|
||
- name: Create version_.py | ||
run: | | ||
python3 $(pwd)/label_studio/core/version.py | ||
cat $(pwd)/label_studio/core/version_.py | ||
- name: Build and push | ||
uses: docker/[email protected] | ||
id: docker_build_and_push | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ env.IMAGE_NAME }}:${{ env.DOCKER_TAG }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: "Slack Invite Checker" | ||
|
||
on: | ||
schedule: | ||
- cron: '0 */6 * * *' # At minute 0 past every 6th hour. | ||
workflow_dispatch: | ||
|
||
env: | ||
INVITE_LINK: 'https://slack.labelstudio.heartex.com/' | ||
|
||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check if the invite link is valid | ||
run: | | ||
! grep -Eo '("|")isSharedInviteError("|")\s*:\s*true' <( | ||
curl --silent --location ${{ env.INVITE_LINK }} -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:96.0) Gecko/20100101 Firefox/96.0' -H "Accept: application/json" | ||
) | ||
- name: Notify to Slack | ||
if: ${{ failure() }} | ||
uses: slackapi/[email protected] | ||
with: | ||
channel-id: '${{ secrets.SLACK_LS_MONITORING_CHANNEL }}' | ||
slack-message: "Our <${{ env.INVITE_LINK }}|public invite link> is down and needs to be manually updated:\n1. <https://slack.com/intl/en-es/help/articles/201330256-Invite-new-members-to-your-workspace#share-an-invite-link|Generate a new link> without expiry date; you may need to deactivate the previous one first.\n2. Update the permanent redirect link <https://s3.console.aws.amazon.com/s3/bucket/slack.labelstudio.heartex.com/property/website/edit?region=us-east-1|on the S3 dashboard> with newly generated link WITHOUT URL SCHEME." | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_LS_BOT_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,6 @@ jobs: | |
fail-fast: false | ||
matrix: | ||
python-version: | ||
- 3.6 | ||
- 3.7 | ||
- 3.8 | ||
- 3.9 | ||
|
@@ -38,13 +37,13 @@ jobs: | |
# SENTRY_DSN: | ||
|
||
steps: | ||
- uses: actions/checkout@v2.4.0 | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2.3.1 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- uses: actions/cache@v2.1.6 | ||
- uses: actions/cache@v3 | ||
name: Configure pip cache | ||
id: pip-cache | ||
with: | ||
|
@@ -62,15 +61,15 @@ jobs: | |
pip install -e . | ||
- name: Setup node | ||
uses: actions/setup-node@v2.5.1 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "${{ env.NODE }}" | ||
|
||
- name: Get npm cache directory | ||
id: npm-cache-dir | ||
run: echo "::set-output name=dir::$(npm config get cache)" | ||
|
||
- uses: actions/cache@v2.1.6 | ||
- uses: actions/cache@v3 | ||
name: Configure npm cache | ||
id: npm-cache | ||
with: | ||
|
@@ -80,7 +79,7 @@ jobs: | |
${{ runner.os }}-node-${{ env.NODE }}- | ||
- name: Install LSF & set version.py | ||
run: ./deploy/prebuild.sh | ||
run: ./deploy/prebuild_wo_frontend.sh | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
|
@@ -90,7 +89,14 @@ jobs: | |
- name: Run functional tests | ||
run: | | ||
cd label_studio/ | ||
pytest --junitxml report.xml --cov=. -vv | ||
pytest --cov=. --cov-report=xml -vv -n auto | ||
- name: Upload coverage to Codecov | ||
uses: codecov/[email protected] | ||
with: | ||
fail_ci_if_error: true | ||
files: ./label_studio/coverage.xml | ||
verbose: true | ||
|
||
run_pytest_postgresql: | ||
name: LS PostgreSQL Ubuntu | ||
|
@@ -147,18 +153,18 @@ jobs: | |
- 6379:6379 | ||
|
||
steps: | ||
- uses: actions/checkout@v2.4.0 | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2.3.1 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install OS dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install virtualenv libsasl2-dev python-dev libldap2-dev libssl-dev | ||
sudo apt-get install virtualenv libsasl2-dev python-dev libldap2-dev libssl-dev libxml2-dev libxslt-dev python-dev | ||
- uses: actions/cache@v2.1.6 | ||
- uses: actions/cache@v3 | ||
name: Configure pip cache | ||
id: pip-cache | ||
with: | ||
|
@@ -174,15 +180,15 @@ jobs: | |
pip install -e . | ||
- name: Setup node | ||
uses: actions/setup-node@v2.5.1 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 14 | ||
|
||
- name: Get npm cache directory | ||
id: npm-cache-dir | ||
run: echo "::set-output name=dir::$(npm config get cache)" | ||
|
||
- uses: actions/cache@v2.1.6 | ||
- uses: actions/cache@v3 | ||
name: Configure npm cache | ||
id: npm-cache | ||
with: | ||
|
@@ -192,7 +198,7 @@ jobs: | |
${{ runner.os }}-node-${{ env.NODE }}- | ||
- name: Install LSF & set version.py | ||
run: ./deploy/prebuild.sh | ||
run: ./deploy/prebuild_wo_frontend.sh | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
|
@@ -202,12 +208,14 @@ jobs: | |
- name: Run functional tests | ||
run: | | ||
cd label_studio/ | ||
pytest --junitxml report.xml --cov=. -vv | ||
pytest --cov=. --cov-report=xml -vv -n auto | ||
- name: "Upload coverage to Codecov" | ||
uses: codecov/codecov-action@v2.1.0 | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3.0.0 | ||
with: | ||
fail_ci_if_error: true | ||
files: ./label_studio/coverage.xml | ||
verbose: true | ||
|
||
windows_label_studio: | ||
name: LS SQLite Windows | ||
|
@@ -216,7 +224,6 @@ jobs: | |
fail-fast: false | ||
matrix: | ||
python-version: | ||
- 3.6 | ||
- 3.7 | ||
- 3.8 | ||
- 3.9 | ||
|
@@ -232,13 +239,13 @@ jobs: | |
# SENTRY_DSN: | ||
|
||
steps: | ||
- uses: actions/checkout@v2.4.0 | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2.3.1 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- uses: actions/cache@v2.1.6 | ||
- uses: actions/cache@v3 | ||
name: Configure pip cache | ||
with: | ||
path: ~\AppData\Local\pip\Cache | ||
|
@@ -277,12 +284,5 @@ jobs: | |
collect_analytics: 0 | ||
run: | | ||
cd label_studio/ | ||
coverage run -m pytest | ||
python -m pytest -vv -n auto | ||
- name: Collect coverage results | ||
if: always() | ||
env: | ||
collect_analytics: 0 | ||
run: | | ||
cd label_studio/ | ||
coverage report -i -m --fail-under=40 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: "Upload to PYPI" | ||
|
||
on: | ||
release: | ||
types: | ||
- released | ||
|
||
jobs: | ||
ReleaseNotification: | ||
name: "notify" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: hmarr/[email protected] | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.release.tag_name }} | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.7' | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip install twine | ||
- name: Package and Upload | ||
env: | ||
STACKMANAGER_VERSION: ${{ github.event.release.tag_name }} | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_APIKEY }} | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
twine upload dist/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.