Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
ROS-Kubernetes
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Larkin Heintzman
ROS-Kubernetes
Commits
28b3b53d
Commit
28b3b53d
authored
Jan 25, 2022
by
Larkin Heintzman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clean up!
parent
e3a65930
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
20 additions
and
369 deletions
+20
-369
Dockerfile
docker/base/Dockerfile
+15
-3
selfkey.pub
docker/base/selfkey.pub
+1
-0
Dockerfile
docker/drone/Dockerfile
+3
-1
Dockerfile
docker/master/Dockerfile
+0
-38
ros_entrypoint.sh
docker/master/ros_entrypoint.sh
+0
-12
Dockerfile
docker/node/Dockerfile
+0
-43
bashCheckRoscore.sh
docker/node/bashCheckRoscore.sh
+0
-16
check_roscore.py
docker/node/check_roscore.py
+0
-14
ros_entrypoint.sh
docker/node/ros_entrypoint.sh
+0
-11
buildRosCluster.yml
kubernetes/buildRosCluster.yml
+0
-15
drone-deployment.yaml
kubernetes/drone-deployment.yaml
+1
-1
listener-deployment.yaml
kubernetes/listener-deployment.yaml
+0
-82
master-deployment.yaml
kubernetes/master-deployment.yaml
+0
-47
talker-deployment.yaml
kubernetes/talker-deployment.yaml
+0
-86
No files found.
docker/base/Dockerfile
View file @
28b3b53d
...
...
@@ -2,7 +2,7 @@ ARG from=ros:noetic
FROM
${from}
RUN
apt-get update
&&
apt-get
install
-y
python3-pip git ca-certificates
RUN
apt-get update
&&
apt-get
install
-y
libsdl2-dev libusb-1.0-0-dev build-essential cmake
&&
apt-get
install
-y
openssh-server
RUN
apt-get update
&&
apt-get
install
-y
libsdl2-dev libusb-1.0-0-dev build-essential cmake
&&
apt-get
install
-y
openssh-server
iputils-ping
sudo
RUN
pip3
install
git+https://github.com/catkin/catkin_tools.git
...
...
@@ -22,8 +22,6 @@ RUN apt-get update && \
RUN
catkin config
\
--extend
/opt/ros/
$ROS_DISTRO
&&
\
catkin build
--cmake-args
-DCMAKE_CXX_FLAGS
=
"-std=c++17"
# \
# roscpp_tutorials
# might need something different in the bash script
# COPY bashCheckRoscore.sh /usr/local/bin/bashCheckRoscore.sh
...
...
@@ -37,9 +35,23 @@ RUN chmod 755 /usr/local/bin/ros_entrypoint.sh && \
RUN
echo
"source /opt/ros/noetic/setup.bash"
>>
/home/webssh/.bashrc
RUN
echo
"source /opt/ros_ws/devel/setup.bash"
>>
/home/webssh/.bashrc
# put rsa key in image
RUN
mkdir
-p
/home/webssh/.ssh
COPY
selfkey.pub /home/webssh/.ssh/authorized_keys
RUN
chown
-R
webssh:webssh /home/webssh/.ssh
RUN
chmod
600 /home/webssh/.ssh/authorized_keys
# RUN echo "Host remotehost\n\tStrictHostKeyChecking no\n" >> /home/webssh/.ssh/config
RUN
service ssh start
EXPOSE
22
ENTRYPOINT
["/usr/local/bin/ros_entrypoint.sh"]
CMD
["/usr/sbin/sshd","-D"]
CMD
["bash"]
# CMD ["service ssh start"]
# run ros package launch file
...
...
docker/base/selfkey.pub
0 → 100644
View file @
28b3b53d
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC+1wxuQlF2SEKtg7g2KllzaBp7Fx3bbkrdNVeMtbthr63CLsqane27yCKV2xCbQbn5BTBbyhjPFI3yJL2ohYH3POMqBRl/QriJ9a8ATDC2TofMKIBJrtZXbLCg8exQvHwJbtVnKZk7IBmySDl8lVEtPbAyvbDt15bHcDVdc7hOQBV5u7nAAQAZTBwmf8bDywrri0bX2ZPuFgtFHKoVV2HrB7gY+xghlkXaYtf1I37T9dFEOHy7RUA2q6ykBlGQBr/2vOKuvKa+QkpWVz5R3EHkaK7Xqsxv20VAceIo9h+RMoW/e1T+RJmQKm5JpeBC1Io5KYzKoHzDb1wd48vPZtqtD9kVrC97pvLMhaUcPk3WPP1TWxr9j+drUMMOLnY6JjrLTOKB6bO/AIfFTXIFY9L6zDEibFJOnMOvLNgf8dsF72qQFpBE4rAeVUTwYjvj2QRtHMIiAYjh4ieE1qHiwERYKsjUNvsKAihvo+v+TbwLSwj97ZAsH3KEvjjmpFAnY3k= llh@pop-os
docker/drone/Dockerfile
View file @
28b3b53d
...
...
@@ -5,9 +5,10 @@ FROM ${from}
# python-catkin-tools \
# && rm -rf /var/lib/apt/lists/*
RUN
apt-get update
&&
apt-get
install
-y
python3-pip git ca-certificates
RUN
apt-get update
&&
apt-get
install
-y
libsdl2-dev libusb-1.0-0-dev build-essential cmake ffmpeg python3-opencv libavcodec-dev libavdevice-dev libavfilter-dev libavformat-dev libavresample-dev libavutil-dev libpostproc-dev libswresample-dev libswscale-dev
RUN
apt-get update
&&
apt-get
install
-y
libsdl2-dev libusb-1.0-0-dev build-essential cmake ffmpeg python3-opencv libavcodec-dev libavdevice-dev libavfilter-dev libavformat-dev libavresample-dev libavutil-dev libpostproc-dev libswresample-dev libswscale-dev
iputils-ping
RUN
apt-get update
&&
apt-get
install
-y
ros-noetic-tf
RUN
pip3
install
git+https://github.com/catkin/catkin_tools.git
# set up udev and usb stuff
...
...
@@ -37,6 +38,7 @@ WORKDIR /usr/local/include/
RUN
git clone https://gitlab.com/libeigen/eigen.git
&&
mv
eigen/ Eigen3/
# clone ros package repo
RUN
echo
"test"
ENV
ROS_WS /opt/ros_ws
RUN
mkdir
-p
$ROS_WS
/src
WORKDIR
$ROS_WS
...
...
docker/master/Dockerfile
deleted
100644 → 0
View file @
e3a65930
ARG
from=ros:noetic
FROM
${from}
# install build tools
RUN
apt-get update
&&
apt-get
install
-y
python3-pip git
# work around as the apt-get version fails
RUN
pip3
install
git+https://github.com/catkin/catkin_tools.git
# clone ros package repo
ENV
ROS_WS /opt/ros_ws
RUN
mkdir
-p
$ROS_WS
/src
WORKDIR
$ROS_WS
RUN
git
-C
src clone
\
-b
$ROS_DISTRO
-devel
\
https://github.com/ros/ros_tutorials.git
# install ros package dependencies
RUN
apt-get update
&&
rosdep update
&&
rosdep
install
-y
--from-paths
src/ros_tutorials/roscpp_tutorials
--ignore-src
# build ros package source
RUN
catkin config
\
--extend
/opt/ros/
$ROS_DISTRO
&&
\
catkin build
\
roscpp_tutorials
COPY
ros_entrypoint.sh /usr/local/bin/ros_entrypoint.sh
RUN
chmod
755 /usr/local/bin/ros_entrypoint.sh
ENTRYPOINT
["/usr/local/bin/ros_entrypoint.sh"]
CMD
["roscore"]
# source ros package from entrypoint
# RUN sed --in-place --expression \
# '$isource "$ROS_WS/devel/setup.bash"' \
# /ros_entrypoint.sh
# run ros package launch file
# CMD ["roslaunch", "roscpp_tutorials", "talker_listener.launch"]
docker/master/ros_entrypoint.sh
deleted
100755 → 0
View file @
e3a65930
#!/bin/bash
set
-e
echo
"==> Executing master image entrypoint ..."
# setup ros environment
source
"/opt/ros/
$ROS_DISTRO
/setup.bash"
# might need to source the devel space as well
source
"
$ROS_WS
/devel/setup.bash"
echo
"==> Container ready"
exec
"
$@
"
docker/node/Dockerfile
deleted
100644 → 0
View file @
e3a65930
ARG
from=ros:noetic
FROM
${from}
# install build tools
# RUN apt-get update && apt-get install -y \
# python-catkin-tools \
# && rm -rf /var/lib/apt/lists/*
RUN
apt-get update
&&
apt-get
install
-y
python3-pip git
RUN
pip3
install
git+https://github.com/catkin/catkin_tools.git
# clone ros package repo
ENV
ROS_WS /opt/ros_ws
RUN
mkdir
-p
$ROS_WS
/src
WORKDIR
$ROS_WS
RUN
git
-C
src clone
\
-b
$ROS_DISTRO
-devel
\
https://github.com/ros/ros_tutorials.git
# install ros package dependencies
RUN
apt-get update
&&
\
rosdep update
&&
\
rosdep
install
-y
\
--from-paths
\
src/ros_tutorials/roscpp_tutorials
\
--ignore-src
&&
\
rm
-rf
/var/lib/apt/lists/
*
# build ros package source
RUN
catkin config
\
--extend
/opt/ros/
$ROS_DISTRO
&&
\
catkin build
\
roscpp_tutorials
COPY
bashCheckRoscore.sh /usr/local/bin/bashCheckRoscore.sh
COPY
ros_entrypoint.sh /usr/local/bin/ros_entrypoint.sh
RUN
chmod
755 /usr/local/bin/bashCheckRoscore.sh
&&
chmod
755 /usr/local/bin/ros_entrypoint.sh
ENTRYPOINT
["/usr/local/bin/ros_entrypoint.sh"]
# CMD [""]
CMD
["bash"]
# run ros package launch file
# CMD ["roslaunch", "roscpp_tutorials", "talker_listener.launch"]
docker/node/bashCheckRoscore.sh
deleted
100755 → 0
View file @
e3a65930
#!/bin/bash
# set -e
# make sure to source ros work space so we can use the rostopic command
FILE
=
"./resp.txt"
OUT
=
"confirm"
until
[[
$OUT
!=
"confirm"
]]
do
rostopic list &>
$FILE
echo
$OUT
OUT
=
$(
awk
'/ERR/ { print "confirm" }'
$FILE
)
sleep
1
done
echo
"found roscore!"
rm
$FILE
# exit 1
docker/node/check_roscore.py
deleted
100644 → 0
View file @
e3a65930
#!/usr/bin/env python3
import
sys
import
rospy
if
rospy
.
is_shutdown
():
print
(
"Waiting roscore ..."
)
sys
.
exit
(
1
)
# if not rosgraph.is_master_online():
# print("Waiting roscore ...")
# sys.exit(1)
print
(
"roscore found!"
)
docker/node/ros_entrypoint.sh
deleted
100755 → 0
View file @
e3a65930
#!/bin/bash
set
-e
echo
"==> Executing node image entrypoint ..."
# setup ros environment
source
"/opt/ros/
$ROS_DISTRO
/setup.bash"
# might need to source the devel space as well
source
"
$ROS_WS
/devel/setup.bash"
echo
"==> Container ready"
exec
"
$@
"
kubernetes/buildRosCluster.yml
deleted
100644 → 0
View file @
e3a65930
version
:
'
2.4'
services
:
master
:
image
:
llhcluster/master:v0
build
:
context
:
./master/
args
:
from
:
ros:noetic
node
:
image
:
llhcluster/node:v0
build
:
context
:
./node/
args
:
from
:
ros:noetic
kubernetes/
plathD
eployment.yaml
→
kubernetes/
drone-d
eployment.yaml
View file @
28b3b53d
...
...
@@ -28,7 +28,7 @@ spec:
name
:
ttyacm
-
mountPath
:
/dev/dji_usb
name
:
ttydji
image
:
llh/drone
arm
:v0
image
:
llh/drone:v0
command
:
[
"
/bin/bash"
]
args
:
[
"
-c"
,
"
source
/opt/ros_ws/devel/setup.bash
&&
/usr/local/bin/bashCheckRoscore.sh
&&
rostopic
pub
-r
1
armReady
std_msgs/String
'ready'"
]
# args: ["-c", "source /opt/ros_ws/devel/setup.bash && /usr/local/bin/bashCheckRoscore.sh"]
...
...
kubernetes/listener-deployment.yaml
deleted
100644 → 0
View file @
e3a65930
apiVersion
:
apps/v1
kind
:
Deployment
metadata
:
name
:
listener-deployment
labels
:
app
:
llhcluster
node
:
listener
spec
:
replicas
:
1
# The deployment handles all matching templated pods
selector
:
matchLabels
:
node
:
listener
# Template for a replica.
# The deployment makes sure that a POD containing the containers
# defined below is always running.
template
:
metadata
:
labels
:
node
:
listener
spec
:
# Wait roscore to be running before starting the pod.
# An initContainer is executed when this pod is created
# and tries to connect to the rocore which is running in
# a container in the master pod deployment.
# https://kubernetes.io/docs/concepts/workloads/pods/init-containers/
# initContainers:
# - name: init-service-listener
# image: llh/node:v0
# args:
# - bashCheckRoscore.sh
# env:
# - name: ROS_MASTER_URI
# value: http://service-master:11311
# - name: ROS_HOSTNAME
# value: service-listener
containers
:
# The real node container
-
name
:
llhclusterpublisher
image
:
llh/node:v0
command
:
[
"
/bin/bash"
]
args
:
[
"
-c"
,
"
source
/opt/ros_ws/devel/setup.bash
&&
/usr/local/bin/bashCheckRoscore.sh
&&
rostopic
echo
/chatter"
]
env
:
-
name
:
ROS_MASTER_URI
value
:
http://service-master:11311
-
name
:
ROS_HOSTNAME
value
:
service-listener
nodeSelector
:
name
:
plath
# When the roscore container stops or fails, all the node
# containers need to be restarted because the ros network
# configuration is lost.
# This liveness probe restarts the node container if the
# 'chatter' topic is not anymore listed in the ROS network.
# This is required because the node doesn't fail automatically
# when roscore stops / restarts.
# https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/
# livenessProbe:
# exec:
# command: ["/bin/bash -c 'ros_entrypoint.sh && rostopic info /chatter'"]
# # args: ["-c", "ros_entrypoint.sh && rostopic info /chatter"]
# initialDelaySeconds: 3
# periodSeconds: 3
---
apiVersion
:
v1
kind
:
Service
metadata
:
name
:
service-listener
labels
:
app
:
llhcluster
node
:
listener
spec
:
# Start a headless service
# https://kubernetes.io/docs/concepts/services-networking/service/#headless-services
clusterIP
:
None
ports
:
# Dummy port
-
port
:
11311
selector
:
node
:
listener
kubernetes/master-deployment.yaml
deleted
100644 → 0
View file @
e3a65930
apiVersion
:
apps/v1
kind
:
Deployment
metadata
:
name
:
roscore-deployment
labels
:
app
:
llhcluster
node
:
roscore
spec
:
replicas
:
1
# The deployment handles all matching templated pods
selector
:
matchLabels
:
node
:
roscore
# Template for a replica.
# The deployment makes sure that a POD containing the containers
# defined below is always running.
template
:
metadata
:
labels
:
node
:
roscore
spec
:
containers
:
-
name
:
roscore
image
:
llh/master:v0
args
:
-
roscore
ports
:
-
containerPort
:
11311
name
:
roscoreport
nodeSelector
:
name
:
master
---
apiVersion
:
v1
kind
:
Service
metadata
:
name
:
service-master
labels
:
app
:
llhcluster
node
:
roscore
spec
:
clusterIP
:
None
ports
:
-
port
:
11311
selector
:
node
:
roscore
kubernetes/talker-deployment.yaml
deleted
100644 → 0
View file @
e3a65930
apiVersion
:
apps/v1
kind
:
Deployment
metadata
:
name
:
talker-deployment
labels
:
app
:
llhcluster
node
:
talker
spec
:
replicas
:
1
# The deployment handles all matching templated pods
selector
:
matchLabels
:
node
:
talker
# Template for a replica.
# The deployment makes sure that a POD containing the containers
# defined below is always running.
template
:
metadata
:
labels
:
node
:
talker
spec
:
# Wait roscore to be running before starting the pod.
# An initContainer is executed when this pod is created
# and tries to connect to the rocore which is running in
# a container in the master pod deployment.
# https://kubernetes.io/docs/concepts/workloads/pods/init-containers/
# initContainers:
# - name: init-service-talker
# image: llh/node:v0
# args:
# - bashCheckRoscore.sh
# env:
# - name: ROS_MASTER_URI
# value: http://service-master:11311
# - name: ROS_HOSTNAME
# value: service-talker
containers
:
# The real node container
-
name
:
llhclusterpublisher
image
:
llh/node:v0
command
:
[
"
/bin/bash"
]
args
:
[
"
-c"
,
"
source
/opt/ros_ws/devel/setup.bash
&&
/usr/local/bin/bashCheckRoscore.sh
&&
rostopic
pub
-r
1
chatter
std_msgs/String
'hello
worl'"
]
env
:
-
name
:
ROS_MASTER_URI
value
:
http://service-master:11311
-
name
:
ROS_HOSTNAME
value
:
service-talker
nodeSelector
:
name
:
plath
# When the roscore container stops or fails, all the node
# containers need to be restarted because the ros network
# configuration is lost.
# This liveness probe restarts the node container if the
# 'chatter' topic is not anymore listed in the ROS network.
# This is required because the node doesn't fail automatically
# when roscore stops / restarts.
# https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/
# livenessProbe:
# exec:
# command: ["/bin/bash -c 'ros_entrypoint.sh && rostopic info /chatter'"]
# # command:
# # - ros_entrypoint.sh
# # - /opt/ros/melodic/bin/rostopic
# # - info
# # - chatter
# initialDelaySeconds: 3
# periodSeconds: 3
---
apiVersion
:
v1
kind
:
Service
metadata
:
name
:
service-talker
labels
:
app
:
llhcluster
node
:
talker
spec
:
# Start a headless service
# https://kubernetes.io/docs/concepts/services-networking/service/#headless-services
clusterIP
:
None
ports
:
# Dummy port
-
port
:
11311
selector
:
node
:
talker
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment