New Kegbot Server pre-release (testers wanted!): v1.3.0

Hey everyone: We’re almost ready to cut a new release of kegbot-server! Are you feeling adventurous? We could use your help testing! Read on…

What’s new?

This continues the work originally announced here. You can see the changelog for full changes. Highlights:

  • Full support for installing and running your server using Docker and docker-compose; it’s all documented on a new docs site.
  • Large reduction in the number of settings you need to set or fiddle with to get things working.
  • An experimental new API that may eventually power a shiny new frontend.
  • Many under-the-hood improvements to make future development easier.
  • Several bugs fixed and small feature enhancements added.

Basically - its a 2022 refresh of the server you already know & maybe use.

How to test

  1. Step 1: Make a backup of your database and kegbot-data directory. Take a database dump in addition to a kegbot backup, just in case.
  2. Step 2: Try the new installation instructions: Available here: Kegbot Server documentation
  3. Step 3: Report any issues or questions here. I’m sure we can improve the docs even more.

cheers!

3 Likes

Thanks for this @mike, I’ll take a look at this over the week, excited to see the new frontend!

1 Like

So good to see some activity Mike, I will give the upgrade a run

1 Like

Just got this error when attempting the upgrade

[email protected]:~/kegberry$ docker-compose run kegbot upgrade Creating kegberry_kegbot_run … done Error response from daemon: OCI runtime create failed: container_linux.go:367: starting container process caused: exec: “upgrade”: executable file not found in $PATH: unknown ERROR: 1

my path is /home/kegbot/kegberry/docker-compose.yml if that makes any difference

I just realised the docker container image has changed in the new install instructions. I’m not precious about the data but would be good to keep it. Not sure how to do a database dump and the export data feature isn’t working in kegbot. Is it possible to move my database over from the previous version?

Just got this error when attempting the upgrade

Ah. This likely means you’re using an old container image. Did you replace the compose with the new one according to the instructions? (But see next - let’s get you backed up first.)

Once the new compose is in place, you can force docker to rebuild the images it uses - good way to ensure you’re on the latest image:

docker-compose build

I just realised the docker container image has changed in the new install instructions. I’m not precious about the data but would be good to keep it. Not sure how to do a database dump and the export data feature isn’t working in kegbot. Is it possible to move my database over from the previous version?

Yes, we should be able to figure that out. Can you post your existing config here?

Mike you are a legend…

I took a copy of my vhd (linux vm running on oracle virtual box) so happy to test everything out. Apologies I did realise after I posted initially that the containers are new and I would need a fresh install. The other question I have is have you deprecated the old API? I use it with an alexa skill to query whats on tap, again I can lose it but it is pretty cool to show off when people visit!

version: ‘3.0’

services:
kegbot:
image: kegbot/server:latest
restart: always
ports:
- ‘8000:8000’
volumes:
- /home/kegbot/kegberry/data:/kegbot-data
tmpfs:
- /tmp
- /var/tmp
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’
KEGBOT_SECRET_KEY: ‘xxxx’
KEGBOT_INSECURE_SHARED_API_KEY: ‘xxxx’

workers:
image: kegbot/server:latest
restart: always
command: bin/kegbot run_workers
volumes:
- /home/kegbot/kegberry/data:/kegbot-data
tmpfs:
- /tmp
- /var/tmp
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’
KEGBOT_SECRET_KEY: ‘xxxx’

mysql:
image: kegbot/mariadb:latest
restart: always
environment:
MYSQL_ROOT_PASSWORD: ‘xxx’
MYSQL_USER: ‘kegbot_dev’
MYSQL_PASSWORD: ‘xxxx’
MYSQL_DATABASE: ‘kegbot_dev’
tmpfs:
- /tmp
- /var/tmp
volumes:
- /home/kegbot/kegberry/mysql:/var/lib/mysql

redis:
image: redis:latest
restart: always

pycore:
image: kegbot/pycore:latest
restart: always
tmpfs:
- /tmp
- /var/tmp
environment:
KEGBOT_REDIS_URL: redis://redis:6379/0
KEGBOT_API_KEY: ‘xxxx’
KEGBOT_API_URL: ‘http://kegbot:8000/api/

kegboard:
image: kegbot/pycore:latest
restart: always
command: bin/kegboard_daemon.py --kegboard_device=/dev/ttyACM0
tmpfs:
- /tmp
- /var/tmp
environment:
KEGBOT_REDIS_URL: redis://redis:6379/0
devices:
- /dev/ttyACM0:/dev/ttyACM0
- /dev/bus/usb:/dev/bus/usb

volumes:
mysql-data:
kegbot-data:

Awesome! Inline:

I took a copy of my vhd (linux vm running on oracle virtual box) so happy to test everything out.

OK! That sounds like a decent backup. What wasn’t working about the built-in backup option, by the way?

Thanks for your existing docker-compose. Starting with the new example compose file as the basis, I think you’ll want to make the following changes:

1/ Update volumes. In the kegbot and workers block, it would be:

volumes:
  - /home/kegbot/kegberry/data:/kegbot-data

In the mysql definition, try:

volumes:
  - /home/kegbot/kegberry/data/mysql:/var/lib/mysql

2/ For the mysql block, I forgot that we’ve been using the mariadb fork. So change image to read:

image: mariadb/latest

I think you’ll need to be on a 64bit raspberry pi os since maraidb doesn’t provide 32bit arm images. Can you try uname -m - it should say aarch64; if it says armv7l then you’ll have to use our (old) mariadb build for that arch:

 image: kegbot/mariadb:latest

3/ Add the pycore and kegboard blocks back. These don’t really need to be in the same compose file, but I see how it’s convenient to share the redis.

have you deprecated the old API?

Nope! The v2 API shouldn’t interfere with the legacy API, which is unchanged. We’ll break/drop that api in the v2.0.0 server release, whenever that is, but for now you should be good.

(If you want to play with the new API, you’ll need to turn the setting on to enable it. )

Thanks Mike, will give that a go.

The backup within the web interface just didn’t have the files in the interface. To be honest I haven’t checked the file system to see if it worked. I’ll check that as well.

Report back shortly

1 Like

Sounds good! I’m also on the Kegbot slack at weird hours (including now), if you want a little more realtime help. I’ll shadow what we learn back into the docs, of course!

Install works perfectly, up and running in minutes and no new issues.

I can’t see that update you released yet Mike, I did the upgrade process but said I was on the latest version. Is it still pushing to docker?