You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2020/08/16 07:58:30 UTC

[GitHub] [hbase-operator-tools] petersomogyi commented on a change in pull request #73: HBASE-24882 Migrate hbase-operator-tools testing to ci-hadoop

petersomogyi commented on a change in pull request #73:
URL: https://github.com/apache/hbase-operator-tools/pull/73#discussion_r471080552



##########
File path: dev-support/jenkins/Jenkinsfile
##########
@@ -0,0 +1,142 @@
+// 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.
+
+pipeline {
+
+    agent {
+        label 'Hadoop'
+    }
+
+    options {
+        // N.B. this is per-branch, which means per PR
+        disableConcurrentBuilds()
+        buildDiscarder(logRotator(numToKeepStr: '15'))
+        timeout (time: 1, unit: 'HOURS')
+        timestamps()
+        skipDefaultCheckout()
+    }
+
+    environment {
+        SRC_REL = 'src'
+        PATCH_REL = 'output'
+        YETUS_REL = 'yetus'
+        // Branch or tag name.  Yetus release tags are 'rel/X.Y.Z'
+        YETUS_VERSION = 'rel/0.12.0'
+        DOCKERFILE_REL = "${SRC_REL}/dev-support/jenkins/Dockerfile"
+        YETUS_DRIVER_REL = "${SRC_REL}/dev-support/jenkins/jenkins_precommit_github_yetus.sh"
+        ARCHIVE_PATTERN_LIST = 'TEST-*.xml,org.apache.h*.txt,*.dumpstream,*.dump'
+        BUILD_URL_ARTIFACTS = "artifact/${WORKDIR_REL}/${PATCH_REL}"
+        SET_JAVA_HOME = '/usr/local/openjdk-8'
+        WORKDIR_REL = 'yetus-precommit-check'
+        WORKDIR = "${WORKSPACE}/${WORKDIR_REL}"
+        SOURCEDIR = "${WORKDIR}/${SRC_REL}"
+        PATCHDIR = "${WORKDIR}/${PATCH_REL}"
+        DOCKERFILE = "${WORKDIR}/${DOCKERFILE_REL}"
+        YETUS_DRIVER = "${WORKDIR}/${YETUS_DRIVER_REL}"
+        YETUSDIR = "${WORKDIR}/${YETUS_REL}"
+        PLUGINS = 'all'
+    }
+
+    parameters {
+        booleanParam(name: 'DEBUG',
+               defaultValue: false,
+               description: 'Print extra outputs for debugging the jenkins job and yetus')
+    }
+
+    stages {
+        stage ('precommit checks') {
+            steps {
+                dir("${SOURCEDIR}") {
+                    checkout scm
+                }
+                dir("${YETUSDIR}") {
+                    checkout([
+                      $class           : 'GitSCM',
+                      branches         : [[name: "${YETUS_VERSION}"]],
+                      userRemoteConfigs: [[url: 'https://github.com/apache/yetus.git']]]
+                    )
+                }
+                dir("${WORKDIR}") {
+                    withCredentials([
+                      usernamePassword(
+                        credentialsId: 'apache-hbase-at-github.com',
+                        passwordVariable: 'GITHUB_PASSWORD',
+                        usernameVariable: 'GITHUB_USER'
+                      )]) {
+                        sh label: 'test-patch', script: '''#!/bin/bash -e
+                            hostname -a ; pwd ; ls -la
+                            printenv 2>&1 | sort

Review comment:
       Jenkins filters out sensitive information. This is the same with other PR builds we have.
   ```
   17:00:32  GITHUB_PASSWORD=****
   17:00:32  GITHUB_USER=****
   ```
   I think it won't be filtered if this is printed to a file in `gather_machine_environment.sh` and adding our own logic would be problematic. A contributor could just change gather_machine_environment.sh in a PR not to filter out GitHub user/pass and get the credentials.

##########
File path: dev-support/jenkins/Jenkinsfile
##########
@@ -0,0 +1,142 @@
+// 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.
+
+pipeline {
+
+    agent {
+        label 'Hadoop'
+    }
+
+    options {
+        // N.B. this is per-branch, which means per PR
+        disableConcurrentBuilds()
+        buildDiscarder(logRotator(numToKeepStr: '15'))
+        timeout (time: 1, unit: 'HOURS')
+        timestamps()
+        skipDefaultCheckout()
+    }
+
+    environment {
+        SRC_REL = 'src'
+        PATCH_REL = 'output'
+        YETUS_REL = 'yetus'
+        // Branch or tag name.  Yetus release tags are 'rel/X.Y.Z'
+        YETUS_VERSION = 'rel/0.12.0'
+        DOCKERFILE_REL = "${SRC_REL}/dev-support/jenkins/Dockerfile"
+        YETUS_DRIVER_REL = "${SRC_REL}/dev-support/jenkins/jenkins_precommit_github_yetus.sh"
+        ARCHIVE_PATTERN_LIST = 'TEST-*.xml,org.apache.h*.txt,*.dumpstream,*.dump'
+        BUILD_URL_ARTIFACTS = "artifact/${WORKDIR_REL}/${PATCH_REL}"
+        SET_JAVA_HOME = '/usr/local/openjdk-8'
+        WORKDIR_REL = 'yetus-precommit-check'
+        WORKDIR = "${WORKSPACE}/${WORKDIR_REL}"
+        SOURCEDIR = "${WORKDIR}/${SRC_REL}"
+        PATCHDIR = "${WORKDIR}/${PATCH_REL}"
+        DOCKERFILE = "${WORKDIR}/${DOCKERFILE_REL}"
+        YETUS_DRIVER = "${WORKDIR}/${YETUS_DRIVER_REL}"
+        YETUSDIR = "${WORKDIR}/${YETUS_REL}"
+        PLUGINS = 'all'
+    }
+
+    parameters {
+        booleanParam(name: 'DEBUG',
+               defaultValue: false,
+               description: 'Print extra outputs for debugging the jenkins job and yetus')
+    }
+
+    stages {
+        stage ('precommit checks') {
+            steps {
+                dir("${SOURCEDIR}") {
+                    checkout scm
+                }
+                dir("${YETUSDIR}") {
+                    checkout([
+                      $class           : 'GitSCM',
+                      branches         : [[name: "${YETUS_VERSION}"]],
+                      userRemoteConfigs: [[url: 'https://github.com/apache/yetus.git']]]
+                    )
+                }
+                dir("${WORKDIR}") {
+                    withCredentials([
+                      usernamePassword(
+                        credentialsId: 'apache-hbase-at-github.com',
+                        passwordVariable: 'GITHUB_PASSWORD',
+                        usernameVariable: 'GITHUB_USER'
+                      )]) {
+                        sh label: 'test-patch', script: '''#!/bin/bash -e
+                            hostname -a ; pwd ; ls -la
+                            printenv 2>&1 | sort

Review comment:
       Valid comment, I'll move hostname to gather_machine_environment.sh. I think pwd and ls are not important, the path is already printed out by Jenkins at the beginning of the build along with the worker node name.
   Unfortunately, this does not match the hostname: H2 is asf902 but H18 is asf914. 🙁




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