Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: LEAP-452: FE Repo Modernization / Monorepo #5154

Merged
merged 108 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
b25b233
fix: LEAP-1: Start migration to monorepo (#4731)
juliosgarbi Sep 28, 2023
c984dac
feat: LEAP-47: Move datamanager into the monorepo (#4737)
juliosgarbi Sep 28, 2023
e1e0c4e
feat: LEAP-53: Move editor into the monorepo (#4870)
juliosgarbi Oct 18, 2023
5decbe6
Merge branch 'develop' of https://github.com/HumanSignal/label-studio…
juliosgarbi Oct 27, 2023
24fb8f7
Merge branch 'fb-leap-e-1' of https://github.com/HumanSignal/label-st…
juliosgarbi Nov 1, 2023
f06d850
Merge branch 'develop' of https://github.com/HumanSignal/label-studio…
juliosgarbi Nov 1, 2023
11b2b31
Merge branch 'develop' of https://github.com/HumanSignal/label-studio…
juliosgarbi Nov 2, 2023
85d2562
Merge branch 'develop' of https://github.com/HumanSignal/label-studio…
juliosgarbi Nov 6, 2023
20bf775
feat: LEAP-324: Return builds files to LS monorepo (#4997)
juliosgarbi Nov 6, 2023
d5bffe7
Merge branch 'fb-leap-e-1' of https://github.com/HumanSignal/label-st…
juliosgarbi Nov 7, 2023
e358cd8
Merge branch 'develop' of https://github.com/HumanSignal/label-studio…
juliosgarbi Nov 7, 2023
e62ec1d
Merge branch 'develop' of https://github.com/HumanSignal/label-studio…
juliosgarbi Nov 8, 2023
80a6266
fix: LEAP-347: LSF running as standalone app (#5022)
juliosgarbi Nov 9, 2023
40ac7e9
Merge branch 'fb-leap-e-1' of https://github.com/HumanSignal/label-st…
juliosgarbi Nov 9, 2023
c271290
feat: LEAP-54: Move editor e2e tests to the new LS monorepo (#5028)
juliosgarbi Nov 15, 2023
b3401f0
chore: LEAP-50: Update makefile to work with current state of monorep…
Gondragos Nov 16, 2023
4db6a80
Merge branch 'fb-leap-e-1' of https://github.com/HumanSignal/label-st…
juliosgarbi Nov 16, 2023
4d01c3a
feat: LEAP-239: Move ls-frontend-test to monorepo and make cypress te…
juliosgarbi Nov 20, 2023
64cef8c
Merge branch 'fb-leap-e-1' of https://github.com/HumanSignal/label-st…
juliosgarbi Nov 20, 2023
2521775
feat: LEAP-56: Update package scripts to run units e2e and integratio…
juliosgarbi Nov 20, 2023
cefe26f
Merge branch 'fb-leap-e-1' of https://github.com/HumanSignal/label-st…
juliosgarbi Nov 20, 2023
3a33b23
feat: LEAP-325: Implement a mechanism to toggle between the current s…
juliosgarbi Nov 21, 2023
b675217
Merge branch 'fb-leap-e-1' of https://github.com/HumanSignal/label-st…
juliosgarbi Nov 21, 2023
d335d22
ci: CI TEST monorepo (#5064)
robot-ci-heartex Nov 22, 2023
7c9048f
Merge branch 'fb-leap-e-1' of https://github.com/HumanSignal/label-st…
juliosgarbi Nov 22, 2023
a8ff87d
feat: LEAP-379: Add docs to monorepo (#5074)
juliosgarbi Nov 22, 2023
86f73c6
fix: LEAP-409: Update files to match with monorepo monorepo (#5073)
robot-ci-heartex Nov 23, 2023
af167cd
Merge branch 'fb-leap-e-1' of https://github.com/HumanSignal/label-st…
juliosgarbi Nov 23, 2023
3f78429
Merge branch 'develop' of https://github.com/HumanSignal/label-studio…
juliosgarbi Nov 23, 2023
3f33c82
ci: TEST monorepo (#5079)
robot-ci-heartex Nov 23, 2023
0444560
Merge branch 'fb-leap-e-1' of https://github.com/HumanSignal/label-st…
juliosgarbi Nov 23, 2023
89ed52f
fix: LEAP-420: Update README.md and update env files (#5081)
juliosgarbi Nov 24, 2023
8c8e718
Merge branch 'fb-leap-e-1' of https://github.com/HumanSignal/label-st…
juliosgarbi Nov 24, 2023
4f3a6a6
Merge branch 'develop' of https://github.com/HumanSignal/label-studio…
juliosgarbi Nov 24, 2023
53f8257
fix: LEAP-E-1: Merge with development (#5086)
juliosgarbi Nov 24, 2023
350132e
Merge branch 'fb-leap-e-1' of https://github.com/HumanSignal/label-st…
juliosgarbi Nov 24, 2023
694ab41
add post install and change the build to production node_env
juliosgarbi Nov 28, 2023
d69765d
fix annotation not being displayed at the first view in the task
juliosgarbi Nov 28, 2023
1df1e74
Merge branch 'develop' of https://github.com/HumanSignal/label-studio…
juliosgarbi Dec 4, 2023
f62c2cc
fix: LEAP-346: Rework org token to use get_random_string instead of h…
juliosgarbi Dec 4, 2023
937c2f2
fix wasm audio deps copy
bmartel Dec 5, 2023
4adc019
Merge branch 'fb-leap-e-1' of https://github.com/HumanSignal/label-st…
juliosgarbi Dec 6, 2023
e5bd5f1
fix standalone lsf
juliosgarbi Dec 6, 2023
8400577
Merge branch 'develop' of https://github.com/HumanSignal/label-studio…
juliosgarbi Dec 6, 2023
9bd5ed0
merge conflicts
juliosgarbi Dec 6, 2023
54dc8c9
fix standalone and watch method
juliosgarbi Dec 6, 2023
25f54fa
fix unit tests
juliosgarbi Dec 6, 2023
27bf08b
Merge branch 'develop' of https://github.com/HumanSignal/label-studio…
juliosgarbi Dec 7, 2023
3b1e1dd
fix: OPTIC-341: CSS inconsistencies which cause conflicts in MonoRepo…
robot-ci-heartex Dec 8, 2023
137e98d
adding the ability to override the app js scripts from overriding tem…
bmartel Dec 8, 2023
32e37ea
fix: OPTIC-341: Incorrect icon width causing layout issues with TabPa…
robot-ci-heartex Dec 8, 2023
218e0be
commit dist folder
juliosgarbi Dec 11, 2023
c871cb6
merge
farioas Dec 11, 2023
a058d59
Merge remote-tracking branch 'origin/develop' into fb-leap-452
farioas Dec 11, 2023
0d6d758
add configurations to build options
bmartel Dec 11, 2023
7eec7fa
Merge remote-tracking branch 'origin/develop' into fb-leap-452
farioas Dec 11, 2023
e05bbd8
update editor files
juliosgarbi Dec 11, 2023
89840c3
Merge branch 'fb-leap-452' of https://github.com/HumanSignal/label-st…
juliosgarbi Dec 11, 2023
b2b6bdb
remove console.log
juliosgarbi Dec 11, 2023
e9b33e6
ci: fix job
farioas Dec 11, 2023
931bd3e
Merge remote-tracking branch 'origin/develop' into fb-leap-452
farioas Dec 11, 2023
57efcf5
update datamanager and eraser tool svg id
juliosgarbi Dec 11, 2023
c5b6a15
Merge branch 'fb-leap-452' of https://github.com/HumanSignal/label-st…
juliosgarbi Dec 11, 2023
9ed4665
Merge remote-tracking branch 'origin/develop' into fb-leap-452
farioas Dec 11, 2023
18b184e
Merge remote-tracking branch 'origin/develop' into fb-leap-452
farioas Dec 11, 2023
3293269
Merge branch 'fb-leap-452' of https://github.com/HumanSignal/label-st…
juliosgarbi Dec 11, 2023
28b5692
remove console.log
juliosgarbi Dec 11, 2023
d60f268
Merge remote-tracking branch 'origin/develop' into fb-leap-e-1
bmartel Dec 11, 2023
b8be456
use run-many for production builds for faster parallel execution, fix…
bmartel Dec 11, 2023
e72ad83
move xpath-range to dependencies
bmartel Dec 11, 2023
dc22dd8
change release file to work with poetry
juliosgarbi Dec 12, 2023
bb0a1c3
add toml and update yarn lock
juliosgarbi Dec 12, 2023
237e117
Merge branch 'fb-leap-e-1' of https://github.com/HumanSignal/label-st…
juliosgarbi Dec 12, 2023
1579c39
merge with leap-e-1
juliosgarbi Dec 12, 2023
b750dc0
Test docker build without node-gyp
hlomzik Dec 12, 2023
3f60d6a
Merge branch 'fb-leap-452' of https://github.com/HumanSignal/label-st…
juliosgarbi Dec 12, 2023
41f3cea
fix docker file
juliosgarbi Dec 12, 2023
ad3bed4
change the yarn packageManager
juliosgarbi Dec 13, 2023
fbc9bfc
same yarn as LSE
juliosgarbi Dec 13, 2023
2144ce1
Merge remote-tracking branch 'origin/develop' into fb-leap-452
farioas Dec 13, 2023
444c49e
Merge remote-tracking branch 'origin/develop' into fb-leap-452
farioas Dec 13, 2023
53a7ee2
test short build
farioas Dec 13, 2023
8a48e99
restore dockerfile
farioas Dec 13, 2023
09de618
Merge remote-tracking branch 'origin/develop' into fb-leap-452
farioas Dec 14, 2023
6ee674f
test cross compile
farioas Dec 14, 2023
3a9f869
Merge remote-tracking branch 'origin/develop' into fb-leap-452
farioas Dec 14, 2023
2960a8b
Merge remote-tracking branch 'origin/develop' into fb-leap-452
farioas Dec 14, 2023
99d12f6
Merge branch 'fb-leap-452' of https://github.com/HumanSignal/label-st…
juliosgarbi Dec 14, 2023
d997d73
add monorepo env variable set to true
juliosgarbi Dec 14, 2023
ab7da47
Merge remote-tracking branch 'origin/develop' into fb-leap-452
farioas Dec 14, 2023
caa18e2
Merge branch 'fb-leap-452' of https://github.com/HumanSignal/label-st…
juliosgarbi Dec 15, 2023
e2e8b11
remove duplicated import
juliosgarbi Dec 19, 2023
0cb33e4
fix indentation
juliosgarbi Dec 19, 2023
d217f66
Merge branch 'develop' of https://github.com/HumanSignal/label-studio…
juliosgarbi Dec 19, 2023
a46c0f9
Merge branch 'develop' into fb-leap-452
juliosgarbi Dec 19, 2023
a0efa0f
delete migration
juliosgarbi Dec 19, 2023
e566dcc
fix lint
juliosgarbi Dec 19, 2023
88c2ebc
remove packageManager
juliosgarbi Dec 20, 2023
946d82a
empty commit
nikitabelonogov Dec 20, 2023
3e7e3b1
ci: Build frontend
robot-ci-heartex Dec 20, 2023
0a12de0
Merge branch 'fb-leap-452' of https://github.com/HumanSignal/label-st…
juliosgarbi Dec 26, 2023
846a981
add correct favicon
juliosgarbi Dec 26, 2023
c2586c3
ci: Build frontend
robot-ci-heartex Dec 26, 2023
e5a58d8
update watch command and makefile
juliosgarbi Dec 26, 2023
e17406f
Merge branch 'fb-leap-452' of https://github.com/HumanSignal/label-st…
juliosgarbi Dec 26, 2023
d0b70a1
erge branch 'develop' of https://github.com/HumanSignal/label-studio …
juliosgarbi Jan 3, 2024
f643a77
merge conflicts
juliosgarbi Jan 3, 2024
35a6e97
ci: Build frontend
robot-ci-heartex Jan 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
!deploy/uwsgi.ini
!deploy/default.conf
!label_studio/**
!web/**
!setup.py
!README.md
!licenses/**
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ __pycache__
# docs
__generated__
\#$
data/
docs/data/
etc/
/src/
yarn-error.log
/dist/

# mobile/builds
db/
logfile
env/
venv/
.venv
.vscode
Expand Down
15 changes: 8 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# syntax=docker/dockerfile:1.3
FROM node:18 AS frontend-builder
FROM --platform=${BUILDPLATFORM} node:18 AS frontend-builder

ENV NPM_CACHE_LOCATION=$HOME/.cache/yarn/v6 \
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
NX_REJECT_UNKNOWN_LOCAL_CACHE=0

WORKDIR /label-studio/label_studio/frontend
WORKDIR /label-studio/web

COPY --chown=1001:0 label_studio/frontend .
COPY --chown=1001:0 web .
COPY --chown=1001:0 pyproject.toml /label-studio

# Fix Docker Arm64 Build
Expand All @@ -15,7 +16,7 @@ RUN yarn config set network-timeout 1200000 # HTTP timeout used when downloading

RUN --mount=type=cache,target=$NPM_CACHE_LOCATION,uid=1001,gid=0 \
yarn install --frozen-lockfile \
&& yarn run build:production
&& yarn run build

FROM ubuntu:22.04

Expand Down Expand Up @@ -71,8 +72,8 @@ RUN --mount=type=cache,target=$POETRY_CACHE_DIR \

COPY --chown=1001:0 . .

RUN rm -rf ./label_studio/frontend
COPY --chown=1001:0 --from=frontend-builder /label-studio/label_studio/frontend/dist ./label_studio/frontend/dist
RUN rm -rf ./label_studio/web
COPY --chown=1001:0 --from=frontend-builder /label-studio/web/dist ./label_studio/web/dist

RUN python3 label_studio/manage.py collectstatic --no-input && \
chown -R 1001:0 $LS_DIR && \
Expand Down
12 changes: 6 additions & 6 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
include deploy/requirements.txt

# react LSF / react-app with dm
recursive-include label_studio/frontend/dist/lsf *
include label_studio/frontend/dist/react-app/*
recursive-include label_studio/frontend/dist/dm/ *
recursive-include web/dist/libs/editor *
include web/dist/apps/labelstudio/*
recursive-include web/dist/libs/datamanager/ *

# html template files
recursive-include label_studio *.html

# exclude node modules
prune label_studio/frontend/node_modules
prune label_studio/frontend/build-tmp
prune web/node_modules
prune web/build-tmp

# annotation templates
recursive-include label_studio/annotation_templates *
Expand All @@ -36,4 +36,4 @@ recursive-include label_studio/tests/test_suites *.yml
include label_studio/pytest.ini

# feature flags
include label_studio/feature_flags.json
include label_studio/feature_flags.json
15 changes: 8 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,20 @@ shell-dev:

# Install modules
frontend-setup:
cd label_studio/frontend && yarn install --frozen-lockfile && yarn run download:all;
cd web && yarn install --frozen-lockfile;

# Fetch DM and LSF
frontend-fetch:
cd label_studio/frontend && yarn run download:all;
# Keep it here for potential rollback
## Fetch DM and LSF
#frontend-fetch:
# cd label_studio/frontend && yarn run download:all;

# Build frontend continuously on files changes
frontend-watch:
cd label_studio/frontend && yarn start
cd web && yarn run watch

# Build production-ready optimized bundle
frontend-build:
cd label_studio/frontend && yarn install --frozen-lockfile && yarn run build:production
frontend-build: frontend-setup
cd web && yarn run build

# Run tests
test:
Expand Down
6 changes: 3 additions & 3 deletions deploy/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -123,19 +123,19 @@ http {
# Frontend react
# Source: https://github.com/heartexlabs/label-studio-frontend
location /label-studio-frontend/ {
alias /label-studio/label_studio/frontend/dist/lsf/;
alias /label-studio/web/dist/libs/editor/;
}

# Data Manager
# Source: https://github.com/heartexlabs/dm2
location /dm/ {
alias /label-studio/label_studio/frontend/dist/dm/;
alias /label-studio/web/dist/libs/datamanager/;
}

# LabelStudio frontend
# Source: https://github.com/heartexlabs/label-studio/blob/HEAD/label_studio/frontend/src
location /react-app/ {
alias /label-studio/label_studio/frontend/dist/react-app/;
alias /label-studio/web/dist/apps/labelstudio/;
}

location /nginx_health {
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ services:
- app
environment:
- LABEL_STUDIO_HOST=${LABEL_STUDIO_HOST:-}
- ENABLE_MONOREPO_ENV=1
# Optional: Specify SSL termination certificate & key
# Just drop your cert.pem and cert.key into folder 'deploy/nginx/certs'
# - NGINX_SSL_CERT=/certs/cert.pem
Expand Down
17 changes: 14 additions & 3 deletions label_studio/core/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,12 +476,23 @@
ALLOW_IMPORT_TASKS_WITH_UNKNOWN_EMAILS = get_bool_env('ALLOW_IMPORT_TASKS_WITH_UNKNOWN_EMAILS', default=False)

""" React Libraries: do not forget to change this dir in /etc/nginx/nginx.conf """

ENABLE_MONOREPO_ENV = get_bool_env('ENABLE_MONOREPO_ENV', default=False)

# EDITOR = label-studio-frontend repository
EDITOR_ROOT = os.path.join(BASE_DIR, '../frontend/dist/lsf')
EDITOR_ROOT = (
os.path.join(BASE_DIR, '../../web/dist/libs/editor')
if ENABLE_MONOREPO_ENV
else os.path.join(BASE_DIR, '../../label_studio/frontend/dist/lsf')
)
# DM = data manager (included into FRONTEND due npm building, we need only version.json file from there)
DM_ROOT = os.path.join(BASE_DIR, '../frontend/dist/dm')
DM_ROOT = (
os.path.join(BASE_DIR, '../../web/dist/libs/datamanager')
if ENABLE_MONOREPO_ENV
else os.path.join(BASE_DIR, '../../label_studio/frontend/dist/dm')
)
# FRONTEND = GUI for django backend
REACT_APP_ROOT = os.path.join(BASE_DIR, '../frontend/dist/react-app')
REACT_APP_ROOT = os.path.join(BASE_DIR, '../../web/dist/apps/labelstudio')

# per project settings
BATCH_SIZE = 1000
Expand Down
7 changes: 3 additions & 4 deletions label_studio/core/utils/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,9 @@ def find_editor_files():
editor_dir = settings.EDITOR_ROOT

# find editor files to include in html
editor_js_dir = os.path.join(editor_dir, 'js')
editor_js = [prefix + 'js/' + f for f in os.listdir(editor_js_dir) if f.endswith('.js')]
editor_css_dir = os.path.join(editor_dir, 'css')
editor_css = [prefix + 'css/' + f for f in os.listdir(editor_css_dir) if f.endswith('.css')]
editor_js = [prefix + f for f in os.listdir(editor_dir) if f.endswith('.js')]
editor_css = [prefix + f for f in os.listdir(editor_dir) if f.endswith('.css')]

return {'editor_js': editor_js, 'editor_css': editor_css}


Expand Down
3 changes: 0 additions & 3 deletions label_studio/frontend/.env.example

This file was deleted.

6 changes: 0 additions & 6 deletions label_studio/frontend/.eslintignore

This file was deleted.

4 changes: 0 additions & 4 deletions label_studio/frontend/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion label_studio/frontend/.yarnrc.yml

This file was deleted.

169 changes: 0 additions & 169 deletions label_studio/frontend/get-build.js

This file was deleted.

6 changes: 0 additions & 6 deletions label_studio/frontend/jest-puppeteer.config.js

This file was deleted.

Loading
Loading