Name: rotisserie
Owner: International Business Machines
Description: automagically view the most interesting PlayerUnknown's Battlegrounds streams on Twitch.
Created: 2017-07-05 16:15:00.0
Updated: 2018-05-22 17:37:48.0
Pushed: 2018-05-23 15:39:44.0
Homepage: https://rotisserie.tv
Size: 4037
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Read this in other languages: ??.
rotisserie takes the concept of the red zone in American football and applies it to the popular online battle royale game PLAYERUNKNOWN'S BATTLEGROUNDS. The idea is to always be viewing the most popular PUBG twitch stream with the least amount of people alive in-game.
The following pieces of software are required to run rotisserie locally:
You can install these dependencies with one of the two following commands, depending on your os:
sudo apt-get install tesseract-ocr ffmpeg imagemagick
pip install livestreamer
brew install tesseract ffmpeg imagemagick
pip install livestreamer
Create a Kubernetes cluster with either Minikube for local testing, or with IBM Bluemix Container Service to deploy in cloud. The code here is regularly tested against Kubernetes Cluster from Bluemix Container Service using Travis.
livestreamer --twitch-oauth-authenticate
A browser window will open, and prompt you to authorize livestreamer to use
your twitch account. Click Authorize
.
Your browser will refresh, and a page saying “SORRY, this page does not exist
yet” will appear. Ignore this. In your address bar, there will be a callback
URL with access_token=<TOKEN>
. This is your OAuth token, copy it down and
proceed to the next section.
export docker_username="YOUR_DOCKER_USERNAME"
export token="YOUR_OAUTH_TOKEN"
You must create an app in your Twitch account using the developer mode (https://dev.twitch.tv/) to retrieve the clientID
export clientID="YOUR_CLIENT_ID"
localhost
and 3001
if running locally, or the IP address and port of a remote OCR host if running in containers. Mimic the environment variables exported by kubernetes.export ROTISSERIE_OCR_SERVICE_HOST="localhost"
export ROTISSERIE_OCR_SERVICE_PORT="3001"
it clone https://github.com/IBM/rotisserie.git
d rotisserie
cker build -t $docker_username/rotisserie-ocr -f deploy/images/ocr.Dockerfile .
cker build -t $docker_username/rotisserie-app -f deploy/images/app.Dockerfile .
cker push $docker_username/rotisserie-ocr
cker push $docker_username/rotisserie-app
npm install .
rotisserie
dir if you aren't there already, and start
the app:node ocr.js 2>&1 >/dev/null &
node app.js
Now you can open a browser and navigate to http://localhost:3000
to watch
rotisserie.
You can also run rotisserie in a docker container.
docker run -d -p 3001:3001 --name rotisserie-ocr $docker_username/rotisserie-ocr
docker run -d -p 3000:3000 --name rotisserie-app -e ROTISSERIE_OCR_SERVICE_HOST=$ROTISSERIE_OCR_SERVICE_HOST -e ROTISSERIE_OCR_SERVICE_PORT=$ROTISSERIE_OCR_SERVICE_PORT -e token=$token -e clientID=$clientID $docker_username/rotisserie-app
Now you can open a browser and navigate to http://localhost:3000
to watch
rotisserie.
note: Ensure your $OCR_HOST
environment variable is set to the cluster_public_ip:3001
.
ho -n "YOUR_OAUTH_TOKEN" | base64
:
ken: YOUR_OAUTH_TOKEN_IN_BASE64
bectl create -f rotisserie-secrets.yaml
rotisserie-app.yaml
and rotisserie-ocr.yaml
yaml files to use your image.
containers:
- name: rotisserie-app
image: <docker_username>/rotisserie-app
bectl apply -f rotisserie-ocr.yaml
bectl apply -f rotisserie-app.yaml
r clusters provisioned with Bluemix
cs workers YOUR_CLUSTER_NAME
r Minikube
nikube ip
http://IP_ADDRESS:30080
The production version of rotisserie has slightly different operational procedures. The production kubernetes manifest is located in the deploy directory. It is typically interacted with via the provided Makefile. Major differences between the production rotisserie and the one used in the developer journey are use of ingress controllers in kuberenetes and adding Letsencrypt.
There are a few commands we can use to work with the deployment.
To deploy without letsencrypt use make roll
roll
To deploy with letsencrypt use make full-roll
full-roll
To redeploy the deployments, without removing svc/ing/other, use make redeploy
redeploy
To delete the entire deployment we can use make purge
purge
Note: this depends on you deploying with a unique sha. See the 'make-rev' rule in the Makefile. In most cases git pull; make roll
should work. In cases where a roll failed or the app failed for reasons not connected to the code, a dummy commit might need to be added before re-rolling. Please only roll from master.
To whitelist simply set an environment variable called ROTISSERIE_WHITELIST
to a string with space separated usernames. Same with blacklisting, but with the environment variable ROTISSERIE_BLACKLIST
.
rotisserie is currently licensed under the Apache 2.0 License.