From 3c49f18f76f58446e3cf402d9b21e0f4094032d3 Mon Sep 17 00:00:00 2001 From: charliemirabile <46761267+charliemirabile@users.noreply.github.com> Date: Mon, 3 Mar 2025 23:28:29 -0500 Subject: [PATCH] CI: move code into singularity repo There is no reason for circumference to be involved here, it just makes it easier to break CI if the two repos end up out of sync. We learned this lesson the last time we did something other than monorepo. --- .../circumference-test-container.yaml | 6 ++--- Containerfile | 25 +++++++++++++++++++ start.sh | 19 ++++++++++++++ 3 files changed, 46 insertions(+), 4 deletions(-) create mode 100644 Containerfile create mode 100755 start.sh diff --git a/.github/workflows/circumference-test-container.yaml b/.github/workflows/circumference-test-container.yaml index 27b0154b..2d42540e 100644 --- a/.github/workflows/circumference-test-container.yaml +++ b/.github/workflows/circumference-test-container.yaml @@ -22,12 +22,10 @@ jobs: sudo apt install -y podman podman --version - - name: Clone circumference and start PINPing + - name: Start PINPing id: run_tests run: | - git clone https://github.com/underground-software/circumference ../circumference - cd ../circumference - podman build --build-context=singularity_git_repo=$OLDPWD -t singularity-test . + podman build --build-context=singularity_git_repo=. -t singularity-test . podman run --rm --privileged localhost/singularity-test:latest - name: Report test results diff --git a/Containerfile b/Containerfile new file mode 100644 index 00000000..087ff369 --- /dev/null +++ b/Containerfile @@ -0,0 +1,25 @@ +FROM fedora:latest + +RUN dnf update -y && \ + dnf install -y \ + podman \ + podman-compose \ + jq \ + ShellCheck \ + which \ + python-flake8 \ + python-virtualenv \ + python-pip \ + git + +RUN sed -i 's/log_driver = "journald"/log_driver = "json-file"/' /usr/share/containers/containers.conf + +COPY --from=singularity_git_repo . ./singularity + +RUN mkdir -p singularity/{repos,docs} + +COPY start.sh . + +WORKDIR singularity + +ENTRYPOINT ["/start.sh"] diff --git a/start.sh b/start.sh new file mode 100755 index 00000000..574df7f4 --- /dev/null +++ b/start.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +set -ex + +mkdir -p /var/lib/containers/storage +mount -t tmpfs tmpfs /var/lib/containers/storage +podman-compose build +podman-compose up -d +# wait until synapse is done initializing +podman-compose logs -f submatrix 2>&1 | sed '/Synapse now listening on TCP port 8008/ q' +if [ -f test.sh ] +then + ./test.sh +else + virtualenv . + pip install -r requirements.txt + pytest +fi +podman-compose down