[CI]: Adopt custom CI image for junifer docs #374

Merged
synchon merged 22 commits from chore/docs-ci-image-upgrade into main 2024-10-14 11:59:29 +00:00
3 changed files with 43 additions and 52 deletions

View file

@ -18,7 +18,24 @@ concurrency: preview-${{ github.ref }}
jobs:
build-docs:
runs-on: ubuntu-latest
# Use custom docs CI image
container: ghcr.io/juaml/junifer-docs:main
steps:
- name: Check ANTs
run: |
echo "Using ANTs : $(antsRegistration --version)"
- name: Install system dependencies
run: |
# actions/checkout fails to identify Git as it's not in the CI image
apt-get -qq update && \
fraimondo commented 2024-10-14 08:09:50 +00:00 (Migrated from github.com)

Why can't we have this already in the image? Same as the "home dir" steps. Ideally, this image should be also usable externally.

Why can't we have this already in the image? Same as the "home dir" steps. Ideally, this image should be also usable externally.
synchon commented 2024-10-14 08:12:32 +00:00 (Migrated from github.com)

Currently I couldn't find a way to put it inside the image as the build kept failing. I wanted the same as well so it's usable, but I guess it'll take some trial and error to fix this mess that gh-action has. Here's that PR: https://github.com/juaml/junifer/pull/373

Currently I couldn't find a way to put it inside the image as the build kept failing. I wanted the same as well so it's usable, but I guess it'll take some trial and error to fix this mess that gh-action has. Here's that PR: https://github.com/juaml/junifer/pull/373
fraimondo commented 2024-10-14 08:16:18 +00:00 (Migrated from github.com)

ok then, let's move forward.

ok then, let's move forward.
apt-get -qq install -y \
git \
git-annex \
make \
jq
# Copy xfms directory
mkdir -p $HOME/junifer/data/xfms && \
cp -ar /root/junifer/data/xfms/. $HOME/junifer/data/xfms/
- name: Checkout source
uses: actions/checkout@v4
with:
@ -28,36 +45,14 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Check for sudo
shell: bash
- name: Install Python dependencies
run: |
if type sudo >/dev/null 2>&1; then SUDO="sudo"; else SUDO=""; fi
echo "SUDO=$SUDO" >> $GITHUB_ENV
- name: Install dependencies
run: |
$SUDO bash -c "$(curl -fsSL http://neuro.debian.net/_files/neurodebian-travis.sh)"
$SUDO apt-get update -qq
$SUDO apt-get install git-annex-standalone
python -m pip install --upgrade pip setuptools wheel
python -m pip install -e ".[docs,neurokit2]"
- name: Configure git for datalad
- name: Configure Git for DataLad
run: |
git config --global user.email "runner@github.com"
git config --global user.name "GITHUB CI Runner"
- name: Install ANTs
run: |
echo "++ Add universe repo"
sudo add-apt-repository -y universe
echo "++ Update package manager info"
sudo apt-get update -qq
echo "++ Downloading ANTs"
curl -fsSL -o ants.zip https://github.com/ANTsX/ANTs/releases/download/v2.5.1/ants-2.5.1-ubuntu-22.04-X64-gcc.zip
unzip ants.zip -d /opt
mv /opt/ants-2.5.1/bin/* /opt/ants-2.5.1
rm ants.zip
echo "/opt/ants-2.5.1" >> $GITHUB_PATH
git config --global user.email "junifer-runner@github.com"
git config --global user.name "GitHub Runner"
- name: Test build docs
run: |
BUILDDIR=_build/main make -C docs/ local

View file

@ -12,7 +12,24 @@ on:
jobs:
build-docs:
runs-on: ubuntu-latest
# Use custom docs CI image
container: ghcr.io/juaml/junifer-docs:main
steps:
- name: Check ANTs
run: |
echo "Using ANTs : $(antsRegistration --version)"
- name: Install system dependencies
run: |
# actions/checkout fails to identify Git as it's not in the CI image
apt-get -qq update && \
apt-get -qq install -y \
git \
git-annex \
make \
jq
# Copy xfms directory
mkdir -p $HOME/junifer/data/xfms && \
cp -ar /root/junifer/data/xfms/. $HOME/junifer/data/xfms/
- name: Checkout source
uses: actions/checkout@v4
with:
@ -23,37 +40,15 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Check for sudo
shell: bash
- name: Install Python dependencies
run: |
if type sudo >/dev/null 2>&1; then SUDO="sudo"; else SUDO=""; fi
echo "SUDO=$SUDO" >> $GITHUB_ENV
- name: Install dependencies
run: |
$SUDO bash -c "$(curl -fsSL http://neuro.debian.net/_files/neurodebian-travis.sh)"
$SUDO apt-get update -qq
$SUDO apt-get install git-annex-standalone
python -m pip install --upgrade pip setuptools wheel
python -m pip install -e ".[docs,neurokit2]"
python -m pip install git+https://github.com/dls-controls/sphinx-multiversion@only-arg
- name: Configure git for datalad
- name: Configure Git for DataLad
run: |
git config --global user.email "runner@github.com"
git config --global user.name "GITHUB CI Runner"
- name: Install ANTs
run: |
echo "++ Add universe repo"
sudo add-apt-repository -y universe
echo "++ Update package manager info"
sudo apt-get update -qq
echo "++ Downloading ANTs"
curl -fsSL -o ants.zip https://github.com/ANTsX/ANTs/releases/download/v2.5.1/ants-2.5.1-ubuntu-22.04-X64-gcc.zip
unzip ants.zip -d /opt
mv /opt/ants-2.5.1/bin/* /opt/ants-2.5.1
rm ants.zip
echo "/opt/ants-2.5.1" >> $GITHUB_PATH
git config --global user.email "junifer-runner@github.com"
git config --global user.name "GitHub Runner"
- name: Checkout gh-pages
# As we already did a deploy of gh-pages above, it is guaranteed to be there
# so check it out so we can selectively build docs below

View file

@ -0,0 +1 @@
Adopt usage of custom docs CI image for building and previewing docs actions by `Synchon Mandal`_