blockscout-rs icon indicating copy to clipboard operation
blockscout-rs copied to clipboard

scoutcloud: service for autodeploy

Open sevenzing opened this issue 11 months ago • 1 comments

This is epic issue for developing scoutcloud - API service for autodeploy blockscout instances

Initial tasks

  • [x] initial service structure (db schema, api schema, service-template) https://github.com/blockscout/blockscout-rs/pull/806
  • [x] github client to create/update files, and handle workflows https://github.com/blockscout/blockscout-rs/pull/806
  • [x] config generation https://github.com/blockscout/blockscout-rs/pull/814
  • [x] add endpoints related to balance (user balance, instance total cost etc) https://github.com/blockscout/blockscout-rs/pull/852
  • [x] creating instance, basic CRUD for instances/deployments https://github.com/blockscout/blockscout-rs/pull/834
  • [x] handling balances and stoping instances https://github.com/blockscout/blockscout-rs/pull/846

Improvements

  • [x] https://github.com/blockscout/blockscout-rs/issues/931

sevenzing avatar Mar 13 '24 09:03 sevenzing

QA related

Links

  • Swagger: https://app.swaggerhub.com/apis/LYMARENKOLEV/scoutcloud/0.1.1

  • Postman collection (url): https://galactic-sunset-60264.postman.co/workspace/Blockscout-workspace~55946628-0c3d-48ac-b418-05a67600b1d6/collection/15533327-d23e80de-affa-4d3e-9349-3fa231c2378b?action=share&creator=15533327&active-environment=15533327-fc0fe3bc-0e5b-414d-85f4-5fdf2e1e7863

  • Postman collection (file) v1-scoutcloud.proto.postman_collection.json

Common flow to start blockscout:

  1. get api key (for now only insert data in database):
insert into users(id, email) values (1, '[email protected]');
insert into auth_tokens(user_id) values (1);
insert into balance_changes(user_id, amount) values (1, 100);
select token_value from auth_tokens;
  1. create instance: POST /api/v1/instances
  2. start deployment: POST /api/v1/instances/{instance_id}/status:update with {"action": "START"}
  3. wait until status moves from PENDING to RUNNING: GET /api/v1/instances/{instance_id}/deployments/current
  4. in case of error see autodeploy private repo

sevenzing avatar May 01 '24 19:05 sevenzing