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

Merge upstream #6

Open
wants to merge 66 commits into
base: master
Choose a base branch
from
Open

Merge upstream #6

wants to merge 66 commits into from

Commits on Sep 21, 2023

  1. Use bookworm for building Docker image (Fixes DOMjudge#154)

    * Use Python venv to build domserver because Sphinx version should be
      6.1.0 or higher to avoid a build issue.
    * Use PHP 8.x because it's default in Debian.
    * Use libcgoup2 instead of libcgroup1, which is no longer available.
    tossy310 authored and vmcj committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    53b67e3 View commit details
    Browse the repository at this point in the history
  2. Fix shellcheck

    tossy310 authored and vmcj committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    cc9ad12 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    138ab77 View commit details
    Browse the repository at this point in the history

Commits on Oct 9, 2023

  1. Fixup PHP version to 8.?

    Fix PHP version in the PHP timezone configuration script, used to access PHP's configuration directory.
    agcom authored and nickygerritsen committed Oct 9, 2023
    Configuration menu
    Copy the full SHA
    65f98d7 View commit details
    Browse the repository at this point in the history

Commits on Nov 11, 2023

  1. Install lsof in judgehost containers

    Michael Vasseur authored and vmcj committed Nov 11, 2023
    Configuration menu
    Copy the full SHA
    be8721b View commit details
    Browse the repository at this point in the history

Commits on Dec 12, 2023

  1. Use --privileged instead of --cap-add=sys_admin due to build error

    Encountring the following errors with --cap-add=sys_admin inside the dj_make_chroot script; one inside the debootstrap, and the other somewhere inside the script itself:
    
    ...
    W: Failure trying to run: chroot "/chroot/domjudge" mount -t proc proc /proc
    W: See /chroot/domjudge/debootstrap/debootstrap.log for details
    ...
    mount: /chroot/domjudge/proc: cannot mount proc read-only.
           dmesg(1) may have more information after failed mount system call.
    ...
    
    The /chroot/domjudge/debootstrap/debootstrap.log does not exist nor the dmesg to investigate further (naive approach OFC).
    agcom authored and vmcj committed Dec 12, 2023
    Configuration menu
    Copy the full SHA
    c6b7e9d View commit details
    Browse the repository at this point in the history

Commits on Jan 3, 2024

  1. Integrate new PHP version for local development

    Make the image slightly smaller by removing the older PHP versions.
    Start using the latest version for faster PHP. In domjudge/domjudge CI
    we use the lowest supported one so we catch the whole spectrum.
    Michael Vasseur authored and vmcj committed Jan 3, 2024
    Configuration menu
    Copy the full SHA
    46d8f5a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a26b7a9 View commit details
    Browse the repository at this point in the history
  3. Mention new UID/GID in README

    As mentiond by @christopher.
    Michael Vasseur authored and vmcj committed Jan 3, 2024
    Configuration menu
    Copy the full SHA
    2c412ae View commit details
    Browse the repository at this point in the history

Commits on Jan 7, 2024

  1. Removing breaking part from CI

    We fail on an error with libc-bin:
    https://gitlab.com/DOMjudge/domjudge-packaging/-/jobs/5876287000
    
    I got this working in GitHub Actions already so we disable this here and
    fix this in GHA.
    Michael Vasseur authored and vmcj committed Jan 7, 2024
    Configuration menu
    Copy the full SHA
    12cb080 View commit details
    Browse the repository at this point in the history

Commits on Jan 8, 2024

  1. Upgrade gitlabci container to ubuntu 22.04 (jammy)

    The default for PHP changes to 8.1. The package php8.1-json is now already provided
    by both php8.1-{fpm,cli} and became virtual.
    
    The npm pa11y tool is now install globally as npm changed its working,
    given that we run this in CI as either domjudge or root having it
    globally is actually better.
    vmcj committed Jan 8, 2024
    Configuration menu
    Copy the full SHA
    c51e4f7 View commit details
    Browse the repository at this point in the history

Commits on Jan 12, 2024

  1. Move creation of GitLab container to GitHub Actions

    Although we duplicate code now, the intent is so much easier to follow
    vmcj committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    69e41f6 View commit details
    Browse the repository at this point in the history

Commits on Jan 15, 2024

  1. Remove forgotten file

    vmcj committed Jan 15, 2024
    Configuration menu
    Copy the full SHA
    da865fb View commit details
    Browse the repository at this point in the history
  2. Move contributor image creation to GitHub actions

    We could speed this up with creating the amd64 image in parallel but the
    bottleneck is always the arm64 as GitHub doesn't seem to have arm
    runners available yet.
    
    We now create a PR image which can be tested before in case this is
    needed.
    vmcj committed Jan 15, 2024
    Configuration menu
    Copy the full SHA
    88b9604 View commit details
    Browse the repository at this point in the history
  3. Create action for docker build scripts

    The PRs for changes to those scripts will be stored in the registry
    of the user/organisation which forked or in our GitHub docker registry
    if this branch is under the domjudge organization. Here we always build
    against our latest version.
    
    The GitLab code had the option to not push the latest tag, for when we
    rebuild an older container, otherwise we always release against the
    overwritten value or if nothing was provided against the latest released
    tag (so which latest points to). The code for world readable files has
    been kept.
    
    Our build script is extended to now also have an option to push to
    another organization/namespace so we can push the image to the github
    container registry of the person doing the PR.
    
    As we don't do this often we explicit clean the github runner of older
    versions to make sure we always build against the latest image available
    of our dependencies and don't encounter the earlier builds if a PR is
    done more often (to fix something for example).
    
    The image can be locally tested by looking at the special tag based on
    the branchname/issue_number.
    vmcj committed Jan 15, 2024
    Configuration menu
    Copy the full SHA
    8944e11 View commit details
    Browse the repository at this point in the history

Commits on Jan 18, 2024

  1. Repair the release

    The repo was not properly quoted and the github.ref has another format with direct push.
    The push should be done without the tag after the image.
    
    Push resulting image to our DOMjudge GitHub container registry
    
    Alternative is to push to the own doing the PR, but they would be able
    to push another image to have the risk that in theory we test another PR
    than was used in the code from the PR.
    
    It seems to try to push the latest tag so make which tag pushed
    explicit.
    Michael Vasseur authored and vmcj committed Jan 18, 2024
    Configuration menu
    Copy the full SHA
    0f87362 View commit details
    Browse the repository at this point in the history

Commits on Feb 3, 2024

  1. Use the correct variables

    Michael Vasseur authored and vmcj committed Feb 3, 2024
    Configuration menu
    Copy the full SHA
    41d0d0d View commit details
    Browse the repository at this point in the history
  2. Keep consistent in naming

    Michael Vasseur authored and vmcj committed Feb 3, 2024
    Configuration menu
    Copy the full SHA
    9c0247e View commit details
    Browse the repository at this point in the history
  3. Clarify which registry is used

    - PRs/branches: ghcr
    - merged: DockerHub
    Michael Vasseur authored and vmcj committed Feb 3, 2024
    Configuration menu
    Copy the full SHA
    da759fc View commit details
    Browse the repository at this point in the history
  4. Don't run this on branches in our own org

    We would trigger both on push and pull_request, skip the 2nd one.
    
    So we either run when this is a push in our organisation but not to
    main,
    OR if this is a pull_request from another organisation/user to
    domjudge_org.
    Michael Vasseur authored and vmcj committed Feb 3, 2024
    Configuration menu
    Copy the full SHA
    c255021 View commit details
    Browse the repository at this point in the history
  5. Don't build release image on PRs

    When we push to our own organization this would trigger. As we only care
    for the push target in our own repo this is much easier. If someone
    would for they would need to change this but that is up to them.
    Michael Vasseur authored and vmcj committed Feb 3, 2024
    Configuration menu
    Copy the full SHA
    22ab830 View commit details
    Browse the repository at this point in the history
  6. Run {group,user}mod as root

    This broke when the container user changed from root -> domjudge and not all actions as root were prefixed with sudo.
    vmcj committed Feb 3, 2024
    Configuration menu
    Copy the full SHA
    c514814 View commit details
    Browse the repository at this point in the history
  7. Use lowercase github organization name

    Michael Vasseur authored and vmcj committed Feb 3, 2024
    Configuration menu
    Copy the full SHA
    d54511a View commit details
    Browse the repository at this point in the history
  8. GitHub CI does not runs on ubuntu instead of alpine

    Michael Vasseur authored and vmcj committed Feb 3, 2024
    Configuration menu
    Copy the full SHA
    3ee0b23 View commit details
    Browse the repository at this point in the history
  9. Don't run the PR job on merge-queue

    The branchname would become something hard to read and the branchname
    chosen by the contributor should already have an image as we work from a
    PR.
    Michael Vasseur authored and vmcj committed Feb 3, 2024
    Configuration menu
    Copy the full SHA
    d5b5527 View commit details
    Browse the repository at this point in the history
  10. Detect mergequeue branch in another way

    Building the image for the readonly branch is not needed as we already
    know this should work in the PR, only if someone would force merging
    before the CI passes we would need this.
    Michael Vasseur authored and vmcj committed Feb 3, 2024
    Configuration menu
    Copy the full SHA
    427e087 View commit details
    Browse the repository at this point in the history

Commits on Feb 7, 2024

  1. Add instructions for setting up Traefik in Docker

    Include an example which sets up a Traefik reverse proxy in Docker,
    including ACME for automated https certificate management. The
    deprecated and legacy `--link` flag of run commands is replaced with
    Docker networks in all run commands.
    Kevinjil authored and vmcj committed Feb 7, 2024
    Configuration menu
    Copy the full SHA
    62889e1 View commit details
    Browse the repository at this point in the history

Commits on Mar 21, 2024

  1. Always use the latest tag

    In the past we would search for the last pushed which would with
    semantic versioning be the same, this makes more sense IMHO.
    vmcj committed Mar 21, 2024
    Configuration menu
    Copy the full SHA
    43982ab View commit details
    Browse the repository at this point in the history

Commits on Mar 22, 2024

  1. Find latest version tag which exists on domjudge.org

    We can't use latest as there is no release on domjudge.org with that
    name, but this makes atleast clear which index we try to get.
    
    This reverts commit 43982ab and
    improves on it.
    vmcj committed Mar 22, 2024
    Configuration menu
    Copy the full SHA
    c6dae90 View commit details
    Browse the repository at this point in the history

Commits on Apr 26, 2024

  1. Use latest ubuntu for maintainer container

    Michael Vasseur authored and vmcj committed Apr 26, 2024
    Configuration menu
    Copy the full SHA
    34fe46a View commit details
    Browse the repository at this point in the history

Commits on Apr 27, 2024

  1. Rebuild the contributor image every friday morning

    This was tried in the past but failed for some of our images, so this is
    the first check to make this work again.
    Michael Vasseur authored and vmcj committed Apr 27, 2024
    Configuration menu
    Copy the full SHA
    16c3a06 View commit details
    Browse the repository at this point in the history

Commits on Apr 28, 2024

  1. Fix build of gitlab container

    This is hard to test but uses the newer action which should have a newer
    version of node. Also added the automatic weekly rebuild of the image.
    Michael Vasseur authored and vmcj committed Apr 28, 2024
    Configuration menu
    Copy the full SHA
    940500e View commit details
    Browse the repository at this point in the history
  2. Upgrade gitlab image to 24.04

    Also removed some unneeded packages as we don't run those tests anymore.
    We need some extra changes for the pa11y now as the chrome-browser gets
    installed in an unreachable location for the domjudge user.
    Also download the latest dictionary file now as we use the system
    codespell now.
    Composer is now again in the ubuntu repo's so we reverted to using that
    one.
    Michael Vasseur authored and vmcj committed Apr 28, 2024
    Configuration menu
    Copy the full SHA
    7c8d5b9 View commit details
    Browse the repository at this point in the history

Commits on Apr 30, 2024

  1. Add PHP version of 22.04 image

    We didn't install that version after the last upgrade.
    Michael Vasseur authored and vmcj committed Apr 30, 2024
    Configuration menu
    Copy the full SHA
    4ffd7bc View commit details
    Browse the repository at this point in the history
  2. Rename image to new ubuntu version

    This means we published a gitlabci container 22.04 which was actually
    24.04.
    Michael Vasseur authored and vmcj committed Apr 30, 2024
    Configuration menu
    Copy the full SHA
    e1fcd78 View commit details
    Browse the repository at this point in the history

Commits on Jun 1, 2024

  1. Show "Run workflow" button

    Michael Vasseur authored and vmcj committed Jun 1, 2024
    Configuration menu
    Copy the full SHA
    b58c97b View commit details
    Browse the repository at this point in the history

Commits on Jun 3, 2024

  1. Annotate GitHub actions log

    The current build fails and the log is very hard to read
    Michael Vasseur authored and vmcj committed Jun 3, 2024
    Configuration menu
    Copy the full SHA
    8ee3377 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1a89f09 View commit details
    Browse the repository at this point in the history
  3. Don't store the resulting image for PRs

    Moving this out of the security scope of the repository would make that
    we need to store this for the `github.author`. As we never used this
    before it's now taken out.
    Michael Vasseur authored and vmcj committed Jun 3, 2024
    Configuration menu
    Copy the full SHA
    a2a06fb View commit details
    Browse the repository at this point in the history
  4. Actually trigger the workflow for PRs

    The workflows did not always trigger for PRs versus normal pushes.
    Michael Vasseur authored and vmcj committed Jun 3, 2024
    Configuration menu
    Copy the full SHA
    58d6a0a View commit details
    Browse the repository at this point in the history
  5. Only run when a file has changed

    Michael Vasseur authored and vmcj committed Jun 3, 2024
    Configuration menu
    Copy the full SHA
    49329b5 View commit details
    Browse the repository at this point in the history
  6. Install pkg-config to detect systemd files locations

    Michael Vasseur authored and vmcj committed Jun 3, 2024
    Configuration menu
    Copy the full SHA
    5c48773 View commit details
    Browse the repository at this point in the history
  7. Also add pkg-config for the intermediate build

    Michael Vasseur authored and vmcj committed Jun 3, 2024
    Configuration menu
    Copy the full SHA
    57bbd8f View commit details
    Browse the repository at this point in the history

Commits on Jul 7, 2024

  1. Don't mount the cgroup as read-only

    Fixes: DOMjudge#193
    
    I wonder why we never had this in the past as we do intent to create the domjudge cgroup in that directory.
    vmcj committed Jul 7, 2024
    Configuration menu
    Copy the full SHA
    2608426 View commit details
    Browse the repository at this point in the history

Commits on Jul 9, 2024

  1. Switch from 'apt' back to 'apt-get'

    The newer 'apt' command is recommended for interactive use, but not
    for scripts. Running 'apt' non-interactively produces the following
    message:
    
        WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
    tom93 authored and vmcj committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    7d40d40 View commit details
    Browse the repository at this point in the history
  2. Remove redundant 'apt-get install ca-certificates'

    That package is already installed earlier in the same file.
    tom93 authored and vmcj committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    986b352 View commit details
    Browse the repository at this point in the history
  3. Restore rm /var/lib/apt/lists in docker-gitlabci/Dockerfile

    It was removed as part of commit 7c8d5b9 (Upgrade gitlab image to
    24.04, 2024-04-28), but it should be kept to reduce the size of the
    image (if the lists aren't removed in the same RUN directive as
    `apt-get update` then they will be stored in the layer and make the
    image larger, even if a later RUN directive removes the lists).
    tom93 authored and vmcj committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    d60e5e5 View commit details
    Browse the repository at this point in the history
  4. Remove apt lists after 'apt-get update' in docker-contributor/Dockerfile

    We already do this in all other places. It reduces the size of the
    image.
    
    (Note that the 'rm' command has to be done in the same RUN instruction
    as 'apt-get update', otherwise the lists will still be stored in the
    intermediate layers. So some of the RUN instructions had to be
    merged.)
    tom93 authored and vmcj committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    d1da7b7 View commit details
    Browse the repository at this point in the history

Commits on Aug 2, 2024

  1. Clean up docker/build.sh

     - Move usage check to the top, to serve as documentation for people
       who read the script.
    
     - Remove `-x` from shebang line (#!), to only enable tracing in CI.
    
     - Fix `set -x` call (previously it was inside the `if` condition,
       which is wrong).
    
     - Remove PS4 variable (which adds info to the trace) because sh does
       not support LINENO, and the rest of the info is not that useful.
    
     - Inline `trace_off` into section_start and section_end to produce
       less noise in the trace. (The "section_start" lines will still be
       displayed though. Hiding them is tricky; see
       DOMjudge/domjudge/gitlab/integration.sh for an example, but note
       that it requires bash for `shopt -s expand_aliases`.)
    
     - Make the no-op placeholders for section_start and section_end
       produce less noise in the trace.
    
     - Redirect stderr to stdout as a workaround for a GitHub Actions
       issue that causes them to appear out-of-order.
    
     - Simplify initialisation of NAMESPACE variable to make the trace
       look nicer.
    
     - Put the variable assignments in a log group to make it look nicer.
    
     - Fix the invocation of build.sh in the build-domjudge-container-*
       workflows to use `./build.sh` rather than `sh ./build.sh` so that
       the options in the shebang line will be respected. Also remove
       unnecessary calls to `set -x` in the workflows.
    tom93 authored and vmcj committed Aug 2, 2024
    Configuration menu
    Copy the full SHA
    a2b0824 View commit details
    Browse the repository at this point in the history
  2. Remove obsolete reference to --link from docker/README.md

    Commit 62889e1 (Add instructions for setting up Traefik in Docker,
    2024-02-06) switched from the legacy `--link` option to a user-defined
    bridge network (`--net`).
    tom93 authored and vmcj committed Aug 2, 2024
    Configuration menu
    Copy the full SHA
    b2ccd49 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    3a56ee9 View commit details
    Browse the repository at this point in the history
  4. Switch to headless JDK

    This is what the manual now suggests, and it's more consistent with
    dj_make_chroot which uses default-jre-headless.
    
    Not updating debian/control and live-image/install.sh for now because
    they are legacy or currently untested.
    tom93 authored and vmcj committed Aug 2, 2024
    Configuration menu
    Copy the full SHA
    5c995f5 View commit details
    Browse the repository at this point in the history

Commits on Aug 4, 2024

  1. Preserve ownership of /opt/domjudge set by make install-*

    Previously, the DOMjudge Docker scripts changed the ownership of
    /opt/domjudge to "domjudge" recursively, overriding the ownership set
    by the DOMjudge installation commands (`make install-domserver` and
    `make install-judgehost`), which mostly set the owner to "root".
    
    It is unclear why the Docker scripts did that, since the DOMjudge
    installation commands should be responsible for installing with the
    correct ownership.
    
    This commit removes the `chown -R` calls from the Docker scripts in
    order to preserve the ownership set by the DOMjudge installation
    commands and avoid security issues.
    
    Note that the new behaviour is slightly fragile because it relies on
    Docker's `COPY --from` directive to preserve the ownership when
    copying files between build stages, and that only works if the
    numerical user and group IDs are the same. We plan to add a check that
    the IDs are the same.
    tom93 authored and vmcj committed Aug 4, 2024
    Configuration menu
    Copy the full SHA
    b6ae271 View commit details
    Browse the repository at this point in the history
  2. Drop support for building containers DOMjudge <8.0

    We assume PHP8 already in the scripts, so I suspect this did not work
    anymore. When someone wants such an older version they can still check
    the history for the current files and alter the setup from there.
    Michael Vasseur authored and vmcj committed Aug 4, 2024
    Configuration menu
    Copy the full SHA
    2cb7eb9 View commit details
    Browse the repository at this point in the history

Commits on Aug 25, 2024

  1. Install all tools for pa11y as domjudge user

    The CI broke as the cache only knows of an older version of Chrome.
    Michael Vasseur authored and vmcj committed Aug 25, 2024
    Configuration menu
    Copy the full SHA
    3009a17 View commit details
    Browse the repository at this point in the history

Commits on Aug 26, 2024

  1. Trigger on PRs

    vmcj committed Aug 26, 2024
    Configuration menu
    Copy the full SHA
    9c84b13 View commit details
    Browse the repository at this point in the history
  2. Create the user before installing the tools as that user

    Also actually cleanup the cache, there is another better method for that
    but I'll leave that for another PR.
    vmcj committed Aug 26, 2024
    Configuration menu
    Copy the full SHA
    55881c8 View commit details
    Browse the repository at this point in the history

Commits on Oct 20, 2024

  1. Install tools for dumping the database

    Michael Vasseur authored and vmcj committed Oct 20, 2024
    Configuration menu
    Copy the full SHA
    914a501 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4983ddc View commit details
    Browse the repository at this point in the history

Commits on Oct 21, 2024

  1. Add Apache2 configuration to docker-contributor

    Adding configuration for Apache2 enables easier testing of
    webserver-specific features and issues.
    
    By default, the contributor image still uses NGINX as webserver. Add an
    option to use Apache2 by default, or switch back and forth between
    NGINX/Apache2 with the `switch-webserver` command.
    Kevinjil committed Oct 21, 2024
    Configuration menu
    Copy the full SHA
    6283816 View commit details
    Browse the repository at this point in the history

Commits on Oct 23, 2024

  1. Allow deletion of default config to fail

    If the container is restarted, the configuration file does not exist. Do
    not fail the `rm` command if the file could not be removed to ensure
    idempotency of the Apache2 configuration part.
    
    Fixes an issue introduced in 6283816.
    Kevinjil committed Oct 23, 2024
    Configuration menu
    Copy the full SHA
    b291368 View commit details
    Browse the repository at this point in the history

Commits on Nov 15, 2024

  1. Merge remote-tracking branch 'upstream/main' into merge-upstream

    NOTE: Might need cgroupv2 apt package
    07joshua03 committed Nov 15, 2024
    Configuration menu
    Copy the full SHA
    1951d97 View commit details
    Browse the repository at this point in the history

Commits on Nov 18, 2024

  1. Configuration menu
    Copy the full SHA
    4d466c7 View commit details
    Browse the repository at this point in the history

Commits on Nov 20, 2024

  1. Configuration menu
    Copy the full SHA
    78ae198 View commit details
    Browse the repository at this point in the history
  2. Revert "Change java version to OpenJDK 17"

    This reverts commit 78ae198.
    07joshua03 committed Nov 20, 2024
    Configuration menu
    Copy the full SHA
    fbb8915 View commit details
    Browse the repository at this point in the history
  3. Lock OpenJDK version 21

    07joshua03 committed Nov 20, 2024
    Configuration menu
    Copy the full SHA
    7a6b9e1 View commit details
    Browse the repository at this point in the history