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 5f6d2cf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,27 @@ jobs:
fail-fast: false
matrix:
epics-target: [RTEMS-beatnik, linux-x86_64] # , linux-aarch64]
target: [developer, runtime]
target: [developer, runtime, proxy]
os: [ubuntu-latest]
include:
- epics-target: RTEMS-beatnik
epics-host: linux-x86_64
extension: -rtems-beatnik
platform: linux/amd64
os: ubuntu-latest
proxy: "ubuntu:20.04"
target: [developer, proxy]

- epics-target: linux-x86_64
epics-host: linux-x86_64
extension: ""
platform: linux/amd64
os: ubuntu-latest
target: [developer, runtime]

# - 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

runs-on: ${{ matrix.os }}
env:
Expand Down Expand Up @@ -68,6 +69,7 @@ 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 }}
Expand All @@ -89,6 +91,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 5f6d2cf

Please sign in to comment.