This is an automated email from the ASF dual-hosted git repository.

Abacn pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new ce221883440 fix performance plot (#40366)
ce221883440 is described below

commit ce221883440eb68edaf80ac0816969803cfd7fdc
Author: Abdelrahman Ibrahim <[email protected]>
AuthorDate: Thu Oct 1 17:18:45 2026 +0300

    fix performance plot (#40366)
---
 website/build.gradle | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/website/build.gradle b/website/build.gradle
index b9d721484d0..5b49779fa44 100644
--- a/website/build.gradle
+++ b/website/build.gradle
@@ -153,25 +153,36 @@ task downloadPerformanceLooks(type: Exec) {
   onlyIf { gcpCredsHost != null }
 
   doFirst {
-    commandLine 'docker', 'exec',
+    // The website container is started as the host uid, which has no
+    // /etc/passwd entry. gcloud storage calls pwd.getpwuid and crashes,
+    // so the build publishes without the plots. Root is required only to
+    // add that uid. gcloud then runs as the repo owner.
+    commandLine 'docker', 'exec', '-u', '0',
       "${-> setupDockerContainer.containerId()}", '/bin/bash', '-lc',
       """
       set -u
 
       SRC="gs://public_looker_explores_us_a3853f40"
       OUT_DIR="${performanceLooksOutDir}"
+      HOST_UID="\$(stat -c '%u' /opt/website)"
+      HOST_GID="\$(stat -c '%g' /opt/website)"
+
+      if ! getent passwd "\$HOST_UID" >/dev/null 2>&1; then
+        echo "beamweb:x:\${HOST_UID}:\${HOST_GID}:beamweb:/tmp:/bin/bash" >> 
/etc/passwd
+      fi
 
       export HOME=/tmp
       export CLOUDSDK_CONFIG=/tmp/gcloud
       export GOOGLE_APPLICATION_CREDENTIALS="${gcpCredsInContainer}"
 
-      gcloud auth activate-service-account 
--key-file="\$GOOGLE_APPLICATION_CREDENTIALS" --no-user-output-enabled
-
       mkdir -p "\$OUT_DIR"
+      # mkdir above runs as root. The leaf directory must be writable by the 
host uid.
+      chown "\$HOST_UID:\$HOST_GID" "\$OUT_DIR"
 
       echo "[performance_looks] Syncing looks..."
 
-      if gcloud storage rsync -r "\$SRC" "\$OUT_DIR"; then
+      if gosu "\$HOST_UID:\$HOST_GID" gcloud auth activate-service-account 
--key-file="\$GOOGLE_APPLICATION_CREDENTIALS" --no-user-output-enabled \
+        && gosu "\$HOST_UID:\$HOST_GID" gcloud storage rsync -r "\$SRC" 
"\$OUT_DIR"; then
         echo "[performance_looks] Download completed successfully"
       else
         echo "[performance_looks][WARNING] Failed to sync looks from GCS"

Reply via email to