Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 94 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: Docker Images

on:
push:
tags: ['v*']

permissions:
contents: read

env:
ORG: ${{ secrets.DOCKER_HUB_USERNAME }}

jobs:
base:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v5
with:
context: .
file: baseDockerfile
push: true
tags: |
${{ env.ORG }}/base:latest
${{ env.ORG }}/base:${{ github.ref_name }}
cache-from: type=gha,scope=base
cache-to: type=gha,scope=base,mode=max

algorithms:
needs: base
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
algorithm:
- afp
- bingo
- brush
- bsr
- e2et
- eplex
- eql
- feat
- ffx
- geneticengine
- gpgomea
- gplearn
- gpzgd
- itea
- lightgbm
- nesymres
- operon
- ps-tree
- pysr
- qlattice
- rils-rols
- sklearn
- tir
- tpsr
- udsr
- xgboost
steps:
- uses: actions/checkout@v4
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- uses: docker/setup-buildx-action@v3
- name: Resolve Dockerfile
id: dockerfile
run: |
if [ -f "algorithms/${{ matrix.algorithm }}/Dockerfile" ]; then
echo "path=algorithms/${{ matrix.algorithm }}/Dockerfile" >> $GITHUB_OUTPUT
else
echo "path=alg-Dockerfile" >> $GITHUB_OUTPUT
fi
- uses: docker/build-push-action@v5
with:
context: .
file: ${{ steps.dockerfile.outputs.path }}
build-args: |
ALGORITHM=${{ matrix.algorithm }}
BASE_IMAGE=${{ env.ORG }}/base:${{ github.ref_name }}
push: true
tags: |
${{ env.ORG }}/${{ matrix.algorithm }}:latest
${{ env.ORG }}/${{ matrix.algorithm }}:${{ github.ref_name }}
cache-from: type=gha,scope=${{ matrix.algorithm }}
Comment on lines +86 to +93
cache-to: type=gha,scope=${{ matrix.algorithm }},mode=max
3 changes: 2 additions & 1 deletion alg-Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM srbench/base AS build
ARG BASE_IMAGE=srbench/base
FROM ${BASE_IMAGE} AS build
################################################################################

# Install env
Expand Down
3 changes: 2 additions & 1 deletion algorithms/tir/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM srbench/base AS build
ARG BASE_IMAGE=srbench/base
FROM ${BASE_IMAGE} AS build
################################################################################

USER root
Expand Down
59 changes: 3 additions & 56 deletions baseDockerfile
Original file line number Diff line number Diff line change
@@ -1,72 +1,19 @@
#################################################################################
## Notes: this image is large and many improvements are possible.
## Sources:
## - https://uwekorn.com/2021/03/01/deploying-conda-environments-in-docker-how-to-do-it-right.html
## - https://pythonspeed.com/articles/conda-docker-image-size/
## micromamba is failing for PySR, so sticking with mambaforge for now.
## FROM --platform=linux/amd64 mambaorg/micromamba:0.21.2 as build
##FROM condaforge/mambaforge:4.11.0-2 as base
## FROM condaforge/miniforge-pypy3:24.3.0-0 AS base
#FROM condaforge/miniforge-pypy3:23.11.0-0 AS base
#################################################################################
## Nvidia code ##################################################################
#################################################################################
#ENV PATH /usr/local/nvidia/bin/:$PATH
#ENV LD_LIBRARY_PATH /usr/local/nvidia/lib:/usr/local/nvidia/lib64:$LD_LIBRARY_PATH
## Tell nvidia-docker the driver spec that we need as well as to
## use all available devices, which are mounted at /usr/local/nvidia.
## The LABEL supports an older version of nvidia-docker, the env
## variables a newer one.
#ENV NVIDIA_VISIBLE_DEVICES all
#ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
#LABEL com.nvidia.volumes.needed="nvidia_driver"
################################################################################
FROM mambaorg/micromamba:1.5.8

# Install base packages.
USER root

ARG DEBIAN_FRONTEND=noninteractive

# # proxy for apt
# ENV MIRROR="mirrors\.ocf\.berkeley\.edu"

# RUN sed -i -e "s/archive\.ubuntu\.com/${MIRROR}/" /etc/apt/sources.list
# RUN sed -i -e "s/security\.ubuntu\.com/${MIRROR}/" /etc/apt/sources.list
# RUN sed -i -e "s/http/https/" /etc/apt/sources.list
#
# ENV MIRROR="debian\.csail\.mit\.edu"
# ENV MIRROR="us\.debian\.org"
# ENV MIRROR="debian\.cc\.lehigh\.edu"
# ENV MIRROR="debian\.cs\.binghamton\.edu"
# ENV MIRROR="debian\.mirror\.constant\.com"

# RUN sed -i -e "s/deb\.debian\.org/${MIRROR}/" /etc/apt/sources.list.d/debian.sources
RUN sed -i -e "s/http/https/" /etc/apt/sources.list.d/debian.sources
# COPY debian.sources /etc/apt/list/sources.list.d/
RUN apt update \
&& apt install -y \
# default-jdk \
RUN sed -i -e "s/http/https/" /etc/apt/sources.list.d/debian.sources \
&& apt update \
&& apt install -y \
rsync \
# bzip2 \
# ca-certificates \
curl \
git \
# wget \
build-essential \
Comment thread
lacava marked this conversation as resolved.
libgmp3-dev \
libblas-dev \
liblapack-dev \
libgsl-dev \
vim \
# jq \
&& rm -rf /var/lib/apt/lists/*

USER $MAMBA_USER

# Install env
################################################################################
#USER $MAMBA_USER
# SHELL ["/bin/bash", "-c"]
#VOLUME ["/srbench"]
# WORKDIR "/srbench"
Loading