https://www.anaconda.com/download/success
conda config --add channels conda-forge
conda create --name=pyoccenv python=3.10
conda activate pyoccenv
conda install -c conda-forge pythonocc-core=7.8.1
conda deactivate
conda env remove --name pyoccenv
conda env list
run_local.bat
-
Install Docker CLI: https://www.docker.com/products/cli/
-
Install Google Cloud CLI: https://cloud.google.com/sdk/docs/install
-
Authenticate with Google Cloud and log in to project:
gcloud auth login
gcloud config set project open-shape-server
- Enable Google Cloud Run service:
gcloud services enable run.googleapis.com
- Enable Artifact Registry and create repository: https://console.cloud.google.com/artifacts
gcloud services enable artifactregistry.googleapis.com
gcloud artifacts repositories create os-server --repository-format=docker --location=us-central1
- Build container image:
docker build -t os-server .
- Deploy on local: http://localhost:8000/
docker run --env-file .env -p 8000:8000 os-server
- Give build a tag to register with Google Artifact Registry
docker tag os-server us-central1-docker.pkg.dev/open-shape-server/os-server/os-server:latest
- Push latest image to Google Artifact Registry
docker push us-central1-docker.pkg.dev/open-shape-server/os-server/os-server:latest
- Deploy latest image on Google Cloud Run with these settings (keep remaining default):
gcloud run deploy os-server --image=us-central1-docker.pkg.dev/open-shape-server/os-server/os-server:latest --platform=managed --region=us-central1 --allow-unauthenticated --port=8000
Once deployed, API will be accessible at the URL specified on the service details page: https://console.cloud.google.com/run/detail/us-central1/os-server/
To modify your deployment settings, click the Edit & Deploy New Version button on the service details page. Here you can modify the deployment settings including adding your environmental variables as described below.
The following variables must be set as Repository secrets in the Github repo for the Github Actions CI/CD to work.
SERVICE_NAME: os-server
REGION: us-central1
GCP_SA_KEY: [GCloud service account key]
GCP_PROJECT_ID: open-shape-server


