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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 20 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,27 @@ jobs:
backend: ['django', 'sqlalchemy']
python-version: [3.5, 3.8]

services:
postgres:
image: postgres:10
env:
POSTGRES_DB: test_${{ matrix.backend }}
POSTGRES_PASSWORD: ''
POSTGRES_HOST_AUTH_METHOD: trust
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
rabbitmq:
image: rabbitmq:latest
ports:
- 5672:5672

steps:
- uses: actions/checkout@v2
- uses: CasperWA/[email protected]
with:
postgresql version: '10'
postgresql db: test_${{ matrix.backend }}
postgresql user: postgres
postgresql password: ''
postgresql auth: trust

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
Expand All @@ -127,13 +139,9 @@ jobs:

- name: Install system dependencies
run: |
wget -O - "https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc" | sudo apt-key add -
echo 'deb https://dl.bintray.com/rabbitmq-erlang/debian bionic erlang' | sudo tee -a /etc/apt/sources.list.d/bintray.rabbitmq.list
echo 'deb https://dl.bintray.com/rabbitmq/debian bionic main' | sudo tee -a /etc/apt/sources.list.d/bintray.rabbitmq.list
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


- name: Upgrade pip
run: |
Expand Down
32 changes: 20 additions & 12 deletions .github/workflows/test-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,27 @@ jobs:
python-version: [3.5, 3.6, 3.7, 3.8]
backend: ['django', 'sqlalchemy']

services:
postgres:
image: postgres:10
env:
POSTGRES_DB: test_${{ matrix.backend }}
POSTGRES_PASSWORD: ''
POSTGRES_HOST_AUTH_METHOD: trust
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
rabbitmq:
image: rabbitmq:latest
ports:
- 5672:5672

steps:
- uses: actions/checkout@v2
- uses: CasperWA/[email protected]
with:
postgresql version: '10'
postgresql db: test_${{ matrix.backend }}
postgresql user: postgres
postgresql password: ''
postgresql auth: trust

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
Expand All @@ -115,13 +127,9 @@ jobs:

- name: Install system dependencies
run: |
wget -O - "https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc" | sudo apt-key add -
echo 'deb https://dl.bintray.com/rabbitmq-erlang/debian bionic erlang' | sudo tee -a /etc/apt/sources.list.d/bintray.rabbitmq.list
echo 'deb https://dl.bintray.com/rabbitmq/debian bionic main' | sudo tee -a /etc/apt/sources.list.d/bintray.rabbitmq.list
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

- run: pip install --upgrade pip

Expand Down
32 changes: 20 additions & 12 deletions .github/workflows/update-requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,29 @@ jobs:
backend: ['django', 'sqlalchemy']
python-version: [3.5, 3.6, 3.7, 3.8]

services:
postgres:
image: postgres:10
env:
POSTGRES_DB: test_${{ matrix.backend }}
POSTGRES_PASSWORD: ''
POSTGRES_HOST_AUTH_METHOD: trust
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
rabbitmq:
image: rabbitmq:latest
ports:
- 5672:5672

steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.client_payload.head_ref }}
- uses: CasperWA/[email protected]
with:
postgresql version: '10'
postgresql db: test_${{ matrix.backend }}
postgresql user: postgres
postgresql password: ''
postgresql auth: trust

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
Expand All @@ -36,13 +48,9 @@ jobs:

- name: Install system dependencies
run: |
wget -O - "https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc" | sudo apt-key add -
echo 'deb https://dl.bintray.com/rabbitmq-erlang/debian bionic erlang' | sudo tee -a /etc/apt/sources.list.d/bintray.rabbitmq.list
echo 'deb https://dl.bintray.com/rabbitmq/debian bionic main' | sudo tee -a /etc/apt/sources.list.d/bintray.rabbitmq.list
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

- run: pip install --upgrade pip

Expand Down