-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1868 from k-okada/fix_for_mac
[unitree/cross] Enable to share single docker image with multiple users
- Loading branch information
Showing
19 changed files
with
331 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,9 @@ user: | |
install: | ||
./install.sh | ||
|
||
compress: | ||
./compress.sh | ||
|
||
clean: | ||
rm -fr ${TARGET_MACHINE}_ws_* | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
|
||
if [ -e "arm64v8_User" ]; then | ||
if [ -e "arm64v8_User.tgz" ]; then | ||
echo "WARNING: Compressed arm64v8_User.tgz is found." | ||
read -p "WARNING: Are you sure to continue [y/N] ? " -n 1 -r | ||
echo # (optional) move to a new line | ||
if [[ $REPLY =~ ^[Yy]$ ]]; then | ||
tar -zcvf arm64v8_User.tgz arm64v8_User | ||
fi | ||
else | ||
tar -zcvf arm64v8_User.tgz arm64v8_User | ||
fi | ||
fi | ||
|
||
if [ -e "arm64v8_System" ]; then | ||
if [ -e "arm64v8_System.tgz" ]; then | ||
echo "WARNING: Compressed arm64v8_System.tgz is found." | ||
read -p "WARNING: Are you sure to continue [y/N] ? " -n 1 -r | ||
echo # (optional) move to a new line | ||
if [[ $REPLY =~ ^[Yy]$ ]]; then | ||
chmod 644 arm64v8_System/ros1_inst/share/pr2eus/*.l | ||
tar -zcvf arm64v8_System.tgz arm64v8_System | ||
fi | ||
else | ||
chmod 644 arm64v8_System/ros1_inst/share/pr2eus/*.l | ||
tar -zcvf arm64v8_System.tgz arm64v8_System | ||
fi | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
function fail { | ||
printf '\033[31m%s\033[0m\n' "$1" >&2 ## Send message to stderr. | ||
exit "${2-1}" ## Return a code specified by $2, or 1 by default. | ||
} | ||
[ -z "${HOST_UID}" ] && fail "ERROR: HOST_UID is requried, add '-e HOST_UID=$(id -u)' to your docker commandline option" | ||
[ -z "${HOST_GID}" ] && fail "ERROR: HOST_GID is requried, add '-e HOST_GID=$(id -g)' to your docker commandline option" | ||
|
||
# create user with same UID as the host user | ||
# -g The numerical value of the group's ID. | ||
groupadd -g $HOST_GID user | ||
# -u The numerical value of the user's ID. | ||
# -o Allow the creation of a user account with a duplicate (non-unique) UID. | ||
# -m Create the user's home directory if it does not exist. | ||
# -g The group name or number of the user's initial login group. | ||
# -s The name of the user's login shell. | ||
useradd -u $HOST_UID -o -m -g $HOST_GID -s /usr/bin user -G sudo | ||
echo user:user | chpasswd | ||
export HOME=/home/user | ||
chown $HOST_UID:$HOST_GID $HOME | ||
cd $HOME | ||
|
||
runuser -u user -- "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
repositories: | ||
catkin_virtualenv: | ||
type: git | ||
url: https://github.com/locusrobotics/catkin_virtualenv | ||
version: 0.9.0 | ||
# | ||
# 0.9.0 contains following two patches, but not release on ROS1 | ||
# catkin_virtualenv depends on python3-rospkg-modules (and others). It is installed in build_ros1_dependencies.sh | ||
# | ||
# At current, if we do a catkin build with CATKIN_ENABLE_TESTING=FALSE, | ||
# we get the error 'Unknown CMake command "catkin_run_tests_target"' | ||
# when calling catkin_generate_virtualenv. The following PR fixes this error. | ||
# https://github.com/locusrobotics/catkin_virtualenv/pull/89 | ||
# | ||
# Some python environments may not have ensurepip installed. | ||
# Also, some users may not be able to use sudo apt install to install python3-venv (sudo command), etc. | ||
# The following PR will enable catkin_virtualenv in environments without ensurepip by doing get-pip.py within venv. | ||
# https://github.com/locusrobotics/catkin_virtualenv/pull/90 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
jsk_unitree_robot/cross/ros1_dependencies_build_scripts/1045-virtualenv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
set -xeuf -o pipefail | ||
|
||
DEBIAN_DIR=/home/user/ros1_dependencies_sources/src/virtualenv/debian/debian | ||
SOURCE_DIR=/home/user/ros1_dependencies_sources/src/virtualenv/virtualenv-15.1.0 | ||
|
||
cd ${DEBIAN_DIR}/patches | ||
for patch_file in $(grep -v ^# series); do | ||
OUT="$(patch -p1 --forward --directory ${SOURCE_DIR} < ${patch_file} | tee /dev/tty)" || echo "${OUT}" | grep "Skipping patch" -q || (echo "$OUT" && false) || echo "OK" | ||
done | ||
cd ${SOURCE_DIR} | ||
mkdir -p /opt/jsk/${INSTALL_ROOT}/ros1_dependencies/lib/python3.6/site-packages/ | ||
SKIP_PYTHON_SCRIPTS=1 \ | ||
PYTHONPATH="/opt/jsk/${INSTALL_ROOT}/ros1_dependencies/lib/python3.6/site-packages" \ | ||
python3 \ | ||
setup.py install \ | ||
--force --root=/opt/jsk/${INSTALL_ROOT}/ros1_dependencies \ | ||
--no-compile -O0 --single-version-externally-managed --prefix=./ | ||
# --prefix /opt/jsk/${INSTALL_ROOT}/ros1_dependencies |
21 changes: 21 additions & 0 deletions
21
jsk_unitree_robot/cross/ros1_dependencies_build_scripts/1046-python3-pyparsing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
set -xeuf -o pipefail | ||
|
||
DEBIAN_DIR=/home/user/ros1_dependencies_sources/src/python3-pyparsing/debian/debian | ||
SOURCE_DIR=/home/user/ros1_dependencies_sources/src/python3-pyparsing/pyparsing-2.2.0+dfsg1 | ||
|
||
# cd ${DEBIAN_DIR}/patches | ||
# for patch_file in $(grep -v ^# series); do | ||
# OUT="$(patch -p1 --forward --directory ${SOURCE_DIR} < ${patch_file} | tee /dev/tty)" || echo "${OUT}" | grep "Skipping patch" -q || (echo "$OUT" && false) || echo "OK" | ||
# done | ||
|
||
cd ${SOURCE_DIR} | ||
|
||
mkdir -p /opt/jsk/${INSTALL_ROOT}/ros1_dependencies/lib/python3.6/site-packages/ | ||
SKIP_PYTHON_SCRIPTS=1 \ | ||
PYTHONPATH="/opt/jsk/${INSTALL_ROOT}/ros1_dependencies/lib/python3.6/site-packages" \ | ||
python3 \ | ||
setup.py install \ | ||
--force --root=/opt/jsk/${INSTALL_ROOT}/ros1_dependencies \ | ||
--no-compile -O0 --single-version-externally-managed --prefix=./ | ||
# --prefix /opt/jsk/${INSTALL_ROOT}/ros1_dependencies |
21 changes: 21 additions & 0 deletions
21
jsk_unitree_robot/cross/ros1_dependencies_build_scripts/1047-python3-catkin-pkg-modules
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
set -xeuf -o pipefail | ||
|
||
DEBIAN_DIR=/home/user/ros1_dependencies_sources/src/python3-catkin-pkg-modules/debian/debian | ||
SOURCE_DIR=/home/user/ros1_dependencies_sources/src/python3-catkin-pkg-modules/catkin_pkg_modules-0.5.2 | ||
|
||
# cd ${DEBIAN_DIR}/patches | ||
# for patch_file in $(grep -v ^# series); do | ||
# OUT="$(patch -p1 --forward --directory ${SOURCE_DIR} < ${patch_file} | tee /dev/tty)" || echo "${OUT}" | grep "Skipping patch" -q || (echo "$OUT" && false) || echo "OK" | ||
# done | ||
|
||
cd ${SOURCE_DIR} | ||
|
||
mkdir -p /opt/jsk/${INSTALL_ROOT}/ros1_dependencies/lib/python3.6/site-packages/ | ||
SKIP_PYTHON_SCRIPTS=1 \ | ||
PYTHONPATH="/opt/jsk/${INSTALL_ROOT}/ros1_dependencies/lib/python3.6/site-packages" \ | ||
python3 \ | ||
setup.py install \ | ||
--force --root=/opt/jsk/${INSTALL_ROOT}/ros1_dependencies \ | ||
--no-compile -O0 --single-version-externally-managed --prefix=./ | ||
# --prefix /opt/jsk/${INSTALL_ROOT}/ros1_dependencies |
Oops, something went wrong.