You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/03/15 22:58:30 UTC
[GitHub] [airflow] pierrejeambrun opened a new pull request #22296: Add recipe for BeamRunGoPipelineOperator
pierrejeambrun opened a new pull request #22296:
URL: https://github.com/apache/airflow/pull/22296
closes: https://github.com/apache/airflow/issues/21545
Hello,
Here is a first draft of the `go-beam` recipe that allows you to run beam pipeline written in go.
I tested it locally with the direct runner. Everything seems fine.
Let me know what you think,
Best,
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] pierrejeambrun commented on pull request #22296: Add recipe for BeamRunGoPipelineOperator
Posted by GitBox <gi...@apache.org>.
pierrejeambrun commented on pull request #22296:
URL: https://github.com/apache/airflow/pull/22296#issuecomment-1069657325
@mik-laj Thank you for your comments.
I just updated the PR, let me know what you think.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] pierrejeambrun commented on a change in pull request #22296: Add recipe for BeamRunGoPipelineOperator
Posted by GitBox <gi...@apache.org>.
pierrejeambrun commented on a change in pull request #22296:
URL: https://github.com/apache/airflow/pull/22296#discussion_r828467003
##########
File path: docs/docker-stack/docker-images-recipes/go-beam.Dockerfile
##########
@@ -0,0 +1,35 @@
+# 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.
+ARG BASE_AIRFLOW_IMAGE
+FROM ${BASE_AIRFLOW_IMAGE}
+
+SHELL ["/bin/bash", "-o", "pipefail", "-e", "-u", "-x", "-c"]
+
+USER 0
+
+ENV GO_INSTALL_DIR=/usr/local/go
+
+# Install Go
+RUN DOWNLOAD_URL="https://dl.google.com/go/go1.16.4.linux-amd64.tar.gz" \
Review comment:
You are right, good catch. Done :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] mik-laj merged pull request #22296: Add recipe for BeamRunGoPipelineOperator
Posted by GitBox <gi...@apache.org>.
mik-laj merged pull request #22296:
URL: https://github.com/apache/airflow/pull/22296
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] pierrejeambrun commented on a change in pull request #22296: Add recipe for BeamRunGoPipelineOperator
Posted by GitBox <gi...@apache.org>.
pierrejeambrun commented on a change in pull request #22296:
URL: https://github.com/apache/airflow/pull/22296#discussion_r828468900
##########
File path: docs/docker-stack/docker-images-recipes/go-beam.Dockerfile
##########
@@ -0,0 +1,35 @@
+# 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.
+ARG BASE_AIRFLOW_IMAGE
+FROM ${BASE_AIRFLOW_IMAGE}
+
+SHELL ["/bin/bash", "-o", "pipefail", "-e", "-u", "-x", "-c"]
+
+USER 0
+
+ENV GO_INSTALL_DIR=/usr/local/go
+
+# Install Go
+RUN DOWNLOAD_URL="https://dl.google.com/go/go1.16.4.linux-amd64.tar.gz" \
+ && TMP_DIR="$(mktemp -d)" \
+ && curl -fL "${DOWNLOAD_URL}" --output "${TMP_DIR}/go.linux-amd64.tar.gz" \
+ && mkdir -p "${GO_INSTALL_DIR}" \
+ && tar xzf "${TMP_DIR}/go.linux-amd64.tar.gz" -C "${GO_INSTALL_DIR}" --strip-components=1 \
+ && rm -rf "${TMP_DIR}"
+
+ENV GOROOT=/usr/local/go
+ENV PATH="$GOROOT/bin:$PATH"
Review comment:
Good idea. I just added that check and a test as well to validate this behavior.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] mik-laj commented on a change in pull request #22296: Add recipe for BeamRunGoPipelineOperator
Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #22296:
URL: https://github.com/apache/airflow/pull/22296#discussion_r827485790
##########
File path: docs/docker-stack/docker-images-recipes/go-beam.Dockerfile
##########
@@ -0,0 +1,35 @@
+# 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.
+ARG BASE_AIRFLOW_IMAGE
+FROM ${BASE_AIRFLOW_IMAGE}
+
+SHELL ["/bin/bash", "-o", "pipefail", "-e", "-u", "-x", "-c"]
+
+USER 0
+
+ENV GO_INSTALL_DIR=/usr/local/go
+
+# Install Go
+RUN DOWNLOAD_URL="https://dl.google.com/go/go1.16.4.linux-amd64.tar.gz" \
Review comment:
Can you add support for ARM processors? This shouldn't be hard if you use the `uname -m` command
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] github-actions[bot] commented on pull request #22296: Add recipe for BeamRunGoPipelineOperator
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #22296:
URL: https://github.com/apache/airflow/pull/22296#issuecomment-1070279820
The PR is likely OK to be merged with just subset of tests for default Python and Database versions without running the full matrix of tests, because it does not modify the core of Airflow. If the committers decide that the full tests matrix is needed, they will add the label 'full tests needed'. Then you should rebase to the latest main or amend the last commit of the PR, and push it with --force-with-lease.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] mik-laj commented on a change in pull request #22296: Add recipe for BeamRunGoPipelineOperator
Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #22296:
URL: https://github.com/apache/airflow/pull/22296#discussion_r827485230
##########
File path: docs/docker-stack/docker-images-recipes/go-beam.Dockerfile
##########
@@ -0,0 +1,35 @@
+# 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.
+ARG BASE_AIRFLOW_IMAGE
+FROM ${BASE_AIRFLOW_IMAGE}
+
+SHELL ["/bin/bash", "-o", "pipefail", "-e", "-u", "-x", "-c"]
+
+USER 0
+
+ENV GO_INSTALL_DIR=/usr/local/go
+
+# Install Go
+RUN DOWNLOAD_URL="https://dl.google.com/go/go1.16.4.linux-amd64.tar.gz" \
Review comment:
Can you extract the version to the argument to keep consistency with other recipes?
https://github.com/apache/airflow/blob/65871e36f326414082b5b1969cfea2ca082254cc/docs/docker-stack/docker-images-recipes/gcloud.Dockerfile#L22
https://github.com/apache/airflow/blob/65871e36f326414082b5b1969cfea2ca082254cc/docs/docker-stack/docker-images-recipes/hadoop.Dockerfile#L39
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] mik-laj commented on a change in pull request #22296: Add recipe for BeamRunGoPipelineOperator
Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #22296:
URL: https://github.com/apache/airflow/pull/22296#discussion_r827490018
##########
File path: docs/docker-stack/docker-images-recipes/go-beam.Dockerfile
##########
@@ -0,0 +1,35 @@
+# 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.
+ARG BASE_AIRFLOW_IMAGE
+FROM ${BASE_AIRFLOW_IMAGE}
+
+SHELL ["/bin/bash", "-o", "pipefail", "-e", "-u", "-x", "-c"]
+
+USER 0
+
+ENV GO_INSTALL_DIR=/usr/local/go
+
+# Install Go
+RUN DOWNLOAD_URL="https://dl.google.com/go/go1.16.4.linux-amd64.tar.gz" \
+ && TMP_DIR="$(mktemp -d)" \
+ && curl -fL "${DOWNLOAD_URL}" --output "${TMP_DIR}/go.linux-amd64.tar.gz" \
+ && mkdir -p "${GO_INSTALL_DIR}" \
+ && tar xzf "${TMP_DIR}/go.linux-amd64.tar.gz" -C "${GO_INSTALL_DIR}" --strip-components=1 \
+ && rm -rf "${TMP_DIR}"
+
+ENV GOROOT=/usr/local/go
+ENV PATH="$GOROOT/bin:$PATH"
Review comment:
Can you add a check if the application is available and if not, raise an exception with a link to this documentation and golang website?
We should add check here:
https://github.com/apache/airflow/blob/774ca085d2d2d58d4292b43c3511a145cc07154b/airflow/providers/apache/beam/hooks/beam.py#L310
To check if program exists, we should use [`shutil.which`](https://docs.python.org/3/library/shutil.html#shutil.which)
To generate link, we shouldn't use `airflow.airflow.utils.docs`, because this doc is not versioned. We can use the static link.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] pierrejeambrun commented on a change in pull request #22296: Add recipe for BeamRunGoPipelineOperator
Posted by GitBox <gi...@apache.org>.
pierrejeambrun commented on a change in pull request #22296:
URL: https://github.com/apache/airflow/pull/22296#discussion_r828468492
##########
File path: docs/docker-stack/docker-images-recipes/go-beam.Dockerfile
##########
@@ -0,0 +1,35 @@
+# 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.
+ARG BASE_AIRFLOW_IMAGE
+FROM ${BASE_AIRFLOW_IMAGE}
+
+SHELL ["/bin/bash", "-o", "pipefail", "-e", "-u", "-x", "-c"]
+
+USER 0
+
+ENV GO_INSTALL_DIR=/usr/local/go
+
+# Install Go
+RUN DOWNLOAD_URL="https://dl.google.com/go/go1.16.4.linux-amd64.tar.gz" \
Review comment:
Nice idea. I tweaked a little bit the run command. It kind of feel a bit hacky.
Let me know if you have a better idea on how to do that, I am not really familiar with multi platform docker images.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org