diff --git a/docker/user_workspace/.gitignore b/docker/user_workspace/.gitignore deleted file mode 100644 index 1061e97..0000000 --- a/docker/user_workspace/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -cache -*.tar -*.tar.gz diff --git a/docker/user_workspace/CATKIN_IGNORE b/docker/user_workspace/CATKIN_IGNORE deleted file mode 100644 index e69de29..0000000 diff --git a/docker/user_workspace/Dockerfile b/docker/user_workspace/Dockerfile deleted file mode 100644 index 5b02759..0000000 --- a/docker/user_workspace/Dockerfile +++ /dev/null @@ -1,41 +0,0 @@ -ARG WORKSPACE_PATH -ARG BASE_IMAGE=ctumrs/mrs_uav_system:1.5.0_hailo_ai - -############################################################################# - -# FIRST STAGE: BUILD THE WORKSPACE -FROM $BASE_IMAGE AS stage_build - -ARG WORKSPACE_PATH - -COPY ./cache/${WORKSPACE_PATH}/ /${WORKSPACE_PATH}/ - -# create catkin workspace -RUN [ ! -e /${WORKSPACE_PATH}/.catkin_tools ] && cd /${WORKSPACE_PATH} && catkin init && catkin config --profile reldeb --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_EXPORT_COMPILE_COMMANDS=ON && catkin profile set reldeb && catkin config --extend /opt/ros/noetic || echo "[Docker]: catkin workspace already exists" - -# copy the sources from the local subfolder -COPY src/ /${WORKSPACE_PATH}/src/ - -RUN cd /${WORKSPACE_PATH} && catkin build -s - -############################################################################# - -# SECOND STAGE: COPY THE WORKSPACE TO A BLANK APLINE IMAGE -FROM alpine AS stage_cache_workspace - -ARG WORKSPACE_PATH - -COPY --from=stage_build /${WORKSPACE_PATH} /${WORKSPACE_PATH} - -############################################################################# - -# THIRD STAGE: copy the workspace to a final blank ROS-equipped base image -FROM alpine AS stage_finalization - -ARG WORKSPACE_PATH - -COPY ./cache/${WORKSPACE_PATH}/src /${WORKSPACE_PATH}/src -COPY ./cache/${WORKSPACE_PATH}/.catkin_tools /${WORKSPACE_PATH}/.catkin_tools -COPY ./cache/${WORKSPACE_PATH}/devel /${WORKSPACE_PATH}/devel - -CMD ["sh"] diff --git a/docker/user_workspace/build_image.sh b/docker/user_workspace/build_image.sh deleted file mode 100755 index 83c5c5f..0000000 --- a/docker/user_workspace/build_image.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash - -set -e - -trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG -trap 'echo "$0: \"${last_command}\" command failed with exit code $?"' ERR - -# get the path to this script -MY_PATH=`dirname "$0"` -MY_PATH=`( cd "$MY_PATH" && pwd )` - -cd ${MY_PATH} - -## -------------------------------------------------------------- -## | setup | -## -------------------------------------------------------------- - -LOCAL_TAG=catkin_workspace:yolo - -ARCH=arm64 # robofly -# ARCH=amd64 - -source ./paths.sh - -## -------------------------------------------------------------- -## | build | -## -------------------------------------------------------------- - -# initialize the cache -[ ! -e ${CACHE_PATH}/${WORKSPACE_PATH} ] && mkdir -p ./${CACHE_PATH}/${WORKSPACE_PATH} - -PASS_TO_DOCKER_BUILD="Dockerfile src ${CACHE_PATH}/${WORKSPACE_PATH}" - -docker buildx use default - -echo "" -echo "$0: building the user's workspace" -echo "" - -# this first build compiles the contents of "src" and storest the intermediate -tar -czh $PASS_TO_DOCKER_BUILD 2>/dev/null | docker build - --no-cache --target stage_cache_workspace --output ./${CACHE_PATH} --build-arg WORKSPACE_PATH=${WORKSPACE_PATH} --file Dockerfile --platform=linux/$ARCH - -echo "" -echo "$0: packing the workspace into a docker image" -echo "" - -# this second build takes the resulting workspace and storest in in a final image -# that can be deployed to a drone -docker build . --no-cache --target stage_finalization --file Dockerfile --build-arg WORKSPACE_PATH=${WORKSPACE_PATH} --tag $LOCAL_TAG --platform=linux/$ARCH - -echo "" -echo "$0: workspace was packed into '$LOCAL_TAG'" -echo "" diff --git a/docker/user_workspace/clean_cache.sh b/docker/user_workspace/clean_cache.sh deleted file mode 100755 index e7b04d5..0000000 --- a/docker/user_workspace/clean_cache.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -set -e - -trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG -trap 'echo "$0: \"${last_command}\" command failed with exit code $?"' ERR - -# get the path to this script -MY_PATH=`dirname "$0"` -MY_PATH=`( cd "$MY_PATH" && pwd )` - -cd ${MY_PATH} - -## -------------------------------------------------------------- -## | setup | -## -------------------------------------------------------------- - -source ./paths.sh - -## -------------------------------------------------------------- -## | build | -## -------------------------------------------------------------- - -rm -rf $CACHE_PATH - -echo "" -echo "$0: cache cleaned" -echo "" diff --git a/docker/user_workspace/export_image.sh b/docker/user_workspace/export_image.sh deleted file mode 100755 index 6944e82..0000000 --- a/docker/user_workspace/export_image.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash - -set -e - -trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG -trap 'echo "$0: \"${last_command}\" command failed with exit code $?"' ERR - -# get the path to this script -MY_PATH=`dirname "$0"` -MY_PATH=`( cd "$MY_PATH" && pwd )` - -cd ${MY_PATH} - -## -------------------------------------------------------------- -## | setup | -## -------------------------------------------------------------- - -LOCAL_TAG=catkin_workspace:yolo -EXPORT_PATH=~/docker - -## -------------------------------------------------------------- -## | export | -## -------------------------------------------------------------- - -docker save ${LOCAL_TAG} | gzip > ${EXPORT_PATH}/${LOCAL_TAG}.tar.gz - -echo "" -echo "$0: image exorted as ${EXPORT_PATH}/${LOCAL_TAG}.tar.gz" -echo "" - diff --git a/docker/user_workspace/paths.sh b/docker/user_workspace/paths.sh deleted file mode 100644 index a001e4f..0000000 --- a/docker/user_workspace/paths.sh +++ /dev/null @@ -1,3 +0,0 @@ -export WORKSPACE_PATH=etc/docker/catkin_workspace -export CACHE_PATH=cache -