From e74627d68592eb56dfee432a6a46059b90bd1206 Mon Sep 17 00:00:00 2001 From: Teo Koon Peng Date: Wed, 12 Jun 2024 08:04:27 +0000 Subject: [PATCH] updating images Signed-off-by: Teo Koon Peng --- .github/actions/bootstrap/action.yml | 3 - .github/minimal-rmf/Dockerfile | 30 ++++++++++ .github/workflows/api-server.yml | 2 +- .github/workflows/nightly.yml | 89 ++++++++++++++-------------- docker/Dockerfile | 9 --- 5 files changed, 74 insertions(+), 59 deletions(-) create mode 100644 .github/minimal-rmf/Dockerfile delete mode 100644 docker/Dockerfile diff --git a/.github/actions/bootstrap/action.yml b/.github/actions/bootstrap/action.yml index 48473eb2e..f792eb20e 100644 --- a/.github/actions/bootstrap/action.yml +++ b/.github/actions/bootstrap/action.yml @@ -18,9 +18,6 @@ runs: with: node-version: '20' cache: 'pnpm' - - name: Install pipenv - run: pip3 install pipenv - shell: bash - name: Install dependencies run: pnpm install -w --filter ${{ inputs.package }}... --no-frozen-lockfile shell: bash diff --git a/.github/minimal-rmf/Dockerfile b/.github/minimal-rmf/Dockerfile new file mode 100644 index 000000000..a5d88693e --- /dev/null +++ b/.github/minimal-rmf/Dockerfile @@ -0,0 +1,30 @@ +ARG BASE_IMAGE=docker.io/ros:jazzy-ros-base +FROM $BASE_IMAGE +ARG BRANCH=main +ARG ROS_DISTRO=jazzy + +### build minimal rmf + +RUN apt update && apt install -y curl + +# # fetch sources +RUN mkdir -p /rmf && cd /rmf \ + && curl -sL https://github.com/open-rmf/rmf_internal_msgs/archive/refs/heads/$BRANCH.tar.gz -o rmf_internal_msgs.tar.gz \ + && curl -sL https://github.com/open-rmf/rmf_building_map_msgs/archive/refs/heads/$BRANCH.tar.gz -o rmf_building_map_msgs.tar.gz \ + && mkdir -p /rmf/src/rmf/rmf_internal_msgs && tar zxf rmf_internal_msgs.tar.gz -C /rmf/src/rmf/rmf_internal_msgs --strip-components=1 && rm rmf_internal_msgs.tar.gz \ + && mkdir -p /rmf/src/rmf/rmf_building_map_msgs && tar zxf rmf_building_map_msgs.tar.gz -C /rmf/src/rmf/rmf_building_map_msgs --strip-components=1 && rm rmf_building_map_msgs.tar.gz + +RUN rosdep update && rosdep install --from-paths /rmf/src -yi + +RUN cd /rmf \ + && . /opt/ros/$ROS_DISTRO/setup.sh \ + && colcon build --merge-install --install-base /opt/rmf --cmake-args -DCMAKE_BUILD_TYPE=Release \ + && rm -rf /rmf + +RUN curl -fsSL https://get.pnpm.io/install.sh | bash - +# shell runs in non-interactive mode, which does not source .bashrc so we need to set the PATH manually +ENV PNPM_HOME /root/.local/share/pnpm +ENV PATH "$PNPM_HOME:$PATH" + +# nodejs seems to have changed the official mirror, the default in pnpm is very slow now +RUN pnpm config -g set 'node-mirror:release' https://nodejs.org/dist && pnpm env use --global lts diff --git a/.github/workflows/api-server.yml b/.github/workflows/api-server.yml index 06274fe5c..328943acc 100644 --- a/.github/workflows/api-server.yml +++ b/.github/workflows/api-server.yml @@ -15,7 +15,7 @@ jobs: name: Tests runs-on: ubuntu-24.04 container: - image: ghcr.io/${{ github.repository }}/e2e + image: ghcr.io/${{ github.repository }}/minimal-rmf credentials: username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index c3a659ad4..a8867e29e 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -3,60 +3,57 @@ on: schedule: # 2am SGT - cron: '0 18 * * *' + workflow_dispatch: jobs: build-docker-images: name: Push Docker images to GitHub Packages runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v2 - - name: Push e2e image to GitHub Packages - uses: docker/build-push-action@v1 + - name: Push minimal-rmf image to GitHub Packages + uses: docker/build-push-action@v5 with: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} registry: ghcr.io - repository: ${{ github.repository }}/e2e + repository: ${{ github.repository }}/minimal-rmf tags: latest - path: docker - dashboard-e2e: - strategy: - matrix: - npm: ['latest'] - fail-fast: false - needs: build-docker-images - name: Dashboard e2e - runs-on: ubuntu-24.04 - container: - image: ghcr.io/${{ github.repository }}/e2e - options: --privileged --ipc=host - defaults: - run: - shell: bash - working-directory: packages/dashboard-e2e - env: - BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }} - BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} - BROWSERSTACK_BUILD: ${{ github.head_ref }}:${{ github.event.number }} - steps: - - uses: actions/checkout@v2 - - name: bootstrap - uses: ./.github/actions/bootstrap - with: - package: rmf-dashboard-e2e - skip-build: true - - name: test - uses: nick-fields/retry@v2 - with: - timeout_minutes: 20 - max_attempts: 3 - command: | - . /rmf_demos_ws/install/setup.bash - cd packages/dashboard-e2e - pnpm test - shell: bash - - name: upload artifacts - uses: actions/upload-artifact@v2 - if: always() - with: - name: artifacts - path: packages/dashboard-e2e/artifacts + path: .github/minimal-rmf + # dashboard-e2e: + # strategy: + # matrix: + # npm: ['latest'] + # fail-fast: false + # needs: build-docker-images + # name: Dashboard e2e + # runs-on: ubuntu-24.04 + # container: + # image: ghcr.io/${{ github.repository }}/e2e + # options: --privileged --ipc=host + # defaults: + # run: + # shell: bash + # working-directory: packages/dashboard-e2e + # steps: + # - uses: actions/checkout@v2 + # - name: bootstrap + # uses: ./.github/actions/bootstrap + # with: + # package: rmf-dashboard-e2e + # skip-build: true + # - name: test + # uses: nick-fields/retry@v2 + # with: + # timeout_minutes: 20 + # max_attempts: 3 + # command: | + # . /rmf_demos_ws/install/setup.bash + # cd packages/dashboard-e2e + # pnpm test + # shell: bash + # - name: upload artifacts + # uses: actions/upload-artifact@v2 + # if: always() + # with: + # name: artifacts + # path: packages/dashboard-e2e/artifacts diff --git a/docker/Dockerfile b/docker/Dockerfile deleted file mode 100644 index 19f77674b..000000000 --- a/docker/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -ARG BASE_IMAGE=ghcr.io/open-rmf/rmf/rmf_demos -FROM $BASE_IMAGE - -RUN curl -sL https://deb.nodesource.com/setup_16.x | bash - && \ - apt-get update && apt-get install -y \ - nodejs \ - jq && \ - pip3 install pipenv && \ - npm config set unsafe-perm