jjb/lava: Parameterize repo URL and branch for test scripts
authorKienan Stewart <kstewart@efficios.com>
Thu, 18 May 2023 17:51:49 +0000 (13:51 -0400)
committerKienan Stewart <kstewart@efficios.com>
Thu, 18 May 2023 19:00:31 +0000 (15:00 -0400)
This permets us to launch a build with a different repo URL and/or
branch. Without this change, any changes we want to test must be
pushed on to the lttng-ci master branch before the run.

Pass repo URL and branch through to the clone in the setup job as well.

Change-Id: Ie9d45b2285e8e484dd23727278bb87e9c3ddfae2

jobs/system-tests.yaml
lava/system-tests/destructive-tests.yml
lava/system-tests/kernel-tests.yml
lava/system-tests/perf-tests.yml
lava/system-tests/setup.yml
scripts/system-tests/generate-properties-master.sh
scripts/system-tests/lava2-submit.py
scripts/system-tests/run-baremetal-tests.sh
scripts/system-tests/run-kvm-tests.sh
scripts/system-tests/template_lava_job.jinja2

index 57cba7f2276b071f161225384fe3483e76841aa9..32298e57b64d842fa6194cbdb202c0a85aadd39e 100644 (file)
           name: 'ROOTFS_URL'
           default: 'https://obj.internal.efficios.com/lava/rootfs/rootfs_amd64_xenial_2018-12-05.tar.gz'
           description: 'The URL at which the system root FS can be downloaded'
+      - string:
+          name: 'LTTNG_CI_REPO'
+          default: 'https://github.com/lttng/lttng-ci.git'
+          description: 'LTTng-ci git repo to checkout the CI scripts'
+      - string:
+          name: 'LTTNG_CI_BRANCH'
+          default: 'master'
+          description: 'The branch of the CI repository to clone for job scripts'
 
 - publisher:
     name: 'system_tests_email_ext_default'
           properties-content: |
             BUILD_DEVICE=kvm
             LTTNG_VERSION={lttngversion}
+            LTTNG_CI_REPO=${{LTTNG_CI_REPO}}
+            LTTNG_CI_BRANCH=${{LTTNG_CI_BRANCH}}
 
     scm:
       - git:
-          url: https://github.com/lttng/lttng-ci
+          url: "${{LTTNG_CI_REPO}}"
           basedir: src/lttng-ci/
+          branches:
+            - "${{LTTNG_CI_BRANCH}}"
 
     builders:
       - shell: !include-raw-escape: scripts/system-tests/generate-properties-master.sh
           properties-content: |
             BUILD_DEVICE=baremetal
             LTTNG_VERSION={lttngversion}
+            LTTNG_CI_REPO=${{LTTNG_CI_REPO}}
+            LTTNG_CI_BRANCH=${{LTTNG_CI_BRANCH}}
 
     scm:
       - git:
-          url: https://github.com/lttng/lttng-ci
+          url: "${{LTTNG_CI_REPO}}"
           basedir: src/lttng-ci/
+          branches:
+            - "${{LTTNG_CI_BRANCH}}"
 
     builders:
       - shell: !include-raw-escape: scripts/system-tests/generate-properties-master.sh
       - string:
           name: 'S3_STORAGE_LTTNG_MODULES'
           description: 'Path to store the LTTng Modules'
+      - string:
+          name: 'LTTNG_CI_REPO'
+          default: 'https://github.com/lttng/lttng-ci.git'
+          description: 'LTTng-ci git repo to checkout the CI scripts'
+      - string:
+          name: 'LTTNG_CI_BRANCH'
+          default: 'master'
+          description: 'The branch of the CI repository to clone for job scripts'
 
     properties:
       - build-discarder:
 
     scm:
       - git:
-          url: https://github.com/lttng/lttng-ci
+          url: "${{LTTNG_CI_REPO}}"
           basedir: src/lttng-ci/
+          branches:
+            - "${{LTTNG_CI_BRANCH}}"
 
     builders:
       - shell: !include-raw-escape: scripts/system-tests/checkout-modules.sh
index f8a325ae4c901b508b300bd0b6211b00afb2938c..b1b4f27e7fb98f455a7a0f53c8d96c6bbb7620cd 100644 (file)
@@ -8,7 +8,7 @@ params:
 run:
         steps:
                 - apt install -y curl
-                - git clone https://github.com/lttng/lttng-ci ci
+                - git clone "${CI_REPO}" --branch="${CI_BRANCH}" ci
                 - export TMPDIR="/tmp"
                 - systemctl stop systemd-timesyncd.service
                 - mkdir -p coredump
index 071cb81ae24b5df6f2c6576beba485bf1f34ddf1..f51c969a34fd73f3f5726e77214a85f184bfa5bc 100644 (file)
@@ -8,7 +8,7 @@ params:
 run:
         steps:
                 - apt install -y curl
-                - git clone https://github.com/lttng/lttng-ci ci
+                - git clone "${CI_REPO}" --branch="${CI_BRANCH}" ci
                 - export TMPDIR="/tmp"
                 - mkdir -p coredump
                 - echo "$(pwd)/coredump/core.%e.%p.%h.%t" > /proc/sys/kernel/core_pattern
index 026ccaf69c9a05096fcb543a7cb672879f9a9bd7..0355d825f7e55c54d86cfeb2d9b16ef0ad187d15 100644 (file)
@@ -8,7 +8,7 @@ params:
 run:
         steps:
                 - apt install -y libpfm4-dev curl
-                - git clone https://github.com/lttng/lttng-ci ci
+                - git clone "${CI_REPO}" --branch="${CI_BRANCH}" ci
                 - export TMPDIR="/tmp"
                 - mkdir -p coredump
                 - echo "$(pwd)/coredump/core.%e.%p.%h.%t" > /proc/sys/kernel/core_pattern
index f835548584445f78e736bc8eebfcea6dcd802f75..597d856820e07810d6fd812e758c26b06b43cc00 100644 (file)
@@ -21,7 +21,7 @@ run:
     - pip3 install 'pip==20.3'
     - hash -r
     - pip3 install vlttng
-    - git clone https://github.com/lttng/lttng-ci ci
+    - git clone "${CI_REPO}" --branch="${CI_BRANCH}" ci
     - mkdir -p /root/.ssh
     - chmod 700 /root/.ssh
     - cp lava/system-tests/authorized_keys /root/.ssh/authorized_keys
index 758a488e7b174bad3a3c0a6b463df9ce5ede4c5d..ea70b3cdf4617f770941547311aff284e96e82f2 100644 (file)
@@ -31,6 +31,8 @@ signature_v2 = False" > "$WORKSPACE/s3cfg"
 
 LTTNG_CI_PATH="$WORKSPACE/src/lttng-ci"
 echo "LTTNG_CI_PATH=$LTTNG_CI_PATH" >> properties.txt
+echo "LTTNG_CI_REPO=$LTTNG_CI_REPO" >> properties.txt
+echo "LTTNG_CI_BRANCH=$LTTNG_CI_BRANCH" >> properties.txt
 KERNEL_COMMIT_ID=$KERNEL_TAG_ID
 
 echo "KERNEL_COMMIT_ID=$KERNEL_COMMIT_ID" >> properties.txt
index 232be5d43bb72016c08e5012bfe2d4702b9627c1..fd573af19ba2bf0664492125ac08a8ad379cbf11 100644 (file)
@@ -199,6 +199,8 @@ def main():
         '-r', '--rootfs-url', required=False,
         default="https://obj.internal.efficios.com/lava/rootfs/rootfs_amd64_xenial_2018-12-05.tar.gz"
     )
+    parser.add_argument('--ci-repo', required=False, default='https://github.com/lttng/lttng-ci.git')
+    parser.add_argument('--ci-branch', required=False, default='master')
     args = parser.parse_args()
 
     if args.type not in TestType.values:
@@ -265,6 +267,9 @@ def main():
 
     context['kprobe_round_nb'] = 10
 
+    context['ci_repo'] = args.ci_repo
+    context['ci_branch'] = args.ci_branch
+
     render = jinja_template.render(context)
 
     print('Job to be submitted:')
index 32ead9a53c3f056d7ea26abbdc7262aec8670a26..b1819c4a0b81afbb0bf732d81b92822991344d3e 100644 (file)
@@ -36,7 +36,9 @@ python -u "$LTTNG_CI_PATH"/scripts/system-tests/lava2-submit.py \
                           -tc "$LTTNG_TOOLS_COMMIT_ID" \
                           -uc "$LTTNG_UST_COMMIT_ID" \
                           -id "$BUILD_TAG" \
-                          -r "$ROOTFS_URL"
+                          -r "$ROOTFS_URL" \
+                          --ci-repo "$LTTNG_CI_REPO" \
+                          --ci-branch "$LTTNG_CI_BRANCH"
 
 set +eu
 deactivate
index 7c36757f5636aa977e58bd453dcfe2277b06ac97..e6ceac3046a378b85ee5fb815060e26f7d3570b8 100644 (file)
@@ -35,7 +35,9 @@ python -u "$LTTNG_CI_PATH"/scripts/system-tests/lava2-submit.py \
                           -tc "$LTTNG_TOOLS_COMMIT_ID" \
                           -uc "$LTTNG_UST_COMMIT_ID" \
                           -id "$BUILD_TAG" \
-                          -r "$ROOTFS_URL"
+                          -r "$ROOTFS_URL" \
+                          --ci-repo "$LTTNG_CI_REPO" \
+                          --ci-branch "$LTTNG_CI_BRANCH"
 
 set +eu
 deactivate
index b6080066763cc7f18de914019aa6a89cbf57f779..59fc91f0da701270926a53c3ae39c6227c8fb129 100644 (file)
@@ -60,10 +60,14 @@ actions:
     - test:
         definitions:
             # Base setup #
-            - repository: https://github.com/lttng/lttng-ci.git
+            - repository: {{ ci_repo }}
               from: git
+              branch: {{ ci_branch }}
               path: lava/system-tests/setup.yml
               name: x86-env-setup
+              params:
+                CI_REPO: {{ ci_repo }}
+                CI_BRANCH: {{ ci_branch }}
             # Base vlttng setup #
             - repository:
                 metadata:
@@ -90,26 +94,35 @@ actions:
               name: vlttng-env-setup-inline
               path: inline/vlttng-env-setup
           {% if test_type == TestType.baremetal_tests %}
-            - repository: https://github.com/lttng/lttng-ci.git
+            - repository: {{ ci_repo }}
               from: git
+              branch: {{ ci_branch }}
               path: lava/system-tests/perf-tests.yml
               name: perf-tests
               params:
                 LTTNG_VERSION_STRING: {{ lttng_version_string }}
                 JENKINS_BUILD_ID: {{ jenkins_build_id }}
+                CI_REPO: {{ ci_repo }}
+                CI_BRANCH: {{ ci_branch }}
           {% elif test_type == TestType.kvm_tests %}
-            - repository: https://github.com/lttng/lttng-ci.git
+            - repository: {{ ci_repo }}
               from: git
+              branch: {{ ci_branch }}
               path: lava/system-tests/kernel-tests.yml
               name: kernel-tests
               params:
                 LTTNG_VERSION_STRING: {{ lttng_version_string }}
                 JENKINS_BUILD_ID: {{ jenkins_build_id }}
-            - repository: https://github.com/lttng/lttng-ci.git
+                CI_REPO: {{ ci_repo }}
+                CI_BRANCH: {{ ci_branch }}
+            - repository: {{ ci_repo }}
               from: git
+              branch: {{ ci_branch }}
               path: lava/system-tests/destructive-tests.yml
               name: destructive-tests
               params:
                 LTTNG_VERSION_STRING: {{ lttng_version_string }}
                 JENKINS_BUILD_ID: {{ jenkins_build_id }}
+                CI_REPO: {{ ci_repo }}
+                CI_BRANCH: {{ ci_branch }}
           {% endif %}
This page took 0.03068 seconds and 4 git commands to generate.