Skip to content

Commit

Permalink
Merge pull request #285 from rapyuta-robotics/devel
Browse files Browse the repository at this point in the history
🎉 release: v7.3.0
  • Loading branch information
ankitrgadiya authored Mar 13, 2024
2 parents bf0ada8 + 264c77b commit 076bee5
Show file tree
Hide file tree
Showing 13 changed files with 241 additions and 173 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
deploy:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2

Expand Down
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ graphlib-backport = ">=1.0.3"
jinja2 = ">=3.0.1"
munch = ">=2.4.0"
pyyaml = ">=5.4.1"
rapyuta-io = ">=1.14.0"
rapyuta-io = ">=1.15.0"
tabulate = ">=0.8.0"
pyrfc3339 = ">=1.1"
directory-tree = ">=0.0.3.1"
Expand Down
343 changes: 177 additions & 166 deletions Pipfile.lock

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion riocli/apply/manifests/deployment-nonros-device.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,7 @@ spec:
volumes:
- execName: exec-docker
mountPath: "/tmp" # Path on container
subPath: "/tmp" # Path on device
subPath: "/tmp" # Path on device
uid: 1000 # Optional userid for subpath
gid: 1000 # Optional groupid for subpath
perm: 755 # Optional permissions for subpath
3 changes: 3 additions & 0 deletions riocli/apply/manifests/deployment-ros-device-no-rosbag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ spec:
- execName: exec-docker
mountPath: "/tmp" # Path on container
subPath: "/tmp" # Path on device
uid: 1000 # Optional userid for subpath
gid: 1000 # Optional groupid for subpath
perm: 755 # Optional permissions for subpath
rosNetworks:
- depends:
kind: network
Expand Down
5 changes: 4 additions & 1 deletion riocli/apply/manifests/staticroute.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ metadata:
project: "project-guid"
# region: us
labels:
app: test
app: test
spec:
sourceIPRange:
- 10.0.0.0/8
5 changes: 4 additions & 1 deletion riocli/deployment/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,12 @@ def create_object(self, client: Client, **kwargs) -> typing.Any:
exec_mounts = []
if 'volumes' in self.spec:
for vol in self.spec.volumes:
uid = getattr(vol, 'uid', None)
gid = getattr(vol, 'gid', None)
perm = getattr(vol, 'perm', None)
exec_mounts.append(
ExecutableMount(vol.execName, vol.mountPath,
vol.subPath))
vol.subPath, uid, gid, perm))

if len(exec_mounts) > 0:
provision_config = add_mount_volume_provision_config(
Expand Down
6 changes: 6 additions & 0 deletions riocli/deployment/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@ def add_mount_volume_provision_config(provision_config, component_name, device,
exec_mount = {
'mountPath': mount.mount_path
}
if mount.uid is not None:
exec_mount['uid'] = mount.uid
if mount.gid is not None:
exec_mount['gid'] = mount.gid
if mount.perm is not None:
exec_mount['perm'] = mount.perm
if mount.sub_path:
exec_mount['subPath'] = mount.sub_path
else:
Expand Down
7 changes: 7 additions & 0 deletions riocli/jsonschema/schemas/deployment-schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@ definitions:
subPath:
type: string
pattern: '^\/$|(^(?=\/)|^\.|^\.\.)(\/(?=[^/\0])[^/\0]+)*\/?$'
uid:
type: integer
gid:
type: integer
perm:
type: integer

additionalProperties: false


Expand Down
7 changes: 7 additions & 0 deletions riocli/jsonschema/schemas/static_route-schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,18 @@ definitions:
uuid:
type: string
pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
ipRange:
type: string
pattern: '^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4}(?:/([1-9]|1\d|2\d|3[0-2]))?$'
staticRouteSpec:
type: object
properties:
url:
type: string
sourceIPRange:
type: array
items:
"$ref": "#/definitions/ipRange"
staticRouteStatus:
type: object
properties:
Expand Down
9 changes: 8 additions & 1 deletion riocli/static_route/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,14 @@ def create_object(self, client: Client, **kwargs) -> typing.Any:
return unmunchify(r)

def update_object(self, client: Client, obj: typing.Any) -> None:
pass
client = new_v2_client()

self.pop("rc", None)

static_route = unmunchify(self)
r = client.update_static_route(obj.metadata.name, static_route)

return unmunchify(r)

def delete_object(self, client: Client, obj: typing.Any):
client = new_v2_client()
Expand Down
18 changes: 18 additions & 0 deletions riocli/v2client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,24 @@ def create_static_route(self, metadata: dict) -> Munch:

return munchify(data)

def update_static_route(self, name: str, sr: dict) -> Munch:
"""
Update the new static route
"""
url = "{}/v2/staticroutes/{}/".format(self._host, name)
headers = self._config.get_auth_header()
response = RestClient(url).method(HttpMethod.PUT).headers(
headers).execute(payload=sr)

handle_server_errors(response)

data = json.loads(response.text)
if not response.ok:
err_msg = data.get('error')
raise Exception("static routes: {}".format(err_msg))

return munchify(data)

def delete_static_route(self, name: str) -> Munch:
"""
Delete a static route by its name
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"python-dateutil>=2.8.2",
"pytz",
"pyyaml>=5.4.1",
"rapyuta-io>=1.14.0",
"rapyuta-io>=1.15.0",
"requests>=2.20.0",
"setuptools",
"six>=1.13.0",
Expand Down

0 comments on commit 076bee5

Please sign in to comment.