Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 24.04 #33

Merged
merged 2 commits into from
May 10, 2024
Merged
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
11 changes: 10 additions & 1 deletion .github/scripts/check-patterns.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ IFS=' ' read -r -a changed <<< $ALL_CHANGED_FILES
TOOL_CONFIG_PATTERNS=("docker/tool-config.Dockerfile .github/workflows/tool-config.yml docker/conf/**")
BUILDER_2004_PATTERNS=("docker/ubuntu-2004-builder.Dockerfile .github/workflows/builder-ubuntu.yml")
BUILDER_2204_PATTERNS=("docker/ubuntu-2204-builder.Dockerfile .github/workflows/builder-ubuntu.yml")
BUILDER_2404_PATTERNS=("docker/ubuntu-2404-builder.Dockerfile .github/workflows/builder-ubuntu.yml")
CONTRIB_PATTERNS=("docker/psibase-contributor.Dockerfile .github/workflows/contributor.yml")

matches_pattern() {
Expand Down Expand Up @@ -46,6 +47,14 @@ for pattern in ${BUILDER_2204_PATTERNS[@]}; do
fi
done

run_2404="0"
for pattern in ${BUILDER_2404_PATTERNS[@]}; do
if matches_pattern $pattern; then
run_2404="1"
break
fi
done

run_contrib="0"
if [[ "$run_tc" == "1" ]] || [[ "$run_2204" == "1" ]]; then
run_contrib="1"
Expand All @@ -58,4 +67,4 @@ else
done
fi

echo "${run_tc} ${run_2004} ${run_2204} ${run_contrib}"
echo "${run_tc} ${run_2004} ${run_2204} ${run_2404} ${run_contrib}"
12 changes: 11 additions & 1 deletion .github/workflows/_dispatcher.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
run_tc: ${{ steps.schedule-builders.outputs.run_tc }}
run_2004: ${{ steps.schedule-builders.outputs.run_2004 }}
run_2204: ${{ steps.schedule-builders.outputs.run_2204 }}
run_2404: ${{ steps.schedule-builders.outputs.run_2404 }}
run_contrib: ${{ steps.schedule-builders.outputs.run_contrib }}

steps:
Expand Down Expand Up @@ -60,10 +61,11 @@ jobs:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
necessary_jobs=$(./.github/scripts/check-patterns.sh "$ALL_CHANGED_FILES")
read -r run_tc run_2004 run_2204 run_contrib <<< "$necessary_jobs"
read -r run_tc run_2004 run_2204 run_2404 run_contrib <<< "$necessary_jobs"
echo "run_tc=${run_tc}" | tee -a $GITHUB_OUTPUT
echo "run_2004=${run_2004}" | tee -a $GITHUB_OUTPUT
echo "run_2204=${run_2204}" | tee -a $GITHUB_OUTPUT
echo "run_2404=${run_2404}" | tee -a $GITHUB_OUTPUT
echo "run_contrib=${run_contrib}" | tee -a $GITHUB_OUTPUT

build-tool-config:
Expand All @@ -88,6 +90,14 @@ jobs:
with:
ubuntu_version: "2204"

build-2404:
name: "Build 24.04 builder"
needs: determine-actions
if: ${{ needs.determine-actions.outputs.run_2404 == '1' }}
uses: ./.github/workflows/builder-ubuntu.yml
with:
ubuntu_version: "2404"

build-contributor:
name: "Build contributor"
needs: [determine-actions, build-tool-config, build-2204]
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ An image based on Ubuntu 22.04 that contains an environment suitable for buildin

Used by the `psibase-contributor` image.

## ubuntu-2404-builder

An image based on Ubuntu 24.04 that contains an environment suitable for building Psibase from source.

## tool-config

A [scratch](https://hub.docker.com/_/scratch)-based image that contains configuration files for various third-party tooling required by psibase contributor and other downstream images to allow them to display the admin-sys monitoring dashboards (e.g. Prometheus, Grafana, etc.).
Expand Down
2 changes: 1 addition & 1 deletion WORKFLOWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ This reusable workflow generates the builder images, which are environments capa

### Input variables

* `ubuntu_version` - When set to either `"2004"` or `"2204"`, then the generated image will be based on the corresponding version of Ubuntu.
* `ubuntu_version` - When set to either `"2004"`, `"2204"`, or `"2404"`, then the generated image will be based on the corresponding version of Ubuntu.

### How to run

Expand Down
82 changes: 82 additions & 0 deletions docker/ubuntu-2404-builder.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
FROM ubuntu:24.04

ARG TARGETARCH

RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get update \
&& apt-get install -yq software-properties-common \
&& apt-get update \
&& apt-get install -yq \
autoconf \
binaryen \
build-essential \
ccache \
cmake \
curl \
git \
libssl-dev \
libtool \
pkg-config \
python3-requests \
strace \
wget \
zstd \
clang-16 \
libclang-16-dev \
lld-16 \
llvm-16 \
libboost1.83-dev \
&& apt-get clean -yq \
&& rm -rf /var/lib/apt/lists/*

# https://github.com/WebAssembly/wasi-sdk/releases/tag/wasi-sdk-20
ENV WASI_SDK_PREFIX=/usr/lib/llvm-16
ENV PATH=${WASI_SDK_PREFIX}/bin:$PATH
RUN cd ${WASI_SDK_PREFIX}/lib/clang/16/ \
&& curl -LO https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-20/libclang_rt.builtins-wasm32-wasi-20.0.tar.gz \
&& tar xf libclang_rt.builtins-wasm32-wasi-20.0.tar.gz \
&& rm libclang_rt.builtins-wasm32-wasi-20.0.tar.gz \
&& cd ${WASI_SDK_PREFIX}/share \
&& curl -LO https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-20/wasi-sysroot-20.0.tar.gz \
&& tar xf wasi-sysroot-20.0.tar.gz \
&& rm wasi-sysroot-20.0.tar.gz

RUN <<EOT bash
set -eux
if [ "amd64" = "$TARGETARCH" ]; then
export NODEPATH=node-v20.11.0-linux-x64
elif [ "arm64" = "$TARGETARCH" ]; then
export NODEPATH=node-v20.11.0-linux-arm64
fi

cd /opt
curl -LO https://nodejs.org/dist/v20.11.0/\$NODEPATH.tar.xz
tar xf \$NODEPATH.tar.xz
rm \$NODEPATH.tar.xz
mv \$NODEPATH node-v20.11.0
export PATH="/opt/node-v20.11.0/bin:$PATH"
npm i -g yarn
EOT
ENV PATH=/opt/node-v20.11.0/bin:$PATH

ENV RUSTUP_HOME=/opt/rustup
ENV CARGO_HOME=/opt/cargo
RUN cd /root \
&& curl --proto '=https' --tlsv1.2 -sSf -o rustup.sh https://sh.rustup.rs \
&& chmod 700 rustup.sh \
&& ./rustup.sh -y --no-modify-path \
&& /opt/cargo/bin/rustup target add \
wasm32-unknown-unknown \
wasm32-wasi \
&& /opt/cargo/bin/cargo install \
[email protected] \
mdbook \
mdbook-linkcheck \
mdbook-mermaid \
mdbook-pagetoc \
sccache \
wasm-pack \
&& chmod -R 777 $RUSTUP_HOME \
&& chmod -R 777 $CARGO_HOME \
&& rm rustup.sh
ENV PATH=$CARGO_HOME/bin:$PATH