abstractdog commented on code in PR #6970:
URL: https://github.com/apache/hive/pull/6970#discussion_r4641670814


##########
dev-support/docker/ci/jenkins/README.md:
##########
@@ -0,0 +1,102 @@
+<!--
+{% comment %}
+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.
+{% endcomment %}
+-->
+# Hive CI Jenkins
+
+This directory contains all the necessary resources to build the Jenkins image 
that is used in http://ci.hive.apache.org/
+and is hosted under https://hub.docker.com/r/apache/hive-ci-jenkins/. 
+
+The Jenkins container runs in a Kubernetes cluster powered by Google Cloud.
+
+## Build
+
+### Local
+To build a new image with the latest Jenkins version and the respective 
plugins run.
+```
+docker build . -t apache/hive-ci-jenkins:lts-jdk25
+```
+The Dockerfile does not contain fixed versions for Jenkins and the plugins 
used which means that on every build
+everything will be upgraded based on the latest available.
+
+### CI 
+
+There is a GitHub action that can be used to build and publish the latest 
Jenkins image on https://hub.docker.com/r/apache/hive-ci-jenkins/.
+
+## Run & test
+To start the container and test that everything is working run.
+```
+docker run -p 35000:8080 apache/hive-ci-jenkins:lts-jdk25
+```
+The Jenkins UI can be accessed via http://0.0.0.0:35000/.
+
+## Upgrade guide
+
+The bulk of stateful content that is maintained by Jenkins is located under 
the "/var/jenkins_home" directory and the
+latter is mounted to a persistent volume (see `kubectl describe 
pod/JENKINS_POD`).
+
+For the upgrade, we need to ensure that the current state and configurations 
in the persistent volume are not in conflict
+with the new Jenkins version before pushing the new image to production.
+
+1. Obtain a backup of the jenkins_home directory from the persistent volume.
+```
+kubectl exec JENKINS_POD -- tar cf - --exclude=junitResult.xml --exclude=*log* 
--exclude=archive --exclude=workflow --exclude=*git/objects* --exclude=.kube 
/var/jenkins_home > jenkins_home_backup.tar

Review Comment:
   nit: `$JENKINS_POD`



##########
dev-support/docker/ci/jenkins/README.md:
##########
@@ -0,0 +1,102 @@
+<!--
+{% comment %}
+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.
+{% endcomment %}
+-->
+# Hive CI Jenkins
+
+This directory contains all the necessary resources to build the Jenkins image 
that is used in http://ci.hive.apache.org/
+and is hosted under https://hub.docker.com/r/apache/hive-ci-jenkins/. 
+
+The Jenkins container runs in a Kubernetes cluster powered by Google Cloud.
+
+## Build
+
+### Local
+To build a new image with the latest Jenkins version and the respective 
plugins run.
+```
+docker build . -t apache/hive-ci-jenkins:lts-jdk25
+```
+The Dockerfile does not contain fixed versions for Jenkins and the plugins 
used which means that on every build
+everything will be upgraded based on the latest available.
+
+### CI 
+
+There is a GitHub action that can be used to build and publish the latest 
Jenkins image on https://hub.docker.com/r/apache/hive-ci-jenkins/.
+
+## Run & test
+To start the container and test that everything is working run.
+```
+docker run -p 35000:8080 apache/hive-ci-jenkins:lts-jdk25
+```
+The Jenkins UI can be accessed via http://0.0.0.0:35000/.
+
+## Upgrade guide
+
+The bulk of stateful content that is maintained by Jenkins is located under 
the "/var/jenkins_home" directory and the
+latter is mounted to a persistent volume (see `kubectl describe 
pod/JENKINS_POD`).
+
+For the upgrade, we need to ensure that the current state and configurations 
in the persistent volume are not in conflict
+with the new Jenkins version before pushing the new image to production.
+
+1. Obtain a backup of the jenkins_home directory from the persistent volume.
+```
+kubectl exec JENKINS_POD -- tar cf - --exclude=junitResult.xml --exclude=*log* 
--exclude=archive --exclude=workflow --exclude=*git/objects* --exclude=.kube 
/var/jenkins_home > jenkins_home_backup.tar
+```
+Currently, the jenkins_home directory is ~280GB which makes a complete local 
backup and testing impractical.
+The majority of disk space is occupied by the "jobs" directory and in 
particular by archives that are kept for each build, test results, and log 
files for each run.
+These files are kept for archiving and diagnosability purposes when users 
wants to consult the results of each build.
+However, they are not indispensable for the correct functionality of the 
Jenkins instance so for the sake of our experiments we can exclude them from 
the backup.
+The command took ~5 minutes to run and created an archive of 2.8GB. The 
exclusions are referring to voluminous files that are nonessential for testing 
the upgrade.
+
+2. Extract the jenkins_home directory from the archive.
+```
+tar -xf jenkins_home_backup.tar
+```
+
+3. Prevent the local instance from running builds.
+
+The backup contains the production credentials (GitHub, Slack, JIRA, etc.) so 
any build that runs locally may post
+commit statuses, comments, or notifications on behalf of the production 
instance. Remove the `kubernetes` cloud, which
+cannot work outside the cluster and only floods the logs with failed 
provisioning attempts, and disable the executors
+of the built-in node.
+```
+sed -i \
+  -e '/<clouds>/,/<\/clouds>/d' \
+  -e 's/<numExecutors>[0-9]*<\/numExecutors>/<numExecutors>0<\/numExecutors>/' 
\
+  var/jenkins_home/config.xml

Review Comment:
   does this work on a mac? sed is always crazy, depending on GNU or not, maybe 
mention GNU sed explicitly or change the command



##########
dev-support/docker/ci/jenkins/Dockerfile:
##########
@@ -0,0 +1,30 @@
+#
+# 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.
+#
+FROM  jenkins/jenkins:lts-jdk25

Review Comment:
   nit two spaces after `FROM` ?



##########
dev-support/docker/ci/jenkins/Dockerfile:
##########
@@ -0,0 +1,30 @@
+#
+# 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.
+#
+FROM  jenkins/jenkins:lts-jdk25
+
+USER root
+RUN apt-get update && apt-get install -y nano curl nmap make git less && 
apt-get clean

Review Comment:
   + `rm -rf /var/lib/apt/lists/*` as it's not necessarily take care of by 
`clean`



##########
dev-support/docker/ci/jenkins/README.md:
##########
@@ -0,0 +1,102 @@
+<!--
+{% comment %}
+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.
+{% endcomment %}
+-->
+# Hive CI Jenkins
+
+This directory contains all the necessary resources to build the Jenkins image 
that is used in http://ci.hive.apache.org/
+and is hosted under https://hub.docker.com/r/apache/hive-ci-jenkins/. 
+
+The Jenkins container runs in a Kubernetes cluster powered by Google Cloud.
+
+## Build
+
+### Local
+To build a new image with the latest Jenkins version and the respective 
plugins run.
+```
+docker build . -t apache/hive-ci-jenkins:lts-jdk25
+```
+The Dockerfile does not contain fixed versions for Jenkins and the plugins 
used which means that on every build
+everything will be upgraded based on the latest available.
+
+### CI 
+
+There is a GitHub action that can be used to build and publish the latest 
Jenkins image on https://hub.docker.com/r/apache/hive-ci-jenkins/.
+
+## Run & test
+To start the container and test that everything is working run.
+```
+docker run -p 35000:8080 apache/hive-ci-jenkins:lts-jdk25
+```
+The Jenkins UI can be accessed via http://0.0.0.0:35000/.
+
+## Upgrade guide
+
+The bulk of stateful content that is maintained by Jenkins is located under 
the "/var/jenkins_home" directory and the
+latter is mounted to a persistent volume (see `kubectl describe 
pod/JENKINS_POD`).

Review Comment:
   nit: `JENKINS_POD` is more like a variable, so `$JENKINS_POD`



##########
dev-support/docker/ci/jenkins/README.md:
##########
@@ -0,0 +1,102 @@
+<!--
+{% comment %}
+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.
+{% endcomment %}
+-->
+# Hive CI Jenkins
+
+This directory contains all the necessary resources to build the Jenkins image 
that is used in http://ci.hive.apache.org/
+and is hosted under https://hub.docker.com/r/apache/hive-ci-jenkins/. 
+
+The Jenkins container runs in a Kubernetes cluster powered by Google Cloud.
+
+## Build
+
+### Local
+To build a new image with the latest Jenkins version and the respective 
plugins run.
+```
+docker build . -t apache/hive-ci-jenkins:lts-jdk25
+```
+The Dockerfile does not contain fixed versions for Jenkins and the plugins 
used which means that on every build
+everything will be upgraded based on the latest available.
+
+### CI 
+
+There is a GitHub action that can be used to build and publish the latest 
Jenkins image on https://hub.docker.com/r/apache/hive-ci-jenkins/.
+
+## Run & test
+To start the container and test that everything is working run.
+```
+docker run -p 35000:8080 apache/hive-ci-jenkins:lts-jdk25
+```
+The Jenkins UI can be accessed via http://0.0.0.0:35000/.
+
+## Upgrade guide
+
+The bulk of stateful content that is maintained by Jenkins is located under 
the "/var/jenkins_home" directory and the
+latter is mounted to a persistent volume (see `kubectl describe 
pod/JENKINS_POD`).
+
+For the upgrade, we need to ensure that the current state and configurations 
in the persistent volume are not in conflict
+with the new Jenkins version before pushing the new image to production.
+
+1. Obtain a backup of the jenkins_home directory from the persistent volume.
+```
+kubectl exec JENKINS_POD -- tar cf - --exclude=junitResult.xml --exclude=*log* 
--exclude=archive --exclude=workflow --exclude=*git/objects* --exclude=.kube 
/var/jenkins_home > jenkins_home_backup.tar
+```
+Currently, the jenkins_home directory is ~280GB which makes a complete local 
backup and testing impractical.
+The majority of disk space is occupied by the "jobs" directory and in 
particular by archives that are kept for each build, test results, and log 
files for each run.
+These files are kept for archiving and diagnosability purposes when users 
wants to consult the results of each build.

Review Comment:
   nit: `users want`



##########
dev-support/docker/ci/jenkins/README.md:
##########
@@ -0,0 +1,102 @@
+<!--
+{% comment %}
+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.
+{% endcomment %}
+-->
+# Hive CI Jenkins
+
+This directory contains all the necessary resources to build the Jenkins image 
that is used in http://ci.hive.apache.org/
+and is hosted under https://hub.docker.com/r/apache/hive-ci-jenkins/. 
+
+The Jenkins container runs in a Kubernetes cluster powered by Google Cloud.
+
+## Build
+
+### Local
+To build a new image with the latest Jenkins version and the respective 
plugins run.
+```
+docker build . -t apache/hive-ci-jenkins:lts-jdk25

Review Comment:
   this needs `cd dev-support/docker/ci/jenkins/` first



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to