Commit 59a8d1bd authored by Larkin Heintzman's avatar Larkin Heintzman

general clean up and ssh serving

parent 28b3b53d
......@@ -20,7 +20,7 @@ chown $(id -u):$(id -g) $HOME/.kube/config
kubectl apply -f flannel.yml
kubectl taint nodes --all node-role.kubernetes.io/master-
kubectl label nodes $HOSTNAME name=master
kubectl label nodes $HOSTNAME name=base
# print join command again to clipboard
# kubeadm token create --print-join-command > ./tmpJoinCommand.txt
......
......@@ -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 iputils-ping sudo
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 net-tools sudo
RUN pip3 install git+https://github.com/catkin/catkin_tools.git
......@@ -23,13 +23,10 @@ RUN catkin config \
--extend /opt/ros/$ROS_DISTRO && \
catkin build --cmake-args -DCMAKE_CXX_FLAGS="-std=c++17"
# might need something different in the bash script
# COPY bashCheckRoscore.sh /usr/local/bin/bashCheckRoscore.sh
COPY ros_entrypoint.sh /usr/local/bin/ros_entrypoint.sh
RUN useradd -m -s /bin/bash -p $(openssl passwd -1 password) webssh
RUN chmod 755 /usr/local/bin/ros_entrypoint.sh && \
/usr/local/bin/ros_entrypoint.sh
RUN chmod 755 /usr/local/bin/ros_entrypoint.sh
# make ssh-ing easier
RUN echo "source /opt/ros/noetic/setup.bash" >> /home/webssh/.bashrc
......@@ -37,12 +34,9 @@ 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
# 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 chmod 600 /home/webssh/.ssh/authorized_keys
RUN service ssh start
EXPOSE 22
......@@ -50,9 +44,5 @@ ENTRYPOINT ["/usr/local/bin/ros_entrypoint.sh"]
CMD ["/usr/sbin/sshd","-D"]
CMD ["bash"]
# CMD ["service ssh start"]
# run ros package launch file
# CMD ["roslaunch", "roscpp_tutorials", "talker_listener.launch"]
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC+1wxuQlF2SEKtg7g2KllzaBp7Fx3bbkrdNVeMtbthr63CLsqane27yCKV2xCbQbn5BTBbyhjPFI3yJL2ohYH3POMqBRl/QriJ9a8ATDC2TofMKIBJrtZXbLCg8exQvHwJbtVnKZk7IBmySDl8lVEtPbAyvbDt15bHcDVdc7hOQBV5u7nAAQAZTBwmf8bDywrri0bX2ZPuFgtFHKoVV2HrB7gY+xghlkXaYtf1I37T9dFEOHy7RUA2q6ykBlGQBr/2vOKuvKa+QkpWVz5R3EHkaK7Xqsxv20VAceIo9h+RMoW/e1T+RJmQKm5JpeBC1Io5KYzKoHzDb1wd48vPZtqtD9kVrC97pvLMhaUcPk3WPP1TWxr9j+drUMMOLnY6JjrLTOKB6bO/AIfFTXIFY9L6zDEibFJOnMOvLNgf8dsF72qQFpBE4rAeVUTwYjvj2QRtHMIiAYjh4ieE1qHiwERYKsjUNvsKAihvo+v+TbwLSwj97ZAsH3KEvjjmpFAnY3k= llh@pop-os
......@@ -5,10 +5,9 @@ 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 iputils-ping
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 net-tools openssh-server sudo
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
......@@ -35,14 +34,13 @@ RUN cmake .. \
# clone eigen into correct location and rename
WORKDIR /usr/local/include/
RUN git clone https://gitlab.com/libeigen/eigen.git && mv eigen/ Eigen3/
RUN git clone https://github.com/libigl/eigen.git && mv eigen/ Eigen3/ && cp -r ./Eigen3/Eigen/ ./Eigen/
# clone ros package repo
RUN echo "test"
ENV ROS_WS /opt/ros_ws
RUN mkdir -p $ROS_WS/src
WORKDIR $ROS_WS
RUN git -C src clone https://git.caslab.ece.vt.edu/hlarkin3/drone-ros-packages/ -b replicants
RUN git -C src clone http://git.caslab.ece.vt.edu/hlarkin3/drone-ros-packages.git -b replicants
# install ros package dependencies
RUN apt-get update && \
......@@ -60,10 +58,26 @@ RUN catkin config \
COPY bashCheckRoscore.sh /usr/local/bin/bashCheckRoscore.sh
COPY ros_entrypoint.sh /usr/local/bin/ros_entrypoint.sh
RUN useradd -m -s /bin/bash -p $(openssl passwd -1 password) ssher
RUN chmod 755 /usr/local/bin/bashCheckRoscore.sh && chmod 755 /usr/local/bin/ros_entrypoint.sh
# make ssh-ing easier
RUN echo "source /opt/ros/noetic/setup.bash" >> /home/ssher/.bashrc
RUN echo "source /opt/ros_ws/devel/setup.bash" >> /home/ssher/.bashrc
# also need to put env variables in here
RUN echo "export ROS_MASTER_URI=http://service-master:11311" >> /home/ssher/.bashrc
RUN echo "export ROS_HOSTNAME=service-drone" >> /home/ssher/.bashrc
# put rsa key in image
RUN mkdir -p /home/ssher/.ssh
# COPY selfkey.pub /home/ssher/.ssh/authorized_keys
RUN chown -R ssher:ssher /home/ssher/.ssh
# RUN chmod 600 /home/ssher/.ssh/authorized_keys
RUN sudo service ssh start
EXPOSE 22
ENTRYPOINT ["/usr/local/bin/ros_entrypoint.sh"]
# CMD [""]
CMD ["/usr/sbin/sshd","-D"]
CMD ["bash"]
# run ros package launch file
......
......@@ -28,7 +28,7 @@ spec:
- containerPort: 11311
name: baseport
nodeSelector:
name: master
name: base
---
......
......@@ -30,7 +30,7 @@ spec:
name: ttydji
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/ros_entrypoint.sh && sudo service ssh restart && /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"]
ports:
- containerPort: 11311
......@@ -41,7 +41,7 @@ spec:
- name: ROS_HOSTNAME
value: service-drone
nodeSelector:
name: plath
name: base
volumes:
- name: ttyacm
hostPath:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment