Skip to content

Commit 441fb9f

Browse files
benoit-ctyalenconlhproustmarc alenconSaboniAmine
authoredMay 19, 2021
API for codecarbon (#145)
* WIP : Database schema * Black formating * WIP : Refactor BaseModel * Use new EmissionCreate pydantic model * Add TODO comment * Save Emission to database * Saving experiment to database * saving projects to database * Add reading of emissions from database * Saving Teams in Database and Connect with API * Saving Organization to DB and connection with API * Add codecarbondb scheme * Update readme * Api repository (#152) Adding repository to emissions persistence router * Add files via upload * Testing the API (#149) * refacto: extracting server as standalone package, api test setup (example on one router) * feat: in memory emissions repository tests (to test the interface) Co-authored-by: Amine Saboni <asaboni@octo.com> Co-authored-by: benoit-cty <6603048+benoit-cty@users.noreply.github.com> * refacto: isolate infra implementation domain objects, experiments / org in memory repo tests * fix pre-commit * WIP Docker * fix imports & test names * move schemas * Alembic files * wip: adding user interface * lint * lint * wip: adding api key generation * adding pydantic email type * WIP : one table creation * First working version of DB with Alembic * adding router for users + refacto adding testing documentation * linting * typos * New structure for Emission Runs Experiment * Correction Emission Run Experiment * Add sample on all API route. * Fix import * Rebase api in api_db * Refactoring * Refacto * All PUT entry work * Try to fix test * run carbonserver with docker-compose fix pre-commit * allow usage of postgresql in docker-compose * use 3.8 python image for carbonserver * run fastapi with --reload param for dev environment * wip : fIx test * Fix tests * implement read_experiment * Implement get_one_project on Projects * Implement get_one_team on teams * Adding an entrypoint * Implement get_one_organization on Organizations * Update CodecarbonDB model * tests: postman collection + added tests * refacto: database/schemas.py -> api/schemas.py. Extract db_to_class as static method * wip: migration refacto: Run_id should be stored as string from db creation * pre-commit & typos * refacto: isolate unit from integration tests execution, doc * refacto: change id types to uuid, alembic migration new initial revision * ci: test integration * ci: added build_server job, with act patched Dockerfile for local debug * update doc * Fix requirements * WIP : prepare docker for package * isort import and flake8 ignore * Add multiple version of Python to Docker Co-authored-by: alencon <56264647+alencon@users.noreply.github.com> Co-authored-by: lhproust <64827117+lhproust@users.noreply.github.com> Co-authored-by: marc alencon <alenconma@macbook-pro-de-marc.home> Co-authored-by: Amine Saboni <43726203+SaboniAmine@users.noreply.github.com> Co-authored-by: Amine Saboni <asaboni@octo.com> Co-authored-by: Kenzo-Hugo Hillion <hillion.kenzo@posteo.net>
1 parent 08635e5 commit 441fb9f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+3252
-6
lines changed
 

‎.flake8

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33

44
[flake8]
55
select = C,E,F,W,B
6-
ignore = E203, E501, W503
6+
ignore = E203, E501, W503, B008
77
copyright-check = True

‎.github/workflows/build.yml

+19-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: build
1+
name: build package & server
22

33
on: [push, pull_request]
44

@@ -19,5 +19,22 @@ jobs:
1919
run: |
2020
python -m pip install --upgrade pip
2121
pip install tox tox-gh-actions
22-
- name: Test with tox
22+
- name: Test package with tox
2323
run: tox -vv
24+
25+
build_server:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@v2
29+
- name: Set up Python 3.7.10
30+
uses: actions/setup-python@v2
31+
with:
32+
python-version: '3.7'
33+
- name: Install dependencies
34+
run: |
35+
python -m pip install --upgrade pip
36+
pip install tox tox-gh-actions
37+
- name: Unit tests on api with tox
38+
run: |
39+
cd carbonserver/
40+
tox -e unit -vv

0 commit comments

Comments
 (0)
Please sign in to comment.