This is the main repo for Cloud Zeta, a cloud platform for creators to manage 3D assets, collaborate on projects, and deliver content from anywhere.
- Dev container on Windows (WSL) or Linux
- It is recommended to use
VS Codefor easy ramp up.CLionorVisual Studiomay also work, but you will be on your own to setup dev environment.
https://learn.microsoft.com/en-us/windows/wsl/install
Some of our dependencies need it.
sudo apt-get install git-lfsFor macOS
brew install git-lfsgit clone --recurse-submodules git@github.com:cloud-zeta/zeta.gitWhen updating existing repository, don't forget to update all submodules:
git pull
git submodule update --recursiveBefore you begin, ensure Docker is installed. The recommended setup is to run Docker Desktop on Windows and use WSL2 as the backend. This allows developers to use the same setup on both Windows and Linux.
If you use CLion, check out the Docker toolchain documentation.
NOTE
Do not install VS Code in WSL using apt-get. Instead, follow the VS Code WSL Tutorial.
Once done, code command in WSL will open the VS Code in Windows.
code .We use DevContainer for the development. When you open the VS Code workspace for the first time, VS Code will automatically prompt you to Re-open in the container. VS Code will build the container and setup the environment for you.
The first time running this will take some time.
See Developing inside a Container for more context about DevContainers.
Run the following command in the VS Code terminal (inside the DevContainer)
./scripts/build_usd.sh
./scripts/build.sh
./devops/run/web_app.sh
./devops/run/web_server.shOnce everything is done, open http://localhost:8080 in any brower avaialble to your Windows.
VS Code already sets up all the necessary port forwarding.
Set the TARGET_DEPLOYMENT environment variable to zeta to use the Supabase database in beta.
This points to the beta database with https://beta.zetabase.ai.
TARGET_DEPLOYMENT=zeta ./devops/run/web_server.sh
TARGET_DEPLOYMENT=zeta ./devops/run/web_app.shINFO
You can also visit the beta instance directly at beta.zetabase.ai.
And supabase admin console at studio.beta.zetabase.ai.
Take a look at the .env file for the credentials for the admin console.
Start the local Kubernetes cluster and deploy the Postgres and Supabase services.
minikube start --cpus 8 --memory 4096 --disk-size 20g --driver=docker --network=zeta_default --network-plugin=cni --cni=cilium
minikube addons enable storage-provisioner
minikube addons enable default-storageclass
TARGET_DEPLOYMENT=local ./devops/deploy/postgres.sh
TARGET_DEPLOYMENT=local ./devops/deploy/supabase.shThen run the Zeta containers, similar to the previous section, but with TARGET_DEPLOYMENT=local.
TARGET_DEPLOYMENT=local ./devops/run/web_server.sh
TARGET_DEPLOYMENT=local ./devops/run/web_app.shCheck out tasks.json for available targets. See VS Code Tasks to learn more.
| Tasks | Description |
|---|---|
build-usd-wasm-release |
Release build for OpenUSD for Emscripten |
build-usd-linux-debug |
Debug build for OpenUSD for Linux |
run-tests-linux |
Run native tests for Linux |
build-usd-viewer-linux |
Build Hydrogent USD Viewer for Linux |
run-usd-viewer-linux |
Run Hydrogent USD Viewer for Linux |
NOTE Cloud Zeta's DevContainer has been confitured to run Linux GUI programs. The GUI is available in a VNC server available at http://localhost:6080. If you don't know the password, ask around.
NOTE Make sure to use the corresponding cmake-kits for different Emscripten and Linux tasks.
We use Google Cloud Run to host backend services. The code is available at src/python.
To run the full web server, run the following steps:
Step 1: Build OpenUSD for Linux
./scripts/build_usd.sh -t linux -v releaseAlternatively, you can use the build-usd-linux-release VS Code task.
Step 2: Build OpenUSD
./scripts/build_zeta_native.shAlternatively, you can also build with VS Code by select the Clang kit.
See cmake-kits for more detauls.
Step 3: Run the Web Server
./devops/run/web_server.shThis script will build the container for the web server and execute it.
NOTE
The flask app requires GOOGLE_APPLICATION_CREDENTIALS points to a valid Google Cloud secret.
Currently, we don't have a dev or staging environment.
To debug individual Python scripts or run test without Google Cloud dependencies, you need to create pip virtual environment.
cd src/python
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python zeta/importer/usdz.pyStep 4 (optional): Attach Python Debugger to Web Server
- When running in debug mode, flask app will listen on port 5678 for debugger.
- Run
docker -psto get the id of the zeta-flask container. - Run
docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' <zeta-flask-id>to get the ip of the running container and set it in the launch.json file. - Run the
(debugpy) attach to web serverdebug option.
NOTE This path is maintain for the CI/CD pipeline. Not recommended for day-to-day development.
Simply run the following command to build Cloud Zeta with Docker:
./docker_build.shThe script will build the Docker image and run the build inside the container. The build artifacts
will available in the ./build directory.
To build the image or Cloud Zeta project manually, inspect the content of
docker_build.sh, build.sh and
Dockerfile.
By default, the build script will build the release build, for debug build, run the following
command:
./docker_build.sh -e debug./docker_run.shThe script will run the Cloud Zeta web app inside the container, it will automatically reload the app when
- The Javascript source code changes.
- After each
./docker_build.shcommand.
Build
cmake --build /code/zeta/build-Emscripten-Release --config Release --target install --The test server has no cloud dependencies, just run:
./scripts/run_test_server.shVisit tests at http://localhost:8082/tests/.