Closed gjeusel closed 1 year ago
Sorry, maybe it would be more appropriate to open this issue at https://github.com/CrunchyData/crunchy-containers ?
A sample of customized dockerfile to get latest timescaledb is actually found in another unrelated issue.
Still, the question remains, would it be possible to add the tsl file in the official image ? 🙏
Hi, I bumped into this issue as well. at first, I tried to use timescaledb function. But got this error:
ERROR: function "time_bucket_gapfill" is not supported under the current "apache" license
Hint: Upgrade your license to 'timescale' to use this free community feature.
To fix that I found that we can do (what @gjeusel was doing in config):
ALTER SYSTEM SET timescaledb.license = 'timescale';
-- reload setting changes
SELECT pg_reload_conf();
And got the error:
ERROR: could not access file "$libdir/timescaledb-tsl-2.4.0": No such file or directory
Same as @gjeusel Would it be possible to add that lib?
Hi guys,
No update on this issue? @gjeusel did you find a workaround?
@ludzzz The workaround refered to by gjeusel works.
Here is a complete working example:
Dockerfile:
ARG VERSION
FROM registry.developers.crunchydata.com/crunchydata/crunchy-postgres-gis-ha:${VERSION}
USER root
RUN curl -sSL -o /etc/yum.repos.d/timescale_timescaledb.repo "https://packagecloud.io/install/repositories/timescale/timescaledb/config_file.repo?os=el&dist=8" && \
yum --disablerepo=crunchypg13 update -y && \
yum --disablerepo=crunchypg13 install -y timescaledb-2-postgresql-13 && \
yum clean all
USER 26
# magical user used here: https://github.com/CrunchyData/crunchy-containers/blob/master/build/postgres-gis/Dockerfile
Build and push your dockerfile to a repository.
Operator yaml:
apiVersion: postgres-operator.crunchydata.com/v1beta1
kind: PostgresCluster
metadata:
name: example-cluster
spec:
image: {{ .Values.image }}
imagePullSecrets:
- name: dockersecret
patroni:
dynamicConfiguration:
postgresql:
parameters:
shared_preload_libraries: timescaledb
timescaledb.license: timescale
imagePullSecrets
is only required If you are using a private repository for your image.
@johanjk i tried using your dockerfile but it fails with the following logs
ERROR: MODE environment variable is not set, aborting.
any idea what might be going wrong
I assume the log is an output from when you ran the container standalone using docker run
, not through the crd of the operator?
In that case, see https://crunchydata.github.io/crunchy-containers/stable/container-specifications/crunchy-postgres/#running-modes to set the mode env var.
Hello, is this something that progress might be made on? I am attempting to build a custom image as mentioned in this thread however I am hitting:
`#5 1.922 CentOS Linux 8 - AppStream 146 B/s | 38 B 00:00
I assume this is related to centos8 being EOL?
@yash-kalwani were you able to build the image successfully?
For anyone coming across the issue I was facing, adding --disablerepo=crunchypg13,appstream,baseos
to the yum commands allowed me to download the timescaldb version as described above. It's not ideal but is a workaround
I am hitting the license issue too. The compression is not available with the Apache version. Honestly, without compression TS is pretty much unusable in production.
@benjamin-bergia, I was able to get past this by building my own image. I have the following DOCKERFILE:
FROM registry.developers.crunchydata.com/crunchydata/crunchy-postgres:centos8-13.5-0
USER root
RUN curl -sSL -o /etc/yum.repos.d/timescale_timescaledb.repo "https://packagecloud.io/install/repositories/timescale/timescaledb/config_file.repo?os=el&dist=8" && \
yum --disablerepo=crunchypg13,appstream,baseos update -y && \
yum --disablerepo=crunchypg13,appstream,baseos install -y timescaledb-2-postgresql-13 && \
yum clean all
USER 26
Thanks a lot @kbmanseau !
I still to have some issues afterward:
ALTER SYSTEM SET timescaledb.license = 'timescale';
ERROR: could not access file "$libdir/timescaledb-tsl-2.5.0": No such file or directory
promscale=# CREATE EXTENSION promscale;
ERROR: could not access file "$libdir/timescaledb-tsl-2.5.0": No such file or directory
promscale=# CREATE EXTENSION timescaledb;
ERROR: extension "timescaledb" has already been loaded with another version
DETAIL: The loaded version is "2.5.0".
HINT: Start a new session and execute CREATE EXTENSION as the first command. Make sure to pass the "-X" flag to psql.
promscale=#
I modified the dockerfile slightly to add the promscale extension:
FROM registry.developers.crunchydata.com/crunchydata/crunchy-postgres:centos8-13.5-0
USER root
RUN curl -sSL -o /etc/yum.repos.d/timescale_timescaledb.repo "https://packagecloud.io/install/repositories/timescale/timescaledb/config_file.repo?os=el&dist=8" && \
yum --disablerepo=crunchypg13,appstream,baseos update -y && \
yum --disablerepo=crunchypg13,appstream,baseos install -y timescaledb-2-postgresql-13 && \
curl -sSL -O https://github.com/timescale/promscale_extension/releases/download/0.3.0/promscale_extension-0.3.0.pg13.x86_64.rpm && \
yum --disablerepo=crunchypg13,appstream,baseos localinstall -y promscale_extension-0.3.0.pg13.x86_64.rpm && \
rm promscale_extension-0.3.0.pg13.x86_64.rpm && \
yum clean all
USER 26
and here is my cluster config:
patroni:
dynamicConfiguration:
postgresql:
parameters:
shared_preload_libraries: timescaledb,promscale
timescaledb.license: timescale
Got it to work!
The version of the packages to install has to be 2.5.0: timescaledb-2-postgresql-13-2.5.0 timescaledb-2-loader-postgresql-13-2.5.0
. I tried with 2.5.2
and it doesn't work. By default, when not specifying the version, it defaults to 2.6.0
.
New Dockerfile:
FROM registry.developers.crunchydata.com/crunchydata/crunchy-postgres:centos8-13.5-0
USER root
RUN curl -sSL -o /etc/yum.repos.d/timescale_timescaledb.repo "https://packagecloud.io/install/repositories/timescale/timescaledb/config_file.repo?os=el&dist=8" && \
yum --disablerepo=crunchypg13,appstream,baseos update -y && \
yum --disablerepo=crunchypg13,appstream,baseos install -y timescaledb-2-postgresql-13-2.5.0 timescaledb-2-loader-postgresql-13-2.5.0 && \
curl -sSL -O https://github.com/timescale/promscale_extension/releases/download/0.3.0/promscale_extension-0.3.0.pg13.x86_64.rpm && \
yum --disablerepo=crunchypg13,appstream,baseos localinstall -y promscale_extension-0.3.0.pg13.x86_64.rpm && \
rm promscale_extension-0.3.0.pg13.x86_64.rpm && \
yum clean all
USER 26
Thanks again everyone
Any idea how to install the tsl extension in a ubi8 container ?
@mariusstaicu the following works for me (note it resembles previously posted dockerfiles in this thread very closely)
ARG VERSION
FROM registry.developers.crunchydata.com/crunchydata/crunchy-postgres-gis:${VERSION}
USER root
RUN curl -sSL -o /etc/yum.repos.d/timescale_timescaledb.repo "https://packagecloud.io/install/repositories/timescale/timescaledb/config_file.repo?os=el&dist=8" && \
microdnf --disablerepo=crunchypg14 update -y && \
microdnf --disablerepo=crunchypg14 install -y timescaledb-2-postgresql-14 && \
microdnf --disablerepo=crunchypg14 install -y timescaledb-toolkit-postgresql-14 && \
microdnf clean all
USER 26
# magical user used here: https://github.com/CrunchyData/crunchy-containers/blob/master/build/postgres-gis/Dockerfile
working with -build-arg VERSION=ubi8-14.4-3.2-0
thanks @johanjk, meanwhile I managed to do it also using microdnf in a similar fashion
i confirm this is working also with version ubi8-14.5-1
however, this will not work if the cluster already exists, it needs to be run on bootstrap, before running CREATE EXTENSION ... timescaledb ...
Closing this thread out. As noted in the thread, we include the TimescaleDB Apache 2 Edition in our container images. The TimescaleDB Community Edition is subject to the Timescale License Agreement and as a result not something that Crunchy Data packages or distributes. There are some comments in this thread regarding approaches to modifying the container images to add the TimescaleDB Community Edition extension. Crunchy Data has not validated these approaches.
FROM registry.developers.crunchydata.com/crunchydata/crunchy-postgres:${CRUNCHY_POSTGRES_VERSION}
USER root
RUN curl -sSL -o /etc/yum.repos.d/timescale_timescaledb.repo "https://packagecloud.io/install/repositories/timescale/timescaledb/config_file.repo?os=el&dist=8" && \
microdnf update -y && \
microdnf install -y timescaledb-2-loader-postgresql-14-2.11.0 && \
microdnf install -y timescaledb-2-postgresql-14-2.11.0 && \
microdnf install -y timescaledb-toolkit-postgresql-14-1.16.0 && \
microdnf clean all
USER 26
Here is a version that works and uses a specific version of timescale. If you don't do this you get a new version every time you build and that can cause minor product upgrades to be incompatible.
I found the answer to the original question that was posted here - this should probably be closed and locked. Long-story short licencing issues means roll your own containers.
Trying to modify it using patroni:
Result in:
And indeed, this file does not exists at:
Would it be possible to build the docker images with this additional file ? Even though I understand the reasons for the license to be kept as "apache" by default.