diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 000000000..d1e4b52af --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,49 @@ +name: moma CD + +on: + push: + branches: [ "master" ] + +env: + # Use docker.io for Docker Hub if empty + REGISTRY: ghcr.io + # github.repository as / + IMAGE_NAME: ${{ github.repository }} + +jobs: + build-dockers: + name: Build docker images + strategy: + matrix: + dockerfile: [dev, robot, demo] + runs-on: ubuntu-latest + steps: + - name: Check out moma repo + uses: actions/checkout@v3 + with: + path: moma_ws/src/moma + submodules: recursive + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Log into registry ${{ env.REGISTRY }} + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@v4 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: type=raw,value=${{ matrix.dockerfile }} + - name: Build and push docker + uses: docker/build-push-action@v4 + with: + context: ./moma_ws/src/moma/docker/ + file: ./moma_ws/src/moma/docker/${{ matrix.dockerfile }}.Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..53d4a57aa --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,79 @@ +name: moma CI + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +env: + # Use docker.io for Docker Hub if empty + REGISTRY: ghcr.io + # github.repository as / + IMAGE_NAME: ${{ github.repository }} + CATKIN_WS_PATH: moma_ws + +jobs: + build-docker: + runs-on: ubuntu-latest + outputs: + docker_image_name: ${{ steps.meta.outputs.tags }} + steps: + - name: Check out moma repo + uses: actions/checkout@v3 + with: + path: moma_ws/src/moma + submodules: recursive + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Log into registry ${{ env.REGISTRY }} + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + - name: Build and push docker + uses: docker/build-push-action@v4 + with: + context: ./moma_ws/src/moma/docker/ + file: ./moma_ws/src/moma/docker/dev.Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max + + build-catkin: + needs: build-docker + runs-on: ubuntu-latest + container: + image: ${{ needs.build-docker.outputs.docker_image_name }} + steps: + - name: Git safe directory (only for running within containers) + run: git config --system --add safe.directory '*' + - name: Check out moma repo + uses: actions/checkout@v3 + with: + path: moma_ws/src/moma + submodules: recursive + - run: ls + shell: bash + - name: Set up Catkin workspace + run: | + cd ${{ env.CATKIN_WS_PATH }} + source /root/.bashrc + catkin init + catkin config --extend /root/moma_dep_ws/devel + catkin config --cmake-args -DCMAKE_BUILD_TYPE=Release + shell: bash + - name: Build the workspace + run: | + cd ${{ env.CATKIN_WS_PATH }} + source /root/.bashrc + catkin build --continue + shell: bash \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index 6d542ae3e..fbe146595 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,3 @@ -[submodule "submodules/yumi"] - path = submodules/yumi - url = git@github.com:ethz-asl/yumi.git - branch = asl-devel [submodule "submodules/roboticsgroup_gazebo_plugins"] path = submodules/roboticsgroup_gazebo_plugins url = git@github.com:roboticsgroup/roboticsgroup_gazebo_plugins.git diff --git a/docker/scripts/install_demo.sh b/docker/scripts/install_demo.sh index 7e80d09fc..00f265ec9 100644 --- a/docker/scripts/install_demo.sh +++ b/docker/scripts/install_demo.sh @@ -7,15 +7,22 @@ cd $MOMA_DEP_WS/src || exit 1 vcs import --recursive --input $SCRIPTS_PATH/moma_demo.repos # Upgrade numpy version -pip install --upgrade numpy==1.23.0 +pip install --no-cache-dir --upgrade numpy==1.23.0 + +# This helps torch download on Github Actions :) +export TMPDIR='/var/tmp' # Pip install VGN requirements -pip install -r vgn/requirements.txt +pip install --no-cache-dir catkin_pkg scipy matplotlib mpi4py pybullet==2.7.9 tqdm +pip install --no-cache-dir torch==1.12.0+cpu -f https://download.pytorch.org/whl/torch_stable.html +pip install --no-cache-dir tensorboard +pip install --no-cache-dir open3d==0.13.0 # Pip install gdown to get google drive files -pip install gdown +pip install --no-cache-dir gdown # Make sure we can unzip too +apt-get update apt-get install unzip # Download the data file from google drive @@ -25,6 +32,7 @@ gdown 1MysYHve3ooWiLq12b58Nm8FWiFBMH-bJ unzip data.zip -d vgn_data mv vgn_data/data/* vgn/assets/ rm -r vgn_data +rm data.zip # Add a rundemo alias: echo 'alias rundemo="roslaunch grasp_demo grasp_demo.launch launch_rviz:=true"' >> ~/.bashrc diff --git a/docker/scripts/install_sys_deps.sh b/docker/scripts/install_sys_deps.sh index 4c17e0740..f4d312beb 100644 --- a/docker/scripts/install_sys_deps.sh +++ b/docker/scripts/install_sys_deps.sh @@ -16,9 +16,5 @@ apt-get -qq update && apt-get install -y python3-catkin-tools python3-vcstool py # Install other system deps apt-get -qq update && apt-get install -y qtbase5-dev bash-completion -# This is for nvblox -pip install --upgrade cmake -apt-get -qq update && apt-get install -y libgoogle-glog-dev libgtest-dev libgflags-dev python3-dev libsqlite3-dev - # Clear cache to keep layer size down rm -rf /var/lib/apt/lists/* diff --git a/docker/scripts/moma_demo.repos b/docker/scripts/moma_demo.repos index 5a10c1393..565be57da 100644 --- a/docker/scripts/moma_demo.repos +++ b/docker/scripts/moma_demo.repos @@ -10,4 +10,4 @@ repositories: moma: type: git url: https://github.com/ethz-asl/moma.git - version: 6730e11ca580dd80fb49a553db5394111bf232ff + version: demo diff --git a/submodules/yumi b/submodules/yumi deleted file mode 160000 index 18a2b0641..000000000 --- a/submodules/yumi +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 18a2b06413389b00a09c6a525569f4e106923780