gratipay / gdr.rocks

GDR = Gratipay Dependency Resolver
http://gdr.rocks/
2 stars 1 forks source link

Deploy! #1

Closed chadwhitacre closed 7 years ago

chadwhitacre commented 7 years ago

I used the Docker's DO image, which is based on Ubuntu 16.04. Seems to already have git.

apt-get -y update && apt-get install -y python python-pip
apt-get install unattended-upgrades
dpkg-reconfigure unattended-upgrades
chadwhitacre commented 7 years ago
pip install virtualenv
chadwhitacre commented 7 years ago
pip install --upgrade pip
chadwhitacre commented 7 years ago
apt-get install make
chadwhitacre commented 7 years ago
make
chadwhitacre commented 7 years ago
./update.sh
chadwhitacre commented 7 years ago

As with bot, it's set up to pull from GitHub minutely as part of update.sh. Pull to deploy, not push.

chadwhitacre commented 7 years ago

Rerun of ./update.sh is fast.

chadwhitacre commented 7 years ago

, and it should be installed in cron now ...

chadwhitacre commented 7 years ago
$ tail -f /var/log/syslog
...
Oct 17 21:27:01 digitalocean cron[919]: (root) RELOAD (crontabs/root)
Oct 17 21:27:01 digitalocean CRON[24078]: (root) CMD (/root/update-if-needed.sh 2>&1 | logger -t UPDATE-GDR)

👍

chadwhitacre commented 7 years ago

Okay! Now to get the webapp installed ...

chadwhitacre commented 7 years ago

Pushed 218fd417fd139d95934c1328a7740765b308fefc, waited.

Oct 17 21:34:05 digitalocean UPDATE-GDR: Successfully built 17900867f252

👍

chadwhitacre commented 7 years ago

Blech. Figured we'd already have upstart. shrug

apt-get install upstart
chadwhitacre commented 7 years ago

Erm, systemd ...

chadwhitacre commented 7 years ago

😖

chadwhitacre commented 7 years ago

Something! :-)

$ curl http://gdr.rocks/v1 -i -X POST --form "file=@requirements.txt"
HTTP/1.1 100 Continue

HTTP/1.1 500 Internal Server Error
Server: gunicorn/19.6.0
Date: Mon, 17 Oct 2016 21:57:40 GMT
Connection: keep-alive
Transfer-Encoding: chunked
Content-Type: text/plain; charset=UTF-8

Internal server error, program!

$
chadwhitacre commented 7 years ago

BLAM!!!!!!!!!!!! Just before was with the requirements.txt for this repo. With a simpler Flask==0.11.1 it works!

$ curl http://gdr.rocks/v1 -i -X POST --form "file=@requirements.txt"
HTTP/1.1 100 Continue

HTTP/1.1 200 OK
Server: gunicorn/19.6.0
Date: Mon, 17 Oct 2016 21:59:01 GMT
Connection: keep-alive
Transfer-Encoding: chunked
Content-Type: application/json

[
    {   
        "deps": [
            {   
                "license": "UNKNOWN",
                "name": "click",
                "version": "6.6"
            },
            {   
                "license": "BSD",
                "name": "Flask",
                "version": "0.11.1"
            },
            {   
                "license": "UNKNOWN",
                "name": "itsdangerous",
                "version": "0.24"
            },
            {

                "license": "BSD",
                "name": "Jinja2",
                "version": "2.8"
            },
            {
                "license": "BSD",
                "name": "MarkupSafe",
                "version": "0.23"
            },
            {
                "license": "BSD",
                "name": "Werkzeug",
                "version": "0.11.11"
            }
        ]
    }   
]$
chadwhitacre commented 7 years ago

Eff it. Added to rc.local:

make --directory=/root run &

Rebooted a couple times and I think we're good enough for now! 👏

chadwhitacre commented 7 years ago

Configured to HUP on pull in 9791ee43de1d01f526c41be3a9e74e1d0c2d661e. Okay!

chadwhitacre commented 7 years ago

Calling this deployed. 👍

I suppose we should update the documentation at http://gdr.rocks/, then I think we're pretty close to ready to circle back to https://github.com/gratipay/gratipay.com/pull/4135.

chadwhitacre commented 7 years ago

Oh! Also, I gave this a floating IP so we can swap droplets out underneath and not worry about DNS.

chadwhitacre commented 7 years ago

We'll probably want some better error handling along the way. :-)

chadwhitacre commented 7 years ago

Announced!