Fix permissions
This commit is contained in:
parent
db9d01aa1c
commit
b912a96868
11
Dockerfile
11
Dockerfile
|
@ -26,7 +26,7 @@ RUN make px4_sitl_default
|
||||||
RUN pip3 install typer-slim loguru sh
|
RUN pip3 install typer-slim loguru sh
|
||||||
|
|
||||||
#Remove the ubuntu GUI and replace it with lxqt
|
#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 virtualbox-guest-dkms virtualbox-guest-utils spice-vdagent qemu-guest-agent
|
||||||
RUN apt-get install --yes docker-compose-v2
|
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/
|
COPY ./skel/ /opt/spiri-sdk/user-home-skeleton/
|
||||||
RUN cp -r /opt/spiri-sdk/user-home-skeleton/* /etc/skel/
|
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 echo 'spiri:spiri-friend' | chpasswd
|
||||||
RUN usermod -aG sudo,docker spiri
|
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
|
#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 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"
|
# 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
|
# RUN apt install codium --yes
|
||||||
|
|
||||||
#This should be the first real user created and the `users` group on most linux distros
|
#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
|
||||||
|
|
|
@ -6,6 +6,7 @@ import contextlib
|
||||||
import pathlib
|
import pathlib
|
||||||
import time
|
import time
|
||||||
import functools
|
import functools
|
||||||
|
from typing import List
|
||||||
from loguru import logger
|
from loguru import logger
|
||||||
import sh
|
import sh
|
||||||
import atexit
|
import atexit
|
||||||
|
@ -110,7 +111,7 @@ def wait_for_gazebo(timeout=60, interval=1):
|
||||||
|
|
||||||
|
|
||||||
@app.command()
|
@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,
|
"""Starts the simulated drone with a given sys_id,
|
||||||
each drone must have it's own unique 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()
|
@app.command()
|
||||||
@functools.wraps(start)
|
def start_group(
|
||||||
def start_group(count: int = typer.Argument(min=1, max=10), *args, **kwargs):
|
count: int = typer.Argument(min=1, max=10), extra_apps: List[pathlib.Path] = []
|
||||||
|
):
|
||||||
"""Start a group of robots"""
|
"""Start a group of robots"""
|
||||||
for i in range(count):
|
for i in range(count):
|
||||||
logger.info(f"start robot {i}")
|
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:
|
if i == 0:
|
||||||
wait_for_gazebo()
|
wait_for_gazebo()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue