FiloSottile / HNTitles

Tweet probabilistically generated HN post titles.
https://twitter.com/HNTitles
29 stars 3 forks source link

Has this really been running for 5 years? #2

Closed benwinding closed 5 years ago

benwinding commented 6 years ago

I saw this on an old HN thread, has this really been tweeting every few hours since 2013? Amazing!

Just interested where this is hosted and how it's deployed (Docker?)

Bravo 👌

FiloSottile commented 5 years ago

It has! Running almost untouched since 2013 😃

It was just a simple daemontools service running in its own manually provisioned virtualenv on a Proxmox VM on my main server.

$ cat /var/lib/supervise/HNTitles/run
#!/bin/sh
echo starting
exec 2>&1
SERVICE_DIR="$PWD"
cd /home/filippo/HNTitles
exec envdir "$SERVICE_DIR/env" setuidgid filippo ./venv/bin/python tweep.py

Fun fact, hngen.py was deleted for some reason (?), but the bot kept working because hngen.pyc was there.

I just moved it to a Docker container provisioned with Ansible on my new home server.

FROM python:2.7-alpine3.8
RUN apk add --no-cache git
RUN pip install pipenv 
RUN git clone https://github.com/FiloSottile/HNTitles
WORKDIR HNTitles
RUN pipenv install --system --deploy --clear
USER nobody
ENTRYPOINT ["python", "tweep.py"]

Let's see if it lasts another 5 years!

benwinding commented 5 years ago

Amazing! Thanks for the overview, I'm impressed at the reliability, it would be cool to see the entire progression of what it thought Hacker News Titles worked the best.

Anyway, here's to another 5 years! :champagne: