Skip to content

Commit 9862129

Browse files
authored
chore: cleanup extension sources before proceeding to next task (#474)
* chore: cleanup extension sources before proceeding to next task * chore: use self-hosted x86 runner * chore: additional cleanup; speeding up groonga/pgroonga builds
1 parent 472cc60 commit 9862129

25 files changed

+151
-15
lines changed

.github/workflows/dockerhub-release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222

2323
docker_x86_release:
2424
needs: settings
25-
runs-on: ubuntu-latest
25+
runs-on: [self-hosted, X64]
2626
timeout-minutes: 120
2727
env:
2828
arch: amd64

Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ RUN apt update && \
1616

1717
RUN --mount=type=bind,source=docker/cache,target=/ccache,rw \
1818
ccache -s && \
19+
ansible-galaxy collection install community.general && \
1920
cd /tmp/ansible && \
2021
ansible-playbook -e '{"async_mode": false}' playbook-docker.yml && \
2122
apt -y autoremove && \
@@ -24,7 +25,7 @@ RUN --mount=type=bind,source=docker/cache,target=/ccache,rw \
2425
apt install -y default-jdk-headless locales && \
2526
sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \
2627
locale-gen && \
27-
rm -rf /tmp/* /var/lib/apt/lists/* /var/tmp/*
28+
rm -rf /tmp/* /var/lib/apt/lists/* /var/tmp/* /usr/lib/python3/dist-packages/ansible_collections/*
2829

2930
ENV LANGUAGE en_US.UTF-8
3031
ENV LANG en_US.UTF-8

ansible/tasks/docker/setup.yml

+6
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@
3838
- set_fact:
3939
platform: "{{ platform_output.stdout }}"
4040

41+
- name: determining number of processors
42+
shell: nproc
43+
register: nproc_output
44+
- set_fact:
45+
parallel_jobs: "{{ nproc_output.stdout }}"
46+
4147
- name: Setup - import postgresql.conf
4248
template:
4349
src: files/postgresql_config/postgresql.conf.j2

ansible/tasks/postgres-extensions/01-postgis.yml

+10
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,13 @@
8686
chdir: /tmp/postgis-{{ postgis_release }}
8787
target: install
8888
become: yes
89+
90+
- name: postgis - SFCGAL cleanup
91+
file:
92+
state: absent
93+
path: /tmp/SFCGAL-v{{ sfcgal_release }}
94+
95+
- name: postgis - cleanup
96+
file:
97+
state: absent
98+
path: /tmp/postgis-{{ postgis_release }}

ansible/tasks/postgres-extensions/02-pgrouting.yml

+5
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,8 @@
4444
chdir: /tmp/pgrouting-{{ pgrouting_release }}/build
4545
target: install
4646
become: yes
47+
48+
- name: pgRouting - cleanup
49+
file:
50+
state: absent
51+
path: /tmp/pgrouting-{{ pgrouting_release }}

ansible/tasks/postgres-extensions/03-pgtap.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,9 @@
1717
make:
1818
chdir: /tmp/pgtap-{{ pgtap_release }}
1919
target: install
20-
become: yes
20+
become: yes
21+
22+
- name: pgTAP - cleanup
23+
file:
24+
state: absent
25+
path: /tmp/pgtap-{{ pgtap_release }}

ansible/tasks/postgres-extensions/04-pg_cron.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,9 @@
2929
lineinfile:
3030
path: /etc/postgresql/postgresql.conf
3131
state: present
32-
line: cron.database_name = 'postgres'
32+
line: cron.database_name = 'postgres'
33+
34+
- name: pg_cron - cleanup
35+
file:
36+
state: absent
37+
path: /tmp/pg_cron-{{ pg_cron_release }}

ansible/tasks/postgres-extensions/05-pgaudit.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,9 @@
3535
target: install
3636
params:
3737
USE_PGXS: 1
38-
become: yes
38+
become: yes
39+
40+
- name: pgAudit - cleanup
41+
file:
42+
state: absent
43+
path: /tmp/pgaudit-{{ pgaudit_release }}

ansible/tasks/postgres-extensions/06-pgjwt.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,9 @@
99
make:
1010
chdir: /tmp/pgjwt
1111
target: install
12-
become: yes
12+
become: yes
13+
14+
- name: pgjwt - cleanup
15+
file:
16+
state: absent
17+
path: /tmp/pgjwt

ansible/tasks/postgres-extensions/07-pgsql-http.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,9 @@
3535
make:
3636
chdir: /tmp/pgsql-http-{{ pgsql_http_release }}
3737
target: install
38-
become: yes
38+
become: yes
39+
40+
- name: pgsql-http - cleanup
41+
file:
42+
state: absent
43+
path: /tmp/pgsql-http-{{ pgsql_http_release }}

ansible/tasks/postgres-extensions/08-plpgsql_check.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,9 @@
3030
make:
3131
chdir: /tmp/plpgsql_check-{{ plpgsql_check_release }}
3232
target: install
33-
become: yes
33+
become: yes
34+
35+
- name: plpgsql_check - cleanup
36+
file:
37+
state: absent
38+
path: /tmp/plpgsql_check-{{ plpgsql_check_release }}

ansible/tasks/postgres-extensions/09-pg-safeupdate.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,9 @@
2222
make:
2323
chdir: /tmp/pg-safeupdate-{{ pg_safeupdate_release }}
2424
target: install
25-
become: yes
25+
become: yes
26+
27+
- name: pg-safeupdate - cleanup
28+
file:
29+
state: absent
30+
path: /tmp/pg-safeupdate-{{ pg_safeupdate_release }}

ansible/tasks/postgres-extensions/10-timescaledb.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,9 @@
2828
make:
2929
chdir: /tmp/timescaledb/build
3030
target: install
31-
become: yes
31+
become: yes
32+
33+
- name: timescaledb - cleanup
34+
file:
35+
state: absent
36+
path: /tmp/timescaledb

ansible/tasks/postgres-extensions/11-wal2json.yml

+5
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,8 @@
1010
chdir: /tmp/wal2json
1111
target: install
1212
become: yes
13+
14+
- name: wal2json - cleanup
15+
file:
16+
state: absent
17+
path: /tmp/wal2json

ansible/tasks/postgres-extensions/12-pljava.yml

+6
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,9 @@
7676
file:
7777
path: ~/.m2
7878
state: absent
79+
80+
- name: pljava - cleanup
81+
become: yes
82+
file:
83+
state: absent
84+
path: /tmp/pljava-{{ pljava_release }}

ansible/tasks/postgres-extensions/13-plv8.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@
5050
become: yes
5151
when: not async_mode
5252

53+
- name: plv8 - cleanup
54+
file:
55+
state: absent
56+
path: /tmp/plv8
57+
when: not async_mode
58+
5359
- name: plv8 - build
5460
make:
5561
chdir: /tmp/plv8
@@ -58,4 +64,3 @@
5864
poll: 0
5965
register: plv8_build
6066
when: async_mode
61-

ansible/tasks/postgres-extensions/14-pg_plan_filter.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,9 @@
1515
make:
1616
chdir: /tmp/pg_plan_filter
1717
target: install
18-
become: yes
18+
become: yes
19+
20+
- name: pg_plan_filter - cleanup
21+
file:
22+
state: absent
23+
path: /tmp/pg_plan_filter

ansible/tasks/postgres-extensions/15-pg_net.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,9 @@
2929
make:
3030
chdir: /tmp/pg_net-{{ pg_net_release }}
3131
target: install
32-
become: yes
32+
become: yes
33+
34+
- name: pg_net - cleanup
35+
file:
36+
state: absent
37+
path: /tmp/pg_net-{{ pg_net_release }}

ansible/tasks/postgres-extensions/16-rum.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,9 @@
2626
target: install
2727
params:
2828
USE_PGXS: 1
29-
become: yes
29+
become: yes
30+
31+
- name: rum - cleanup
32+
file:
33+
state: absent
34+
path: /tmp/rum-{{ rum_release }}

ansible/tasks/postgres-extensions/17-pg_hashids.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,9 @@
1414
make:
1515
chdir: /tmp/pg_hashids
1616
target: install
17-
become: yes
17+
become: yes
18+
19+
- name: pg_hashids - cleanup
20+
file:
21+
state: absent
22+
path: /tmp/pg_hashids

ansible/tasks/postgres-extensions/18-pgsodium.yml

+10
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,13 @@
6969
state: present
7070
# script is expected to be placed by finalization tasks for different target platforms
7171
line: pgsodium.getkey_script= '{{ pg_bindir }}/pgsodium_getkey.sh'
72+
73+
- name: libsodium - cleanup
74+
file:
75+
state: absent
76+
path: /tmp/libsodium-{{ libsodium_release }}
77+
78+
- name: pgsodium - cleanup
79+
file:
80+
state: absent
81+
path: /tmp/pgsodium-{{ pgsodium_release }}

ansible/tasks/postgres-extensions/20-pg_stat_monitor.yml

+5
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,8 @@
1616
chdir: /tmp/pg_stat_monitor
1717
target: install
1818
params: USE_PGXS=1
19+
20+
- name: pg_stat_monitor cleanup
21+
file:
22+
state: absent
23+
path: /tmp/pg_stat_monitor

ansible/tasks/postgres-extensions/23-vault.yml

+5
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,8 @@
2424
chdir: /tmp/vault-{{ vault_release }}
2525
target: install
2626
become: yes
27+
28+
- name: vault - cleanup
29+
file:
30+
state: absent
31+
path: /tmp/vault-{{ vault_release }}

ansible/tasks/postgres-extensions/24-pgroonga.yml

+13
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
- name: groonga - build
2424
make:
2525
chdir: /tmp/groonga-{{ groonga_release }}
26+
jobs: "{{ parallel_jobs | default(omit) }}"
2627
become: yes
2728

2829
- name: groonga - install
@@ -48,6 +49,7 @@
4849
- name: pgroonga - build
4950
make:
5051
chdir: /tmp/pgroonga-{{ pgroonga_release }}
52+
jobs: "{{ parallel_jobs | default(omit) }}"
5153
become: yes
5254

5355
- name: pgroonga - install
@@ -56,3 +58,14 @@
5658
target: install
5759
become: yes
5860

61+
- name: groonga - cleanup
62+
file:
63+
state: absent
64+
path: /tmp/groonga-{{ groonga_release }}
65+
become: yes
66+
67+
- name: pgroonga - cleanup
68+
file:
69+
state: absent
70+
path: /tmp/pgroonga-{{ pgroonga_release }}
71+
become: yes

ansible/tasks/postgres-extensions/99-finish_async_tasks.yml

+5
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,8 @@
1212
chdir: /tmp/plv8
1313
target: install
1414
become: yes
15+
16+
- name: plv8 - cleanup
17+
file:
18+
state: absent
19+
path: /tmp/plv8

0 commit comments

Comments
 (0)