Skip to content

codekow/demo-ocp-label-studio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Label-Studio on Openshift

Explore and demo label-studio on OpenShift

Usage

Quick Start

See Label Studio Helm Chart with OpenShift Values

. scripts/bootstrap.sh

# local demo
local_demo

# openshift demo
openshift_demo

Import local files via files.txt

scripts/serve_local_files.sh path_to_files/*.png

Import from YOLO format to label studio

mkdir -p scratch/example
cd scratch/example

unzip yolo.zip -d example

label-studio-converter import yolo \
  -i example/ \
  -o ls-tasks.json \
  --image-ext .jpg \
  --image-root-url http://localhost:8081

cd ../..

scripts/serve_local_files.sh scratch/example/images

Create a Label Studio Project via cli

label-studio init Example \
  --initial-project-description "An Example Project" \
  --label-config ls-tasks.label_config.xml

TL;DR Example

# create project for label-studio
oc new-project label-studio

APP_NAME=label-studio-patch
oc new-app https://github.com/redhat-na-ssa/demo-ocp-label-studio.git \
  --name "${APP_NAME}" \
  --strategy docker \
  --context-dir container/patch

oc expose service \
  "${APP_NAME}" \
  --port 8080 \
  --overrides='{"spec":{"tls":{"termination":"edge"}}}'

Local Dev

# activate python virtual env (bash)
source venv/bin/activate

# start label-studio
label-studio

OpenShift

New Project for testing

# create project for label-studio
oc new-project label-studio-source

Build strategy docker to patch public image

APP_NAME=label-studio-patch
oc new-app https://github.com/redhat-na-ssa/demo-ocp-label-studio.git \
  --name "${APP_NAME}" \
  --strategy docker \
  --context-dir container/patch

Build strategy source (s2i)

APP_NAME=label-studio-s2i-source
oc new-app https://github.com/redhat-na-ssa/demo-ocp-label-studio.git \
  --name "${APP_NAME}" \
  --strategy source \
  --context-dir container/s2i

Build strategy docker

APP_NAME=label-studio-s2i-docker
oc new-app https://github.com/redhat-na-ssa/demo-ocp-label-studio.git \
  --name "${APP_NAME}" \
  --strategy docker \
  --context-dir container/s2i

Expose via route, w/ https, in OpenShift (repeat as needed)

# create route
oc expose service \
  "${APP_NAME}"

# update route to use tls
oc patch route \
  "${APP_NAME}" \
  --patch='{"spec":{"tls":{"termination":"edge"}}}'

Links

MLOps CoP Links