Skip to content
Merged

fix ci. #1557

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
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ networks:

services:
rest:
image: apache/iceberg-rest-fixture
image: apache/iceberg-rest-fixture:1.9.2
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this is due to the new default behavior for iceberg-rest-fixture

apache/iceberg#13599

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lesson learned is that we should always have a version attached to docker image, otherwise it will cause failure that's difficult to debug.

environment:
- AWS_ACCESS_KEY_ID=admin
- AWS_SECRET_ACCESS_KEY=password
Expand Down
2 changes: 1 addition & 1 deletion crates/integration_tests/testdata/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ networks:

services:
rest:
image: apache/iceberg-rest-fixture
image: apache/iceberg-rest-fixture:1.9.2
environment:
- AWS_ACCESS_KEY_ID=admin
- AWS_SECRET_ACCESS_KEY=password
Expand Down
6 changes: 4 additions & 2 deletions crates/integration_tests/testdata/spark/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ set -e

start-master.sh -p 7077
start-worker.sh spark://spark-iceberg:7077
start-history-server.sh

echo "Starting provision"
python3 ./provision.py

echo "Finished provisioning"
touch /tmp/ready

tail -f /dev/null
echo "Print logs"
tail -f $SPARK_HOME/logs/*
10 changes: 6 additions & 4 deletions crates/test_utils/src/cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,18 @@

use std::process::Command;

use tracing::info;
use tracing::{error, info};

pub fn run_command(mut cmd: Command, desc: impl ToString) {
pub fn run_command(mut cmd: Command, desc: impl ToString) -> bool {
let desc = desc.to_string();
info!("Starting to {}, command: {:?}", &desc, cmd);
let exit = cmd.status().unwrap();
if exit.success() {
info!("{} succeed!", desc)
info!("{} succeed!", desc);
true
} else {
panic!("{} failed: {:?}", desc, exit);
error!("{} failed: {:?}", desc, exit);
false
}
}

Expand Down
29 changes: 25 additions & 4 deletions crates/test_utils/src/docker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,30 @@ impl DockerCompose {
"1200000",
]);

run_command(
let ret = run_command(
cmd,
format!(
"Starting docker compose in {}, project name: {}",
self.docker_compose_dir, self.project_name
),
)
);

if !ret {
let mut cmd = Command::new("docker");
cmd.current_dir(&self.docker_compose_dir);

cmd.env("DOCKER_DEFAULT_PLATFORM", Self::get_os_arch());

cmd.args(vec![
"compose",
"-p",
self.project_name.as_str(),
"logs",
"spark-iceberg",
]);
run_command(cmd, "Docker compose logs");
panic!("Docker compose up failed!")
}
}

pub fn down(&self) {
Expand All @@ -106,13 +123,17 @@ impl DockerCompose {
"--remove-orphans",
]);

run_command(
let ret = run_command(
cmd,
format!(
"Stopping docker compose in {}, project name: {}",
self.docker_compose_dir, self.project_name
),
)
);

if !ret {
panic!("Failed to stop docker compose")
}
}

pub fn get_container_ip(&self, service_name: impl AsRef<str>) -> IpAddr {
Expand Down
Loading