Mesa (main): ci/lava: Let LAVA job submitter run without JWT file

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 28 07:34:16 UTC 2022


Module: Mesa
Branch: main
Commit: 9666ab7172985f9958574eb40b4c92bbefa4326d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9666ab7172985f9958574eb40b4c92bbefa4326d

Author: Guilherme Gallo <guilherme.gallo at collabora.com>
Date:   Thu Mar 24 18:22:49 2022 -0300

ci/lava: Let LAVA job submitter run without JWT file

Make jwt-file argument optional, this means that this submitter could
deal with more generic use cases, such as running it locally, since the
MINIO JWT is a sensitive information, which is not really required to
test if the submitter is working well.

Signed-off-by: Guilherme Gallo <guilherme.gallo at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15938>

---

 .gitlab-ci/lava/lava_job_submitter.py | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/.gitlab-ci/lava/lava_job_submitter.py b/.gitlab-ci/lava/lava_job_submitter.py
index fc1c1aaa146..f5ccf8f7887 100755
--- a/.gitlab-ci/lava/lava_job_submitter.py
+++ b/.gitlab-ci/lava/lava_job_submitter.py
@@ -146,17 +146,23 @@ def generate_lava_yaml(args):
     #   - inline .gitlab-ci/common/init-stage1.sh
     #   - fetch and unpack per-pipeline build artifacts from build job
     #   - fetch and unpack per-job environment from lava-submit.sh
-    #   - exec .gitlab-ci/common/init-stage2.sh 
-    run_steps = []
+    #   - exec .gitlab-ci/common/init-stage2.sh
 
     with open(args.first_stage_init, 'r') as init_sh:
       run_steps += [ x.rstrip() for x in init_sh if not x.startswith('#') and x.rstrip() ]
 
-    with open(args.jwt_file) as jwt_file:
+    if args.jwt_file:
+        with open(args.jwt_file) as jwt_file:
+            run_steps += [
+                "set +x",
+                f'echo -n "{jwt_file.read()}" > "{args.jwt_file}"  # HIDEME',
+                "set -x",
+                f'echo "export CI_JOB_JWT_FILE={args.jwt_file}" >> /set-job-env-vars.sh',
+            ]
+    else:
         run_steps += [
-            "set +x",
-            f'echo -n "{jwt_file.read()}" > "{args.jwt_file}"  # HIDEME',
-            "set -x",
+            "echo Could not find jwt file, disabling MINIO requests...",
+            "unset MINIO_RESULTS_UPLOAD",
         ]
 
     run_steps += [
@@ -164,7 +170,9 @@ def generate_lava_yaml(args):
       'wget -S --progress=dot:giga -O- {} | tar -xz -C {}'.format(args.build_url, args.ci_project_dir),
       'wget -S --progress=dot:giga -O- {} | tar -xz -C /'.format(args.job_rootfs_overlay_url),
       f'echo "export CI_JOB_JWT_FILE={args.jwt_file}" >> /set-job-env-vars.sh',
-      'exec /init-stage2.sh',
+      # Putting CI_JOB name as the testcase name, it may help LAVA farm
+      # maintainers with monitoring
+      f"lava-test-case 'mesa-ci_{args.mesa_job_name}' --shell /init-stage2.sh",
     ]
 
     values['actions'] = [



More information about the mesa-commit mailing list