Page MenuHomePhabricator

[sct.backend] Create skeleton fastapi API
Closed, ResolvedPublic

Description

Repo: https://gitlab.wikimedia.org/toolforge-repos/sample-complex-app-backend

This should just say "hello world" for now

By the end of the task the tool should be able to build from the repository (using buildservice) and started as a continuous job on port 8080

Event Timeline

dcaro renamed this task from [sct.backend] create skeleton fastapi API to [sct.backend] Create skeleton fastapi API.Jul 16 2024, 4:03 PM
dcaro updated the task description. (Show Details)
dcaro removed dcaro as the assignee of this task.Jul 16 2024, 4:20 PM
dcaro triaged this task as High priority.
dcaro changed the task status from Open to In Progress.Jul 17 2024, 2:23 PM
dcaro claimed this task.
dcaro moved this task from Next Up to In Progress on the Toolforge (Toolforge iteration 13) board.

if you are feeling lazy, you can probably steal a bunch of stuff from here, including a local dev environment using docker-compose: https://github.com/blancadesal/fastapi-toolhunt

if you are feeling lazy, you can probably steal a bunch of stuff from here, including a local dev environment using docker-compose: https://github.com/blancadesal/fastapi-toolhunt

Nice, right on time xd

Copied a minimal setup (tox+pre-commit), starting small, too much stuff in there xd

Built and running in tools:

tools.sample-complex-app@tools-bastion-13:~$ toolforge jobs run --command "curl http://backend-api:8000/" --image python3.11 --wait 120 check-api
INFO: job 'check-api' completed

tools.sample-complex-app@tools-bastion-13:~$ cat check-api.*
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    14  100    14    0     0   1827      0 --:--:-- --:--:-- --:--:--  2000
"Hello world!"

Hmpf... I'm using the wrong port! xd

Fixed:

tools.sample-complex-app@tools-bastion-13:~$ toolforge jobs run --command "curl http://backend-api:8080/" --image python3.11 --wait 120 check-api
INFO: job 'check-api' completed
tools.sample-complex-app@tools-bastion-13:~$ cat check-api.*; echo
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    14  100    14    0     0   1662      0 --:--:-- --:--:-- --:--:--  1750
"Hello world!"
dcaro moved this task from In Review to Done on the Toolforge (Toolforge iteration 13) board.