Code Monkey home page Code Monkey logo

mygcemgrbot's Introduction

Requirements

  1. gcloud CLI
  2. Ruby, Bundler

mygcemgrbot's People

Watchers

TaichiFunit avatar

mygcemgrbot's Issues

自動起動 & バックアップ戦略を考える

目標

  1. SpotVMなGCEインスタンスの常時起動
  2. デイリーバックアップ

方向性

  1. Spot VMなGCEインスタンスの常時起動は, 数分おきにstart [APIを叩くことで実現
  2. バックアップはGCE Diskをスナップショットすることで実現

方法 その1 Google Cloud Workflows & Google Cloud Scheduler

Managed Cron ServiceであるGoogle Cloud SchedulerとGoogle Cloud Workflowsを組み合わせて常時起動, デイリーバックアップを実現.
Scheduler JobのON/OFFで常時起動のON/OFFとなるためランニングコストの制御もしやすい.

方法 その2 Discord Botクライアントスクリプト側で常時起動, デイリーバックアップを同居

すでにDiscord Bot用のスクリプトを常時稼働させているので, このスクリプトの中に擬似的にcronっぽい機能を実装して定期実行を実現する.
Spot VMのGCEインスタンス常時起動であれば一定間隔でAPI callすればよいだけなのでこのやり方でも良い.
デイリーバックアップは要検討. ディスクのフルスナップショットを取得する都合上時刻決め打ちではなくインスタンスの終了時にバックアップが取れると良い.

インスタンスの起動時にstatus=STOPPEDだったらバックアップするとかでも良いかも?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.