bsdpot / potluck

This project contains the FreeBSD pot (jail) (pkg install pot) flavours which are regularly built with Jenkins and published on potluck.honeyguide.net.
BSD 3-Clause "New" or "Revised" License
44 stars 10 forks source link

loki image won't build on freebsd 14 #46

Closed bretton closed 4 months ago

bretton commented 4 months ago

loki.sh has the following steps for manual loki and promtail install

# last updated 2022-07-20
step "Download loki release from github"
fetch -qo - https://github.com/grafana/loki/releases/download/\
v2.6.1/loki-freebsd-amd64.zip | unzip -p - loki-freebsd-amd64 \
  >/usr/local/bin/loki
chmod 755 /usr/local/bin/loki

if [ "$(sha256 -q /usr/local/bin/loki)" != \
  "ece8b6d91fcf9a3b0cae6f828988c23cb077e17662fff4e5e0066570d29aa3d5" ]; then
  exit_error "/usr/local/bin/loki checksum mismatch!"
fi

# last updated 2022-07-20
step "Download promtail release from github"
fetch -qo - https://github.com/grafana/loki/releases/download/\
v2.6.1/promtail-freebsd-amd64.zip | unzip -p - promtail-freebsd-amd64 \
  >/usr/local/bin/promtail
chmod 755 /usr/local/bin/promtail

if [ "$(sha256 -q /usr/local/bin/promtail)" != \
  "7aa244fb3d0f8dba8b9edff7536fa55be2300bee7c63b0b003ac1a8f7d99ab9d" ]; then
  exit_error "/usr/local/bin/promtail checksum mismatch!"
fi

This fails to build on freebsd 14.

whereas beast-of-argh.sh has an updated setup, and newer versions, as follows. it builds fine.

# this is failing to extract on FBSD14
#step "Download loki release from github"
#fetch -qo - https://github.com/grafana/loki/releases/download/\
#v2.9.5/loki-freebsd-amd64.zip | unzip -p - loki-freebsd-amd64 \
#  >/usr/local/bin/loki
#chmod 755 /usr/local/bin/loki
#
#if [ "$(sha256 -q /usr/local/bin/loki)" != \
#  "e9374ec4e4c5fc6021646b7fa7cd7e0a0f08dc0db6741a3c55874f1b8496346a" ]; then
#  exit_error "/usr/local/bin/loki checksum mismatch!"
#fi

# alternative approach as temporary measure (2024-03-03)
step "Download loki release from github"
fetch -qo /tmp/loki-freebsd-amd64.zip https://github.com/grafana/loki/releases/download/v2.9.8/loki-freebsd-amd64.zip

step "Unzip loki"
unzip -o -d /tmp /tmp/loki-freebsd-amd64.zip

step "Validate loki checksum and install if valid"
if [ "$(sha256 -q /tmp/loki-freebsd-amd64)" == "f4dc39f6eada4fde16617e1d9372c897d16cbbe136401732fb644fb8033278a6" ]; then
    cp -f /tmp/loki-freebsd-amd64 /usr/local/bin/loki
    chmod 755 /usr/local/bin/loki
    rm -rf /tmp/loki-freebsd-amd64.zip /tmp/loki-freebsd-amd64
else
    exit_error "loki checksum mismatch!"
fi

# this is failing to extract on FBSD14
#step "Download promtail release from github"
#fetch -qo - https://github.com/grafana/loki/releases/download/\
#v2.9.5/promtail-freebsd-amd64.zip | unzip -p - promtail-freebsd-amd64 \
#  >/usr/local/bin/promtail
#chmod 755 /usr/local/bin/promtail
#
#if [ "$(sha256 -q /usr/local/bin/promtail)" != \
#  "5b4be0640062df6e25c4cbd3f1f12465fa75fcc6194e7605ee386b9424d842c6" ]; then
#  exit_error "/usr/local/bin/promtail checksum mismatch!"
#fi

step "Download promtail release from github"
fetch -qo /tmp/promtail-freebsd-amd64.zip https://github.com/grafana/loki/releases/download/v2.9.8/promtail-freebsd-amd64.zip

step "Unzip promtail"
unzip -o -d /tmp /tmp/promtail-freebsd-amd64.zip

step "Validate promtail checksum and install if valid"
if [ "$(sha256 -q /tmp/promtail-freebsd-amd64)" == "9dcd257be09e4ab22208c819abbaa74782ddcb5cde1f5fbb4fabff938230eeca" ]; then
    cp -f /tmp/promtail-freebsd-amd64 /usr/local/bin/promtail
    chmod 755 /usr/local/bin/promtail
    rm -rf /tmp/promtail-freebsd-amd64.zip /tmp/promtail-freebsd-amd64
else
    exit_error "promtail checksum mismatch!"
fi

I don't want to make major changes to loki, it can be shared back upstream perhaps?

Making a note here in meantime.

grembo commented 4 months ago

@bretton What about switching to the binary package from ports? (it's been available for a while)

pkg install grafana-loki

This contains loki and promtail.

bretton commented 4 months ago

I'll do some testing with beast image soon. Will close issue.