-
Notifications
You must be signed in to change notification settings - Fork 497
feat: add tabletopic e2e case #2827
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
25d828c
feat(perf): implement random Avro value generation for performance te…
Gezi-lzq ff55e18
feat(e2e): implement end-to-end tests for Table Topic feature with Av…
Gezi-lzq 25d1466
feat(tests): add end-to-end tests for Table Topic feature with schema…
Gezi-lzq 27cbf9e
fix(docker): streamline Docker installation in Dockerfile and update …
Gezi-lzq 55addc6
fix(config): update S3 bucket name for Iceberg catalog in configuration
Gezi-lzq File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# 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. | ||
|
||
services: | ||
rest: | ||
image: apache/iceberg-rest-fixture | ||
container_name: "${REST_DOCKER_NAME-rest}" | ||
hostname: "${REST_DOCKER_NAME-rest}" | ||
ports: | ||
- 8181:8181 | ||
environment: | ||
- AWS_ACCESS_KEY_ID=admin | ||
- AWS_SECRET_ACCESS_KEY=password | ||
- AWS_REGION=us-east-1 | ||
- CATALOG_WAREHOUSE=s3://ko3/iceberg/ | ||
- CATALOG_IO__IMPL=org.apache.iceberg.aws.s3.S3FileIO | ||
- CATALOG_S3_ENDPOINT=http://10.5.0.2:4566 | ||
healthcheck: | ||
test: ["CMD-SHELL", "curl -f http://localhost:8181/v1/config || exit 1"] | ||
interval: 10s | ||
timeout: 5s | ||
retries: 20 | ||
start_period: 30s | ||
networks: | ||
ducknet: | ||
ipv4_address: 10.5.1.4 | ||
|
||
networks: | ||
ducknet: | ||
name: ducknet | ||
external: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# 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. | ||
|
||
services: | ||
schema-registry: | ||
image: confluentinc/cp-schema-registry:latest | ||
container_name: "${SCHEMA_REGISTRY_DOCKER_NAME-schema-registry}" | ||
hostname: "${SCHEMA_REGISTRY_DOCKER_NAME-schema-registry}" | ||
ports: | ||
- "8081:8081" | ||
environment: | ||
SCHEMA_REGISTRY_HOST_NAME: ${LOCALSTACK_DOCKER_NAME-schema-registry} | ||
SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS: ${KAFKA_BOOTSTRAP_SERVERS} | ||
SCHEMA_REGISTRY_LISTENERS: http://0.0.0.0:8081 | ||
restart: on-failure | ||
healthcheck: | ||
test: ["CMD-SHELL", "curl -f http://localhost:8081 || exit 1"] | ||
interval: 10s | ||
timeout: 60s | ||
retries: 30 | ||
networks: | ||
ducknet: | ||
ipv4_address: 10.5.1.3 | ||
|
||
networks: | ||
ducknet: | ||
name: ducknet | ||
external: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# 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. | ||
|
||
import subprocess | ||
|
||
class DockerComposeService: | ||
""" | ||
A helper class to manage the lifecycle of an external service | ||
defined in a docker-compose.yaml file. | ||
This is NOT a ducktape service and must be managed manually from test code. | ||
""" | ||
def __init__(self, compose_file_path, logger): | ||
""" | ||
:param compose_file_path: Path to the docker-compose.yaml file. | ||
:param logger: The test logger instance. | ||
""" | ||
self.compose_file_path = compose_file_path | ||
self.logger = logger | ||
|
||
def start(self, env=None): | ||
""" | ||
Starts the service using 'docker compose up'. | ||
:param env: A dictionary of environment variables to pass to the command. | ||
""" | ||
self.logger.info(f"Manually starting external service from {self.compose_file_path}...") | ||
self._run_command("up -d", env) | ||
|
||
def stop(self): | ||
""" | ||
Stops the service using 'docker compose down'. | ||
""" | ||
self.logger.info(f"Manually stopping external service from {self.compose_file_path}...") | ||
self._run_command("down --remove-orphans -v") | ||
|
||
def _run_command(self, command, env=None): | ||
env_prefix = "" | ||
if env: | ||
for key, value in env.items(): | ||
env_prefix += f"{key}='{value}' " | ||
|
||
# Use sudo -E to preserve environment variables for the docker compose command. | ||
cmd = f"{env_prefix} sudo -E docker compose -f {self.compose_file_path} {command}" | ||
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. Using shell=True with user-controlled input in subprocess.check_call is a security risk. Consider using subprocess.run with a list of arguments instead of shell=True. Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||
|
||
try: | ||
self.logger.info(f"Running command: {cmd}") | ||
subprocess.check_call(cmd, shell=True) | ||
except subprocess.CalledProcessError as e: | ||
self.logger.error(f"Failed to run command: {cmd}. Error: {e}") | ||
log_cmd = f"{env_prefix} sudo docker compose -f {self.compose_file_path} logs" | ||
subprocess.run(log_cmd, shell=True) | ||
raise |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.