Skip to main content

A flow language for botrun

Project description

botrun_flow_lang

安裝

  • 用 poetry 管理 python 環境

輸出可用的 requirements.txt

poetry export -f requirements.txt --output requirements.txt --without-hashes --without-urls

建立 dev 的 index

gcloud firestore indexes composite create \
  --collection-group=botrun-hatch-dev-hatch \
  --field-config=field-path=user_id,order=ascending \
  --field-config=field-path=name,order=ascending \
  --field-config=field-path=__name__,order=ascending \
  --project=scoop-386004

打包 dev

gcloud builds submit --config cloudbuild_fastapi_dev.yaml --project=scoop-386004

deploy cloud run, dev 的版本

gcloud run deploy botrun-flow-lang-fastapi-dev \
  --image asia-east1-docker.pkg.dev/scoop-386004/botrun-flow-lang/botrun-flow-lang-fastapi-dev \
  --port 8080 \
  --platform managed \
  --allow-unauthenticated \
  --project=scoop-386004 \
  --region=asia-east1 \
  --cpu 2 \
  --memory 8Gi \
  --min-instances 0 \
  --max-instances 5 \
  --timeout 3600s \
  --concurrency 300 \
  --cpu-boost \

建立 staging 的 index

gcloud firestore indexes composite create \
  --collection-group=botrun-hatch-hatch \
  --field-config=field-path=user_id,order=ascending \
  --field-config=field-path=name,order=ascending \
  --field-config=field-path=__name__,order=ascending \
  --project=scoop-386004

打包 Cloud Run, staging 的版本

gcloud builds submit --config cloudbuild_fastapi.yaml --project=scoop-386004

佈署 cloud run, staging 的版本

gcloud run deploy botrun-flow-lang-fastapi \
  --image asia-east1-docker.pkg.dev/scoop-386004/botrun-flow-lang/botrun-flow-lang-fastapi \
  --port 8080 \
  --platform managed \
  --allow-unauthenticated \
  --project=scoop-386004 \
  --region=asia-east1 \
  --cpu 2 \
  --memory 8Gi \
  --min-instances 0 \
  --max-instances 5 \
  --timeout 3600s \
  --concurrency 300 \
  --cpu-boost \

為了要減少冷啟動的時間,每十分鐘呼叫一次 heartbeat

gcloud scheduler jobs create http botrun-flow-lang-heartbeat-job-$ENV \
  --schedule "*/10 * * * *" \
  --time-zone "Asia/Taipei" \
  --uri "https://botrun-flow-lang-fastapi-$ENV-36186877499.asia-east1.run.app/heartbeat" \
  --http-method GET \
  --location "asia-east1" \
  --project "scoop-386004"

測試 scheduler

gcloud scheduler jobs run botrun-flow-lang-heartbeat-job-$ENV --location "asia-east1" --project "scoop-386004"

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

botrun_flow_lang-4.10.261.tar.gz (1.9 kB view hashes)

Uploaded Source

Built Distribution

botrun_flow_lang-4.10.261-py3-none-any.whl (2.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page