Skip to content

Commit

Permalink
Add s390x workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
grimbough committed Sep 10, 2024
1 parent 537cd70 commit a070c98
Showing 1 changed file with 160 additions and 0 deletions.
160 changes: 160 additions & 0 deletions .github/workflows/s390x.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
name: Test package on s390x

on:
push:
branches:
- main
- s390x
workflow_dispatch:

env:
PKG: 'rhdf5'

jobs:
install-depdendencies:
name: Install package dependencies
runs-on: ubuntu-22.04

steps:
- name: checkout
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: s390x

- name: Make R library
run: mkdir -p ${RUNNER_TEMP}/R-lib

- name: Cache Dependencies
id: cache-deps
uses: actions/cache@v4
with:
path: ${{ runner.temp }}/R-lib
key: R_lib-s390x-${{ hashFiles('**/DESCRIPTION') }}
restore-keys: |
R_lib-s390x-${{ hashFiles('**/DESCRIPTION') }}
R_lib-s390x-
- name: Run the build process with Docker
uses: addnab/docker-run-action@v3
with:
image: s390x/r-base:latest
options: |
--platform linux/arm64
-v ${{ runner.temp }}/R-lib:/R-lib
-v ${{ github.workspace }}/../:/build
--env R_LIBS_USER=/R-lib
--env PKG=${{ env.PKG }}
run: |
uname -a
echo "options(Ncpus=4L, timeout = 300)" >> ~/.Rprofile
Rscript -e "library(remotes)" -e "dev_package_deps('/build/${PKG}', dependencies = TRUE) |> update(upgrade = 'always')"
check-s390x:
name: Test package on s390x
runs-on: ubuntu-22.04
needs: install-depdendencies
steps:

- name: checkout
uses: actions/checkout@v4

- name: Make R library
run: mkdir -p ${RUNNER_TEMP}/R-lib

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: s390x

This comment has been minimized.

Copy link
@mr-c

mr-c Sep 17, 2024

I see that https://github.com/docker/setup-qemu-action is using qemu version 7.0.0 by default; latest version is 9.1.0

Maybe try the following to get qemu 8.1.5 (source):

      - name: Set up QEMU
        uses: docker/setup-qemu-action@v3
        with:
          platforms: s390x
          image: tonistiigi/binfmt:qemu-v8.1.5

- name: Cache Dependencies
id: cache-deps
uses: actions/cache@v4
with:
path: ${{ runner.temp }}/R-lib
key: R_lib-s390x-${{ hashFiles('**/DESCRIPTION') }}
restore-keys: |
R_lib-s390x-${{ hashFiles('**/DESCRIPTION') }}
R_lib-s390x-
- name: R CMD INSTALL
uses: addnab/docker-run-action@v3
with:
image: s390x/r-base:latest
options: |
--platform linux/s390x
-v ${{ runner.temp }}/R-lib:/R-lib
-v ${{ github.workspace }}/../:/build
--env R_LIBS_USER=/R-lib
--env PKG=${{ env.PKG }}
--workdir /build
run: |
ls -l
R CMD INSTALL ${PKG} &> ${PKG}.install-out.txt
ls -l
shell: bash

- name: R CMD build
uses: addnab/docker-run-action@v3
with:
image: s390x/r-base:latest
options: |
--platform linux/s390x
-v ${{ runner.temp }}/R-lib:/R-lib
-v ${{ github.workspace }}/../:/build
--env R_LIBS_USER=/R-lib
--env PKG=${{ env.PKG }}
--workdir /build
run: |
ls -l "${R_LIBS_USER}"
R CMD build --keep-empty-dirs --no-resave-data ${PKG}
ls -l
- name: R CMD check
uses: addnab/docker-run-action@v3
with:
image: s390x/r-base:latest4

This comment has been minimized.

Copy link
@mr-c

mr-c Sep 11, 2024

I think this is a typo? Should be image: s390x/r-base:latest without the trailing 4

See https://github.com/grimbough/rhdf5/actions/runs/10791554222/job/29932079469#step:9:21

This comment has been minimized.

Copy link
@grimbough

grimbough Sep 11, 2024

Author Owner

Yep that's a typo. I didn't fix it because some of the installation of dependencies fail with segmentation faults, although the workflow step doesn't report an error:

https://github.com/grimbough/rhdf5/actions/runs/10791554222/job/29929208566#step:7:4533

No point in fixing the main workflow until I solve that issue. Probably using your docker file will be more productive.

This comment has been minimized.

Copy link
@mr-c

mr-c Sep 17, 2024

That segfault for cli is odd; I noticed we had an older version in Debian, so I updated it and we had no issues with the s390x build.

This comment has been minimized.

Copy link
@grimbough

grimbough Sep 19, 2024

Author Owner

Thanks for the hint on updating the docker image. I did not consider than latest would be older than a tagged version. That gets ride of the segfault and I can reproduce the test failures https://github.com/grimbough/rhdf5/actions/runs/10921157682/job/30312676631#step:9:195

options: |
--platform linux/s390x
-v ${{ runner.temp }}/R-lib:/R-lib
-v ${{ github.workspace }}/../:/build
--env R_LIBS_USER=/R-lib
--env PKG=${{ env.PKG }}
--workdir /build
run: |
ls -l
R CMD check --install=check:${PKG}.install-out.txt --library="${R_LIBS_USER}" --no-vignettes --timings ${PKG}*.tar.gz
cat ${PKG}.install-out.txt
ls -l
- name: Build Package Binary
uses: addnab/docker-run-action@v3
with:
image: s390x/r-base:latest
options: |
--platform linux/s390x
-v ${{ runner.temp }}/R-lib:/R-lib
-v ${{ github.workspace }}/../:/build
--env R_LIBS_USER=/R-lib
--env PKG=${{ env.PKG }}
--workdir /build
run: |
mkdir -p ${PKG}.buildbin-libdir
R CMD INSTALL --build --library=${PKG}.buildbin-libdir ${PKG}*.tar.gz
ls -l
- uses: actions/upload-artifact@v4
if: always()
with:
name: my-artifact
path: |
~/**/*.tar.gz
~/**/*.install-out.txt
~/**/*.Rcheck
if-no-files-found: warn




0 comments on commit a070c98

Please sign in to comment.