Skip to content

Commit

Permalink
checkpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
alberto-abarzua committed Nov 15, 2023
1 parent 4c0555a commit 12697c0
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 46 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/backend-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
workflow_dispatch:

jobs:
build-test:
build-lint:
runs-on: ubuntu-latest
environment: general
env:
Expand All @@ -33,6 +33,6 @@ jobs:

- name: Stop and remove containers
if: always()
run: ./manage.py down
run: ./manage.py down --container backend


4 changes: 3 additions & 1 deletion .github/workflows/controller-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ jobs:

- name: Stop and remove containers
if: always()
run: ./manage.py down
run: |
./manage.py down --container controller
./manage.py down --container firmware


Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/firmware-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

- name: Stop and remove containers
if: always()
run: ./manage.py down
run: ./manage.py down --container firmware

esp-idf-build:
runs-on: ubuntu-latest
Expand All @@ -50,11 +50,15 @@ jobs:
run: printenv | grep -v "^\(PWD\|SHLVL\|HOME\)" > .env

- name: Build ESP-IDF Container
run: ./manage.py build --container esp-idf
run: ./manage.py build --container esp_idf

- name: Build firmware for ESP32 using ESP-IDF
run: ./manage.py build-esp

- name: Stop and remove containers
if: always()
run: ./manage.py down --container esp_idf




24 changes: 2 additions & 22 deletions .github/workflows/frontend-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
workflow_dispatch:

jobs:
build-test:
build-lint:
runs-on: ubuntu-latest
environment: general
env:
Expand All @@ -33,25 +33,5 @@ jobs:

- name: Stop and remove containers
if: always()
run: ./manage.py down
run: ./manage.py down --container frontend

esp-idf-build:
runs-on: ubuntu-latest
environment: general
env:
ESP_CONTROLLER_SERVER_HOST: ${{ vars.ESP_CONTROLLER_SERVER_HOST }}
ESP_CONTROLLER_SERVER_PORT: ${{ vars.ESP_CONTROLLER_SERVER_PORT }}
ESP_WIFI_SSID: ${{ vars.ESP_WIFI_SSID }}
ESP_WIFI_PASSWORD: ${{ vars.ESP_WIFI_PASSWORD }}
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Set Env File
run: printenv | grep -v "^\(PWD\|SHLVL\|HOME\)" > .env

- name: Esp-idf Build
run: ./manage.py build-esp




8 changes: 0 additions & 8 deletions backend/src/main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import logging
from contextlib import asynccontextmanager

from fastapi import FastAPI
Expand All @@ -8,13 +7,6 @@
from routers.settings import router as settings_router
from utils.general import start_controller, stop_controller

# class IgnoreEndpointFilter(logging.Filter):
# def filter(self, record: logging.LogRecord) -> bool:
# return "/settings/status/" not in record.getMessage()
#
#
# logging.basicConfig(level=logging.INFO)
# logging.getLogger("uvicorn.access").addFilter(IgnoreEndpointFilter())


@asynccontextmanager
Expand Down
8 changes: 6 additions & 2 deletions controller/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@

[project]
name = "ribot"
version = "0.1"
name = "ribot-controller"
dynamic = ["version"]
description = "Ribot arm controller library"

authors = [
{name = "alberto-abarzua"},
]
Expand All @@ -27,6 +28,9 @@ license = {text = "MIT"}
[tool.pdm.files]
"ribot/py.typed" = "src/ribot/py.typed"

[tool.pdm.version]
source = "call"
getter = "ribot.utils.version.get_version()"


[tool.pdm.scripts]
Expand Down
11 changes: 2 additions & 9 deletions controller/src/ribot/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,8 @@
import numpy as np
import toml # type: ignore

from ribot.control.arm_kinematics import (
ArmKinematics,
ArmParameters,
ArmPose,
)
from ribot.control.controller_servers import (
ControllerServer,
WebsocketServer,
)
from ribot.control.arm_kinematics import ArmKinematics, ArmParameters, ArmPose
from ribot.control.controller_servers import ControllerServer, WebsocketServer
from ribot.utils.algebra import allclose
from ribot.utils.fifo_lock import FIFOLock
from ribot.utils.messages import Message, MessageOp
Expand Down
24 changes: 24 additions & 0 deletions controller/src/ribot/utils/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import requests
from packaging import version

def get_version() -> str:
return '0.0.3'
url = "https://pypi.org/pypi/ribot-controller/json"

response = requests.get(url)
if response.status_code == 200:
package_info = response.json()
current_version_str = package_info["info"]["version"]

# Parse the version string
current_version = version.parse(current_version_str)
print(f"Current version: {current_version}")

# Increment the minor version
new_version = version.Version(f"{current_version.major}.{current_version.minor + 1}.{current_version.micro}")

return str(new_version)
else:
raise Exception("Failed to retrieve package information")


0 comments on commit 12697c0

Please sign in to comment.