https://github.com/runabol/tork-demo-ml
https://github.com/runabol/tork-demo-ml
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/runabol/tork-demo-ml
- Owner: runabol
- Created: 2024-12-22T14:48:01.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-22T14:57:50.000Z (over 1 year ago)
- Last Synced: 2025-03-28T10:17:21.800Z (about 1 year ago)
- Language: Python
- Size: 2.93 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Tork Sentiment Analysis demo
Accompanying code for my article [Building scalable ML workflows](https://dev.to/acoh3n/building-scalable-ml-workflows-4f0k).
Download the latest [Tork binary](https://github.com/runabol/tork/releases/tag/v0.1.109) and untar it.
```bash
tar xvzf tork_0.1.109_darwin_arm64.tgz
```
Start Tork in `standalone` mode:
```bash
./tork run standalone
```
If all goes well, you should something like this:
```bash
...
10:36PM INF Coordinator listening on http://localhost:8000
...
```
Build the docker image that contains the sentiment analysis model
```bash
docker build -t sentiment-analysis .
```
Submit the job. Tork jobs execute asynchronously. Once a job is submitted you get back a job ID to track its progress:
```bash
JOB_ID=$(curl -s \
-X POST \
-H "content-type:text/yaml" \
--data-binary @sentiment.yaml \
http://localhost:8000/jobs | jq -r .id)
```
Poll the job's status and wait for it to complete:
```bash
while true; do
state=$(curl -s http://localhost:8000/jobs/$JOB_ID | jq -r .state)
echo "Status: $state"
if [ "$state" = "COMPLETED" ]; then;
break
fi
sleep 1
done
```
Inspect the job results:
```bash
curl -s http://localhost:8000/jobs/$JOB_ID | jq -r .result
```
```
Positive
```