Skip to content

Commit

Permalink
test matrix with setting arm platform
Browse files Browse the repository at this point in the history
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
  • Loading branch information
vsoch committed Jun 21, 2023
1 parent 55b88ff commit 7f2fff8
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 105 deletions.
Original file line number Diff line number Diff line change
@@ -1,18 +1,37 @@
name: Test ARM Build
name: flux-arm builds
on:
# This must be triggered manually
workflow_dispatch:
pull_request: []
push:
branches: ['main']

# This is for base containers
# This installs up to pmix, but no flux stuff
env:
container: ghcr.io/rse-ops/flux-arm-base

jobs:
build-arm:
build:
runs-on: ubuntu-latest
permissions:
packages: write
strategy:
fail-fast: false
matrix:
platform:
- [linux/arm64/v8, armv8]
- [linux/arm64, arm64]
- [linux/ppc64le, ppc64le]

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.container }}

- name: Make Space For Build
run: |
sudo rm -rf /usr/share/dotnet
Expand All @@ -21,7 +40,7 @@ jobs:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: 'arm64,arm'
platforms: ${{ matrix.platform[0] }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
Expand All @@ -34,10 +53,13 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
id: build
uses: docker/build-push-action@v3
with:
file: Dockerfile.base
push: ${{ github.event_name != 'pull_request' }}
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: ${{ matrix.platform[0] }}
tags: |
ghcr.io/rse-ops/flux-arm
${{ env.container }}:${{ matrix.platform[1] }}
107 changes: 8 additions & 99 deletions Dockerfile → Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ RUN apt-get update && \
apt-get -qq install -y --no-install-recommends \
locales \
ca-certificates \
wget \
wget \
man \
git \
flex \
Expand Down Expand Up @@ -59,7 +59,13 @@ RUN apt-get update && \
python3.7-dev \
python3.8-dev \
python3-pip \
python3-setuptools \
# These are needed for detection by system Python
python3-cffi \
python3-yaml \
python3-ply \
python3-six \
python3-jsonschema \
python3-setuptools \
python3-wheel && \
rm -rf /var/lib/apt/lists/*

Expand Down Expand Up @@ -113,17 +119,6 @@ RUN locale-gen en_US.UTF-8
# NOTE: luaposix installed by rocks due to Ubuntu bug: #1752082 https://bugs.launchpad.net/ubuntu/+source/lua-posix/+bug/1752082
RUN luarocks install luaposix

# Install caliper by hand for now
WORKDIR /opt/caliper
RUN wget -O - https://github.com/LLNL/Caliper/archive/v1.7.0.tar.gz | tar xvz --strip-components 1 && \
mkdir build && \
cd build && \
CC=gcc CXX=g++ cmake .. -DCMAKE_INSTALL_PREFIX=/usr && \
make -j 4 && \
make install && \
cd ../.. && \
rm -rf caliper

# Install openpmix, prrte
WORKDIR /opt/prrte
RUN git clone https://github.com/openpmix/openpmix.git && \
Expand All @@ -144,89 +139,3 @@ RUN git clone https://github.com/openpmix/openpmix.git && \
rm -rf prrte

ENV LANG=C.UTF-8

# This is from the docker check script (run interactively during a test)
# https://github.com/flux-framework/flux-core/blob/master/src/test/docker/checks/Dockerfile
ARG USER=fluxuser
ARG UID=1000
ARG GID=1000
ARG FLUX_SECURITY_VERSION=0.9.0

# Install flux-security by hand for now:
#
WORKDIR /opt
RUN CCACHE_DISABLE=1 && \
V=$FLUX_SECURITY_VERSION && \
PKG=flux-security-$V && \
URL=https://github.com/flux-framework/flux-security/releases/download && \
wget ${URL}/v${V}/${PKG}.tar.gz && \
tar xvfz ${PKG}.tar.gz && \
cd ${PKG} && \
./configure --prefix=/usr --sysconfdir=/etc && \
make -j 4 && \
sudo make install && \
cd .. && \
ldconfig

# Add configured user to image with sudo access:
#
RUN set -x && groupadd -g $UID $USER && \
useradd -g $USER -u $UID -d /home/$USER -m $USER && \
printf "$USER ALL= NOPASSWD: ALL\\n" >> /etc/sudoers

# Setup MUNGE directories & key
RUN mkdir -p /var/run/munge && \
dd if=/dev/urandom bs=1 count=1024 > /etc/munge/munge.key && \
chown -R munge /etc/munge/munge.key /var/run/munge && \
chmod 600 /etc/munge/munge.key

# Build flux core
# This I added and copied how to build with caliper / flux security enabled
# https://github.com/flux-framework/flux-core/blob/master/src/test/docker/docker-run-checks.sh#L185-L191
RUN git clone https://github.com/flux-framework/flux-core && \
cd flux-core && \
./autogen.sh && \
./configure --prefix=/usr --sysconfdir=/etc \
--with-systemdsystemunitdir=/etc/systemd/system \
--localstatedir=/var \
--with-flux-security \
--enable-caliper && \
make clean && \
make && \
sudo make install

# This is from the same src/test/docker/bionic/Dockerfile but in flux-sched
# Flux-sched deps
RUN sudo apt-get update
RUN sudo apt-get -qq install -y --no-install-recommends \
libboost-graph-dev \
libboost-system-dev \
libboost-filesystem-dev \
libboost-regex-dev \
python-yaml \
libyaml-cpp-dev \
libedit-dev

# Build Flux Sched
# https://github.com/flux-framework/flux-sched/blob/master/src/test/docker/docker-run-checks.sh#L152-L158
RUN git clone --depth 1 https://github.com/flux-framework/flux-sched && \
cd flux-sched && \
./autogen.sh && \
./configure --prefix=/usr --sysconfdir=/etc \
--with-systemdsystemunitdir=/etc/systemd/system \
--localstatedir=/var \
--with-flux-security \
--enable-caliper && \
make && \
sudo make install

# Note I ran this manually - didn't check to see if works in build (4th line might be interactive
RUN sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 1 && \
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 2 && \
sudo update-alternatives --config python3 && \
wget https://bootstrap.pypa.io/get-pip.py && \
python3 get-pip.py

# Working directory to be flux so we can pull / update from there
WORKDIR /opt/flux-core

0 comments on commit 7f2fff8

Please sign in to comment.