Skip to content

Commit

Permalink
Merge branch 'HumanSignal:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Fireblossom authored Apr 15, 2024
2 parents 387725c + ad146b6 commit 61a6b44
Show file tree
Hide file tree
Showing 363 changed files with 19,671 additions and 3,480 deletions.
9 changes: 1 addition & 8 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,11 @@
**

# Except:
!deploy/docker-entrypoint.d
!deploy/docker-entrypoint.d/**
!deploy/docker-entrypoint.sh
!deploy/prebuild_wo_frontend.sh
!deploy/requirements-mw.txt
!deploy/requirements.txt
!deploy/heroku_run.sh
!label_studio/**
!setup.py
!README.md

# but ignore:
label_studio/frontend

# except
!label_studio/frontend/dist
60 changes: 60 additions & 0 deletions .github/workflows/docker-build.yml
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
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
deploy_docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.4.0
- uses: actions/checkout@v3

- name: Cache node modules
uses: actions/cache@v2.1.7
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/invite-check.yml
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 '(&quot;|")isSharedInviteError(&quot;|")\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 }}
13 changes: 2 additions & 11 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,7 @@ name: "Close stale issues and PRs"

on:
schedule:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# │ │ │ │ │
# │ │ │ │ │
# │ │ │ │ │
# * * * * *
- cron: "30 1 * * *"
- cron: "30 1 * * *" # At 01:30

permissions:
issues: write
Expand All @@ -27,7 +18,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/stale@7fb802b3079a276cf3c7e6ba9aa003c665b3f838
- uses: actions/stale@v5
with:
days-before-issue-stale: -1
days-before-issue-close: -1 # never closed automatically
Expand Down
60 changes: 30 additions & 30 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ jobs:
fail-fast: false
matrix:
python-version:
- 3.6
- 3.7
- 3.8
- 3.9
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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 }}

Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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 }}

Expand All @@ -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
Expand All @@ -216,7 +224,6 @@ jobs:
fail-fast: false
matrix:
python-version:
- 3.6
- 3.7
- 3.8
- 3.9
Expand All @@ -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
Expand Down Expand Up @@ -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
36 changes: 36 additions & 0 deletions .github/workflows/upload_to_pypi.yml
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/*
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,10 @@ deploy/nginx/certs/*
mydata/
deploy/pgsql/certs/*
!deploy/pgsql/certs/.placeholder

*.swp
*.swo
*.swn
1/*
*/*/1/*
label_studio/tavern-output.json
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This document provides guidelines for contributing code and documentation to Lab

## Types of Contributions

You can contribute to Label Studio by submitting [bug reports and feature requests](), or by writing code to do any of the following:
You can contribute to Label Studio by submitting [bug reports and feature requests](https://github.com/heartexlabs/label-studio/issues/new/choose), or by writing code to do any of the following:
- Fix a bug.
- Provide [example machine learning backend code](https://github.com/heartexlabs/label-studio-ml-backend) to help others add a machine learning backend for a specific model.
- Share [example annotation templates](https://github.com/heartexlabs/label-studio/tree/master/label_studio/annotation_templates) for specific use cases.
Expand All @@ -15,7 +15,7 @@ You can contribute to Label Studio by submitting [bug reports and feature reques

We also welcome contributions to [the documentation](https://github.com/heartexlabs/label-studio/tree/master/docs/source)!

Please don't use the issue tracker to ask questions. Instead, join the [Label Studio Slack Community](http://slack.labelstud.io.s3-website-us-east-1.amazonaws.com/?source=github-contrib) to get help!
Please don't use the issue tracker to ask questions. Instead, join the [Label Studio Slack Community](https://slack.labelstudio.heartex.com/?source=github-contrib) to get help!

If you're not sure whether an idea you have for Label Studio matches up with our planned direction, check out the [public roadmap](https://github.com/heartexlabs/label-studio/blob/master/roadmap.md) first.

Expand Down Expand Up @@ -60,4 +60,4 @@ Follow these code formatting guidelines:

### Additional questions

If you have any questions that aren't answered in these guidelines, please find us in the #contributor channel of the [Label Studio Slack Community](http://slack.labelstud.io.s3-website-us-east-1.amazonaws.com/?source=github-contrib).
If you have any questions that aren't answered in these guidelines, please find us in the #contributor channel of the [Label Studio Slack Community](https://slack.labelstudio.heartex.com/?source=github-contrib).
Loading

0 comments on commit 61a6b44

Please sign in to comment.