Skip to content
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

gradle task for tensor RT example E2E test #2

Merged
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
2 changes: 2 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,8 @@ tasks.register("python38PostCommit") {
dependsOn(":sdks:python:test-suites:direct:py38:postCommitIT")
dependsOn(":sdks:python:test-suites:direct:py38:hdfsIntegrationTest")
dependsOn(":sdks:python:test-suites:portable:py38:postCommitPy38")
// TODO: https://github.com/apache/beam/issues/22651
dependsOn(":sdks:python:test-suites:dataflow:py38:inferencePostCommitIT")
}

tasks.register("python39PostCommit") {
Expand Down
35 changes: 35 additions & 0 deletions sdks/python/test-suites/dataflow/common.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -364,3 +364,38 @@ task validatesContainer() {
}
}
}

def tensorRTTests = tasks.create("tensorRTtests") {
AnandInguva marked this conversation as resolved.
Show resolved Hide resolved
dependsOn 'installGcpTest'
dependsOn ':sdks:python:sdist'
doLast {
def testOpts = basicPytestOpts
def argMap = [
"runner": "DataflowRunner",
"machine_type":"n1-standard-4",
"sdk_container_image": "us.gcr.io/apache-beam-testing/python-postcommit-it/tensor_rt:latest",
"sdk_location": files(configurations.distTarBall.files).singleFile,
"project": "apache-beam-testing",
"region": "us-central1",
"input": "gs://apache-beam-ml/testing/inputs/tensorrt_image_file_names.txt",
"output": "gs://apache-beam-ml/outputs/tensorrt_predictions.txt",
"engine_path": "gs://apache-beam-ml/models/ssd_mobilenet_v2_320x320_coco17_tpu-8.trt",
"disk_size_gb": 75
]
def cmdArgs = mapToArgString(argMap)
exec {
executable 'sh'
args '-c', ". ${envdir}/bin/activate && pip install pillow && python -m apache_beam.examples.inference.tensorrt_object_detection $cmdArgs --experiment='worker_accelerator=type:nvidia-tesla-t4;count:1;install-nvidia-driver' --experiment=no_use_multiple_sdk_containers"
}
}
}

// add all RunInference E2E tests that run on DataflowRunner
// As of now, this test suite is enable in py38 suite as the base NVIDIA image used for Tensor RT
// contains Python 3.8.
// TODO: https://github.com/apache/beam/issues/22651
project.tasks.register("inferencePostCommitIT") {
dependsOn = [
'tensorRTtests',
AnandInguva marked this conversation as resolved.
Show resolved Hide resolved
]
}