-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #54 from Boavizta/dev
Update Boagent to 0.1.0
- Loading branch information
Showing
70 changed files
with
16,559 additions
and
1,700 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
.git | ||
venv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Execute tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- dev | ||
paths: | ||
- "boagent/**" | ||
- "tests/**" | ||
- "poetry.lock" | ||
- "pyproject.toml" | ||
pull_request: | ||
branches: | ||
- main | ||
- dev | ||
paths: | ||
- "boagent/**" | ||
- "tests/**" | ||
- "poetry.lock" | ||
- "pyproject.toml" | ||
|
||
jobs: | ||
test: | ||
strategy: | ||
matrix: | ||
version: ["3.10", "3.11"] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Python setup | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.version }} | ||
- name: Poetry setup | ||
run : python3 -m pip install --upgrade poetry wheel | ||
- name: Install dependencies | ||
run: poetry install | ||
- name: Execute tests | ||
run: poetry run python3 -m pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -137,4 +137,6 @@ dmypy.json | |
.idea/ | ||
.vscode/ | ||
|
||
*.json | ||
*.db | ||
*.svg | ||
*.csv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v2.3.0 | ||
hooks: | ||
- id: check-yaml | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- repo: https://github.com/psf/black | ||
rev: 22.10.0 | ||
hooks: | ||
- id: black | ||
- repo: https://github.com/PyCQA/flake8 | ||
rev: 7.0.0 | ||
hooks: | ||
- id: flake8 | ||
entry: flake8 --ignore=E501,W503 --per-file-ignores='__init__.py:F401' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,21 @@ | ||
FROM python:3.10-slim | ||
|
||
LABEL org.opencontainers.image.authors="bpetit@hubblo.org" | ||
|
||
RUN apt update && apt install gcc g++ -y | ||
|
||
RUN apt-get install -y cron sqlite3 | ||
|
||
RUN useradd -ms /bin/bash boagent | ||
|
||
#USER boagent | ||
LABEL org.opencontainers.image.authors="open-source@boavizta.org" | ||
LABEL org.opencontainers.image.description="Docker image for Boagent, a local API & environmental impact monitoring tool." | ||
LABEL org.opencontainers.image.licenses=Apache-2.0 | ||
|
||
WORKDIR /home/boagent | ||
|
||
COPY requirements.txt requirements.txt | ||
RUN python3 -m pip install --upgrade poetry | ||
|
||
RUN apt update && apt install lshw nvme-cli -y | ||
|
||
RUN pip3 install -r requirements.txt | ||
COPY pyproject.toml . | ||
|
||
ENV PATH $PATH:/home/boagent/.local/bin | ||
RUN poetry install | ||
|
||
COPY . . | ||
|
||
EXPOSE 8000 | ||
|
||
ENTRYPOINT [ "/bin/bash", "-c", "cd boagent/api && uvicorn api:app --host 0.0.0.0" ] | ||
ENTRYPOINT ["poetry", "run", "uvicorn", "--reload", "boagent.api.api:app", "--host", "0.0.0.0"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.