-
Notifications
You must be signed in to change notification settings - Fork 45
test: add integration test with minio #112
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
Changes from 9 commits
a77a0bb
6fe88c3
b0c6562
518a8f7
15b75bd
452d365
b195676
832df81
65f0ae4
a28debc
f43852e
5a747fd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
# under the License. | ||
|
||
/Cargo.lock | ||
**/Cargo.lock | ||
/target | ||
**/target | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
FROM alpine:3.18 | ||
RUN apk update && apk add --no-cache wget ca-certificates bash findutils | ||
|
||
RUN cd /usr/local/bin && \ | ||
wget -q --show-progress https://dl.min.io/client/mc/release/linux-amd64/mc && \ | ||
chmod +x mc |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
set -eux | ||
|
||
echo ">>> Copying tables to Minio" | ||
|
||
echo ">>> Creating Minio store" | ||
mc config host add store http://minio:9000 $MINIO_ACCESS_KEY $MINIO_SECRET_KEY | ||
|
||
echo ">>> Creating bucket" | ||
mc mb store/$MINIO_TEST_BUCKET | ||
|
||
echo ">>> Unzipping tables" | ||
find /opt/data -name "*.zip" -exec unzip {} -d /tmp/data/ \; | ||
|
||
echo ">>> Copying tables to Minio" | ||
find /tmp/data -type d -mindepth 1 -maxdepth 1 -exec mc cp --recursive {} store/$MINIO_TEST_BUCKET \; | ||
|
||
echo ">>> Listing uploaded tables" | ||
mc ls store/$MINIO_TEST_BUCKET | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can this script be incorporated into Dockerfile? it's just a few commands after all. we want to keep things more consolidated |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
version: "3.8" | ||
|
||
services: | ||
minio: | ||
image: quay.io/minio/minio | ||
container_name: minio | ||
ports: | ||
- "9000:9000" | ||
env_file: | ||
- s3.env | ||
command: server /data | ||
healthcheck: | ||
test: mc ready local | ||
interval: 5s | ||
timeout: 10s | ||
retries: 5 | ||
start_period: 2s | ||
|
||
|
||
mc: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
container_name: mc | ||
depends_on: | ||
minio: | ||
condition: service_healthy | ||
env_file: | ||
- s3.env | ||
volumes: | ||
- ../crates/tests/data/tables:/opt/data:ro | ||
- ./copy_tables.sh:/opt/copy_tables.sh | ||
entrypoint: /opt/copy_tables.sh | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
MINIO_ROOT_USER=minio | ||
MINIO_ROOT_PASSWORD=minio123 | ||
MINIO_ACCESS_KEY=minio | ||
MINIO_SECRET_KEY=minio123 | ||
MINIO_TEST_BUCKET=test-bucket |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
[workspace] | ||
members = [] | ||
|
||
[package] | ||
version = "0.1.0" | ||
name = "integration_test" | ||
edition = "2021" | ||
license = "Apache-2.0" | ||
rust-version = "1.75.0" | ||
description = "Integration tests for hudi-rs" | ||
|
||
|
||
[dependencies] | ||
hudi = { features=["datafusion"], path="../crates/hudi" } | ||
datafusion = { version = "= 39.0.0" } | ||
datafusion-expr = { version = "= 39.0.0" } | ||
tokio = { version = "1", features = ["rt-multi-thread"] } | ||
|
||
strum = { version = "0.26.3", features = ["derive"] } | ||
strum_macros = "0.26.4" | ||
url = { version = "2" } |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
[env] | ||
AWS_ACCESS_KEY_ID="minio" | ||
AWS_SECRET_ACCESS_KEY="minio123" | ||
AWS_ENDPOINT="http://localhost:9000" | ||
INTEGRATION_TEST_S3_BUCKET="test-bucket" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this still needed given there is |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why create a lib ? it's just to run an application so bin works better? we don't expect another crate to depend on integ test |
Uh oh!
There was an error while loading. Please reload this page.