Skip to content
Open
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
19 changes: 9 additions & 10 deletions .github/workflows/IntegrationTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ defaults:
jobs:
linux-tests-httpfs:
name: MinIO Tests
runs-on: ubuntu-latest
runs-on: ${{ github.repository_owner == 'duckdb' && 'namespace-profile-linux-x64' || 'ubuntu-latest' }}
env:
S3_TEST_SERVER_AVAILABLE: 1
AWS_DEFAULT_REGION: eu-west-1
Expand All @@ -33,13 +33,13 @@ jobs:
fetch-depth: 0
submodules: 'true'

- uses: actions/setup-python@v4
- uses: actions/setup-python@v6
with:
python-version: '3.10'

- name: Install Ninja
shell: bash
run: sudo apt-get update -y -qq && sudo apt-get install -y -qq ninja-build
run: sudo apt-get update -y -qq && sudo apt-get install -y -qq ninja-build squid

- name: Setup Ccache
uses: hendrikmuhs/ccache-action@main
Expand All @@ -60,14 +60,13 @@ jobs:
- name: Install and run http proxy squid
shell: bash
run: |
sudo apt-get install squid
./scripts/run_squid.sh --port 3128 --log_dir squid_logs &

- name: Run & Populate Python test server
shell: bash
run: |
mkdir -p $PYTHON_HTTP_SERVER_DIR
cd $PYTHON_HTTP_SERVER_DIR
mkdir -p "$PYTHON_HTTP_SERVER_DIR"
cd "$PYTHON_HTTP_SERVER_DIR"
python3 -m http.server 8008 &

- name: Build
Expand All @@ -85,7 +84,7 @@ jobs:
run: |
source ./scripts/run_s3_test_server.sh
source ./scripts/set_s3_test_server_variables.sh
./build/release/test/unittest "*" --skip-error-messages "[]"
./build/release/test/unittest "*" --skip-error-messages "[]" --statically-loaded-extensions "[httpfs,parquet,core_functions]" --on-init "SET httpfs_client_implementation='curl';" || true
./build/release/test/unittest "*" --skip-error-messages "[]" --statically-loaded-extensions "[httpfs,parquet,core_functions]" --on-init "SET httpfs_client_implementation='httplib';" || true
./build/release/test/unittest "*" --skip-error-messages "[]" --statically-loaded-extensions "[httpfs,parquet,core_functions]" --on-init "SET httpfs_connection_caching=true;" || true
python3 duckdb/scripts/ci/run_tests.py ./build/release/test/unittest "*" --test-flags='--skip-error-messages "[]"'
python3 duckdb/scripts/ci/run_tests.py ./build/release/test/unittest "*" --test-flags=' --skip-error-messages "[]" --statically-loaded-extensions "[httpfs,parquet,core_functions]" --on-init "SET httpfs_client_implementation=\'curl\';"' || true
python3 duckdb/scripts/ci/run_tests.py ./build/release/test/unittest "*" --test-flags=' --skip-error-messages "[]" --statically-loaded-extensions "[httpfs,parquet,core_functions]" --on-init "SET httpfs_client_implementation=\'httplib\';"' || true
python3 duckdb/scripts/ci/run_tests.py ./build/release/test/unittest "*" --test-flags=' --skip-error-messages "[]" --statically-loaded-extensions "[httpfs,parquet,core_functions]" --on-init "SET httpfs_connection_caching=true;"' || true
35 changes: 25 additions & 10 deletions .github/workflows/MainDistributionPipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,47 @@ concurrency:
cancel-in-progress: true

jobs:
prepare:
runs-on: ${{ github.repository_owner == 'duckdb' && 'namespace-profile-linux-slim' || 'ubuntu-slim' }}
name: Prepare
outputs:
runners: ${{ steps.runners.outputs.runners }}
steps:
- name: Detect runners
id: runners
uses: duckdb/duckdb-ci/detect-runners@main

duckdb-stable-build:
name: Build extension binaries
uses: duckdb/extension-ci-tools/.github/workflows/_extension_distribution.yml@v1.5-variegata
uses: duckdb/extension-ci-tools/.github/workflows/_extension_distribution.yml@main
needs:
- prepare
with:
extension_name: httpfs
duckdb_version: v1.5.2
ci_tools_version: v1.5-variegata
duckdb_version: main
ci_tools_version: main
runners: ${{ needs.prepare.outputs.runners }}

duckdb-stable-deploy:
name: Deploy extension binaries
needs: duckdb-stable-build
uses: duckdb/extension-ci-tools/.github/workflows/_extension_deploy.yml@v1.5-variegata
needs:
- prepare
- duckdb-stable-build
uses: duckdb/extension-ci-tools/.github/workflows/_extension_deploy.yml@main
secrets: inherit
with:
extension_name: httpfs
duckdb_version: v1.5.2
ci_tools_version: v1.5-variegata
duckdb_version: main
ci_tools_version: main
deploy_latest: ${{ startsWith(github.ref, 'refs/heads/v') }}
deploy_versioned: ${{ startsWith(github.ref, 'refs/heads/v') || github.ref == 'refs/heads/main' }}

code-quality:
name: Code Quality
uses: duckdb/extension-ci-tools/.github/workflows/_extension_code_quality.yml@v1.5-variegata
uses: duckdb/extension-ci-tools/.github/workflows/_extension_code_quality.yml@main
with:
extension_name: httpfs
duckdb_version: v1.5.2
ci_tools_version: v1.5-variegata
duckdb_version: main
ci_tools_version: main
extra_toolchains: 'python3'
format_checks: 'format'
2 changes: 1 addition & 1 deletion duckdb
Submodule duckdb updated 7885 files
2 changes: 1 addition & 1 deletion extension-ci-tools
Submodule extension-ci-tools updated 31 files
+44 −6 .github/workflows/TestCITools.yml
+18 −11 .github/workflows/_extension_deploy.yml
+139 −77 .github/workflows/_extension_distribution.yml
+3 −1 README.md
+9 −4 config/distribution_matrix.json
+19 −0 docker/linux_amd64/Dockerfile
+1 −1 docker/linux_amd64_musl/Dockerfile
+19 −0 docker/linux_arm64/Dockerfile
+1 −1 docker/linux_arm64_musl/Dockerfile
+39 −30 makefiles/duckdb_extension.Makefile
+2 −0 scripts/extbuild/.gitignore
+21 −0 scripts/extbuild/Makefile
+34 −0 scripts/extbuild/README.md
+48 −0 scripts/extbuild/cmd/extbuild/github_event.go
+141 −0 scripts/extbuild/cmd/extbuild/github_event_test.go
+132 −0 scripts/extbuild/cmd/extbuild/logging.go
+13 −0 scripts/extbuild/cmd/extbuild/main.go
+115 −0 scripts/extbuild/cmd/extbuild/matrix.go
+411 −0 scripts/extbuild/cmd/extbuild/matrix_test.go
+19 −0 scripts/extbuild/cmd/extbuild/root.go
+16 −0 scripts/extbuild/go.mod
+18 −0 scripts/extbuild/go.sum
+91 −0 scripts/extbuild/internal/distmatrix/config_test.go
+353 −0 scripts/extbuild/internal/distmatrix/matrix.go
+102 −0 scripts/extbuild/internal/distmatrix/matrix_test.go
+101 −0 scripts/extbuild/internal/distmatrix/output.go
+12 −0 scripts/extbuild/testdata/github/events/extension_template_pull_request.json
+8 −0 scripts/extbuild/testdata/github/events/extension_template_push.json
+6 −0 scripts/extbuild/testdata/github/events/extension_template_unknown.json
+13 −2 scripts/modify_distribution_matrix.py
+17 −17 vcpkg_ports/avro-c/portfile.cmake
28 changes: 28 additions & 0 deletions src/httpfs_curl_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,34 @@ class HTTPFSCurlClient : public HTTPClient {
return TransformResponseCurl(res);
}

unique_ptr<HTTPResponse> Options(OptionsRequestInfo &info) override {
ResetRequestInfo();
auto curl_headers = TransformHeadersCurl(info.headers, info.params);
request_info->url = info.url;

CURLcode res;
{
CURLU *url = curl_url_dup(curl_base_url);

string normalized_path = NormalizePathToBeAdded(info.path);
curl_url_set(url, CURLUPART_URL, normalized_path.c_str(), 0);

curl_easy_setopt(*curl, CURLOPT_URL, nullptr);
curl_easy_setopt(*curl, CURLOPT_CURLU, url);

curl_easy_setopt(*curl, CURLOPT_CUSTOMREQUEST, "OPTIONS");

curl_easy_setopt(*curl, CURLOPT_HTTPHEADER, curl_headers ? curl_headers.headers : nullptr);

res = curl->Execute();
curl_easy_setopt(*curl, CURLOPT_CUSTOMREQUEST, nullptr);
curl_url_cleanup(url);
}

curl_easy_getinfo(*curl, CURLINFO_RESPONSE_CODE, &request_info->response_code);
return TransformResponseCurl(res);
}

unique_ptr<HTTPResponse> Post(PostRequestInfo &info) override {
AddUserAgentIfAvailable(static_cast<HTTPFSParams &>(info.params), info.headers);
ResetRequestInfo();
Expand Down
5 changes: 5 additions & 0 deletions src/httpfs_httplib_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ class HTTPFSClient : public HTTPClient {
return TransformResult(client->Delete(info.path, headers));
}

unique_ptr<HTTPResponse> Options(OptionsRequestInfo &info) override {
auto headers = TransformHeaders(info.headers, info.params);
return TransformResult(client->Options(info.path, headers));
}

unique_ptr<HTTPResponse> Post(PostRequestInfo &info) override {
if (state) {
state->post_count++;
Expand Down
2 changes: 1 addition & 1 deletion src/include/s3_multi_part_upload.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class S3WriteBuffer {
}

void *Ptr() {
return buffer.Ptr();
return buffer.GetDataMutable();
}

// The S3 multipart part number. Note that internally we start at 0 but AWS S3 starts at 1
Expand Down
4 changes: 2 additions & 2 deletions test/extension/autoloading_base.test
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require-env LOCAL_EXTENSION_REPO

# Ensure we have a clean extension directory without any preinstalled extensions
statement ok
set extension_directory='__TEST_DIR__/autoloading_base'
set extension_directory='{TEST_DIR}/autoloading_base'

query I
SELECT (count(*) > 0) FROM duckdb_extensions() WHERE install_path ILIKE '%duckdb_extension'
Expand Down Expand Up @@ -89,7 +89,7 @@ select * from thistablefunctionwillnotexistfosho();

### Autoloading with correct tmp repo
statement ok
set autoinstall_extension_repository='${LOCAL_EXTENSION_REPO}';
set autoinstall_extension_repository='{LOCAL_EXTENSION_REPO}';

statement ok
SET s3_region='eu-west-1';
Expand Down
4 changes: 2 additions & 2 deletions test/extension/autoloading_current_setting.test
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require-env LOCAL_EXTENSION_REPO
require httpfs

statement ok
set extension_directory='__TEST_DIR__/autoloading_current_setting'
set extension_directory='{TEST_DIR}/autoloading_current_setting'

### No autoloading: throw error with installation hint
statement ok
Expand Down Expand Up @@ -38,7 +38,7 @@ select current_setting('s3_region');

### Autoloading with autoinstall and correct extension repo
statement ok
set autoinstall_extension_repository='${LOCAL_EXTENSION_REPO}';
set autoinstall_extension_repository='{LOCAL_EXTENSION_REPO}';

statement ok
set autoinstall_known_extensions=true
Expand Down
4 changes: 2 additions & 2 deletions test/extension/autoloading_filesystems.test
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ set allow_persistent_secrets=false;

# Ensure we have a clean extension directory without any preinstalled extensions
statement ok
set extension_directory='__TEST_DIR__/autoloading_filesystems'
set extension_directory='{TEST_DIR}/autoloading_filesystems'

### No autoloading nor installing: throw error with installation hint
statement ok
Expand All @@ -35,7 +35,7 @@ statement ok
set autoinstall_known_extensions=true

statement ok
set autoinstall_extension_repository='${LOCAL_EXTENSION_REPO}';
set autoinstall_extension_repository='{LOCAL_EXTENSION_REPO}';

# Set an invalid endpoint to ensure we fail in the httpfs extension when trying to connect
statement ok
Expand Down
4 changes: 2 additions & 2 deletions test/extension/autoloading_load_only.test
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require-env LOCAL_EXTENSION_REPO

# Ensure we have a clean extension directory without any preinstalled extensions
statement ok
set extension_directory='__TEST_DIR__/autoloading_load_only'
set extension_directory='{TEST_DIR}/autoloading_load_only'

### No autoloading nor installing: throw error with installation hint
statement ok
Expand Down Expand Up @@ -38,7 +38,7 @@ SET s3_region='eu-west-1';

### Manually install the extension from the local repo
statement ok
INSTALL httpfs FROM '${LOCAL_EXTENSION_REPO}'
INSTALL httpfs FROM '{LOCAL_EXTENSION_REPO}'

# now autoloading works!
statement ok
Expand Down
4 changes: 2 additions & 2 deletions test/extension/autoloading_reset_setting.test
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require httpfs
require-env LOCAL_EXTENSION_REPO

statement ok
set extension_directory='__TEST_DIR__/autoloading_reset_setting'
set extension_directory='{TEST_DIR}/autoloading_reset_setting'

### No autoloading: throw error with installation hint
statement ok
Expand Down Expand Up @@ -40,7 +40,7 @@ Extension

### Autoloading with correct tmp repo and autoinstall
statement ok
set autoinstall_extension_repository='${LOCAL_EXTENSION_REPO}';
set autoinstall_extension_repository='{LOCAL_EXTENSION_REPO}';

statement ok
set autoinstall_known_extensions=true
Expand Down
6 changes: 3 additions & 3 deletions test/extension/duckdb_extension_settings.test
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ statement ok
SET autoload_known_extensions = true;

statement ok
SET extension_directory = '__TEST_DIR__/custom_extension_directory';
SET extension_directory = '{TEST_DIR}/custom_extension_directory';

statement ok
SET custom_extension_repository = '__TEST_DIR__/not_existing_folder'
SET custom_extension_repository = '{TEST_DIR}/not_existing_folder'

statement error
FROM read_csv('https://some.org/file.csv');
----
not_existing_folder

statement ok
SET autoinstall_extension_repository = '__TEST_DIR__/other_folder';
SET autoinstall_extension_repository = '{TEST_DIR}/other_folder';

statement error
FROM read_csv('https://some.org/file.csv');
Expand Down
2 changes: 1 addition & 1 deletion test/sql/attach/attach_httpfs.test
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ require-env S3_ATTACH_DB_PRESIGNED_URL

# ATTACH a DuckDB database over HTTPFS
statement ok
ATTACH '${S3_ATTACH_DB_PRESIGNED_URL}' AS db (READONLY 1);
ATTACH '{S3_ATTACH_DB_PRESIGNED_URL}' AS db (READONLY 1);

query IIIII
SELECT * FROM db.integral_values
Expand Down
12 changes: 6 additions & 6 deletions test/sql/attach/attach_s3.test
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ statement ok
CREATE SECRET (
TYPE S3,
PROVIDER config,
KEY_ID '${AWS_ACCESS_KEY_ID}',
SECRET '${AWS_SECRET_ACCESS_KEY}',
REGION '${AWS_DEFAULT_REGION}',
ENDPOINT '${DUCKDB_S3_ENDPOINT}',
USE_SSL '${DUCKDB_S3_USE_SSL}'
KEY_ID '{AWS_ACCESS_KEY_ID}',
SECRET '{AWS_SECRET_ACCESS_KEY}',
REGION '{AWS_DEFAULT_REGION}',
ENDPOINT '{DUCKDB_S3_ENDPOINT}',
USE_SSL '{DUCKDB_S3_USE_SSL}'
)

# ATTACH a DuckDB database over HTTPFS
statement ok
ATTACH '${S3_ATTACH_DB}' AS db (READONLY 1);
ATTACH '{S3_ATTACH_DB}' AS db (READONLY 1);

query IIIII
SELECT * FROM db.integral_values
Expand Down
18 changes: 9 additions & 9 deletions test/sql/attach/attach_s3_tpch.test_slow
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ statement ok
CREATE SECRET (
TYPE S3,
PROVIDER config,
KEY_ID '${AWS_ACCESS_KEY_ID}',
SECRET '${AWS_SECRET_ACCESS_KEY}',
REGION '${AWS_DEFAULT_REGION}',
ENDPOINT '${DUCKDB_S3_ENDPOINT}',
USE_SSL '${DUCKDB_S3_USE_SSL}'
KEY_ID '{AWS_ACCESS_KEY_ID}',
SECRET '{AWS_SECRET_ACCESS_KEY}',
REGION '{AWS_DEFAULT_REGION}',
ENDPOINT '{DUCKDB_S3_ENDPOINT}',
USE_SSL '{DUCKDB_S3_USE_SSL}'
)

# ATTACH a DuckDB database over HTTPFS
Expand All @@ -39,18 +39,18 @@ USE db
loop i 1 9

query I
PRAGMA tpch(${i})
PRAGMA tpch({i})
----
<FILE>:duckdb/extension/tpch/dbgen/answers/sf1/q0${i}.csv
<FILE>:duckdb/extension/tpch/dbgen/answers/sf1/q0{i}.csv

endloop

loop i 10 23

query I
PRAGMA tpch(${i})
PRAGMA tpch({i})
----
<FILE>:duckdb/extension/tpch/dbgen/answers/sf1/q${i}.csv
<FILE>:duckdb/extension/tpch/dbgen/answers/sf1/q{i}.csv

endloop

Expand Down
5 changes: 1 addition & 4 deletions test/sql/copy/csv/glob/copy_csv_glob_s3.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
# description: Test globbing CSVs on s3
# group: [glob]

statement ok
PRAGMA enable_verification

require httpfs

require-env S3_TEST_SERVER_AVAILABLE 1
Expand Down Expand Up @@ -50,7 +47,7 @@ COPY dates FROM 's3://test-bucket/copy_csv_glob_s3/copy/a[123]/*.csv' (AUTO_DETE
foreach urlstyle path vhost

statement ok
SET s3_url_style='${urlstyle}'
SET s3_url_style='{urlstyle}'

query I
SELECT * FROM dates ORDER BY 1
Expand Down
5 changes: 1 addition & 4 deletions test/sql/copy/csv/glob/read_csv_glob_s3.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
# description: Test globbing CSVs over s3
# group: [glob]

statement ok
PRAGMA enable_verification

require httpfs

require-env S3_TEST_SERVER_AVAILABLE 1
Expand Down Expand Up @@ -49,7 +46,7 @@ COPY (select * from read_csv_auto('duckdb/data/csv/glob/a2/a2.csv')) to 's3://te
foreach urlstyle path vhost

statement ok
SET s3_url_style='${urlstyle}'
SET s3_url_style='{urlstyle}'

# simple globbing
query I
Expand Down
Loading
Loading