Skip to content

Commit decf1e2

Browse files
committed
more os versions
1 parent 086dc40 commit decf1e2

File tree

7 files changed

+50
-87
lines changed

7 files changed

+50
-87
lines changed

.devcontainer/Dockerfile

Lines changed: 24 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -13,55 +13,33 @@ SHELL ["/bin/bash", "-c"]
1313

1414
# install deps
1515
RUN if [ "${BASE_IMAGE_OS}" = "debian" ]; then \
16-
apt-get update && apt-get -y install build-essential libreadline-dev zlib1g-dev \
17-
flex bison libxml2-dev libxslt-dev libssl-dev \
18-
libxml2-utils xsltproc ccache pkg-config wget \
19-
curl lsb-release ca-certificates gnupg sudo git \
20-
nano net-tools awscli libkrb5-dev python3.11 pip; \
16+
apt-get update && \
17+
apt-get -y install build-essential libreadline-dev zlib1g-dev flex bison \
18+
libxml2-dev libxslt-dev libssl-dev git libxml2-utils xsltproc \
19+
pkg-config wget curl sudo lsb-release ca-certificates gnupg \
20+
nano net-tools libkrb5-dev python3 python3-pip python3-venv \
21+
python3-dev && \
22+
apt install --only-upgrade python3-pip && \
23+
pip3 install pipx --break-system-packages; \
2124
fi
2225
RUN if [ "${BASE_IMAGE_OS}" = "almalinux" ]; then \
2326
dnf -y update && \
2427
dnf -y install epel-release && \
25-
dnf config-manager --enable crb && \
26-
dnf -y install gcc gcc-c++ make readline-devel zlib-devel which \
27-
flex bison libxml2-devel libxslt-devel openssl-devel \
28-
ccache pkgconfig wget lsb_release ca-certificates \
29-
gnupg sudo git nano net-tools awscli krb5-devel \
30-
python3.11 pip; \
31-
fi
32-
33-
# Upgrade pip and uv
34-
RUN if [ "$BASE_IMAGE_OS" = "almalinux" ]; then \
35-
python3.11 -m ensurepip --upgrade && \
36-
python3.11 -m pip install --upgrade pip && \
37-
python3.11 -m pip install uv; \
38-
fi
39-
RUN if [ "$BASE_IMAGE_OS" = "debian" ]; then \
40-
python3.11 -m pip install --upgrade pip --break-system-packages && \
41-
python3.11 -m pip install uv --break-system-packages; \
42-
fi
43-
44-
ENV PATH="~/.local/bin:$PATH"
45-
46-
# Install uv (we run mitmproxy with it)
47-
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
48-
49-
# install azure-cli
50-
RUN if [ "${BASE_IMAGE_OS}" = "debian" ]; then \
51-
curl -sL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | tee /etc/apt/keyrings/microsoft.gpg > /dev/null && \
52-
echo "deb [arch=`dpkg --print-architecture` signed-by=/etc/apt/keyrings/microsoft.gpg] https://packages.microsoft.com/repos/azure-cli/ `lsb_release -cs` main" | tee /etc/apt/sources.list.d/azure-cli.list && \
53-
apt-get update && apt-get install -y azure-cli; \
54-
fi
55-
RUN if [ "${BASE_IMAGE_OS}" = "almalinux" ]; then \
56-
rpm --import https://packages.microsoft.com/keys/microsoft.asc && \
57-
dnf install -y https://packages.microsoft.com/config/rhel/${BASE_IMAGE_OS_VERSION}/packages-microsoft-prod.rpm && \
58-
dnf install -y azure-cli; \
28+
(dnf config-manager --set-enabled powertools || true) && \
29+
(dnf config-manager --set-enabled crb || true) && \
30+
dnf -y install gcc gcc-c++ make readline-devel zlib-devel flex bison libxml2-devel \
31+
libxslt-devel openssl-devel pkgconfig wget ca-certificates sudo git \
32+
which gnupg nano net-tools krb5-devel python3 python3-pip \
33+
platform-python-devel && \
34+
pip3 install --upgrade pip && \
35+
pip3 install pipx; \
5936
fi
6037

6138
# install Postgres
6239
RUN if [ "${BASE_IMAGE_OS}" = "debian" ]; then \
63-
sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' && \
64-
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \
40+
wget -O- https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor > postgresql-keyring.gpg && \
41+
cat postgresql-keyring.gpg | sudo tee -a /usr/share/keyrings/postgresql-keyring.gpg > /dev/null && \
42+
sh -c 'echo "deb [signed-by=/usr/share/keyrings/postgresql-keyring.gpg] https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' && \
6543
apt-get update && apt-get -y install postgresql-{14,15,16,17,18}-postgis-3 \
6644
postgresql-{14,15,16,17,18}-pgaudit \
6745
postgresql-server-dev-{14,15,16,17,18} \
@@ -71,7 +49,7 @@ RUN if [ "${BASE_IMAGE_OS}" = "debian" ]; then \
7149
RUN if [ "${BASE_IMAGE_OS}" = "almalinux" ]; then \
7250
ARCH=$(uname -m) && \
7351
dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-$(rpm -E %{rhel})-${ARCH}/pgdg-redhat-repo-latest.noarch.rpm && \
74-
dnf -qy module disable postgresql && \
52+
(dnf -qy module disable postgresql || true) && \
7553
dnf install -y --nogpgcheck \
7654
postgis36_{14,15,16,17,18} \
7755
pgaudit{16_14,17_15,_16,_17,_18} \
@@ -142,6 +120,10 @@ RUN echo "$USERNAME ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/$USERNAME
142120

143121
USER $USERNAME
144122

123+
# Install awscli, azure-cli and mitmdump with rust user
124+
RUN pipx install mitmproxy && pipx install awscli && pipx install azure-cli
125+
ENV PATH="~/.local/bin:${PATH}"
126+
145127
# install Rust environment
146128
ARG RUSTC_VERSION=1.90.0
147129
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y

.github/workflows/ci.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,18 @@ jobs:
2424
arch: x86_64
2525
- runs_on: ubuntu-22.04-arm
2626
arch: aarch64
27+
- base_image_os: almalinux
28+
base_image_os_version: 8
2729
- base_image_os: almalinux
2830
base_image_os_version: 9
31+
- base_image_os: almalinux
32+
base_image_os_version: 10
2933
- base_image_os: debian
3034
base_image_os_version: bookworm
35+
- base_image_os: debian
36+
base_image_os_version: trixie
37+
- base_image_os: debian
38+
base_image_os_version: forky
3139

3240
runs-on: ${{ matrix.runs_on }}
3341

@@ -60,10 +68,18 @@ jobs:
6068
arch: x86_64
6169
- runs_on: ubuntu-22.04-arm
6270
arch: aarch64
71+
- base_image_os: almalinux
72+
base_image_os_version: 8
6373
- base_image_os: almalinux
6474
base_image_os_version: 9
75+
- base_image_os: almalinux
76+
base_image_os_version: 10
6577
- base_image_os: debian
6678
base_image_os_version: bookworm
79+
- base_image_os: debian
80+
base_image_os_version: trixie
81+
- base_image_os: debian
82+
base_image_os_version: forky
6783

6884
runs-on: ${{ matrix.runs_on }}
6985

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.PHONY: build clean install uninstall package set-pg_config-path \
22
check check-with-coverage check-minio check-azure check-gcs check-http check-format check-lint \
3-
start-containers stop-containers
3+
start-containers stop-containers build-containers
44

55
ENVFILE ?= .devcontainer/.env
66

@@ -98,7 +98,7 @@ ifeq ($(FAKE_GCS_IMAGE),docker.io/tustvold/fake-gcs-server)
9898
endif
9999
endif
100100

101-
# start containers in detached mode
101+
# start containers in detached mode without building pg_parquet image (might pull missing images)
102102
docker compose -f .devcontainer/docker-compose.yml up -d --no-build
103103

104104
is_healthy() { \
@@ -121,3 +121,6 @@ endif
121121

122122
stop-containers:
123123
docker compose -f .devcontainer/docker-compose.yml stop
124+
125+
build-containers:
126+
docker compose -f .devcontainer/docker-compose.yml build

build.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,6 @@
1-
use std::process::Command;
2-
31
use cfg_aliases::cfg_aliases;
42

53
fn main() {
6-
println!("cargo::rustc-check-cfg=cfg(rhel8)");
7-
let output = Command::new("cat")
8-
.arg("/etc/os-release")
9-
.output()
10-
.expect("Failed to execute command");
11-
12-
let os_info = String::from_utf8(output.stdout).unwrap();
13-
14-
if os_info.contains("platform:el8") {
15-
println!("cargo::rustc-cfg=rhel8");
16-
}
17-
184
cfg_aliases! {
195
pre_pg18: { any(feature = "pg14", feature = "pg15", feature = "pg16", feature = "pg17") },
206
pre_pg17: { any(feature = "pg14", feature = "pg15", feature = "pg16") },

src/pgrx_tests/common.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -366,15 +366,6 @@ pub(crate) fn extension_exists(extension_name: &str) -> bool {
366366
Spi::get_one(&query).unwrap().unwrap()
367367
}
368368

369-
pub(crate) fn extension_version(extension_name: &str) -> String {
370-
let quoted_extension = spi::quote_literal(extension_name);
371-
let query = format!(
372-
"select default_version from pg_available_extensions where name = {quoted_extension}"
373-
);
374-
375-
Spi::get_one(&query).unwrap().unwrap()
376-
}
377-
378369
pub(crate) fn write_record_batch_to_parquet(schema: SchemaRef, record_batch: RecordBatch) {
379370
let file = File::create(LOCAL_TEST_FILE_PATH).unwrap();
380371
let mut writer = ArrowWriter::try_new(file, schema, None).unwrap();

src/pgrx_tests/copy_type_roundtrip.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ mod tests {
44

55
use crate::pgrx_tests::common::{
66
assert_double, assert_float, assert_int_text_map, assert_json, assert_jsonb,
7-
extension_exists, extension_version, timetz_array_to_utc_time_array, timetz_to_utc_time,
8-
TestResult, TestTable, LOCAL_TEST_FILE_PATH,
7+
extension_exists, timetz_array_to_utc_time_array, timetz_to_utc_time, TestResult,
8+
TestTable, LOCAL_TEST_FILE_PATH,
99
};
1010
use crate::type_compat::fallback_to_text::FallbackToText;
1111
use crate::type_compat::geometry::{
@@ -1038,7 +1038,7 @@ mod tests {
10381038
#[pg_test]
10391039
fn test_geometry() {
10401040
// Skip the test if postgis extension is not available
1041-
if !extension_exists("postgis") || *extension_version("postgis") < *"3.4" {
1041+
if !extension_exists("postgis") {
10421042
return;
10431043
}
10441044

@@ -1056,7 +1056,7 @@ mod tests {
10561056
#[pg_test]
10571057
fn test_geometry_array() {
10581058
// Skip the test if postgis extension is not available
1059-
if !extension_exists("postgis") || *extension_version("postgis") < *"3.4" {
1059+
if !extension_exists("postgis") {
10601060
return;
10611061
}
10621062

@@ -1071,7 +1071,7 @@ mod tests {
10711071
#[pg_test]
10721072
fn test_geometry_geoparquet_metadata() {
10731073
// Skip the test if postgis extension is not available
1074-
if !extension_exists("postgis") || *extension_version("postgis") < *"3.4" {
1074+
if !extension_exists("postgis") {
10751075
return;
10761076
}
10771077

src/pgrx_tests/object_store.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,6 @@ mod tests {
331331
}
332332

333333
#[pg_test]
334-
#[cfg(not(rhel8))]
335334
fn test_s3_temporary_token() {
336335
object_store_cache_clear();
337336

@@ -458,7 +457,6 @@ mod tests {
458457
}
459458

460459
#[pg_test]
461-
#[cfg(not(rhel8))]
462460
fn test_azure_blob_from_env() {
463461
object_store_cache_clear();
464462

@@ -486,7 +484,6 @@ mod tests {
486484
}
487485

488486
#[pg_test]
489-
#[cfg(not(rhel8))]
490487
fn test_azure_blob_from_env_glob_pattern() {
491488
object_store_cache_clear();
492489

@@ -519,7 +516,6 @@ mod tests {
519516
}
520517

521518
#[pg_test]
522-
#[cfg(not(rhel8))]
523519
fn test_azure_uri_with_special_chars() {
524520
object_store_cache_clear();
525521

@@ -546,7 +542,6 @@ mod tests {
546542
}
547543

548544
#[pg_test]
549-
#[cfg(not(rhel8))]
550545
#[should_panic(expected = "no files found that match the pattern")]
551546
fn test_azure_with_nonexistent_pattern_uri() {
552547
object_store_cache_clear();
@@ -565,7 +560,6 @@ mod tests {
565560
}
566561

567562
#[pg_test]
568-
#[cfg(not(rhel8))]
569563
fn test_azure_from_config_file() {
570564
object_store_cache_clear();
571565

@@ -612,7 +606,6 @@ mod tests {
612606
}
613607

614608
#[pg_test]
615-
#[cfg(not(rhel8))]
616609
fn test_azure_from_env_via_connection_string() {
617610
object_store_cache_clear();
618611

@@ -641,7 +634,6 @@ mod tests {
641634
}
642635

643636
#[pg_test]
644-
#[cfg(not(rhel8))]
645637
fn test_azure_from_config_via_connection_string() {
646638
object_store_cache_clear();
647639

@@ -685,7 +677,6 @@ mod tests {
685677

686678
#[pg_test]
687679
#[should_panic(expected = "Account must be specified")]
688-
#[cfg(not(rhel8))]
689680
fn test_azure_no_storage_account() {
690681
object_store_cache_clear();
691682

@@ -707,7 +698,6 @@ mod tests {
707698

708699
#[pg_test]
709700
#[should_panic(expected = "403 Forbidden")]
710-
#[cfg(not(rhel8))]
711701
fn test_azure_wrong_storage_key() {
712702
object_store_cache_clear();
713703

@@ -734,7 +724,6 @@ mod tests {
734724

735725
#[pg_test]
736726
#[should_panic(expected = "404 Not Found")]
737-
#[cfg(not(rhel8))]
738727
fn test_azure_write_wrong_container() {
739728
object_store_cache_clear();
740729

@@ -751,7 +740,6 @@ mod tests {
751740
}
752741

753742
#[pg_test]
754-
#[cfg(not(rhel8))]
755743
fn test_azure_read_write_sas() {
756744
object_store_cache_clear();
757745

@@ -780,7 +768,6 @@ mod tests {
780768

781769
#[pg_test]
782770
#[should_panic(expected = "403 Forbidden")]
783-
#[cfg(not(rhel8))]
784771
fn test_azure_read_only_sas() {
785772
object_store_cache_clear();
786773

@@ -809,7 +796,6 @@ mod tests {
809796

810797
#[pg_test]
811798
#[should_panic(expected = "could not open file")]
812-
#[cfg(not(rhel8))]
813799
fn test_azure_unsupported_uri() {
814800
object_store_cache_clear();
815801

@@ -1029,7 +1015,6 @@ mod tests {
10291015
}
10301016

10311017
#[pg_test]
1032-
#[cfg(not(rhel8))]
10331018
fn test_object_store_cache() {
10341019
object_store_cache_clear();
10351020

0 commit comments

Comments
 (0)