panbingkun commented on code in PR #48860:
URL: https://github.com/apache/spark/pull/48860#discussion_r1846459177


##########
dev/spark-test-image/docs/build-docs-on-local:
##########
@@ -0,0 +1,68 @@
+#!/usr/bin/env bash
+
+#
+# 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.
+#
+
+if ! [ -x "$(command -v docker)" ]; then
+  echo "Error: Docker is not installed." >&2
+  exit 1
+fi
+
+DOCKER_CACHE_IMG="ghcr.io/apache/spark/apache-spark-github-action-image-docs-cache:master"
+REPO_OWNER="apache/spark"
+IMG_TAG=$(date +%s)
+IMG_NAME="apache-spark-ci-image-docs:${IMG_TAG}"
+IMG_URL="$REPO_OWNER/$IMG_NAME"
+DOCKER_MOUNT_SPARK_HOME="/__w/spark/spark"
+BUILD_DOCS_SCRIPT_PATH="${DOCKER_MOUNT_SPARK_HOME}/dev/spark-test-image/docs/build-docs-in-container"
+
+FWDIR="$(cd "`dirname "${BASH_SOURCE[0]}"`"; pwd)"
+SPARK_HOME="$(cd "`dirname "${BASH_SOURCE[0]}"`"/../../..; pwd)"
+
+# 1.Compile Spark outside the container to prepare for the next step of 
generating documents using the container
+build/sbt -Phive -Pkinesis-asl clean unidoc package
+
+# 2.build container image
+docker buildx build \
+  --cache-from type=registry,ref="${DOCKER_CACHE_IMG}" \
+  --tag "${IMG_URL}" "${FWDIR}"
+
+# 3.build docs on container: `error docs`, `scala doc`, `python doc`, `sql doc`
+docker run \
+  --mount type=bind,source="${SPARK_HOME}",target="${DOCKER_MOUNT_SPARK_HOME}" 
\

Review Comment:
   ```shell
   (base) ➜  spark-community git:(SPARK-50295) ✗ ls -al docs/api
   total 0
   drwxr-xr-x    7 panbingkun  staff   224 Nov 18 19:52 .
   drwx------@ 286 panbingkun  staff  9152 Nov 18 19:25 ..
   drwxr-xr-x@  22 panbingkun  staff   704 Nov 18 19:52 R
   drwxr-xr-x   26 panbingkun  staff   832 Nov 18 19:25 java
   drwxr-xr-x   15 panbingkun  staff   480 Nov 18 19:47 python
   drwxr-xr-x    6 panbingkun  staff   192 Nov 18 19:25 scala
   drwxr-xr-x   11 panbingkun  staff   352 Nov 18 19:49 sql
   ```



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to