Skip to content

Commit

Permalink
add proxy stage
Browse files Browse the repository at this point in the history
  • Loading branch information
gilesknap committed Mar 15, 2024
1 parent 92287db commit a6c4796
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 9 deletions.
23 changes: 17 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,35 @@ jobs:
fail-fast: false
matrix:
epics-target: [RTEMS-beatnik, linux-x86_64] # , linux-aarch64]
target: [developer, runtime]
target: [developer, runtime, proxy]
include:
- os: ubuntu-latest # everyone is on os-latest

- epics-target: RTEMS-beatnik
epics-host: linux-x86_64
extension: -rtems-beatnik
platform: linux/amd64
os: ubuntu-latest
proxy: "ubuntu:20.04"

- epics-target: linux-x86_64
epics-host: linux-x86_64
extension: ""
platform: linux/amd64
os: ubuntu-latest
proxy: "none"

# - epics-target: linux-aarch64
# epics-host: linux-aarch64
# # a temporary name until multi-arch is supported
# extension: -native-aarch64
# platform: linux/arm64
# os: ubuntu-latest

exclude:
# only native images need a runtime target
- epics-target: [RTEMS-beatnik]
target: runtime
# only cross compiled images need a proxy target
- epics-target: [linux-x86_64, linux-aarch64]
target: proxy

runs-on: ${{ matrix.os }}
env:
Expand Down Expand Up @@ -68,14 +77,15 @@ jobs:
TARGET_ARCHITECTURE=${{ matrix.epics-target }}
EPICS_HOST_ARCH=${{ matrix.epics-host }}
IMAGE_EXT=${{ matrix.extension }}
PROXY=${{ matrix.proxy }}
tags: ${{ env.TAG }}
cache-from: type=gha,scope=${{ matrix.epics-target }}
cache-to: type=gha,mode=max,scope=${{ matrix.epics-target }}
load: true

- name: Test image
# can't test rtems without some hardware to run on
if: contains(${{ matrix.epics-target }}, "RTEMS")
# can't test non native without some hardware to run on
if: contains(${{ matrix.proxy }}, "none")
run: tests/run-tests.sh

- name: Push image
Expand All @@ -89,6 +99,7 @@ jobs:
TARGET_ARCHITECTURE=${{ matrix.epics-target }}
EPICS_HOST_ARCH=${{ matrix.epics-host }}
IMAGE_EXT=${{ matrix.extension }}
PROXY=${{ matrix.proxy }}
tags: ${{ env.TAG }}
push: true

Expand Down
12 changes: 9 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
##### build stage ##############################################################


ARG TARGET_ARCHITECTURE=linux-x86_64
ARG EPICS_HOST_ARCH=linux-x86_64
ARG IMAGE_EXT
ARG PROXY

ARG BASE=7.0.8ec2b1
ARG REGISTRY=ghcr.io/epics-containers

##### build stage ##############################################################
FROM ${REGISTRY}/epics-base${IMAGE_EXT}-developer:${BASE} AS developer

# The devcontainer mounts the project root to /epics/generic-source
Expand Down Expand Up @@ -56,14 +58,12 @@ COPY ioc ${SOURCE_FOLDER}/ioc
RUN cd ${IOC} && ./install.sh && make

##### runtime preparation stage ################################################

FROM developer AS runtime_prep

# get the products from the build stage and reduce to runtime assets only
RUN ibek ioc extract-runtime-assets /assets ${SOURCE_FOLDER}/ibek*

##### runtime stage ############################################################

FROM ${REGISTRY}/epics-base${IMAGE_EXT}-runtime:${BASE} AS runtime

# get runtime assets from the preparation stage
Expand All @@ -75,3 +75,9 @@ RUN ibek support apt-install --runtime
ENV TARGET_ARCHITECTURE ${IMAGE_NAME}

ENTRYPOINT ["/bin/bash", "-c", "${IOC}/start.sh"]

##### proxy stage ##############################################################
FROM ${PROXY} as proxy

RUN echo 'this will be a proxy pod for the real IOC'

0 comments on commit a6c4796

Please sign in to comment.