-
Notifications
You must be signed in to change notification settings - Fork 906
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8e9cb56
commit 0bbe430
Showing
5 changed files
with
137 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Build docker base image | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
paths: ["src/docker/base/**"] | ||
|
||
permissions: | ||
contents: read | ||
|
||
env: | ||
DEFAULT_UBUNTU: 22.04 | ||
|
||
jobs: | ||
parameters: | ||
name: Collect build parameters | ||
runs-on: ubuntu-22.04 | ||
timeout-minutes: 10 | ||
outputs: | ||
pip-version: ${{ steps.versions.outputs.pip-version }} | ||
setuptools-version: ${{ steps.versions.outputs.setuptools-version }} | ||
ubuntu-version: ${{ steps.versions.outputs.ubuntu-version }} | ||
|
||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
|
||
- uses: ./.github/actions/bootstrap | ||
id: bootstrap | ||
|
||
- id: versions | ||
run: | | ||
echo "pip-version=${{ steps.bootstrap.outputs.pip-version }}" >> "$GITHUB_OUTPUT" | ||
echo "setuptools-version=${{ steps.bootstrap.outputs.setuptools-version }}" >> "$GITHUB_OUTPUT" | ||
echo "ubuntu-version=${{ env.DEFAULT_UBUNTU }}" >> "$GITHUB_OUTPUT" | ||
build-base-images: | ||
name: Build images | ||
uses: ./.github/workflows/_docker-build.yml | ||
needs: parameters | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
python-version: [3.11] | ||
with: | ||
namespace-repository: flwr/base | ||
file-dir: src/docker/base | ||
build-args: | | ||
PYTHON_VERSION=${{ matrix.python-version }} | ||
PIP_VERSION=${{ needs.parameters.outputs.pip-version }} | ||
SETUPTOOLS_VERSION=${{ needs.parameters.outputs.setuptools-version }} | ||
UBUNTU_VERSION=${{ needs.parameters.outputs.ubuntu-version }} | ||
tags: py${{ matrix.python-version }}-ubuntu${{ needs.parameters.outputs.ubuntu-version }} | ||
secrets: | ||
dockerhub-user: ${{ secrets.DOCKERHUB_USERNAME }} | ||
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Copyright 2023 Flower Labs GmbH. All Rights Reserved. | ||
|
||
ARG UBUNTU_VERSION=22.04 | ||
FROM ubuntu:$UBUNTU_VERSION as base | ||
|
||
ENV DEBIAN_FRONTEND noninteractive | ||
# Send stdout and stderr stream directly to the terminal. Ensures that no | ||
# output is retained in a buffer if the application crashes. | ||
ENV PYTHONUNBUFFERED 1 | ||
# Typically, bytecode is created on the first invocation to speed up following invocation. | ||
# However, in Docker we only make a single invocation (when we start the container). | ||
# Therefore, we can disable bytecode writing. | ||
ENV PYTHONDONTWRITEBYTECODE 1 | ||
# Ensure that python encoding is always UTF-8. | ||
ENV PYTHONIOENCODING UTF-8 | ||
ENV LANG C.UTF-8 | ||
ENV LC_ALL C.UTF-8 | ||
|
||
# Install system dependencies | ||
RUN apt-get update \ | ||
&& apt-get -y --no-install-recommends install \ | ||
clang-format git unzip ca-certificates openssh-client liblzma-dev \ | ||
build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev wget\ | ||
libsqlite3-dev curl llvm libncursesw5-dev xz-utils tk-dev libxml2-dev \ | ||
libxmlsec1-dev libffi-dev liblzma-dev \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Install PyEnv and Python | ||
ARG PYTHON_VERSION | ||
ENV PYENV_ROOT /root/.pyenv | ||
ENV PATH $PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH | ||
# https://github.com/hadolint/hadolint/wiki/DL4006 | ||
SHELL ["/bin/bash", "-o", "pipefail", "-c"] | ||
RUN curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash | ||
RUN pyenv install ${PYTHON_VERSION} \ | ||
&& pyenv global ${PYTHON_VERSION} \ | ||
&& pyenv rehash | ||
|
||
# Install specific version of pip | ||
ARG PIP_VERSION | ||
RUN python -m pip install --no-cache-dir pip==$PIP_VERSION | ||
|
||
# Install specific version of setuptools | ||
ARG SETUPTOOLS_VERSION | ||
RUN python -m pip install --no-cache-dir setuptools==$SETUPTOOLS_VERSION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters