关于TestDataflowRunner
,我有一个问题想问。
我创建了一个使用DataflowRunner
运行的波束管道(Java)。我将工作人员部署在属于网络的区域asia-southeast1
中。管道在DataflowRunner
中正常运行。因此,我还希望使用@ValidatesRunner
创建TestDataflowRunner
测试。我使用相同的服务帐户和相同的网络运行了测试。执行图看起来也很好,但未能提供给工作人员。
下面是我用来运行测试的命令。
task validatesRunnerTests(type: Test) {
group = "Verification"
description = "Run tests that require a Dataflow runner to validate that pipelines/transforms work correctly"
systemProperty "beamTestPipelineOptions", JsonOutput.toJson([
"--runner=TestDataflowRunner",
"--project=$projectId",
"--region=us-central1",
"--workerZone=$zone",
"--usePublicIps=false",
"--network=$network",
"--subnetwork=$subnetwork",
"--tempRoot=$stagingBucket",
"--serviceAccount=$serviceAccount",
])
useJUnit {
includeCategories 'org.apache.beam.sdk.testing.ValidatesRunner'
}
}
服务帐户包括以下角色。
roles/dataflow.admin
roles/dataflow.worker
我只有下面的错误日志,但是在Stackdriver实例中找不到任何错误日志。
2020-08-12 17:16:27.061 ICT Startup of the worker pool in zone asia-southeast1-a failed to bring up any of the desired 1 workers. The project quota may have been exceeded or access control policies may be preventing the operation; review the Stackdriver Logging "GCE VM Instance" log for diagnostics.
2020-08-12 17:16:27.095 ICT Workflow failed. Causes: Internal Issue (8c283568ab7f3c3c): 82159483:17
有人知道这个问题并能帮我吗?
谢谢
发布于 2020-08-24 11:51:23
现在的问题似乎是如何让这份工作只与私人IP一起启动。我使用TestDataflowRunner启动了一个Dataflow作业,禁用了公共IP。
我首先克隆了WordCount回购1,并对WordCount.java
进行了三次更改。
添加了以下库:
import org.apache.beam.sdk.testing.TestPipeline;
import org.apache.beam.sdk.testing.TestPipelineOptions;
更改:
public interface WordCountOptions extends PipelineOptions {
至
public interface WordCountOptions extends TestPipelineOptions {
和
Pipeline p = Pipeline.create(options);
至
Pipeline p = TestPipeline.create(options);
我使用了Maven,并运行了以下命令:
mvn clean compile exec:java \
-Dexec.mainClass=org.apache.beam.examples.WordCount \
-Dexec.args=" \
--project=$PROJECT_ID\
--tempRoot=gs://mcbuckety/tempf
--output=gs://$BUCKET_NAME/testrundf \
--runner=TestDataflowRunner
--usePublicIps=false
--subnetwork=regions/us-central1/subnetworks/private"
-Pdataflow-runner
代码编译并启动了Dataflow作业。我去GCE页面检查VM没有公共IP,情况确实如此。我知道代码没有严格的测试;我没有断言任何东西,但是我有管道要启动。
https://stackoverflow.com/questions/63388370
复制