Skip to content

Commit

Permalink
build glim_ros2
Browse files Browse the repository at this point in the history
  • Loading branch information
koide3 committed Jul 25, 2024
1 parent 492cdfd commit 77d254d
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
packages/ubuntu2004/*
packages/ubuntu2204/*
packages/ubuntu2404/*
packages/ubuntu2404/*
packages/local_ppa/*
1 change: 1 addition & 0 deletions packages/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.sh
54 changes: 54 additions & 0 deletions packages/build_glim_ros2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/bin/bash
# docker build -f glim_ros2/docker/deb/Dockerfile.ros2 . -t glim_ros2

mkdir -p local_ppa
cp -R ../ubuntu2004 local_ppa/
cp -R ../ubuntu2204 local_ppa/
cp -R ../ubuntu2404 local_ppa/
cp -R ../setup_ppa.sh local_ppa/

platforms=("amd64")
declare -A pids
declare -A labels

configurations=(
"ubuntu2404 jazzy nvidia/cuda:12.5.1-devel-ubuntu24.04 Dockerfile.ros2"
"ubuntu2404 jazzy nvidia/cuda:12.5.1-devel-ubuntu24.04 Dockerfile.ros2 -cuda12.5"
"ubuntu2204 humble nvidia/cuda:12.5.1-devel-ubuntu22.04 Dockerfile.ros2"
)

for platform in "${platforms[@]}"; do
for configuration in "${configurations[@]}"; do
config=($configuration)
ubuntu_label=${config[0]}
ros_distro=${config[1]}
cuda_base_image=${config[2]}
dockerfile=${config[3]}
package_suffix=${config[4]}

name="glim_ros2:$ubuntu_label$package_suffix.$platform"
echo $name
docker buildx build \
-t $name \
-f glim_ros2/docker/deb/${dockerfile} \
--platform linux/$platform \
--build-arg="BASE_IMAGE=$cuda_base_image" \
--build-arg="ROS_DISTRO=$ros_distro" \
--build-arg="PACKAGE_SUFFIX=$package_suffix" \
. &

pids[$name]=$!
labels[$name]=$ubuntu_label
done
done

for key in "${!pids[@]}"; do
echo "Waiting for $key pid=${pids[$key]} label=${labels[$key]}"
wait ${pids[$key]}
done

for key in "${!labels[@]}"; do
echo "Extracting deb file from $key"
label=${labels[$key]}
docker run --rm -v $(realpath $label):/output $key /bin/bash -c "cp /root/*.deb /output/"
done
2 changes: 0 additions & 2 deletions packages/build_gtsam_points.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/bin/bash
platforms=("amd64" "arm64")
ubuntu_images=("jammy" "noble")
ubuntu_labels=("ubuntu2204" "ubuntu2404")

declare -A pids
declare -A labels
Expand Down
2 changes: 1 addition & 1 deletion packages/glim
2 changes: 1 addition & 1 deletion packages/glim_ros2
4 changes: 2 additions & 2 deletions setup_ppa.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ fi

# Add PPA to sources.list.d/koide3_ppa.list
echo "ubuntu_label=$ubuntu_label"
echo curl -s --compressed "https://koide3.github.io/ppa/$ubuntu_label/KEY.gpg" | gpg --dearmor | tee /etc/apt/trusted.gpg.d/koide3_ppa.gpg >/dev/null
echo echo "deb [signed-by=/etc/apt/trusted.gpg.d/koide3_ppa.gpg] https://koide3.github.io/ppa/$ubuntu_label ./" | tee /etc/apt/sources.list.d/koide3_ppa.list
echo 'curl -s --compressed "https://koide3.github.io/ppa/$ubuntu_label/KEY.gpg" | gpg --dearmor | tee /etc/apt/trusted.gpg.d/koide3_ppa.gpg >/dev/null'
echo 'echo "deb [signed-by=/etc/apt/trusted.gpg.d/koide3_ppa.gpg] https://koide3.github.io/ppa/$ubuntu_label ./" | tee /etc/apt/sources.list.d/koide3_ppa.list'

curl -s --compressed "https://koide3.github.io/ppa/$ubuntu_label/KEY.gpg" | gpg --dearmor | tee /etc/apt/trusted.gpg.d/koide3_ppa.gpg >/dev/null
echo "deb [signed-by=/etc/apt/trusted.gpg.d/koide3_ppa.gpg] https://koide3.github.io/ppa/$ubuntu_label ./" | tee /etc/apt/sources.list.d/koide3_ppa.list

0 comments on commit 77d254d

Please sign in to comment.