Skip to content
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

Use GitHub Actions services (for PostgreSQL and RabbitMQ) #3901

Merged
merged 6 commits into from
Apr 8, 2020

Conversation

CasperWA
Copy link
Contributor

@CasperWA CasperWA commented Apr 7, 2020

Move over to a more "clean" setup of system services in CI tests, here PostgreSQL and RabbitMQ.

This utilizes GitHub Actions services, specifically integrating the Docker images for PostgreSQL and RabbitMQ.

Hence, some oblique lines in the workflow can be removed under the "Install system dependencies" step(s) as well as the PostgreSQL action.

Note: This does not solve the issue of having a PostgreSQL super user with an empty password; the authentication method is kept to "trust", i.e., allowing all connections no matter the database user password.

sudo rm -f /etc/apt/sources.list.d/dotnetdev.list /etc/apt/sources.list.d/microsoft-prod.list
sudo apt update
sudo apt install postgresql-10 rabbitmq-server graphviz
sudo systemctl status rabbitmq-server.service
sudo apt install postgresql-10 graphviz
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we still need to install postgresql-10 manually here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Due to the PostgreSQL tests. It may be that we do not need to after @ltalirz has moved these tests out of the package, but I am not sure?

Copy link
Contributor Author

@CasperWA CasperWA Apr 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More specifically, all tests using this class will not run properly - at least that was my prior experience when messing around with these workflows adding the, now obsolete, PostgreSQL GitHub Action.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you are mentioning the moving out of the PGSU class, then that already happened. The PR was merged yesterday. Did you try to remove it and see if the tests still run? If so what was the failure?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah that makes sense, because there it relies on pg_test to create a postgres cluster on the localhost. So if the service just exposes a postgres database on some other machine, then we still have to install it manually

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concerning the removal of postgresql-10: It is indeed not possible, see here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the actions that ran for this PR we again see sporadic failure to install dependencies using apt. Since it seems that we can't get rid of those even with the improvements introduced with this PR, I think we should probably looking into either providing a custom image or caching. Either way, this would probably be out of scope for this PR.

Yeah - there's some weird stuff happening. Hmm, also since the GitHub Pages were having some maintenance, the Docs CI is failing (I'm guessing that's why).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the actions that ran for this PR we again see sporadic failure to install dependencies using apt. Since it seems that we can't get rid of those even with the improvements introduced with this PR, I think we should probably looking into either providing a custom image or caching. Either way, this would probably be out of scope for this PR.

Since there are "only" 3 packages left (although there may be a lot of dependencies) we could download the packages and keep them under /.ci/ or similar and install them from there? I don't know if this is a viable solution, but it would avoid the fragile sudo apt update.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since there are "only" 3 packages left (although there may be a lot of dependencies) we could download the packages and keep them under /.ci/ or similar and install them from there? I don't know if this is a viable solution, but it would avoid the fragile sudo apt update.

The aiida-core repository is already over 100MB, so I would be really hesitant to start vendoring entire system software packages just to make the CI work.

Copy link
Contributor Author

@CasperWA CasperWA Apr 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found this page commenting on the issue. See also actions/runner-images#675

@codecov
Copy link

codecov bot commented Apr 7, 2020

Codecov Report

Merging #3901 into develop will not change coverage by %.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #3901   +/-   ##
========================================
  Coverage    78.00%   78.00%           
========================================
  Files          457      457           
  Lines        33708    33708           
========================================
  Hits         26295    26295           
  Misses        7413     7413           
Flag Coverage Δ
#django 70.01% <ø> (+<0.01%) ⬆️
#sqlalchemy 70.85% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5da7120...d863518. Read the comment docs.

csadorf
csadorf previously approved these changes Apr 7, 2020
Copy link
Contributor

@csadorf csadorf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@CasperWA
Copy link
Contributor Author

CasperWA commented Apr 7, 2020

LGTM!

Thanks! But just removed the testing commit that removed installing postgresql-10, automatically dismissing your review. You're welcome to re-accept 😄

@CasperWA CasperWA force-pushed the use_github_actions_services branch from 2dcc18d to d863518 Compare April 7, 2020 16:02
@sphuber sphuber merged commit 676a83e into aiidateam:develop Apr 8, 2020
@sphuber sphuber deleted the use_github_actions_services branch April 8, 2020 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants