You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2021/01/05 14:20:01 UTC

[GitHub] [flink-docker] rmetzger opened a new pull request #53: [FLINK-20632] Add script to publish docker images to Github Packages

rmetzger opened a new pull request #53:
URL: https://github.com/apache/flink-docker/pull/53


   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink-docker] rmetzger commented on a change in pull request #53: [FLINK-20632] Add script to publish docker images to Github Packages

Posted by GitBox <gi...@apache.org>.
rmetzger commented on a change in pull request #53:
URL: https://github.com/apache/flink-docker/pull/53#discussion_r552514011



##########
File path: publish-to-github.sh
##########
@@ -0,0 +1,61 @@
+#!/usr/bin/env bash
+
+#
+# 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.
+#
+
+# Support for the GitHub Container Registry has not been enabled yet by the ASF. This script publishes the Flink docker images to Github Packages, on the Apache Flink GitHub repository.

Review comment:
       Yes https://issues.apache.org/jira/browse/INFRA-20959




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink-docker] zentol commented on a change in pull request #53: [FLINK-20632] Add script to publish docker images to Github Packages

Posted by GitBox <gi...@apache.org>.
zentol commented on a change in pull request #53:
URL: https://github.com/apache/flink-docker/pull/53#discussion_r552500383



##########
File path: README.md
##########
@@ -83,7 +83,14 @@ Updating the Dockerfiles involves the following steps:
       https://github.com/apache/flink-docker/commit/5920fd775ca1a8d03ee959d79bceeb5d6e8f35a1)]</sup>
     * Create a pull request against the `master` branch containing this commit.
 
-Once the pull request has been merged, a new manifest should be generated and a pull request opened
+Once the pull request has been merged, we can release the new docker images:
+
+For **publishing as a GitHub Package**, you need to perform the following steps:
+
+1. Login to your GitHub using Docker: `docker login https://docker.pkg.github.com -u <username>`. You will need to use a Personal Access Token (GitHub settings / Developer Settings / Personal access tokens) with the `write:packages` permission.

Review comment:
       couldn't we make this a step of `publish-to-github.sh`?

##########
File path: publish-to-github.sh
##########
@@ -0,0 +1,61 @@
+#!/usr/bin/env bash
+
+#
+# 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.
+#
+
+# Support for the GitHub Container Registry has not been enabled yet by the ASF. This script publishes the Flink docker images to Github Packages, on the Apache Flink GitHub repository.

Review comment:
       would a transition to the container registry break setups that started to rely on github packages?

##########
File path: publish-to-github.sh
##########
@@ -0,0 +1,61 @@
+#!/usr/bin/env bash
+
+#
+# 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.
+#
+
+# Support for the GitHub Container Registry has not been enabled yet by the ASF. This script publishes the Flink docker images to Github Packages, on the Apache Flink GitHub repository.
+
+self="$(basename "$BASH_SOURCE")"
+cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
+
+source common.sh
+
+TARGET_REGISTRY=${TARGET_REGISTRY:-"docker.pkg.github.com/apache/flink/flink"}
+
+echo "Publishing to target repository: $TARGET_REGISTRY"
+
+for dockerfile in $(find . -name "Dockerfile"); do
+    dir=$(dirname $dockerfile)
+
+    metadata="$dir/release.metadata"
+    tags=$(extractValue "Tags" $metadata)
+    tags=$(pruneTags "$tags" $latest_version)
+
+    echo "Building image in $dir"
+
+    DOCKER_BUILD_CMD="docker build"
+    DOCKER_PUSH_CMDS=()
+    IFS=',' read -ra TAGS_ARRAY <<< "$tags"
+	for raw_tag in "${TAGS_ARRAY[@]}"; do
+		# trim whitespace
+		tag=`echo $raw_tag | xargs`
+	    DOCKER_BUILD_CMD+=" -t $TARGET_REGISTRY:$tag"
+	    DOCKER_PUSH_CMDS+=( "docker push $TARGET_REGISTRY:$tag")
+	done
+	DOCKER_BUILD_CMD+=" $dir"
+	echo "	Building docker image using command"

Review comment:
       maybe use `echo -e  "\t[...]"`

##########
File path: publish-to-github.sh
##########
@@ -0,0 +1,61 @@
+#!/usr/bin/env bash
+
+#
+# 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.
+#
+
+# Support for the GitHub Container Registry has not been enabled yet by the ASF. This script publishes the Flink docker images to Github Packages, on the Apache Flink GitHub repository.

Review comment:
       Is there a discussion for enabling the container registry?

##########
File path: publish-to-github.sh
##########
@@ -0,0 +1,61 @@
+#!/usr/bin/env bash
+
+#
+# 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.
+#
+
+# Support for the GitHub Container Registry has not been enabled yet by the ASF. This script publishes the Flink docker images to Github Packages, on the Apache Flink GitHub repository.
+
+self="$(basename "$BASH_SOURCE")"
+cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
+
+source common.sh
+
+TARGET_REGISTRY=${TARGET_REGISTRY:-"docker.pkg.github.com/apache/flink/flink"}
+
+echo "Publishing to target repository: $TARGET_REGISTRY"
+
+for dockerfile in $(find . -name "Dockerfile"); do
+    dir=$(dirname $dockerfile)
+
+    metadata="$dir/release.metadata"
+    tags=$(extractValue "Tags" $metadata)
+    tags=$(pruneTags "$tags" $latest_version)
+
+    echo "Building image in $dir"
+
+    DOCKER_BUILD_CMD="docker build"
+    DOCKER_PUSH_CMDS=()
+    IFS=',' read -ra TAGS_ARRAY <<< "$tags"
+	for raw_tag in "${TAGS_ARRAY[@]}"; do
+		# trim whitespace
+		tag=`echo $raw_tag | xargs`
+	    DOCKER_BUILD_CMD+=" -t $TARGET_REGISTRY:$tag"
+	    DOCKER_PUSH_CMDS+=( "docker push $TARGET_REGISTRY:$tag")
+	done
+	DOCKER_BUILD_CMD+=" $dir"
+	echo "	Building docker image using command"
+	echo "		 $DOCKER_BUILD_CMD"
+	eval $DOCKER_BUILD_CMD
+	echo "	Pushing tags"
+	for push_cmd in "${DOCKER_PUSH_CMDS[@]}"; do
+		echo "		Pushing using $push_cmd"

Review comment:
       same as above but `\t\t`




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink-docker] rmetzger merged pull request #53: [FLINK-20632] Add script to publish docker images to Docker Hub

Posted by GitBox <gi...@apache.org>.
rmetzger merged pull request #53:
URL: https://github.com/apache/flink-docker/pull/53


   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink-docker] rmetzger commented on a change in pull request #53: [FLINK-20632] Add script to publish docker images to Github Packages

Posted by GitBox <gi...@apache.org>.
rmetzger commented on a change in pull request #53:
URL: https://github.com/apache/flink-docker/pull/53#discussion_r552513812



##########
File path: README.md
##########
@@ -83,7 +83,14 @@ Updating the Dockerfiles involves the following steps:
       https://github.com/apache/flink-docker/commit/5920fd775ca1a8d03ee959d79bceeb5d6e8f35a1)]</sup>
     * Create a pull request against the `master` branch containing this commit.
 
-Once the pull request has been merged, a new manifest should be generated and a pull request opened
+Once the pull request has been merged, we can release the new docker images:
+
+For **publishing as a GitHub Package**, you need to perform the following steps:
+
+1. Login to your GitHub using Docker: `docker login https://docker.pkg.github.com -u <username>`. You will need to use a Personal Access Token (GitHub settings / Developer Settings / Personal access tokens) with the `write:packages` permission.

Review comment:
       The login seems to be a permanent, one-time action. I'm not sure if it's worth it adding it to the script




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink-docker] rmetzger merged pull request #53: [FLINK-20632] Add script to publish docker images to Docker Hub

Posted by GitBox <gi...@apache.org>.
rmetzger merged pull request #53:
URL: https://github.com/apache/flink-docker/pull/53


   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org