Skip to content

Commit

Permalink
Merge branch 'develop' into 'fb-optic-1178/memory-leak'
Browse files Browse the repository at this point in the history
  • Loading branch information
yyassi-heartex committed Dec 12, 2024
2 parents d03618b + a900be2 commit 5f84b12
Show file tree
Hide file tree
Showing 61 changed files with 1,519 additions and 332 deletions.
49 changes: 27 additions & 22 deletions .github/workflows/build_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,36 @@ jobs:
VERSION_OVERRIDE: ${{ inputs.version }}
run: poetry build

- name: Attach artifacts to release
if: inputs.release-id
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GIT_PAT }}
script: |
const { repo, owner } = context.repo;
const fs = require('fs');
const release_id = '${{ inputs.release-id }}';
for (let file of await fs.readdirSync('./dist/')) {
console.log('uploadReleaseAsset', file);
await github.rest.repos.uploadReleaseAsset({
owner,
repo,
release_id: release_id,
name: file,
data: await fs.readFileSync(`./dist/${file}`)
});
}
- name: Check SDK version is not git sha
run: grep 'label-studio-sdk\s*=\s*"[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*"' pyproject.toml

- name: Upload to PYPI
if: inputs.upload_to_pypi
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_APIKEY }}
run: poetry run twine upload ${{ inputs.upload_to_pypi == false && '--dry-run' || '' }} dist/*
TWINE_PASSWORD: ${{ inputs.upload_to_pypi && secrets.PYPI_APIKEY || secrets.PYPI_APIKEY_TEST }}
TWINE_REPOSITORY_URL: ${{ inputs.upload_to_pypi && 'https://upload.pypi.org/legacy/' || 'https://test.pypi.org/legacy/' }}
run: poetry run twine upload dist/*

- name: Get PyPI package details
id: pypi-package-details
Expand Down Expand Up @@ -173,26 +198,6 @@ jobs:
}
}, 60 * 1000 )
- name: Attach artifacts to release
if: inputs.release-id
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GIT_PAT }}
script: |
const { repo, owner } = context.repo;
const fs = require('fs');
const release_id = '${{ inputs.release-id }}';
for (let file of await fs.readdirSync('./dist/')) {
console.log('uploadReleaseAsset', file);
await github.rest.repos.uploadReleaseAsset({
owner,
repo,
release_id: release_id,
name: file,
data: await fs.readFileSync(`./dist/${file}`)
});
}
- name: Check file size
env:
DIST_DIR: "./dist"
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/cicd_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,34 @@ jobs:
branch_name: ${{ github.event.pull_request.head.ref || github.ref_name }}
secrets: inherit

deploy:
name: "Deploy"
if: startsWith(github.ref_name, 'ls-release/') || github.ref_name == 'develop'
runs-on: ubuntu-latest
needs:
- build-docker
steps:
- uses: actions/github-script@v7
env:
DOCKER_IMAGE_VERSION: ${{ needs.build-docker.outputs.image_version }}
APP_NAME: ${{ startsWith(github.ref_name, 'ls-release/') && 'ls-release' || 'ls-develop' }}
with:
github-token: ${{ secrets.GIT_PAT }}
script: |
const docker_image_version = process.env.DOCKER_IMAGE_VERSION;
const app_name = process.env.APP_NAME;
github.rest.actions.createWorkflowDispatch({
owner: "HumanSignal",
repo: "label-studio-enterprise",
workflow_id: "argocd-deploy.yml",
ref: "develop",
inputs: {
docker_image_version: docker_image_version,
app_name: app_name,
template_name: "lso",
}
});
pytest:
name: "Tests"
needs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ jobs:

- name: Upload coverage to Codecov
if: ${{ github.event.pull_request.head.repo.fork == false && github.event.pull_request.user.login != 'dependabot[bot]' }}
uses: codecov/codecov-action@v5.0.7
uses: codecov/codecov-action@v5.1.1
with:
name: codecov-python-${{ matrix.python-version }}
flags: pytests
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ python label_studio/manage.py runserver

You can deploy Label Studio with one click in Heroku, Microsoft Azure, or Google Cloud Platform:

[<img src="https://www.herokucdn.com/deploy/button.svg" height="30px">](https://heroku.com/deploy?template=https://github.com/HumanSignal/label-studio/tree/heroku-persistent-pg)
<a href="https://www.heroku.com/deploy?template=https://github.com/HumanSignal/label-studio/tree/heroku-persistent-pg"><img src="https://www.herokucdn.com/deploy/button.svg" alt="Deploy" height="30px"></a>
[<img src="https://aka.ms/deploytoazurebutton" height="30px">](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fhumansignal%2Flabel-studio%2Fdevelop%2Fazuredeploy.json)
[<img src="https://deploy.cloud.run/button.svg" height="30px">](https://deploy.cloud.run)

Expand Down Expand Up @@ -231,7 +231,7 @@ You can use Label Studio as an independent part of your machine learning workflo
| label-studio | Server, distributed as a pip package |
| [Frontend library](web/libs/editor/) | The Label Studio frontend library. This uses React to build the UI and mobx-state-tree for state management. |
| [Data Manager library](web/libs/datamanager/) | A library for the Data Manager, our data exploration tool. |
| [label-studio-converter](https://github.com/HumanSignal/label-studio-converter) | Encode labels in the format of your favorite machine learning library |
| [label-studio-converter](https://github.com/HumanSignal/label-studio-sdk/tree/master/src/label_studio_sdk/converter) | Encode labels in the format of your favorite machine learning library |
| [label-studio-transformers](https://github.com/HumanSignal/label-studio-transformers) | Transformers library connected and configured for use with Label Studio |

## Citation
Expand Down
132 changes: 132 additions & 0 deletions docs/source/guide/upgrade_community.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
---
title: Upgrade Label Studio
type: guide
tier: opensource
order: 96
order_enterprise: 0
meta_title: Upgrade Label Studio Community Edition
meta_description: Documentation for upgrade paths and commands for Label Studio.
section: "Install & Setup"
---

When upgrading Label Studio, keep the following in mind:

- **Backup Your Data**: Before starting the upgrade, make sure to back up your existing projects, databases, and any custom configurations.
- **Review Release Notes**: Check [the release notes](https://github.com/HumanSignal/label-studio/releases) for the version you're upgrading to. Pay attention to any breaking changes or migration steps that may be required.
- **Python Compatibility**: Ensure that your Python version is compatible with the new Label Studio release. Label Studio supports Python 3.9 through 3.13. Using an incompatible Python version can lead to installation errors.
- **Check for Dependency Issues**: After upgrading, verify that all dependencies are correctly installed. If you encounter missing package errors, you might need to install those packages manually. Running Label Studio in a clean Python environment or virtual environment can reduce the likelihood of package conflicts.
- **Test Your Setup**: After upgrading, test your Label Studio instance to ensure everything works as expected. Check key functionalities like task loading, labeling interfaces, data export, and any integrations you use.
- **Troubleshoot Installation Issues**: If you encounter any issues during the upgrade, see [Troubleshoot installation issues](install_troubleshoot).



## Upgrade using pip

```bash
pip install --upgrade label-studio
```


## Upgrade using Docker

1. Stop the existing Label Studio container:
```bash
docker ps # Find the container ID or name
docker stop <container_id_or_name>
```
2. Pull the latest Label Studio Docker image:
```bash
docker pull heartexlabs/label-studio:latest
```
3. Start a new container with the latest image, using the same volume mappings as before:
```bash
docker run -it -p 8080:8080 \
-v /path/to/yourdata:/label-studio/data \
-v /path/to/yourfiles:/label-studio/files \
heartexlabs/label-studio:latest
```
Replace `/path/to/yourdata` and /`path/to/yourfiles` with the actual paths you used previously.
4. Run database migrations (if necessary).

If you encounter any issues after upgrading, you might need to run database migrations:

```bash
docker exec -it <container_id_or_name> bash
cd /label-studio
python manage.py migrate
```
5. Open Label Studio in your browser at `http://localhost:8080` and check that your projects and data are accessible.


## Upgrade after installing from source

If you installed Label Studio [using the source in Github](https://github.com/HumanSignal/label-studio), you can upgrade using the following steps.

<div class="code-tabs">
<div data-name="Using Poetry (recommended)">

If you're using Poetry ([see these instructions](install#Install-from-source)), upgrade with the following steps:
1. Navigate to your Label Studio directory (where you cloned the repository).
2. Fetch the latest changes from the repository:
```bash
git pull
```
3. If you want to upgrade to a specific version, list available tags and checkout the desired one. For example, to upgrade to version 1.14.0:
```bash
git fetch --tags
git checkout v1.14.0
```
4. Install updated dependencies using Poetry:
```bash
poetry install
```
5. Run database migrations to apply any updates to the database schema:
```bash
poetry run python label_studio/manage.py migrate
```
6. Collect static files:
```bash
poetry run python label_studio/manage.py collectstatic
```
7. Restart Label Studio:
```bash
poetry run python label_studio/manage.py runserver
```
</div>
<div data-name="Using pip">
1. Navigate to your Label Studio directory (where you cloned the repository).
2. Fetch the latest changes from the repository:
```bash
git pull
```
1. If you want to upgrade to a specific version, list available tags and checkout the desired one. For example, to upgrade to version 1.14.0:
```bash
git fetch --tags
git checkout v1.14.0
```
1. Install updated dependencies:
```bash
pip install -r requirements.txt
```
1. Run database migrations to apply any updates to the database schema:
```bash
python label_studio/manage.py migrate
```
1. Collect static files:
```bash
python label_studio/manage.py collectstatic
```
1. Restart Label Studio:
```bash
python label_studio/manage.py runserver
```
</div>
</div>
## Upgrade a Kubernetes installation
See [Upgrade Label Studio using Helm](install_k8s#Upgrade-Label-Studio-using-Helm).
Loading

0 comments on commit 5f84b12

Please sign in to comment.