Skip to content
Open
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
@@ -1,4 +1,4 @@
{
"comment": "Modify this file in a trivial way to cause this test suite to run.",
"modification": 1
"modification": 3
}
5 changes: 4 additions & 1 deletion sdks/python/test-suites/dataflow/common.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,10 @@ task installTFTRequirements {
exec {
workingDir "$rootProject.projectDir/sdks/python/apache_beam/testing/benchmarks/cloudml/"
executable 'sh'
args '-c', ". ${envdir}/bin/activate && pip install -r requirements.txt"
args '-c', ". ${envdir}/bin/activate && " +
"grep -v '^tensorflow-transform' requirements.txt > /tmp/cloudml_tft_base_requirements.txt && " +
"pip install -r /tmp/cloudml_tft_base_requirements.txt && " +
"pip install --no-deps tensorflow-transform==1.16.0"
Comment on lines +574 to +577
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.

medium

Using a hardcoded temporary file path like /tmp/cloudml_tft_base_requirements.txt can lead to conflicts, permission issues, or race conditions if multiple builds or tasks run concurrently on the same machine.

It is safer to use mktemp to create a unique temporary file and ensure it is cleaned up after the installation is complete.

      args '-c', ". ${envdir}/bin/activate && " +
          'tmp_file=$(mktemp) && ' +
          'grep -v "^tensorflow-transform" requirements.txt > "$tmp_file" && ' +
          'pip install -r "$tmp_file" && ' +
          'rm "$tmp_file" && ' +
          'pip install --no-deps tensorflow-transform==1.16.0'

}
}
}
Expand Down
Loading