Skip to content

colidescope/os_server

 
 

Repository files navigation

Open Shape Server

Deploy status

Install conda

https://www.anaconda.com/download/success

Helpful Conda commands

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

run_local.bat

Deploy to Google Cloud

  1. Install Docker CLI: https://www.docker.com/products/cli/

  2. Install Google Cloud CLI: https://cloud.google.com/sdk/docs/install

  3. Authenticate with Google Cloud and log in to project:

gcloud auth login
gcloud config set project open-shape-server
  1. Enable Google Cloud Run service:
gcloud services enable run.googleapis.com
  1. 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
  1. Build container image:
docker build -t os-server .
  1. Deploy on local: http://localhost:8000/
docker run --env-file .env -p 8000:8000 os-server
  1. 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
  1. Push latest image to Google Artifact Registry
docker push us-central1-docker.pkg.dev/open-shape-server/os-server/os-server:latest
  1. 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/

image

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.

image

image

Environment variables

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 99.0%
  • Other 1.0%