Skip to content
Merged
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
31 changes: 29 additions & 2 deletions people-and-planet-ai/image-classification/e2e_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,31 @@ def model_endpoint_id() -> str:
client.delete_endpoint(name=endpoint_path).result()


def test_create_images_database_table(bucket_name: str, bigquery_dataset: str) -> None:
@pytest.fixture(scope="session")
def cache_dependencies() -> None:
# The Dataflow staging procedure involves downloading all the requirements and
# rebuilding everything from scratch.
# Recent Apache Beam versions include dependencies that require a C++ and Rust compiler
# and compiling all the dependencies can take a long time.
# We download the pre-compiled dependencies and then set PIP_NO_DEPS to force
# pip to not rebuild any indirect dependencies.
subprocess.run(
[
"pip",
"download",
"--dest",
"/tmp/dataflow-requirements-cache",
"-r",
"requirements.txt",
],
check=True,
)
os.environ["PIP_NO_DEPS"] = "True"


def test_create_images_database_table(
bucket_name: str, bigquery_dataset: str, cache_dependencies: None
) -> None:
# The table is deleted when we delete the dataset.
subprocess.run(
[
Expand All @@ -146,7 +170,10 @@ def test_create_images_database_table(bucket_name: str, bigquery_dataset: str) -


def test_train_model(
bucket_name: str, bigquery_dataset: str, bigquery_table: str
bucket_name: str,
bigquery_dataset: str,
bigquery_table: str,
cache_dependencies: None,
) -> None:
subprocess.run(
[
Expand Down
4 changes: 2 additions & 2 deletions people-and-planet-ai/image-classification/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Pillow==8.4.0
apache-beam[gcp]==2.31.0
apache-beam[gcp]==2.33.0
google-cloud-aiplatform==1.7.0
google-cloud-bigquery==2.29.0 # Indirect dependency, but there is a version conflict that causes pip to hang unless we constraint this.
google-cloud-bigquery==2.30.0 # Indirect dependency, but there is a version conflict that causes pip to hang unless we constraint this.
Loading