-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: diesel metrics for postgres #3943
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for putting together this PR. 👍
I've left a couple of minor questions and some remarks about fixing some version numbers. Otherwise this should be fine.
sudo apt-get install -y libpq-dev postgresql | ||
echo "host all all 127.0.0.1/32 md5" > sudo tee -a /etc/postgresql/10/main/pg_hba.conf | ||
sudo service postgresql restart && sleep 3 | ||
sudo DEBIAN_FRONTEND=noninteractive apt-get --purge remove postgresql\* -y |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain why you changed the postgresql version here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did that to create a predictable environment for configuration and testing. Each distro with distinct versions has a different postgresql package installed, and sometimes its default service is up and running (like in github actions containers). By removing all installed postgresql packages, it will also stop their services and clusters.
Please consider that the default ubuntu package manager does not ship the latest stable PostgreSQL package (version 16, not even 15).
I chose postgresql version 16 as it is the latest stable version. If you are not happy with the latest stable version, simply changing the PG_VERSION
job env var can install whatever is suitable for this job.
PS: Previous script tried using the default installed postgresql (currently 14), and then tried to configure postgresql 10 (/etc/postgresql/10/main/pg_hba.conf)! Something that never happened...
diesel_bench/Cargo.toml
Outdated
"runtime-tokio-rustls", | ||
] } | ||
futures = { version = "0.3", optional = true } | ||
diesel-async = { version = "0", optional = true, default-features = false } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again please prefer a more specific version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
diesel-async
should always be in sync and compatible with the base diesel
repository, is it still necessary to specify a minimum version here? We can benchmark against every commit in these two repositories.
8fa791f
to
21dd0c3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks fine with these minor notes fixed.
.github/workflows/metrics.yml
Outdated
echo 'DATABASE_URL=postgres://postgres:postgres@localhost/' >> $GITHUB_ENV | ||
sudo service postgresql restart $PG_VERSION && sleep 3 | ||
echo 'DATABASE_URL=postgres://postgres:postgres@localhost:5432/' >> $GITHUB_ENV | ||
env: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move that to the top of the script block? I would expect that people (including me) will miss that place in the future otherwise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
.github/workflows/run_benches.yml
Outdated
echo 'DATABASE_URL=postgres://postgres:postgres@localhost/' >> $GITHUB_ENV | ||
sudo service postgresql restart $PG_VERSION && sleep 3 | ||
echo 'DATABASE_URL=postgres://postgres:postgres@localhost:5432/' >> $GITHUB_ENV | ||
env: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as in the other file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Note: Quaint has been temporarily removed from the CI benchmark due to its feature set inconsistencies that cause compile errors. (#3942 (comment))