You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@teaclave.apache.org by zf...@apache.org on 2025/06/06 01:43:22 UTC

(incubator-teaclave-website) branch master updated (460d94f4f -> ed2098b4f)

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

zfc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-teaclave-website.git


    from 460d94f4f [Add] contributing page.
     new d22b244bd [Mod] Split repo init and fetch.
     new a3c5b56c5 [Add] Dockerfile for site build.
     new ed2098b4f [Mod] prebuilt api docs and refactor build-env

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 Dockerfile    | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++
 site/Makefile | 81 +++++++++++++++++++++++++++++++----------------------------
 2 files changed, 114 insertions(+), 38 deletions(-)
 create mode 100644 Dockerfile


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@teaclave.apache.org
For additional commands, e-mail: commits-help@teaclave.apache.org


(incubator-teaclave-website) 01/03: [Mod] Split repo init and fetch.

Posted by zf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zfc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-teaclave-website.git

commit d22b244bdb462e37a2de97838ba98b4a3bdf2d07
Author: Zhaofeng Chen <zf...@apache.org>
AuthorDate: Wed Apr 23 05:40:42 2025 +0000

    [Mod] Split repo init and fetch.
---
 site/Makefile | 29 ++++++++++++++++++++---------
 1 file changed, 20 insertions(+), 9 deletions(-)

diff --git a/site/Makefile b/site/Makefile
index f5d77ac03..43af6c468 100644
--- a/site/Makefile
+++ b/site/Makefile
@@ -6,6 +6,22 @@ staging: build
 site: build
 	ghp-import --no-history --force .vuepress/dist -b asf-site
 
+init-repo:
+	git clone https://github.com/apache/incubator-teaclave.git teaclave
+	git clone -b v2.0.0-preview https://github.com/apache/incubator-teaclave-sgx-sdk.git teaclave-sgx-sdk
+	git clone https://github.com/apache/incubator-teaclave-trustzone-sdk.git teaclave-trustzone-sdk
+
+check-repo:
+	@if [ ! -d "teaclave" ] || [ ! -d "teaclave-sgx-sdk" ] || [ ! -d "teaclave-trustzone-sdk" ]; then \
+		echo "Repositories not found. Running init-repo..."; \
+		$(MAKE) init-repo; \
+	fi
+
+update-repo: check-repo
+	cd teaclave && git pull
+	cd teaclave-sgx-sdk && git pull
+	cd teaclave-trustzone-sdk && git pull
+
 sgx-sdk-api-docs: teaclave-docs
 	cd ../sgx-sdk-api-docs && cargo doc
 	cp -r ../sgx-sdk-api-docs/target/doc .vuepress/dist/api-docs/sgx-sdk
@@ -23,7 +39,7 @@ trustzone-sdk-api-docs: teaclave-docs
 
 client-sdk-python-docs: teaclave-docs
 	python3 -m grpc_tools.protoc --proto_path=teaclave/services/proto/src/proto --python_out=teaclave/sdk/python --grpclib_python_out=teaclave/sdk/python teaclave/services/proto/src/proto/*.proto
-	 PYTHONPATH=teaclave/sdk/python pdoc teaclave/sdk/python/teaclave.py -o .vuepress/dist/api-docs/client-sdk-python
+	PYTHONPATH=teaclave/sdk/python pdoc teaclave/sdk/python/teaclave.py -o .vuepress/dist/api-docs/client-sdk-python
 	@echo "<meta http-equiv=refresh content=0;url=python/teaclave.html>" > .vuepress/dist/api-docs/client-sdk-python/index.html
 
 client-sdk-rust-docs: teaclave-docs
@@ -38,16 +54,10 @@ crate-docs:
 	cp ${TEACLAVE_TARGET_DIR}/docs/enclave .vuepress/dist/api-docs/crates-enclave -r
 	cp ${TEACLAVE_TARGET_DIR}/docs/app .vuepress/dist/api-docs/crates-app -r
 
-teaclave-docs:
-	git clone https://github.com/apache/incubator-teaclave.git teaclave || cd teaclave && git pull
-	git clone -b v2.0.0-preview https://github.com/apache/incubator-teaclave-sgx-sdk.git teaclave-sgx-sdk || cd teaclave-sgx-sdk && git pull
-	git clone https://github.com/apache/incubator-teaclave-trustzone-sdk.git teaclave-trustzone-sdk || cd teaclave-trustzone-sdk && git pull
+teaclave-docs: update-repo
 	vuepress build
 
-dev:
-	git clone https://github.com/apache/incubator-teaclave.git teaclave || cd teaclave && git pull
-	git clone https://github.com/apache/incubator-teaclave-sgx-sdk.git teaclave-sgx-sdk || cd teaclave-sgx-sdk && git pull
-	git clone https://github.com/apache/incubator-teaclave-trustzone-sdk.git teaclave-trustzone-sdk
+dev: update-repo
 	cd teaclave-trustzone-sdk
 	vuepress dev
 
@@ -59,3 +69,4 @@ build: teaclave-docs sgx-sdk-api-docs trustzone-sdk-api-docs client-sdk-python-d
 
 clean:
 	rm -rf .vuepress/dist teaclave teaclave-sgx-sdk teaclave-trustzone-sdk
+


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@teaclave.apache.org
For additional commands, e-mail: commits-help@teaclave.apache.org


(incubator-teaclave-website) 02/03: [Add] Dockerfile for site build.

Posted by zf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zfc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-teaclave-website.git

commit a3c5b56c5df2e7a99942e91b1ca318afcae0b60d
Author: Zhaofeng Chen <zf...@apache.org>
AuthorDate: Wed Apr 23 05:41:35 2025 +0000

    [Add] Dockerfile for site build.
---
 Dockerfile | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)

diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 000000000..34a3ecc6f
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,54 @@
+# Stage 1: Install dependencies
+FROM node:16.20.2-bullseye AS deps
+
+# Install system dependencies
+RUN apt-get update && apt-get install -y \
+    git \
+    python3 \
+    python3-pip \
+    curl \
+    build-essential \
+    openssh-client \
+    && rm -rf /var/lib/apt/lists/*
+
+# Install Rust toolchain and xargo
+RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \
+    . "$HOME/.cargo/env" && \
+    rustup install nightly-2022-10-22 && \
+    rustup default nightly-2022-10-22 && \
+    cargo install xargo
+
+ENV PATH="/root/.cargo/bin:${PATH}"
+
+# Install Python dependencies including ghp-import
+RUN pip3 install grpcio-tools grpclib pdoc ghp-import
+
+# Set working directory
+WORKDIR /app
+
+# Copy package files
+COPY site/package*.json site/
+
+# Install npm dependencies
+RUN cd site && npm install
+
+# Stage 2: Development environment
+FROM node:16.20.2-bullseye
+
+# Copy installed dependencies from deps stage
+COPY --from=deps /root/.cargo /root/.cargo
+COPY --from=deps /usr/local/lib/python3.9/dist-packages /usr/local/lib/python3.9/dist-packages
+COPY --from=deps /app/site/node_modules /app/site/node_modules
+
+# Set up environment
+ENV PATH="/root/.cargo/bin:${PATH}"
+ENV PYTHONPATH="/usr/local/lib/python3.9/dist-packages:${PYTHONPATH}"
+
+# Set working directory
+WORKDIR /app
+
+# Install VuePress globally
+RUN npm install -g vuepress@1.7.1
+
+# Create a volume for the build output
+VOLUME ["/app/site/.vuepress/dist"] 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@teaclave.apache.org
For additional commands, e-mail: commits-help@teaclave.apache.org


(incubator-teaclave-website) 03/03: [Mod] prebuilt api docs and refactor build-env

Posted by zf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zfc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-teaclave-website.git

commit ed2098b4f62c0140a99831ecefa3bcab6f50393f
Author: Zhaofeng Chen <zf...@apache.org>
AuthorDate: Fri Jun 6 01:12:37 2025 +0000

    [Mod] prebuilt api docs and refactor build-env
---
 Dockerfile    | 91 +++++++++++++++++++++++++++++++++++------------------------
 site/Makefile | 62 ++++++++++++++++++----------------------
 2 files changed, 82 insertions(+), 71 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index 34a3ecc6f..898215470 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,54 +1,71 @@
-# Stage 1: Install dependencies
-FROM node:16.20.2-bullseye AS deps
+# SGX Docs stage
+FROM teaclave/teaclave-build-ubuntu-1804-sgx-2.14:latest AS sgx-docs
+WORKDIR /app
+COPY sgx-sdk-api-docs /app/sgx-sdk-api-docs
+RUN . "$HOME/.cargo/env" && cd sgx-sdk-api-docs && cargo doc
+RUN mkdir -p /prebuilt_docs && \
+    cp -r sgx-sdk-api-docs/target/doc /prebuilt_docs/sgx-sdk-docs
 
-# Install system dependencies
-RUN apt-get update && apt-get install -y \
-    git \
-    python3 \
-    python3-pip \
-    curl \
-    build-essential \
-    openssh-client \
-    && rm -rf /var/lib/apt/lists/*
-
-# Install Rust toolchain and xargo
-RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \
-    . "$HOME/.cargo/env" && \
-    rustup install nightly-2022-10-22 && \
-    rustup default nightly-2022-10-22 && \
-    cargo install xargo
+# TODO: Add Trustzone Docs stage
 
-ENV PATH="/root/.cargo/bin:${PATH}"
+# Teaclave Docs stage
+FROM teaclave/teaclave-build-ubuntu-2004-sgx-2.17.1:0.2.0 AS teaclave-docs
+WORKDIR /app
 
-# Install Python dependencies including ghp-import
-RUN pip3 install grpcio-tools grpclib pdoc ghp-import
+# Prepare Teaclave Repo
+RUN git clone https://github.com/apache/incubator-teaclave.git teaclave
+RUN cd teaclave && git submodule update --init 
 
-# Set working directory
-WORKDIR /app
+# Build Python SDK docs
+RUN pip3 install grpcio-tools grpclib pdoc
+RUN python3 -m grpc_tools.protoc \
+    --proto_path=teaclave/services/proto/src/proto \
+    --python_out=teaclave/sdk/python \
+    --grpclib_python_out=teaclave/sdk/python \
+    teaclave/services/proto/src/proto/*.proto
+RUN PYTHONPATH=teaclave/sdk/python pdoc teaclave/sdk/python/teaclave.py -o /tmp/client-sdk-python-docs
 
-# Copy package files
-COPY site/package*.json site/
+# Build Teaclave docs
+RUN . /opt/sgxsdk/environment && \
+    . /root/.cargo/env && \
+    cd teaclave && \
+    mkdir build && \
+    cd build && \
+    cmake .. && \
+    make doc -j$(nproc)
 
-# Install npm dependencies
+# Copy all docs to prebuilt directory
+RUN mkdir -p /prebuilt_docs/teaclave-docs && \
+    cp -r /tmp/client-sdk-python-docs /prebuilt_docs/teaclave-docs/client-sdk-python && \
+    cd teaclave/release/ && \
+    cp -r ./docs/enclave /prebuilt_docs/teaclave-docs/enclave && \
+    cp -r ./docs/app /prebuilt_docs/teaclave-docs/app && \
+    cp -r ./docs/unix /prebuilt_docs/teaclave-docs/client-sdk-rust 
+
+# clean up
+RUN rm -rf teaclave/build
+
+# Dependencies stage
+FROM node:16.20.2-bullseye AS deps
+WORKDIR /app
+COPY site/package*.json site/
 RUN cd site && npm install
 
-# Stage 2: Development environment
-FROM node:16.20.2-bullseye
+# Final stage
+FROM node:16.20.2-bullseye as teaclave-docs-site
 
-# Copy installed dependencies from deps stage
-COPY --from=deps /root/.cargo /root/.cargo
-COPY --from=deps /usr/local/lib/python3.9/dist-packages /usr/local/lib/python3.9/dist-packages
 COPY --from=deps /app/site/node_modules /app/site/node_modules
+COPY --from=sgx-docs /prebuilt_docs/sgx-sdk-docs /prebuilt_docs/sgx-sdk-docs
+COPY --from=teaclave-docs /prebuilt_docs/teaclave-docs /prebuilt_docs/teaclave-docs
 
-# Set up environment
 ENV PATH="/root/.cargo/bin:${PATH}"
 ENV PYTHONPATH="/usr/local/lib/python3.9/dist-packages:${PYTHONPATH}"
 
-# Set working directory
 WORKDIR /app
-
-# Install VuePress globally
 RUN npm install -g vuepress@1.7.1
 
-# Create a volume for the build output
-VOLUME ["/app/site/.vuepress/dist"] 
+RUN apt-get update && apt-get install -y \
+    python3 \
+    python3-pip \
+    curl
+RUN pip3 install ghp-import
\ No newline at end of file
diff --git a/site/Makefile b/site/Makefile
index 43af6c468..7ab642a35 100644
--- a/site/Makefile
+++ b/site/Makefile
@@ -8,7 +8,8 @@ site: build
 
 init-repo:
 	git clone https://github.com/apache/incubator-teaclave.git teaclave
-	git clone -b v2.0.0-preview https://github.com/apache/incubator-teaclave-sgx-sdk.git teaclave-sgx-sdk
+	# v2.0.0-preview branch does not have documents folder, we use master branch instead
+	git clone -b master https://github.com/apache/incubator-teaclave-sgx-sdk.git teaclave-sgx-sdk
 	git clone https://github.com/apache/incubator-teaclave-trustzone-sdk.git teaclave-trustzone-sdk
 
 check-repo:
@@ -22,51 +23,44 @@ update-repo: check-repo
 	cd teaclave-sgx-sdk && git pull
 	cd teaclave-trustzone-sdk && git pull
 
-sgx-sdk-api-docs: teaclave-docs
-	cd ../sgx-sdk-api-docs && cargo doc
-	cp -r ../sgx-sdk-api-docs/target/doc .vuepress/dist/api-docs/sgx-sdk
-	@echo "<meta http-equiv=refresh content=0;url=`echo sgx_tstd | cut -d '/' -f 2`/index.html>" > .vuepress/dist/api-docs/sgx-sdk/index.html
-
-trustzone-sdk-api-docs: teaclave-docs
-	cd teaclave-trustzone-sdk && ./setup.sh
-	bash -c "cd teaclave-trustzone-sdk && source environment && cd optee-utee && xargo doc --target aarch64-unknown-optee-trustzone --no-deps"
-	bash -c "cd teaclave-trustzone-sdk && source environment && cd optee-teec && cargo doc --target aarch64-unknown-linux-gnu --no-deps"
-	mkdir -p .vuepress/dist/api-docs/trustzone-sdk
-	cp -r teaclave-trustzone-sdk/optee-utee/target/aarch64-unknown-optee-trustzone/doc .vuepress/dist/api-docs/trustzone-sdk/optee-utee
-	cp -r teaclave-trustzone-sdk/optee-teec/target/aarch64-unknown-linux-gnu/doc .vuepress/dist/api-docs/trustzone-sdk/optee-teec
-	@echo "<meta http-equiv=refresh content=0;url=`echo optee_utee | cut -d '/' -f 2`/index.html>" > .vuepress/dist/api-docs/trustzone-sdk/optee-utee/index.html
-	@echo "<meta http-equiv=refresh content=0;url=`echo optee_teec | cut -d '/' -f 2`/index.html>" > .vuepress/dist/api-docs/trustzone-sdk/optee-teec/index.html
-
-client-sdk-python-docs: teaclave-docs
-	python3 -m grpc_tools.protoc --proto_path=teaclave/services/proto/src/proto --python_out=teaclave/sdk/python --grpclib_python_out=teaclave/sdk/python teaclave/services/proto/src/proto/*.proto
-	PYTHONPATH=teaclave/sdk/python pdoc teaclave/sdk/python/teaclave.py -o .vuepress/dist/api-docs/client-sdk-python
+sgx-sdk-api-docs: site-build
+	mkdir -p .vuepress/dist/api-docs/sgx-sdk-docs
+	cp -r /prebuilt_docs/sgx-sdk-docs/* .vuepress/dist/api-docs/sgx-sdk-docs/
+	@echo "<meta http-equiv=refresh content=0;url=`echo sgx_tstd | cut -d '/' -f 2`/index.html>" > .vuepress/dist/api-docs/sgx-sdk-docs/index.html
+
+trustzone-sdk-api-docs: site-build
+	@echo "Trustzone SDK API docs not supported yet"
+
+client-sdk-python-docs: site-build
+	cp -r /prebuilt_docs/teaclave-docs/client-sdk-python .vuepress/dist/api-docs/client-sdk-python
 	@echo "<meta http-equiv=refresh content=0;url=python/teaclave.html>" > .vuepress/dist/api-docs/client-sdk-python/index.html
 
-client-sdk-rust-docs: teaclave-docs
-	(cd teaclave && git submodule update --init third_party/rust-sgx-sdk)
-	rustup default nightly-2022-10-22
-	cargo doc --no-deps --manifest-path teaclave/sdk/rust/Cargo.toml
-	cp -r teaclave/sdk/rust/target/doc .vuepress/dist/api-docs/client-sdk-rust
-	@rm -rf teaclave/third_party/rust-sgx-sdk
+client-sdk-rust-docs: site-build
+	cp -r /prebuilt_docs/teaclave-docs/client-sdk-rust .vuepress/dist/api-docs/client-sdk-rust
 	@echo "<meta http-equiv=refresh content=0;url=`echo teaclave_client_sdk | cut -d '/' -f 2`/index.html>" > .vuepress/dist/api-docs/client-sdk-rust/index.html
 
-crate-docs:
-	cp ${TEACLAVE_TARGET_DIR}/docs/enclave .vuepress/dist/api-docs/crates-enclave -r
-	cp ${TEACLAVE_TARGET_DIR}/docs/app .vuepress/dist/api-docs/crates-app -r
+teaclave-crates-docs: site-build
+	cp -r /prebuilt_docs/teaclave-docs/enclave .vuepress/dist/api-docs/crates-enclave 
+	cp -r /prebuilt_docs/teaclave-docs/app .vuepress/dist/api-docs/crates-app
+
+teaclave-docs: teaclave-crates-docs client-sdk-python-docs client-sdk-rust-docs
 
-teaclave-docs: update-repo
+site-build: update-repo
 	vuepress build
 
-dev: update-repo
-	cd teaclave-trustzone-sdk
+dev:
 	vuepress dev
 
 preview:
 	cd .vuepress/dist && python3 -m http.server
 
-build: teaclave-docs sgx-sdk-api-docs trustzone-sdk-api-docs client-sdk-python-docs client-sdk-rust-docs crate-docs
+build: teaclave-docs sgx-sdk-api-docs trustzone-sdk-api-docs 
 	cp ../.asf.yaml .vuepress/dist
 
-clean:
-	rm -rf .vuepress/dist teaclave teaclave-sgx-sdk teaclave-trustzone-sdk
+clean-repo:
+	rm -rf teaclave
+	rm -rf teaclave-sgx-sdk
+	rm -rf teaclave-trustzone-sdk
 
+clean: clean-repo
+	rm -rf .vuepress/dist 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@teaclave.apache.org
For additional commands, e-mail: commits-help@teaclave.apache.org