Skip to content

Commit

Permalink
remove AWS CLI installation
Browse files Browse the repository at this point in the history
Signed-off-by: Oguz Ozturk <[email protected]>
  • Loading branch information
oguzkaganozt committed Oct 14, 2024
1 parent 305c3da commit 30bfde4
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 86 deletions.
155 changes: 70 additions & 85 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,85 +1,70 @@
ARG PLATFORM
FROM ghcr.io/autowarefoundation/autoware:universe-devel-20240927 AS aws-reinvent-simulator-devel
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ARG ROS_DISTRO
ENV CCACHE_DIR="/root/.ccache"

COPY src /autoware/src

# Set up rosdep
RUN --mount=type=ssh \
--mount=type=cache,target=/var/cache/apt,sharing=locked \
apt-get update \
&& rosdep update \
&& rosdep install -y --from-paths src --ignore-src --rosdistro $ROS_DISTRO \
&& apt-get autoremove -y && rm -rf "$HOME"/.cache

# Build simulator
RUN source /opt/ros/"$ROS_DISTRO"/setup.bash \
&& source /opt/autoware/setup.bash \
&& colcon build --cmake-args \
" -Wno-dev" \
" --no-warn-unused-cli" \
--install-base /opt/autoware \
--merge-install \
--mixin release compile-commands ccache \
--base-paths /autoware/src/simulator

RUN find /opt/autoware/lib -type f -name "*.py" -exec chmod +x {} \;
RUN find /opt/autoware/share -type f -name "*.py" -exec chmod +x {} \;

FROM ghcr.io/autowarefoundation/autoware:universe-20240927 AS aws-reinvent-simulator

# Copy simulator from simulator-devel
COPY src /autoware/src
COPY --from=aws-reinvent-simulator-devel /opt/autoware /opt/autoware

# Set up rosdep
RUN --mount=type=ssh \
--mount=type=cache,target=/var/cache/apt,sharing=locked \
apt-get update \
&& apt-get install -y curl unzip \
&& rosdep update \
&& cd /autoware \
&& rosdep install -y --from-paths src --ignore-src --dependency-types=exec --rosdistro $ROS_DISTRO \
&& apt-get autoremove -y && rm -rf "$HOME"/.cache

RUN echo "source /opt/autoware/setup.bash" > /etc/bash.bashrc

# Install AWS CLI
RUN curl -fsSL https://awscli.amazonaws.com/awscli-exe-linux-$(uname -m).zip -o /tmp/aws-cli.zip && \
unzip -q -d /tmp /tmp/aws-cli.zip && \
/tmp/aws/install && \
rm -rf /tmp/aws && \
echo "AWS CLI installed. Checking configuration" && \
aws --version

# Copy simulation scenario and map
COPY docker/etc/simulation /autoware/scenario-sim

# Create entrypoint
COPY docker/etc/aws_entrypoint.sh /aws_entrypoint.sh
RUN chmod +x /aws_entrypoint.sh
ENTRYPOINT ["/aws_entrypoint.sh"]
CMD ["/bin/bash"]

FROM ghcr.io/autowarefoundation/autoware:universe-20240927 AS aws-reinvent-planning-control

RUN --mount=type=ssh \
--mount=type=cache,target=/var/cache/apt,sharing=locked \
apt-get update \
&& apt-get install -y curl unzip

# Install AWS CLI
RUN curl -fsSL https://awscli.amazonaws.com/awscli-exe-linux-$(uname -m).zip -o /tmp/aws-cli.zip && \
unzip -q -d /tmp /tmp/aws-cli.zip && \
/tmp/aws/install && \
rm -rf /tmp/aws && \
echo "AWS CLI installed. Checking configuration" && \
aws --version

# Create entrypoint
COPY docker/etc/aws_entrypoint.sh /aws_entrypoint.sh
RUN chmod +x /aws_entrypoint.sh
ENTRYPOINT ["/aws_entrypoint.sh"]
CMD ["/bin/bash"]
ARG PLATFORM
FROM ghcr.io/autowarefoundation/autoware:universe-devel-20240927 AS aws-reinvent-simulator-devel
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ARG ROS_DISTRO
ENV CCACHE_DIR="/root/.ccache"

COPY src /autoware/src

# Set up rosdep
RUN --mount=type=ssh \
--mount=type=cache,target=/var/cache/apt,sharing=locked \
apt-get update \
&& rosdep update \
&& rosdep install -y --from-paths src --ignore-src --rosdistro $ROS_DISTRO \
&& apt-get autoremove -y && rm -rf "$HOME"/.cache

# Build simulator
RUN source /opt/ros/"$ROS_DISTRO"/setup.bash \
&& source /opt/autoware/setup.bash \
&& colcon build --cmake-args \
" -Wno-dev" \
" --no-warn-unused-cli" \
--install-base /opt/autoware \
--merge-install \
--mixin release compile-commands ccache \
--base-paths /autoware/src/simulator

RUN find /opt/autoware/lib -type f -name "*.py" -exec chmod +x {} \;
RUN find /opt/autoware/share -type f -name "*.py" -exec chmod +x {} \;

FROM ghcr.io/autowarefoundation/autoware:universe-20240927 AS aws-reinvent-simulator

# Copy simulator from simulator-devel
COPY src /autoware/src
COPY --from=aws-reinvent-simulator-devel /opt/autoware /opt/autoware

# Set up rosdep
RUN --mount=type=ssh \
--mount=type=cache,target=/var/cache/apt,sharing=locked \
apt-get update \
&& apt-get install -y curl unzip \
&& rosdep update \
&& cd /autoware \
&& rosdep install -y --from-paths src --ignore-src --dependency-types=exec --rosdistro $ROS_DISTRO \
&& apt-get autoremove -y && rm -rf "$HOME"/.cache

RUN echo "source /opt/autoware/setup.bash" > /etc/bash.bashrc

# Copy simulation scenario and map
COPY docker/etc/simulation /autoware/scenario-sim

# Create entrypoint
COPY docker/etc/aws_entrypoint.sh /aws_entrypoint.sh
RUN chmod +x /aws_entrypoint.sh
ENTRYPOINT ["/aws_entrypoint.sh"]
CMD ["/bin/bash"]

FROM ghcr.io/autowarefoundation/autoware:universe-20240927 AS aws-reinvent-planning-control

RUN --mount=type=ssh \
--mount=type=cache,target=/var/cache/apt,sharing=locked \
apt-get update \
&& apt-get install -y curl unzip \
&& apt-get autoremove -y && rm -rf "$HOME"/.cache

# Create entrypoint
COPY docker/etc/aws_entrypoint.sh /aws_entrypoint.sh
RUN chmod +x /aws_entrypoint.sh
ENTRYPOINT ["/aws_entrypoint.sh"]
CMD ["/bin/bash"]
3 changes: 2 additions & 1 deletion docker/etc/simulation/config/change_parameters
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ else
fi

# change planning evaluator output file
if sed -i "s|output_file:.*|output_file: ${PLANNING_OUTPUT_FILE}|" /opt/autoware/share/autoware_planning_evaluator/config/planning_evaluator.param.yaml; then
planning_evaluator_param_path=/opt/autoware/share/autoware_planning_evaluator/config/planning_evaluator.param.yaml
if sed -i "s|output_file:.*|output_file: ${PLANNING_OUTPUT_FILE}|" "$planning_evaluator_param_path"; then
echo -e "\e[32mPlanning evaluator output file is set to ${PLANNING_OUTPUT_FILE}\e[0m"
else
echo -e "\e[31mError: Failed to set planning evaluator output file\e[0m" >&2
Expand Down

0 comments on commit 30bfde4

Please sign in to comment.