Abacn commented on code in PR #37559:
URL: https://github.com/apache/beam/pull/37559#discussion_r2794558696


##########
website/build.gradle:
##########
@@ -128,6 +128,66 @@ task setupDockerContainer(type: Exec) {
     """echo '[params]\n  branch_repo = "${getBranchRepo()}"' > 
/tmp/_config_branch_repo.toml"""
 }
 
+def performanceLooksOutDir = 
"$dockerSourceDir/site/static/images/performance/looks"
+def gcpCredsInContainer = "/tmp/gcp-key.json"
+
+task copyGcpCredsToContainer(type: Exec) {
+  dependsOn setupDockerContainer
+
+  def gcpCredsHost = providers.gradleProperty("gcpCredsFile").orNull
+  if (gcpCredsHost) {
+    commandLine 'docker', 'cp', gcpCredsHost, 
"${->startDockerContainer.containerId()}:${gcpCredsInContainer}"
+  } else {
+    println "[performance_looks] -PgcpCredsFile not provided, skipping copy"
+  }
+}
+
+task downloadPerformanceLooks(type: Exec) {
+  dependsOn setupDockerContainer, copyGcpCredsToContainer
+
+  def gcpCredsHost = providers.gradleProperty("gcpCredsFile").orNull
+  if (gcpCredsHost) {
+    commandLine 'docker', 'exec',
+      "${-> setupDockerContainer.containerId()}", '/bin/bash', '-lc',
+      """
+      set -u
+
+      SRC="gs://public_looker_explores_us_a3853f40"
+      OUT_DIR="${performanceLooksOutDir}"
+
+      export HOME=/tmp
+      export CLOUDSDK_CONFIG=/tmp/gcloud
+      export GSUTIL_CONFIG_DIR=/tmp/gsutil
+      export GOOGLE_APPLICATION_CREDENTIALS="${gcpCredsInContainer}"
+
+      gcloud auth activate-service-account 
--key-file="\$GOOGLE_APPLICATION_CREDENTIALS" --no-user-output-enabled
+
+      mkdir -p "\$OUT_DIR"
+
+      if DRY_RUN_OUTPUT=\$(gsutil -m rsync -n -r "\$SRC" "\$OUT_DIR" 
2>/dev/null); then
+        if [ -z "\$DRY_RUN_OUTPUT" ]; then

Review Comment:
   I see test run has this log
   
   > [performance_looks] Looks already up to date, skipping download
   
   and the staging website 
https://github.com/apache/beam/actions/runs/21906746147 still not showing 
pictures. Should it be `[ -n "\$DRY_RUN_OUTPUT" ]` here?



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

Reply via email to