forked from tahoe-lafs/tahoe-lafs
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build the Docker images and use them for system-testing
Signed-off-by: Benoit Donneaux <[email protected]>
- Loading branch information
Showing
3 changed files
with
154 additions
and
18 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 |
---|---|---|
|
@@ -46,14 +46,14 @@ jobs: | |
matrix: | ||
include: | ||
- os: macos-12 | ||
python-version: "3.12" | ||
python_version: "3.12" | ||
# We only support PyPy on Linux at the moment. | ||
- os: ubuntu-latest | ||
python-version: "pypy-3.9" | ||
python_version: "pypy-3.9" | ||
- os: ubuntu-latest | ||
python-version: "3.12" | ||
python_version: "3.12" | ||
- os: windows-latest | ||
python-version: "3.12" | ||
python_version: "3.12" | ||
|
||
steps: | ||
# See https://github.com/actions/checkout. A fetch-depth of 0 | ||
|
@@ -63,10 +63,10 @@ jobs: | |
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
- name: Set up Python ${{ matrix.python_version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
python_version: ${{ matrix.python_version }} | ||
cache: 'pip' # caching pip dependencies | ||
|
||
- name: Install Python packages | ||
|
@@ -120,7 +120,7 @@ jobs: | |
# Every source of coverage reports needs a unique "flag name". | ||
# Construct one by smashing a few variables from the matrix together | ||
# here. | ||
COVERALLS_FLAG_NAME: "run-${{ matrix.os }}-${{ matrix.python-version }}" | ||
COVERALLS_FLAG_NAME: "run-${{ matrix.os }}-${{ matrix.python_version }}" | ||
# Mark the data as just one piece of many because we have more than | ||
# one instance of this job (Windows, macOS) which collects and | ||
# reports coverage. This is necessary to cause Coveralls to merge | ||
|
@@ -162,13 +162,13 @@ jobs: | |
- ubuntu-20.04 | ||
- macos-12 | ||
- windows-latest | ||
python-version: | ||
python_version: | ||
- "3.11" | ||
force-foolscap: | ||
- false | ||
include: | ||
- os: ubuntu-20.04 | ||
python-version: "3.12" | ||
python_version: "3.12" | ||
force-foolscap: true | ||
steps: | ||
|
||
|
@@ -179,7 +179,7 @@ jobs: | |
# TODO: See https://tahoe-lafs.org/trac/tahoe-lafs/ticket/3744. | ||
# We have to use an older version of Tor for running integration | ||
# tests on macOS. | ||
- name: Install Tor [macOS, ${{ matrix.python-version }} ] | ||
- name: Install Tor [macOS, ${{ matrix.python_version }} ] | ||
if: ${{ contains(matrix.os, 'macos') }} | ||
run: | | ||
brew install tor | ||
|
@@ -195,10 +195,10 @@ jobs: | |
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
- name: Set up Python ${{ matrix.python_version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
python_version: ${{ matrix.python_version }} | ||
cache: 'pip' # caching pip dependencies | ||
|
||
- name: Install Python packages | ||
|
@@ -236,6 +236,140 @@ jobs: | |
name: integration.eliot-${{ matrix.run-on }}.json | ||
path: integration.eliot.json | ||
|
||
systemtest: | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
image: | ||
- distro: "debian" | ||
tag: "11" | ||
python_version: "3.9" | ||
tox_environment: "py39" | ||
- distro: "ubuntu" | ||
tag: "20.04" | ||
python_version: "3.9" | ||
tox_environment: "py39" | ||
- distro: "ubuntu" | ||
tag: "22.04" | ||
python_version: "3.10" | ||
tox_environment: "py310" | ||
- distro: "fedora" | ||
tag: "35" | ||
python_version: "3.10" | ||
tox_environment: "py310" | ||
- distro: "oraclelinux" | ||
tag: "8" | ||
python_version: "3.9" | ||
tox_environment: "py39" | ||
env: | ||
CONTEXT: .circleci | ||
PREFIX: tahoelafsci | ||
TAG: ${{ matrix.image.tag }} | ||
PYTHON_VERSION: ${{ matrix.image.python_version }} | ||
DISTRO: ${{ matrix.image.distro }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Verify Docker | ||
run: | | ||
docker run --rm hello-world:latest > /dev/null | ||
docker rmi hello-world:latest > /dev/null | ||
docker version | ||
- name: Cache docker images | ||
uses: ScribeMD/[email protected] | ||
with: | ||
key: | | ||
docker-${{ matrix.image.distro }}_${{ matrix.image.tag }}-py${{ matrix.image.python_version }}-${{ hashFiles( | ||
format('{0}/Dockerfile.{1}', env.CONTEXT, matrix.image.distro) | ||
) }} | ||
- name: Build Docker image | ||
run: | | ||
docker images --filter "reference=${PREFIX}/${DISTRO}" | ||
docker images --filter "reference=${PREFIX}/${DISTRO}:${TAG}-py${PYTHON_VERSION}" \ | ||
--quiet | grep -v "^$" \ | ||
|| docker \ | ||
build \ | ||
--build-arg TAG=${TAG} \ | ||
--build-arg PYTHON_VERSION=${PYTHON_VERSION} \ | ||
-t ${PREFIX}/${DISTRO}:${TAG}-py${PYTHON_VERSION} \ | ||
-f ${CONTEXT}/Dockerfile.${DISTRO} \ | ||
. \ | ||
&& docker images --filter "reference=${PREFIX}/${DISTRO}" | ||
- name: Prepare environment variables | ||
run: | | ||
cat > secret-env-plain <<-EOF | ||
# In general, the test suite is not allowed to fail while the job | ||
# succeeds. But you can set this to "yes" if you want it to be | ||
# otherwise. | ||
ALLOWED_FAILURE="no" | ||
# Tell Hypothesis which configuration we want it to use. | ||
TAHOE_LAFS_HYPOTHESIS_PROFILE="ci" | ||
# Tell the C runtime things about character encoding (mainly to do with | ||
# filenames and argv). | ||
LANG="en_US.UTF-8" | ||
# Select a tox environment to run for this job. | ||
TAHOE_LAFS_TOX_ENVIRONMENT=${{ matrix.image.tox_environment }} | ||
# Additional arguments to pass to tox. | ||
TAHOE_LAFS_TOX_ARGS="" | ||
# The path in which test artifacts will be placed. | ||
ARTIFACTS_OUTPUT_PATH="/tmp/artifacts" | ||
# Convince all of our pip invocations to look at the cached wheelhouse | ||
# we maintain. | ||
WHEELHOUSE_PATH="/tmp/wheelhouse" | ||
PIP_FIND_LINKS="file:///tmp/wheelhouse" | ||
# Upload the coverage report. | ||
UPLOAD_COVERAGE="" | ||
EOF | ||
- name: Start the container | ||
id: run | ||
run: | | ||
CID=$(docker run \ | ||
--rm --tty --detach \ | ||
-v .:/tmp/project \ | ||
-w /tmp/project \ | ||
--env-file secret-env-plain \ | ||
"${PREFIX}/${DISTRO}:${TAG}-py${PYTHON_VERSION}" \ | ||
) | ||
docker exec $CID python3 -VV | ||
docker exec $CID env | ||
echo "cid=$CID" >> $GITHUB_OUTPUT | ||
- name: Setup virtualenv | ||
run: | | ||
docker exec \ | ||
${{ steps.run.outputs.cid }} \ | ||
/tmp/project/.circleci/setup-virtualenv.sh \ | ||
"/tmp/venv" \ | ||
"/tmp/project" \ | ||
"\${WHEELHOUSE_PATH}" \ | ||
"\${TAHOE_LAFS_TOX_ENVIRONMENT}" \ | ||
"\${TAHOE_LAFS_TOX_ARGS}" | ||
- name: Run test suite | ||
run: | | ||
docker exec \ | ||
${{ steps.run.outputs.cid }} \ | ||
/tmp/project/.circleci/run-tests.sh \ | ||
"/tmp/venv" \ | ||
"/tmp/project" \ | ||
"\${ALLOWED_FAILURE}" \ | ||
"\${ARTIFACTS_OUTPUT_PATH}" \ | ||
"\${TAHOE_LAFS_TOX_ENVIRONMENT}" \ | ||
"\${TAHOE_LAFS_TOX_ARGS}" | ||
timeout-minutes: 20 | ||
|
||
- name: Stop the container | ||
if: ${{ always() }} | ||
run: | | ||
docker stop --time 3 \ | ||
${{ steps.run.outputs.cid }} | ||
packaging: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
|
@@ -245,7 +379,7 @@ jobs: | |
- macos-12 | ||
- windows-latest | ||
- ubuntu-latest | ||
python-version: | ||
python_version: | ||
- 3.9 | ||
|
||
steps: | ||
|
@@ -255,10 +389,10 @@ jobs: | |
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
- name: Set up Python ${{ matrix.python_version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
python_version: ${{ matrix.python_version }} | ||
cache: 'pip' # caching pip dependencies | ||
|
||
- name: Install Python packages | ||
|
@@ -279,5 +413,5 @@ jobs: | |
- name: Upload PyInstaller package | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: Tahoe-LAFS-${{ matrix.os }}-Python-${{ matrix.python-version }} | ||
name: Tahoe-LAFS-${{ matrix.os }}-Python-${{ matrix.python_version }} | ||
path: dist/Tahoe-LAFS-*-*.* |
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