Skip to content

Commit

Permalink
Upload docker packages (nasa#300)
Browse files Browse the repository at this point in the history
* only one run condition per action

* making different action for testing

* remove unnecessary tests, fix base

* updating melodic python version

* making ci run when its supposed to

* using repository owner

* adding repo_owner

* fixing ubuntu 20, removing already uploaded images
  • Loading branch information
marinagmoreira authored Oct 25, 2021
1 parent d56d9f0 commit 7d32bfa
Show file tree
Hide file tree
Showing 6 changed files with 238 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Docker Image CI
name: Build and Test CI for Pull Requests

on:
push:
branches: [ 'master', 'develop' ]
pull_request:
branches: [ 'master', 'develop' ]

Expand All @@ -23,6 +21,7 @@ jobs:
--build-arg UBUNTU_VERSION=16.04
--build-arg ROS_VERSION=kinetic
--build-arg PYTHON=''
--build-arg REMOTE=ghcr.io/${{ github.repository_owner }}
-t astrobee/astrobee:latest-ubuntu16.04

- name: Test code
Expand All @@ -45,6 +44,7 @@ jobs:
--build-arg UBUNTU_VERSION=18.04
--build-arg ROS_VERSION=melodic
--build-arg PYTHON=3
--build-arg REMOTE=ghcr.io/${{ github.repository_owner }}
-t astrobee/astrobee:latest-ubuntu18.04

- name: Test code
Expand All @@ -67,6 +67,7 @@ jobs:
--build-arg UBUNTU_VERSION=20.04
--build-arg ROS_VERSION=noetic
--build-arg PYTHON=3
--build-arg REMOTE=ghcr.io/${{ github.repository_owner }}
-t astrobee/astrobee:latest-ubuntu20.04

- name: Test code
Expand Down
100 changes: 100 additions & 0 deletions .github/workflows/ci_push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: Build, test and push packages CI

on:
push:
branches: [ 'develop' ]

jobs:

build-xenial:

runs-on: ubuntu-18.04

steps:
- uses: actions/checkout@v2

- name: Checkout submodule
run: git submodule update --init --depth 1 description/media

- name: Build code for Ubuntu 16
run: docker build . -f ./scripts/docker/astrobee.Dockerfile
--build-arg UBUNTU_VERSION=16.04
--build-arg ROS_VERSION=kinetic
--build-arg PYTHON=''
--build-arg REMOTE=ghcr.io/${{ github.repository_owner }}
-t ghcr.io/${{ github.repository_owner }}/astrobee:latest-ubuntu16.04

- name: Test code
run: docker build . -f ./scripts/docker/test_astrobee.Dockerfile
--build-arg UBUNTU_VERSION=16.04
--build-arg REMOTE=ghcr.io/${{ github.repository_owner }}
-t astrobee:test-ubuntu16.04

- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin

- name: Push Docker image
run: |
docker push ghcr.io/${{ github.repository_owner }}/astrobee:latest-ubuntu16.04
build-bionic:

runs-on: ubuntu-18.04

steps:
- uses: actions/checkout@v2

- name: Checkout submodule
run: git submodule update --init --depth 1 description/media

- name: Build code for Ubuntu 18
run: docker build . -f ./scripts/docker/astrobee.Dockerfile
--build-arg UBUNTU_VERSION=18.04
--build-arg ROS_VERSION=melodic
--build-arg PYTHON=3
--build-arg REMOTE=ghcr.io/${{ github.repository_owner }}
-t ghcr.io/${{ github.repository_owner }}/astrobee:latest-ubuntu18.04

- name: Test code
run: docker build . -f ./scripts/docker/test_astrobee.Dockerfile
--build-arg UBUNTU_VERSION=18.04
--build-arg REMOTE=ghcr.io/${{ github.repository_owner }}
-t astrobee:test-ubuntu18.04

- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin

- name: Push Docker image
run: |
docker push ghcr.io/${{ github.repository_owner }}/astrobee:latest-ubuntu18.04
build-focal:

runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2

- name: Checkout submodule
run: git submodule update --init --depth 1 description/media

- name: Build code for Ubuntu 20
run: docker build . -f ./scripts/docker/astrobee.Dockerfile
--build-arg UBUNTU_VERSION=20.04
--build-arg ROS_VERSION=noetic
--build-arg PYTHON=3
--build-arg REMOTE=ghcr.io/${{ github.repository_owner }}
-t ghcr.io/${{ github.repository_owner }}/astrobee:latest-ubuntu20.04

- name: Test code
run: docker build . -f ./scripts/docker/test_astrobee.Dockerfile
--build-arg UBUNTU_VERSION=20.04
--build-arg REMOTE=ghcr.io/${{ github.repository_owner }}
-t astrobee:test-ubuntu20.0

- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin

- name: Push Docker image
run: |
docker push ghcr.io/${{ github.repository_owner }}/astrobee:latest-ubuntu20.04
127 changes: 127 additions & 0 deletions .github/workflows/ci_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
name: Build, test and push packages CI

on:
push:
branches: [ 'release' ]

jobs:

build-xenial:

runs-on: ubuntu-18.04

steps:
- uses: actions/checkout@v2

- name: Checkout submodule
run: git submodule update --init --depth 1 description/media

- name: Build base for Ubuntu 16
run: docker build . -f ./scripts/docker/astrobee_base.Dockerfile
--build-arg UBUNTU_VERSION=16.04
--build-arg ROS_VERSION=kinetic
--build-arg PYTHON=''
-t astrobee/astrobee:base-latest-ubuntu16.04

- name: Build code for Ubuntu 16
run: docker build . -f ./scripts/docker/astrobee.Dockerfile
--build-arg UBUNTU_VERSION=16.04
--build-arg ROS_VERSION=kinetic
--build-arg PYTHON=''
-t astrobee/astrobee:latest-ubuntu16.04

- name: Test code
run: docker build . -f ./scripts/docker/test_astrobee.Dockerfile
--build-arg UBUNTU_VERSION=16.04
-t astrobee:test-ubuntu16.04

- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin

- name: Push Docker image
run: |
export VERSION=`grep -w -m 1 "Release" RELEASE.md | awk '{print $3}'`
docker tag astrobee/astrobee:latest-base-ubuntu16.04 ghcr.io/${{ github.repository_owner }}/astrobee:latest-base-ubuntu16.04
docker push ghcr.io/${{ github.repository_owner }}/astrobee:latest-base-ubuntu16.04
docker tag astrobee/astrobee:latest-ubuntu16.04 ghcr.io/${{ github.repository_owner }}/astrobee:v${VERSION}-ubuntu16.04
docker push ghcr.io/${{ github.repository_owner }}/astrobee:v${VERSION}-ubuntu16.04
build-bionic:

runs-on: ubuntu-18.04

steps:
- uses: actions/checkout@v2

- name: Checkout submodule
run: git submodule update --init --depth 1 description/media

- name: Build base for Ubuntu 18
run: docker build . -f ./scripts/docker/astrobee_base.Dockerfile
--build-arg UBUNTU_VERSION=18.04
--build-arg ROS_VERSION=melodic
--build-arg PYTHON=''
-t astrobee/astrobee:base-latest-ubuntu18.04

- name: Build code for Ubuntu 18
run: docker build . -f ./scripts/docker/astrobee.Dockerfile
--build-arg UBUNTU_VERSION=18.04
--build-arg ROS_VERSION=melodic
--build-arg PYTHON=''
-t astrobee/astrobee:latest-ubuntu18.04

- name: Test code
run: docker build . -f ./scripts/docker/test_astrobee.Dockerfile
--build-arg UBUNTU_VERSION=18.04
-t astrobee:test-ubuntu18.04

- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin

- name: Push Docker image
run: |
export VERSION=`grep -w -m 1 "Release" RELEASE.md | awk '{print $3}'`
docker tag astrobee/astrobee:latest-base-ubuntu18.04 ghcr.io/${{ github.repository_owner }}/astrobee:latest-base-ubuntu18.04
docker push ghcr.io/${{ github.repository_owner }}/astrobee:latest-base-ubuntu18.04
docker tag astrobee/astrobee:latest-ubuntu18.04 ghcr.io/${{ github.repository_owner }}/astrobee:v${VERSION}-ubuntu18.04
docker push ghcr.io/${{ github.repository_owner }}/astrobee:v${VERSION}-ubuntu18.04
build-focal:

runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2

- name: Checkout submodule
run: git submodule update --init --depth 1 description/media

- name: Build base for Ubuntu 20
run: docker build . -f ./scripts/docker/astrobee_base.Dockerfile
--build-arg UBUNTU_VERSION=20.04
--build-arg ROS_VERSION=noetic
--build-arg PYTHON=3
-t astrobee/astrobee:base-latest-ubuntu20.04

- name: Build code for Ubuntu 20
run: docker build . -f ./scripts/docker/astrobee.Dockerfile
--build-arg UBUNTU_VERSION=20.04
--build-arg ROS_VERSION=noetic
--build-arg PYTHON=3
-t astrobee/astrobee:latest-ubuntu20.04

- name: Test code
run: docker build . -f ./scripts/docker/test_astrobee.Dockerfile
--build-arg UBUNTU_VERSION=20.04
-t astrobee:test-ubuntu20.04

- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin

- name: Push Docker image
run: |
export VERSION=`grep -w -m 1 "Release" RELEASE.md | awk '{print $3}'`
docker tag astrobee/astrobee:latest-base-ubuntu20.04 ghcr.io/${{ github.repository_owner }}/astrobee:latest-base-ubuntu20.04
docker push ghcr.io/${{ github.repository_owner }}/astrobee:latest-base-ubuntu20.04
docker tag astrobee/astrobee:latest-ubuntu20.04 ghcr.io/${{ github.repository_owner }}/astrobee:v${VERSION}-ubuntu20.04
docker push ghcr.io/${{ github.repository_owner }}/astrobee:v${VERSION}-ubuntu20.04
3 changes: 2 additions & 1 deletion scripts/docker/astrobee.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
# You must set the docker context to be the repository root directory

ARG UBUNTU_VERSION=16.04
FROM astrobee/astrobee:base-latest-ubuntu${UBUNTU_VERSION}
ARG REMOTE=astrobee
FROM ${REMOTE}/astrobee:base-latest-ubuntu${UBUNTU_VERSION}

ENV USERNAME astrobee

Expand Down
6 changes: 3 additions & 3 deletions scripts/docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ docker run -it --rm --name astrobee \
--user="astrobee" \
--gpus all \
astrobee/astrobee:latest-ubuntu16.04 \
/astrobee_init.sh roslaunch astrobee sim.launch dds:=false
/astrobee_init.sh roslaunch astrobee sim.launch dds:=false robot:=sim_pub
elif [ "$os" = "bionic" ]; then
docker run -it --rm --name astrobee \
--volume=$XSOCK:$XSOCK:rw \
Expand All @@ -72,7 +72,7 @@ docker run -it --rm --name astrobee \
--env="DISPLAY" \
--user="astrobee" \
astrobee/astrobee:latest-ubuntu18.04 \
/astrobee_init.sh roslaunch astrobee sim.launch dds:=false
/astrobee_init.sh roslaunch astrobee sim.launch dds:=false robot:=sim_pub
elif [ "$os" = "focal" ]; then
docker run -it --rm --name astrobee \
--volume=$XSOCK:$XSOCK:rw \
Expand All @@ -81,5 +81,5 @@ docker run -it --rm --name astrobee \
--env="DISPLAY" \
--user="astrobee" \
astrobee/astrobee:latest-ubuntu20.04 \
/astrobee_init.sh roslaunch astrobee sim.launch dds:=false
/astrobee_init.sh roslaunch astrobee sim.launch dds:=false robot:=sim_pub
fi
3 changes: 2 additions & 1 deletion scripts/docker/test_astrobee.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
# You must set the docker context to be the repository root directory

ARG UBUNTU_VERSION=16.04
FROM astrobee/astrobee:latest-ubuntu${UBUNTU_VERSION}
ARG REMOTE=astrobee
FROM ${REMOTE}/astrobee:latest-ubuntu${UBUNTU_VERSION}

# Run tests
RUN cd /build/astrobee && make -j`nproc` tests && make -j`nproc` test

0 comments on commit 7d32bfa

Please sign in to comment.