Skip to content

test CCPi Regularisers on SIRF object #190

test CCPi Regularisers on SIRF object

test CCPi Regularisers on SIRF object #190

Workflow file for this run

name: Build all of the sirf docker images
on:
pull_request:
branches: [ master ]
paths-ignore:
- '**.md'
- 'jupyterhub/**'
- 'VirtualBox/**'
- '.github/workflows/c-cpp.yml'
- 'CITATION.cff'
- '.mailmap'
push:
branches: [ master ]
paths-ignore:
- '**.md'
- 'jupyterhub/**'
- 'VirtualBox/**'
- '.github/workflows/c-cpp.yml'
jobs:
build-core:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install docker and pre-reqs and clean some disk-space
shell: bash -l {0}
run: |
sudo .github/workflows/install_docker.sh
sudo .github/workflows/GHA_increase_disk_space.sh
- name: Build docker core image
# Builds docker image from Docker file.
shell: bash -l {0}
run: |
docker-compose -f docker/docker-compose.yml build --pull core
- name : docker save core
# https://docs.docker.com/engine/reference/commandline/save/
shell: bash -l {0}
run: |
#docker save -o core.tar synerbi/sirf:core
docker image ls
docker save synerbi/sirf:core | gzip > core.tar.gz
ls -l
- name: Upload artifact of the core image.
uses: actions/upload-artifact@v3.1.2
with:
name: sirf-core
path: core.tar.gz
build-core-gpu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install docker and pre-reqs and clean some disk-space
shell: bash -l {0}
run: |
sudo .github/workflows/install_docker.sh
sudo .github/workflows/GHA_increase_disk_space.sh
- name: Build docker core-gpu image
# Builds docker image from Docker file.
shell: bash -l {0}
run: |
docker-compose -f docker/docker-compose.yml -f docker/docker-compose.srv-gpu.yml build --pull core
- name : docker save core-gpu
# https://docs.docker.com/engine/reference/commandline/save/
shell: bash -l {0}
run: |
docker image ls
docker save synerbi/sirf:core-gpu | gzip > core-gpu.tar.gz
ls -l
- name: Upload artifact of the core image.
uses: actions/upload-artifact@v3.1.2
with:
name: sirf-core-gpu
path: core-gpu.tar.gz
build-devel-and-latest:
runs-on: ubuntu-latest
needs: build-core
strategy:
matrix:
tag: ['latest', 'devel']
steps:
- uses: actions/checkout@v3
- name: Install docker and pre-reqs and clean some disk-space
shell: bash -l {0}
run: |
sudo .github/workflows/install_docker.sh
sudo .github/workflows/GHA_increase_disk_space.sh
- name: Download artifact of core image
uses: actions/download-artifact@v3
with:
name: sirf-core
path: /tmp
- name: load core
shell: bash -l {0}
run: |
docker load --input /tmp/core.tar.gz
- name: Build docker image
# Builds docker image from Docker file.
shell: bash -l {0}
run: |
set -ex;
compose_command="docker-compose -f docker/docker-compose.yml"
if [[ ${{ matrix.tag }} == 'devel' ]]; then compose_command="$compose_command -f docker/docker-compose.devel.yml"; fi
# $compose_command pull core
$compose_command build --pull sirf
echo "compose_command=$compose_command" >> $GITHUB_ENV
- name : docker save image
# https://docs.docker.com/engine/reference/commandline/save/
shell: bash -l {0}
run: |
echo "info on layers and their sizes from docker history:"
sirf_image=`docker image ls | grep ${{ matrix.tag }} | awk '/sirf/ { print $3}'`
docker history "$sirf_image"
docker save synerbi/sirf:${{ matrix.tag }} | gzip > ${{ matrix.tag }}.tar.gz
- name: Upload artifact of image.
uses: actions/upload-artifact@v3.1.2
with:
name: sirf-${{ matrix.tag }}
path: ${{ matrix.tag }}.tar.gz
build-service-gpu:
runs-on: ubuntu-latest
needs: build-core-gpu
steps:
- uses: actions/checkout@v3
- name: Install docker and pre-reqs and clean some disk-space
shell: bash -l {0}
run: |
sudo .github/workflows/install_docker.sh
sudo .github/workflows/GHA_increase_disk_space.sh
- name: Download artifact of core image
uses: actions/download-artifact@v3
with:
name: sirf-core-gpu
path: /tmp
- name: load core-gpu
shell: bash -l {0}
run: |
docker load --input /tmp/core-gpu.tar.gz
- name: Build docker service-gpu image
# Builds docker image from Docker file.
shell: bash -l {0}
run: |
set -ex;
# docker-compose -f docker/docker-compose.yml -f docker/docker-compose.srv-gpu.yml pull core
docker-compose -f docker/docker-compose.yml -f docker/docker-compose.srv-gpu.yml build --pull sirf
# Temporarily disabling the save and upload of the image as it is too big.
# see https://github.com/SyneRBI/SIRF-SuperBuild/issues/770
# - name : docker save image
# # https://docs.docker.com/engine/reference/commandline/save/
# shell: bash -l {0}
# run: |
# # first we must delete image that is no longer needed, to save space:
# docker rmi synerbi/sirf:core-gpu
# yes | docker system prune
# docker image ls
# docker save synerbi/sirf:service-gpu | gzip > service-gpu.tar.gz
# - name: Upload artifact of image.
# uses: actions/upload-artifact@v3.1.2
# with:
# name: sirf-service-gpu
# path: service-gpu.tar.gz
build-service-images:
runs-on: ubuntu-latest
needs: build-devel-and-latest
strategy:
matrix:
tag: ['service', 'devel-service']
steps:
- uses: actions/checkout@v3
- name: Install docker and pre-reqs and clean some disk-space
shell: bash -l {0}
run: |
sudo .github/workflows/install_docker.sh
sudo .github/workflows/GHA_increase_disk_space.sh
- name: setup variables
shell: bash -l {0}
run: |
compose_command="docker-compose -f docker/docker-compose.yml"
if [[ ${{ matrix.tag }} == 'service' ]];
then
echo "prereq_image_name="latest"" >> $GITHUB_ENV
compose_command="$compose_command -f docker/docker-compose.srv.yml"
fi
if [[ ${{ matrix.tag }} == 'devel-service' ]]
then
echo "prereq_image_name="devel"" >> $GITHUB_ENV
compose_command="$compose_command -f docker/docker-compose.devel.yml -f docker/docker-compose.srv.yml"
fi
echo "compose_command=$compose_command" >> $GITHUB_ENV
- name: Download artifact of image
uses: actions/download-artifact@v3
with:
name: sirf-${{ env.prereq_image_name }}
path: /tmp
- name: load prerequisite image
shell: bash -l {0}
run: |
docker load --input /tmp/${{ env.prereq_image_name }}.tar.gz
- name: Build docker image
# Builds docker image from Docker file.
shell: bash -l {0}
run: |
set -ex;
# ${{ env.compose_command }} pull sirf
${{ env.compose_command }} build --pull sirf
- name : docker save image
# https://docs.docker.com/engine/reference/commandline/save/
shell: bash -l {0}
run: |
# first we must delete image that is no longer needed, to save space:
docker rmi synerbi/sirf:${{ env.prereq_image_name }}
# get rid of everything over 2 days old
docker system prune -a --filter "until=2d"
docker image ls
docker save synerbi/sirf:service | gzip > ${{ matrix.tag }}.tar.gz
- name: Upload artifact of image.
uses: actions/upload-artifact@v3.1.2
with:
name: sirf-${{ matrix.tag }}
path: ${{ matrix.tag }}.tar.gz
# Docker images are not currently uploaded with this action.
# Disable it for now as it would just waste time.
# upload-images:
# runs-on: ubuntu-latest
# needs: [build-service-images, build-service-gpu]
# strategy:
# matrix:
# tag: ['core', 'latest', 'devel', 'service', 'devel-service', 'core-gpu', 'service-gpu']
# steps:
# - uses: actions/checkout@v3
# - name: Install docker and pre-reqs and clean some disk-space
# shell: bash -l {0}
# run: |
# sudo .github/workflows/install_docker.sh
# sudo .github/workflows/GHA_increase_disk_space.sh
# - name: Download artifact of image
# uses: actions/download-artifact@v3
# with:
# name: sirf-${{ matrix.tag }}
# path: /tmp
# - name: load image
# shell: bash -l {0}
# run: |
# docker load --input /tmp/${{ matrix.tag }}.tar.gz
# - name: Upload docker image
# # Builds docker image from Docker file.
# shell: bash -l {0}
# run: |
# # TODO requirement to
# docker image ls
# echo "Here we would upload image with name: ${{ matrix.tag }}"
# TODO: publish to come later