New kegbot-server beta available for testing

Hi everyone!

I’ve been inspired by all the ways y’all have kept this community going. Finding myself with a bit of extra time on my hands thanks to quarantine, I’ve been working on a new kegbot-server release — the first release in over 5 years!

What’s new

Before you get too excited, this is mostly an “under the hood” release: I’ve pulled in some bugfixes and small features, but the biggest new feature is the codebase: Its major dependencies have been updated to the latest versions, so it should be both easier to build and moreover easier for others to extend from here.

The other big change is that configuration and setup have been simplified to make it easier to run the server on a platform like heroku or in any docker environment. In fact, docker builds are now built automatically. Pre-built docker images for Rapsberry Pi are included too.

You can see a partial changelog here.

How to test

Important: Be sure to manually back up all of your data first. I recommend you try this with a separate/fresh setup rather than anything important.

These instructions assume you have some familiarity with Docker and docker-compose.

Instructions

First, copy and save this file as docker-compose.yml:

version: '3'

services:
  kegbot:
    image: kegbot/server:latest-arm
    ports:
      - "8000:8000"
    volumes:
      - kegbot-data:/kegbot-data
    environment:
      KEGBOT_REDIS_URL: "redis://redis:6379/0"
      KEGBOT_DATABASE_URL: "mysql://kegbot_dev:[email protected]/kegbot_dev"
      KEGBOT_SETUP_ENABLED: "true"
      KEGBOT_DEBUG: "true"

  workers:
    image: kegbot/server:latest-arm
    command: bin/kegbot run_workers
    volumes:
      - kegbot-data:/kegbot-data
    environment:
      KEGBOT_REDIS_URL: "redis://redis:6379/0"
      KEGBOT_DATABASE_URL: "mysql://kegbot_dev:[email protected]/kegbot_dev"
      KEGBOT_SETUP_ENABLED: "true"
      KEGBOT_DEBUG: "true"

Now, start the services:

$ docker-compose up

Visit http://localhost:8000 . It may take a minute for the page to become available. If you see an error, wait a little and try again.

You should be greeted by the Kegbot setup wizard. Walk through to create a new server.

What to test

Generally, explore and look for bugs, there are probably quite a few. If you find something broken, you can reply here or file it on github if you’re confident it’s a bug.

I’ll keep this post updated with the latest instructions and known issues. Thanks!

2 Likes

Awesome Mike, thanks for kegbot and thanks for keeping the hosting etc alive for us enthusiasts!

This is fantastic and I can’t wait to try it out and I’ll move a lot of my features over into the “main” channel via PRs over the next few weeks as I get some free time.

I’m going to test and test and test but maybe an easy answer from @mike, does this work with the pyutils/pycore stuff? My current setup is 100% via the Pi with the Arduino plugged in and full management, user authentication, live pour tracking, etc is done through the web interface. I assume this should all work fine with the Arduino stuff running as legacy, but the new server itself running in the container? Or is there some awesome magic you’ve already put into the container build that handles Arduino communication via RPi USB?

I assume this should all work fine with the Arduino stuff running as legacy, but the new server itself running in the container?

Yep, that’s right! It should work just like the server part, but you can run pycore anywhere else.

Or is there some awesome magic you’ve already put into the container build that handles Arduino communication via RPi USB?

Nope, though that would be cool. Maybe some day…!

1 Like

There is also an experimental “one click deploy” to Heroku. Check it out here: https://github.com/Kegbot/kegbot-heroku

So I’ve done some initial testing on a Raspberry Pi 4 and ran into a couple issues, mainly around the availability of mysql for the 32-bit ARM architecture of the Raspbian image. Good news is that these are resolve with just a couple steps so those wishing to run this new Beta version on RPi should be able to run it without issue.

I have not yet tried to install one of the available 64-bit OS for Raspberry Pi, but I may get around to trying that to see what effect that has.

Slightly Modified Docker-Compose File

services:
  kegbot:
    image: kegbot/server:latest-arm
    ports:
      - "8000:8000"
    volumes:
      - kegbot-data:/kegbot-data
    environment:
      KEGBOT_REDIS_URL: redis://redis:6379/0
      KEGBOT_DATABASE_URL: mysql://kegbot_dev:[email protected]/kegbot_dev
      KEGBOT_SETUP_ENABLED: "true"
      KEGBOT_DEBUG: "true"

  workers:
    image: kegbot/server:latest-arm
    command: bin/kegbot run_workers
    volumes:
      - kegbot-data:/kegbot-data
    environment:
      KEGBOT_REDIS_URL: redis://redis:6379/0
      KEGBOT_DATABASE_URL: mysql://kegbot_dev:[email protected]/kegbot_dev
      KEGBOT_SETUP_ENABLED: "true"
      KEGBOT_DEBUG: "true"

  mysql:
    image: linuxserver/mariadb:latest
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: 'changeme'
      MYSQL_USER: 'kegbot_dev'
      MYSQL_PASSWORD: 'changeme'
      MYSQL_DATABASE: 'kegbot_dev'
    volumes:
      - mysql-data:/var/lib/mysql

  redis:
    image: redis:latest
    restart: always

volumes:
  mysql-data:
  kegbot-data:

I’ve updated with a specific image tag for arm that @mike already pre-compiled for RPi (awesome!!)

The next change was to use the linuxserver/mariadb image instead of mysql since mysql does not have a docker image that supports Raspbian. If you try to run the original docker-compose file you get an error trying to acquire that image.

Finally, once you’ve started everything with docker-compose up -d (I like running the services in the background with the -d switch), run the command docker ps to find the container ID for the MariaDB container. Then, execute the following command, replacing [container id] with your MariaDB Container ID.

docker exec [container id] mysql -uroot -p[your_sql_root_password] -e "set global innodb_file_format=Barracuda; set global innodb_default_row_format=DYNAMIC; set global innodb_large_prefix=ON;"

For example if you leave the default sql password in the docker-compose file, you would run something like this:

docker exec 513d1282322c mysql -uroot -pchangeme -e "set global innodb_file_format=Barracuda; set global innodb_default_row_format=DYNAMIC; set global innodb_large_prefix=ON;"

Now you’re ready to run the server at [Address Of Your Pi]:8000. This should kick you to the Setup screen where you can successfully install the Database.

FYI, if you were to run the setup without that mysql command, you get a screen like below:

1 Like

Great fixes, thanks @johnnyruz! I’ve updated the post at the top, will work with you on automating this through the kegberry script.

Update: I’ve got those mysql changes incorporated into the new installer script.

This ought to do the trick for an easy first-time install:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/kegbot/kegberry/master/install.sh)"

Flawless install! Now to test some of the Pycore stuff this weekend!

1 Like

@mike - thanks for posting this script. I was struggling with some of the other methods and this one did the trick with no issues. Loving my new kegbot setup!

The only issue I’ve run into is a complete inability to disable DEBUG mode. I’ve changed from true to false in the config line (KEGBOT_DEBUG: ‘false’) below in the docker-compose.yml file, but it has no effect. The good news is I can’t really see any ill effects from this, so I don’t think it’s a big deal, but I wanted to let you know in case you can track down why it’s doing it.

Thanks for the script!