Skip to content

Commit

Permalink
Merge branch 'cram2:dev' into tests
Browse files Browse the repository at this point in the history
  • Loading branch information
davidprueser authored Mar 26, 2024
2 parents 5d4adad + b3bba13 commit 3fc29cc
Show file tree
Hide file tree
Showing 8 changed files with 594 additions and 251 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/new-pycram-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: pycram_docker_ci
defaults:
run:
shell: bash -ieo pipefail {0}

on:
push:
branches:
- dev
- master
pull_request:
branches:
- master
- dev
workflow_dispatch: # For manual debugging
inputs:
debug_enabled:
type: boolean
required: false
default: false
description: "Run tmate session"

jobs:
build_and_run_tests:
runs-on: ubuntu-20.04
container:
image: "pycram/pycram:dev"
steps:
- name: Checkout PyCRAM
uses: actions/checkout@v3
with:
path: "ros/src/pycram"
repository: ${{ github.repository }}
ref: ${{ github.ref }}
submodules: "recursive"

# For debugging
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}

- name: Update PyCRAM source files
run: |
rm -rf /opt/ros/overlay_ws/src/pycram/*
cd /opt/ros/overlay_ws/src/pycram
rm -rf .git .github .gitignore .gitmodules .readthedocs.yaml
mv /__w/${{ github.event.repository.name }}/${{ github.event.repository.name }}/ros/src/pycram /opt/ros/overlay_ws/src
- name: Remake workspace & start roscore
run: |
sudo -s
source /opt/ros/noetic/setup.bash
cd /opt/ros/overlay_ws
catkin_make
source /opt/ros/overlay_ws/devel/setup.bash
roslaunch pycram ik_and_description.launch &
- name: Install python dependencies
run: |
pip3 install --upgrade pip --root-user-action=ignore
cd /opt/ros/overlay_ws/src/pycram
pip3 install -r requirements.txt
- name: Install pytest, pyjpt & mlflow
run: |
pip3 install --ignore-installed pytest pyjpt mlflow
- name: Run tests
run: |
source /opt/ros/overlay_ws/devel/setup.bash
roscd pycram
pytest -v test
88 changes: 0 additions & 88 deletions .github/workflows/pycram-ci.yml

This file was deleted.

31 changes: 31 additions & 0 deletions .github/workflows/update-docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: update_docker_image
on:
push:
branches:
- master
- dev
paths:
- 'requirements.txt'
# only run when a commit has changes in the requirements.txt file

jobs:
build_and_push_docker_image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3

- name: log into Docker Hub #Set repository secrets in github secrets
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASS }}

- name: Build and push
uses: docker/build-push-action@v5
with:
context: ./docker
push: true
tags: ${{ vars.DOCKER_IMAGE }}
21 changes: 21 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
ARG FROM_IMAGE=ros:noetic-ros-core
ARG OVERLAY_WS=/opt/ros/overlay_ws

FROM $FROM_IMAGE as cacher
ARG OVERLAY_WS
WORKDIR $OVERLAY_WS/src

RUN apt-get update && apt-get install python3-pip python3-vcstool git -y && pip3 install pip --upgrade
RUN pip3 install rosdep && rosdep init

RUN vcs import --input https://raw.githubusercontent.com/cram2/pycram/dev/pycram-https.rosinstall --recursive --skip-existing $OVERLAY_WS/src
RUN rosdep update && rosdep install --from-paths $OVERLAY_WS/src --ignore-src -r -y

RUN . /opt/ros/noetic/setup.sh && cd $OVERLAY_WS && catkin_make
RUN echo "source $OVERLAY_WS/devel/setup.bash" >> ~/.bashrc

RUN pip3 install --upgrade pip
WORKDIR $OVERLAY_WS/src/pycram
RUN pip3 install -r requirements.txt

EXPOSE 11311
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ SQLAlchemy>=2.0.9
tqdm==4.66.1
psutil==5.9.7
lxml==4.9.1
typing_extensions==4.9.0
4 changes: 2 additions & 2 deletions src/pycram/process_modules/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from .pr2_process_modules import Pr2Manager
from .boxy_process_modules import BoxyManager
from .donbot_process_modules import DonbotManager
from .hsr_process_modules import HSRManager
from .hsr_process_modules import HSRBManager
from .default_process_modules import DefaultManager

Pr2Manager()
BoxyManager()
DonbotManager()
HSRManager()
HSRBManager()
DefaultManager()
Loading

0 comments on commit 3fc29cc

Please sign in to comment.