diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 2918a3ce1..daded6a51 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -10,7 +10,7 @@ on: jobs: skip_check: - runs-on: ubuntu-24.04 + runs-on: [self-hosted, Linux, X64] outputs: should_skip: ${{ steps.skip_check.outputs.should_skip }} steps: @@ -30,7 +30,7 @@ jobs: name: Integration testing timeout-minutes: 30 - runs-on: ubuntu-24.04 + runs-on: [self-hosted, Linux, X64] strategy: matrix: diff --git a/.github/workflows/lints.yml b/.github/workflows/lints.yml index 299714e9b..61ecda6c6 100644 --- a/.github/workflows/lints.yml +++ b/.github/workflows/lints.yml @@ -10,7 +10,7 @@ on: jobs: skip_check: - runs-on: ubuntu-24.04 + runs-on: [self-hosted, Linux, X64] outputs: should_skip: ${{ steps.skip_check.outputs.should_skip }} steps: @@ -30,7 +30,7 @@ jobs: name: Various lints timeout-minutes: 30 - runs-on: ubuntu-24.04 + runs-on: [self-hosted, Linux, X64] strategy: matrix: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a81dbb13d..9cfdc255f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,7 +10,7 @@ on: jobs: skip_check: - runs-on: ubuntu-24.04 + runs-on: [self-hosted, Linux, X64] outputs: should_skip: ${{ steps.skip_check.outputs.should_skip }} steps: @@ -29,7 +29,7 @@ jobs: (github.event.action == 'ready_for_review' || needs.skip_check.outputs.should_skip != 'true') name: Run Tests timeout-minutes: 30 - runs-on: ubuntu-24.04 + runs-on: [self-hosted, Linux, X64] strategy: matrix: diff --git a/README.md b/README.md index 70f435371..4c6fd6114 100644 --- a/README.md +++ b/README.md @@ -36,3 +36,12 @@ cargo clippy ``` Alas, `cargo build` doesn't work. That's a known problem and we're working on it. Please use `cargo make build` instead for now. + +### Setting up self-hosted CI docker container + +To set up docker container for CI, you can run the following command: + +```sh +docker build -t ceno-runner scripts/ci/ +docker run -d ceno-runner +``` diff --git a/scripts/ci/Dockerfile b/scripts/ci/Dockerfile new file mode 100644 index 000000000..b8a1e9e9a --- /dev/null +++ b/scripts/ci/Dockerfile @@ -0,0 +1,31 @@ +# this dockerfile is borrowed from https://baccini-al.medium.com/how-to-containerize-a-github-actions-self-hosted-runner-5994cc08b9fb +FROM ubuntu:22.04 + +ARG DEBIAN_FRONTEND=noninteractive +ARG RUNNER_VERSION="2.320.0" +ARG CHECKSUM="93ac1b7ce743ee85b5d386f5c1787385ef07b3d7c728ff66ce0d3813d5f46900" + +RUN apt update -y && apt upgrade -y && useradd -m docker +RUN apt install -y --no-install-recommends \ + curl jq build-essential libssl-dev libffi-dev python3 python3-venv python3-dev python3-pip + +# these are the dependencies of actions-runner +RUN apt install -y --no-install-recommends \ + libkrb5-3 zlib1g libicu70 + +RUN cd /home/docker && mkdir actions-runner && cd actions-runner \ + && curl -o actions-runner-linux-x64-$RUNNER_VERSION.tar.gz -L https://github.com/actions/runner/releases/download/v$RUNNER_VERSION/actions-runner-linux-x64-$RUNNER_VERSION.tar.gz \ + && echo "$CHECKSUM actions-runner-linux-x64-$RUNNER_VERSION.tar.gz" | shasum -a 256 -c \ + && tar xzf ./actions-runner-linux-x64-$RUNNER_VERSION.tar.gz + +RUN chown -R docker ~docker && cd /home/docker/actions-runner/bin/ \ + && chmod +x installdependencies.sh \ + && ./installdependencies.sh + +COPY start.sh start.sh +RUN chmod +x start.sh + +# GitHub action runner scripts (config.sh and run.sh) are not allowed to be run as root +USER docker + +ENTRYPOINT ["./start.sh"] diff --git a/scripts/ci/start.sh b/scripts/ci/start.sh new file mode 100644 index 000000000..d67bbba00 --- /dev/null +++ b/scripts/ci/start.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +cd /home/docker/actions-runner/ +echo "begin to configure" +./config.sh --url https://github.com/scroll-tech/ceno --token $TOKEN + +./run.sh