Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into upstream-cache-apt-…
Browse files Browse the repository at this point in the history
…archives
  • Loading branch information
youtalk committed May 28, 2024
2 parents 8c55520 + 01fc647 commit 2d238a1
Show file tree
Hide file tree
Showing 17 changed files with 70 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/base/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Autoware",
"build": {
"dockerfile": "../Dockerfile",
"args": { "BASE_IMAGE": "ghcr.io/autowarefoundation/autoware-openadk:latest-devel" }
"args": { "BASE_IMAGE": "ghcr.io/autowarefoundation/autoware:latest-devel" }
},
"remoteUser": "autoware",
"runArgs": [
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/cuda/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Autoware-cuda",
"build": {
"dockerfile": "../Dockerfile",
"args": { "BASE_IMAGE": "ghcr.io/autowarefoundation/autoware-openadk:latest-devel-cuda" }
"args": { "BASE_IMAGE": "ghcr.io/autowarefoundation/autoware:latest-devel-cuda" }
},
"remoteUser": "autoware",
"hostRequirements": {
Expand Down
6 changes: 3 additions & 3 deletions .github/actions/docker-build-and-push/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ runs:
with:
push: ${{ inputs.allow-push == 'true' }}
files: |
docker/${{ inputs.bake-target }}/docker-bake.hcl
docker/docker-bake.hcl
${{ steps.meta-prebuilt.outputs.bake-file }}
${{ steps.meta-devel.outputs.bake-file }}
targets: |
Expand All @@ -114,7 +114,7 @@ runs:
with:
push: true
files: |
docker/${{ inputs.bake-target }}/docker-bake.hcl
docker/docker-bake.hcl
${{ steps.meta-devel.outputs.bake-file }}
${{ steps.meta-prebuilt.outputs.bake-file }}
${{ steps.meta-runtime.outputs.bake-file }}
Expand All @@ -128,7 +128,7 @@ runs:
with:
push: false
files: |
docker/${{ inputs.bake-target }}/docker-bake.hcl
docker/docker-bake.hcl
${{ steps.meta-devel.outputs.bake-file }}
${{ steps.meta-prebuilt.outputs.bake-file }}
${{ steps.meta-runtime.outputs.bake-file }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-main-self-hosted.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
- name: Build 'autoware-universe'
uses: ./.github/actions/docker-build-and-push
with:
bake-target: autoware-openadk
bake-target: autoware
build-args: |
*.platform=linux/arm64
*.args.ROS_DISTRO=${{ needs.load-env.outputs.rosdistro }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- name: Build 'autoware-universe'
uses: ./.github/actions/docker-build-and-push
with:
bake-target: autoware-openadk
bake-target: autoware
build-args: |
*.platform=linux/amd64
*.args.ROS_DISTRO=${{ needs.load-env.outputs.rosdistro }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/docker-build-and-push-main-self-hosted.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ name: docker-build-and-push-main-self-hosted
on:
push:
tags:
- adkit-v*.*.*
- openadkit-v*.*.*
branches:
- main
schedule:
Expand Down Expand Up @@ -75,10 +75,10 @@ jobs:
mkdir src
vcs import src < autoware.repos
- name: Build 'autoware-openadk'
- name: Build 'Autoware'
uses: ./.github/actions/docker-build-and-push
with:
bake-target: autoware-openadk
bake-target: autoware
build-args: |
*.platform=linux/arm64
*.args.ROS_DISTRO=${{ needs.load-env.outputs.rosdistro }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/docker-build-and-push-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ name: docker-build-and-push-main
on:
push:
tags:
- adkit-v*.*.*
- openadkit-v*.*.*
branches:
- main
schedule:
Expand Down Expand Up @@ -70,10 +70,10 @@ jobs:
mkdir src
vcs import src < autoware.repos
- name: Build 'autoware-openadk'
- name: Build 'Autoware'
uses: ./.github/actions/docker-build-and-push
with:
bake-target: autoware-openadk
bake-target: autoware
build-args: |
*.platform=linux/amd64
*.args.ROS_DISTRO=${{ needs.load-env.outputs.rosdistro }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/update-docker-manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Check out repository
uses: actions/checkout@v4

- name: Combine multi arch images for 'autoware-openadk'
- name: Combine multi arch images for 'Autoware'
uses: ./.github/actions/combine-multi-arch-images
with:
package-name: autoware-openadk
package-name: autoware
File renamed without changes.
24 changes: 24 additions & 0 deletions ansible/roles/artifacts/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,30 @@
mode: "644"
checksum: sha256:3540a365bfd6d8afb1b5d8df4ec47f82cb984760d3270c9b41dbbb3422d09a0c

- name: Download tensorrt_yolox/yolox-sPlus-opt-pseudoV2-T4-960x960-T4-seg16cls.onnx
become: true
ansible.builtin.get_url:
url: https://awf.ml.dev.web.auto/perception/models/object_detection_semseg_yolox_s/v1/yolox-sPlus-opt-pseudoV2-T4-960x960-T4-seg16cls.onnx
dest: "{{ data_dir }}/tensorrt_yolox/yolox-sPlus-opt-pseudoV2-T4-960x960-T4-seg16cls.onnx"
mode: "644"
checksum: sha256:73b3812432cedf65cebf02ca4cb630542fc3b1671c4c0fbf7cee50fa38e416a8

- name: Download tensorrt_yolox/yolox-sPlus-opt-pseudoV2-T4-960x960-T4-seg16cls.EntropyV2-calibration.table
become: true
ansible.builtin.get_url:
url: https://awf.ml.dev.web.auto/perception/models/object_detection_semseg_yolox_s/v1/yolox-sPlus-opt-pseudoV2-T4-960x960-T4-seg16cls.EntropyV2-calibration.table
dest: "{{ data_dir }}/tensorrt_yolox/yolox-sPlus-opt-pseudoV2-T4-960x960-T4-seg16cls.EntropyV2-calibration.table"
mode: "644"
checksum: sha256:28cd6524d4bcdb2809592a225d28330433e58dc02c92169ea555b44c1a51a584

- name: Download tensorrt_yolox/semseg_color_map.csv

Check warning on line 232 in ansible/roles/artifacts/tasks/main.yaml

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (semseg)
become: true
ansible.builtin.get_url:
url: https://awf.ml.dev.web.auto/perception/models/object_detection_semseg_yolox_s/v1/semseg_color_map.csv
dest: "{{ data_dir }}/tensorrt_yolox/semseg_color_map.csv"

Check warning on line 236 in ansible/roles/artifacts/tasks/main.yaml

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (semseg)
mode: "644"
checksum: sha256:3d93ca05f31b63424d7d7246a01a2365953705a0ed3323ba5b6fddd744a4bfea

# traffic_light_classifier
- name: Create traffic_light_classifier directory inside {{ data_dir }}
ansible.builtin.file:
Expand Down
13 changes: 13 additions & 0 deletions ansible/roles/rmw_implementation/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,25 @@
register: rmw_implementation__dash_case_rmw_implementation
changed_when: false

- name: Hold check of ros-{{ rosdistro + '-' + rmw_implementation__dash_case_rmw_implementation.stdout }}
ansible.builtin.command: apt-mark showhold
register: held_ros_packages
changed_when: false

- name: Install ros-{{ rosdistro + '-' + rmw_implementation__dash_case_rmw_implementation.stdout }}
become: true
ansible.builtin.apt:
name: ros-{{ rosdistro }}-{{ rmw_implementation__dash_case_rmw_implementation.stdout }}
state: latest
update_cache: true
when: "'ros-' + rosdistro + '-' + rmw_implementation__dash_case_rmw_implementation.stdout not in held_ros_packages.stdout"
register: install_result
failed_when: false

- name: Display warning if ROS 2 RMW package is held
ansible.builtin.debug:
msg: ROS 2 RMW package 'ros-{{ rosdistro + '-' + rmw_implementation__dash_case_rmw_implementation.stdout }}' is apt-mark hold. Skipping installation.
when: not install_result.changed

- name: Add RMW_IMPLEMENTATION to .bashrc
ansible.builtin.lineinfile:
Expand Down
14 changes: 7 additions & 7 deletions docker/autoware-openadk/Dockerfile → docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ WORKDIR /autoware
RUN --mount=type=ssh \
--mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
./setup-dev-env.sh -y --module base --runtime openadk \
./setup-dev-env.sh -y --module base --runtime openadkit \
&& pip uninstall -y ansible ansible-core \
&& apt-get autoremove -y && rm -rf "$HOME"/.cache \
&& echo "source /opt/ros/${ROS_DISTRO}/setup.bash" > /etc/bash.bashrc
Expand Down Expand Up @@ -84,7 +84,7 @@ ENV CXX="/usr/lib/ccache/g++"
RUN --mount=type=ssh \
--mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
./setup-dev-env.sh -y --module all ${SETUP_ARGS} --no-cuda-drivers openadk \
./setup-dev-env.sh -y --module all ${SETUP_ARGS} --no-cuda-drivers openadkit \
&& pip uninstall -y ansible ansible-core \
&& apt-get autoremove -y && rm -rf "$HOME"/.cache \
&& find / -name 'libcu*.a' -delete \
Expand Down Expand Up @@ -120,12 +120,12 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN --mount=type=ssh \
--mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
./setup-dev-env.sh -y --module dev-tools openadk \
./setup-dev-env.sh -y --module dev-tools openadkit \
&& pip uninstall -y ansible ansible-core \
&& apt-get autoremove -y && rm -rf "$HOME"/.cache

# Create entrypoint
COPY docker/autoware-openadk/etc/ros_entrypoint.sh /ros_entrypoint.sh
COPY docker/etc/ros_entrypoint.sh /ros_entrypoint.sh
RUN chmod +x /ros_entrypoint.sh
ENTRYPOINT ["/ros_entrypoint.sh"]
CMD ["/bin/bash"]
Expand All @@ -142,7 +142,7 @@ COPY --from=src-imported /rosdep-exec-depend-packages.txt /tmp/rosdep-exec-depen
RUN --mount=type=ssh \
--mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
./setup-dev-env.sh -y --module all ${SETUP_ARGS} --no-cuda-drivers --runtime openadk \
./setup-dev-env.sh -y --module all ${SETUP_ARGS} --no-cuda-drivers --runtime openadkit \
&& pip uninstall -y ansible ansible-core \
&& apt-get update \
&& cat /tmp/rosdep-exec-depend-packages.txt | xargs apt-get install -y --no-install-recommends \
Expand All @@ -160,11 +160,11 @@ RUN --mount=type=ssh \
COPY --from=prebuilt /autoware/install/ /autoware/install/

# Copy bash aliases
COPY docker/autoware-openadk/etc/.bash_aliases /root/.bash_aliases
COPY docker/etc/.bash_aliases /root/.bash_aliases
RUN echo "source /autoware/install/setup.bash" > /etc/bash.bashrc

# Create entrypoint
COPY docker/autoware-openadk/etc/ros_entrypoint.sh /ros_entrypoint.sh
COPY docker/etc/ros_entrypoint.sh /ros_entrypoint.sh
RUN chmod +x /ros_entrypoint.sh
ENTRYPOINT ["/ros_entrypoint.sh"]
CMD ["bash"]
10 changes: 5 additions & 5 deletions docker/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ print_help() {
}

SCRIPT_DIR=$(readlink -f "$(dirname "$0")")
WORKSPACE_ROOT="$SCRIPT_DIR/../"
WORKSPACE_ROOT="$SCRIPT_DIR/.."

# Parse arguments
parse_arguments() {
Expand Down Expand Up @@ -111,17 +111,17 @@ build_images() {
echo "Targets: ${targets[*]}"

set -x
docker buildx bake --load --progress=plain -f "$SCRIPT_DIR/autoware-openadk/docker-bake.hcl" \
docker buildx bake --load --progress=plain -f "$SCRIPT_DIR/docker-bake.hcl" \
--set "*.context=$WORKSPACE_ROOT" \
--set "*.ssh=default" \
--set "*.platform=$platform" \
--set "*.args.ROS_DISTRO=$rosdistro" \
--set "*.args.BASE_IMAGE=$base_image" \
--set "*.args.SETUP_ARGS=$setup_args" \
--set "*.args.LIB_DIR=$lib_dir" \
--set "devel.tags=ghcr.io/autowarefoundation/autoware-openadk:latest-devel$image_name_suffix" \
--set "prebuilt.tags=ghcr.io/autowarefoundation/autoware-openadk:latest-prebuilt$image_name_suffix" \
--set "runtime.tags=ghcr.io/autowarefoundation/autoware-openadk:latest-runtime$image_name_suffix" \
--set "devel.tags=ghcr.io/autowarefoundation/autoware:latest-devel$image_name_suffix" \
--set "prebuilt.tags=ghcr.io/autowarefoundation/autoware:latest-prebuilt$image_name_suffix" \
--set "runtime.tags=ghcr.io/autowarefoundation/autoware:latest-runtime$image_name_suffix" \
"${targets[@]}"
set +x
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ target "docker-metadata-action-runtime" {}

target "prebuilt" {
inherits = ["docker-metadata-action-prebuilt"]
dockerfile = "docker/autoware-openadk/Dockerfile"
dockerfile = "docker/Dockerfile"
target = "prebuilt"
}

target "devel" {
inherits = ["docker-metadata-action-devel"]
dockerfile = "docker/autoware-openadk/Dockerfile"
dockerfile = "docker/Dockerfile"
target = "devel"
}

target "runtime" {
inherits = ["docker-metadata-action-runtime"]
dockerfile = "docker/autoware-openadk/Dockerfile"
dockerfile = "docker/Dockerfile"
target = "runtime"
}
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ GREEN='\033[0;32m'
NC='\033[0m' # No Color

SCRIPT_DIR=$(readlink -f "$(dirname "$0")")
WORKSPACE_ROOT="$SCRIPT_DIR/../"
WORKSPACE_ROOT="$SCRIPT_DIR/.."
source "$WORKSPACE_ROOT/amd64.env"
if [ "$(uname -m)" = "aarch64" ]; then
source "$WORKSPACE_ROOT/arm64.env"
Expand Down Expand Up @@ -124,9 +124,9 @@ set_variables() {

# Set image based on option
if [ "$option_devel" == "true" ]; then
IMAGE="ghcr.io/autowarefoundation/autoware-openadk:latest-devel"
IMAGE="ghcr.io/autowarefoundation/autoware:latest-devel"
else
IMAGE="ghcr.io/autowarefoundation/autoware-openadk:latest-runtime"
IMAGE="ghcr.io/autowarefoundation/autoware:latest-runtime"
fi
}

Expand Down

0 comments on commit 2d238a1

Please sign in to comment.