[
https://issues.apache.org/jira/browse/BEAM-4849?focusedWorklogId=133760&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-133760
]
ASF GitHub Bot logged work on BEAM-4849:
----------------------------------------
Author: ASF GitHub Bot
Created on: 10/Aug/18 18:39
Start Date: 10/Aug/18 18:39
Worklog Time Spent: 10m
Work Description: lukecwik closed pull request #6029: [BEAM-4849] Support
running Beam Samza jobs in Yarn
URL: https://github.com/apache/beam/pull/6029
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git
a/runners/samza/src/main/java/org/apache/beam/runners/samza/container/BeamContainerRunner.java
b/runners/samza/src/main/java/org/apache/beam/runners/samza/container/BeamContainerRunner.java
new file mode 100644
index 00000000000..bdc135f4034
--- /dev/null
+++
b/runners/samza/src/main/java/org/apache/beam/runners/samza/container/BeamContainerRunner.java
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.beam.runners.samza.container;
+
+import org.apache.samza.config.Config;
+import org.apache.samza.config.ShellCommandConfig;
+import org.apache.samza.runtime.LocalContainerRunner;
+
+/** Runs the beam Yarn container, using the static global job model. */
+public class BeamContainerRunner extends LocalContainerRunner {
+
+ public BeamContainerRunner(Config config) {
+ super(ContainerCfgFactory.jobModel,
System.getenv(ShellCommandConfig.ENV_CONTAINER_ID()));
+ }
+}
diff --git
a/runners/samza/src/main/java/org/apache/beam/runners/samza/container/ContainerCfgFactory.java
b/runners/samza/src/main/java/org/apache/beam/runners/samza/container/ContainerCfgFactory.java
new file mode 100644
index 00000000000..751441ea73b
--- /dev/null
+++
b/runners/samza/src/main/java/org/apache/beam/runners/samza/container/ContainerCfgFactory.java
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.beam.runners.samza.container;
+
+import java.net.URI;
+import java.util.Random;
+import org.apache.samza.config.Config;
+import org.apache.samza.config.ConfigFactory;
+import org.apache.samza.config.ShellCommandConfig;
+import org.apache.samza.container.SamzaContainer;
+import org.apache.samza.job.model.JobModel;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/** Factory for the Beam yarn container to load job model. */
+public class ContainerCfgFactory implements ConfigFactory {
+ private static final Logger LOG =
LoggerFactory.getLogger(ContainerCfgFactory.class);
+
+ private static final Object LOCK = new Object();
+ static volatile JobModel jobModel;
+
+ @Override
+ public Config getConfig(URI configUri) {
+ if (jobModel == null) {
+ synchronized (LOCK) {
+ if (jobModel == null) {
+ String containerId =
System.getenv(ShellCommandConfig.ENV_CONTAINER_ID());
+ LOG.info(String.format("Got container ID: %s", containerId));
+ String coordinatorUrl =
System.getenv(ShellCommandConfig.ENV_COORDINATOR_URL());
+ LOG.info(String.format("Got coordinator URL: %s", coordinatorUrl));
+ int delay = new
Random().nextInt(SamzaContainer.DEFAULT_READ_JOBMODEL_DELAY_MS()) + 1;
+ jobModel = SamzaContainer.readJobModel(coordinatorUrl, delay);
+ }
+ }
+ }
+
+ return jobModel.getConfig();
+ }
+}
diff --git
a/runners/samza/src/main/java/org/apache/beam/runners/samza/container/package-info.java
b/runners/samza/src/main/java/org/apache/beam/runners/samza/container/package-info.java
new file mode 100644
index 00000000000..58a09e6023d
--- /dev/null
+++
b/runners/samza/src/main/java/org/apache/beam/runners/samza/container/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/** Internal implementation of the Beam runner for Apache Samza. */
+package org.apache.beam.runners.samza.container;
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 133760)
Time Spent: 1.5h (was: 1h 20m)
> Support running Beam Samza jobs in Yarn
> ---------------------------------------
>
> Key: BEAM-4849
> URL: https://issues.apache.org/jira/browse/BEAM-4849
> Project: Beam
> Issue Type: Improvement
> Components: runner-samza
> Reporter: Xinyu Liu
> Assignee: Xinyu Liu
> Priority: Major
> Time Spent: 1.5h
> Remaining Estimate: 0h
>
> We need to some util classes and script to run beam job containers in Yarn.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)