Fix permissions

This commit is contained in:
Alex Davies 2024-06-18 15:09:29 -03:00
parent db9d01aa1c
commit b912a96868
2 changed files with 14 additions and 7 deletions

View File

@ -26,7 +26,7 @@ RUN make px4_sitl_default
RUN pip3 install typer-slim loguru sh
#Remove the ubuntu GUI and replace it with lxqt
RUN apt-get purge ubuntu-desktop gdm3 --yes
RUN apt-get purge ubuntu-desktop gdm3 mutter --yes
RUN apt-get install --yes virtualbox-guest-dkms virtualbox-guest-utils spice-vdagent qemu-guest-agent
RUN apt-get install --yes docker-compose-v2
@ -37,10 +37,15 @@ RUN apt-get install --yes lxqt sddm firefox
COPY ./skel/ /opt/spiri-sdk/user-home-skeleton/
RUN cp -r /opt/spiri-sdk/user-home-skeleton/* /etc/skel/
RUN usermod -l spiri -m -d /home/spiri user
RUN usermod -u 1000 -l spiri -m -d /home/spiri user
RUN echo 'spiri:spiri-friend' | chpasswd
RUN usermod -aG sudo,docker spiri
USER spiri
RUN cp -r /opt/spiri-sdk/user-home-skeleton/* /home/spiri/
USER root
#Install vscodium, a vscode fork with no telemetry and a worse package store
# RUN sh -c "curl -fSsL https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/master/pub.gpg | sudo gpg --dearmor | sudo tee /usr/share/keyrings/vscodium.gpg > /dev/null"
# RUN "echo deb [signed-by=/usr/share/keyrings/vscodium.gpg] https://download.vscodium.com/debs vscodium main | sudo tee /etc/apt/sources.list.d/vscodium.list"
@ -48,4 +53,4 @@ RUN usermod -aG sudo,docker spiri
# RUN apt install codium --yes
#This should be the first real user created and the `users` group on most linux distros
RUN chown -R 1000:100 /opt/spiri-sdk
RUN chown -R spiri:100 /opt/spiri-sdk

View File

@ -6,6 +6,7 @@ import contextlib
import pathlib
import time
import functools
from typing import List
from loguru import logger
import sh
import atexit
@ -110,7 +111,7 @@ def wait_for_gazebo(timeout=60, interval=1):
@app.command()
def start(sys_id: int = 1, extra_apps: list[pathlib.Path] = []):
def start(sys_id: int = 1, extra_apps: List[pathlib.Path] = []):
"""Starts the simulated drone with a given sys_id,
each drone must have it's own unique ID.
"""
@ -154,12 +155,13 @@ def start(sys_id: int = 1, extra_apps: list[pathlib.Path] = []):
@app.command()
@functools.wraps(start)
def start_group(count: int = typer.Argument(min=1, max=10), *args, **kwargs):
def start_group(
count: int = typer.Argument(min=1, max=10), extra_apps: List[pathlib.Path] = []
):
"""Start a group of robots"""
for i in range(count):
logger.info(f"start robot {i}")
start(sys_id=i + 1, *args, **kwargs)
start(sys_id=i + 1, extra_apps=extra_apps)
if i == 0:
wait_for_gazebo()