heroku / heroku-buildpack-ci-postgresql Goto Github PK
View Code? Open in Web Editor NEWAn experimental buildpack to provide Postgresql running inside CI dynos
License: MIT License
An experimental buildpack to provide Postgresql running inside CI dynos
License: MIT License
Right now, it looks like this is configured for 9.6.2, with no way to use anything else, although a lot of the supporting infrastructure is in place. Any thoughts on supporting a user-configurable version (via config var or... buildpack source control tag or...)? It would be a great way to, e.g., try out the Postgres 10 betas.
PostgreSQL 14 is now the default for Heroku PostgreSQL addons:
https://devcenter.heroku.com/changelog-items/2445
...so this buildpack's default should be updated to match:
Ideally this would be in the playbook for new PG version releases (I don't see this work tracked in the GUS epic, so presume it's not in the playbook) :-)
I am getting the following on a couple Heroku projects since the updates to Postgres 12:
-----> Copying .profile.d/00-pg-path.sh to add postgresql binaries to PATH
-----> Postgresql done
-----> Timed out running buildpack Postgresql
! Push failed
It hangs there for awhile and then eventually fails.
I filed a support for Heroku PostgreSQL to add pgtap (http://pgtap.org/documentation.html)
but maybe this is easier and more relevant to do in this buildpack.
I would like to use this but run into problems since I need to support collation sv_SE
on some columns. I have added a rake task:
namespace :db do
task add_collation: [:environment] do
puts "Adding sv_SE collation..."
ActiveRecord::Base.connection.execute("SET search_path TO 'public'; CREATE COLLATION sv_SE (locale = 'sv_SE.UTF-8');")
end
end
Rake::Task['db:structure:load_if_sql'].enhance [:add_collation]
But when using heroku-postgres:in-dyno
I'm getting:
ActiveRecord::StatementInvalid: PG::InvalidParameterValue: ERROR: could not create locale "sv_SE.UTF-8": No such file or directory
DETAIL: The operating system could not find any locale data for the locale name "sv_SE.UTF-8".
Is there an easy way to add more locales in the buildpack?
I am getting the following when trying to install Postgres 12 or 13 on a new app:
-----> Copying .profile.d/00-pg-path.sh to add postgresql binaries to PATH
-----> Postgresql done
-----> Timed out running buildpack Postgresql
! Push failed
It will hang on Postgresql done
until the Heroku build timeout kicks in. I am using the POSTGRESQL_VERSION
config var to specify the version. If I switch it to Postgres 10 or 11 on the same app it works as expected.
When setting up this buildpack for Heroku Connect, I initially had trouble with some of our Unicode tests, which we eventually tracked down to the fact that the default Postgres database was using C
for its locale settings (LC_CTYPE
and LC_COLLATE
, for example), while the databases created by the Heroku Postgres addon use en_us.UTF-8
. We were able to get the database to use the correct encoding by setting the following env vars in our CI configuration:
LANG=en_us.UTF-8
LC_CTYPE=en_us.UTF-8
LC_COLLATE=en_us.UTF-8
It might've been more than we need, or we might need to do more in the long run, but this was at least enough to get our tests working again. It'd be nice if this could be set correctly via the buildpack, directly.
The build of Postgres used in the buildpack does not support TLS. If we're building from source, we need to pass the --with-openssl flag. (this is inaccurate; see comment below.)
A build that supports TLS is nice to have for dev/prod parity.
The Heroku-16 stack reached end-of-life on May 1st, 2021, and in a few days (June 1st, 2021) the Heroku-16 build system will be decommissioned, meaning no further builds will be possible:
https://help.heroku.com/0S5P41DC/heroku-16-end-of-life-faq
As such, support for Heroku-16 can be dropped:
https://github.com/heroku/heroku-buildpack-ci-postgresql/search?q=16
There are also some Cedar-14 references that can be removed :-)
Here is my app.json
. Note that the only non-standard thing I am doing is using the subdir-heroku-buildpack
{
"environments": {
"test": {
"scripts": {
"test": "pytest"
},
"env": {
"DJANGO_SETTINGS_MODULE": "myapp.settings",
"DJANGO_SECRET_KEY": "###"
},
"buildpacks": [
{"url": "https://github.com/timanovsky/subdir-heroku-buildpack#6d1c9021ebccd1d55681fad1c22e244a86908fe2"},
{"url": "heroku/python"}
],
"addons": [
"heroku-postgresql:in-dyno"
]
}
}
}
Then I get TESTS FAILED with an error from my django settings file :
"default": dj_database_url.config(default=os.environ["DATABASE_URL"])
~~~~~~~~~~^^^^^^^^^^^^^^^^
File "<frozen os>", line 679, in __getitem__
KeyError: 'DATABASE_URL'
Any idea what's going on ? Is that a bug ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.