Skip to content

ci: test Kerberos authenticator without Hadoop - #941

Open
GorML wants to merge 1 commit into
dask:mainfrom
GorML:kerberos-ci
Open

ci: test Kerberos authenticator without Hadoop#941
GorML wants to merge 1 commit into
dask:mainfrom
GorML:kerberos-ci

Conversation

@GorML

@GorML GorML commented Jul 20, 2026

Copy link
Copy Markdown

Closes #924

We use dask-gateway with Kerberos authentication at my company, so I decided
to try bringing this test coverage back.

Since #923 removed the Hadoop/YARN backend from CI, test_kerberos_auth has
been skipped unconditionally: it was gated on TEST_DASK_GATEWAY_YARN and
relied on the KDC, hostname and keytab of the old Hadoop container.

This PR restores real CI coverage of the Kerberos authenticator without
bringing back the unsupported Hadoop/YARN image:

  • The test now creates its own ephemeral MIT Kerberos realm with
    k5test (a small test-only library from
    the python-gssapi org), so no external KDC is needed. It is gated on a new
    TEST_DASK_GATEWAY_KERBEROS env var, and when that is set there is no
    skip path — missing dependencies fail the job instead of silently
    skipping the test.
  • A new kerberos-tests CI job installs MIT Kerberos from apt, builds
    pykerberos via the [kerberos] extras, and runs the test (~2 minutes).
  • Comments in tests/requirements.txt updated to match.

No production code changes.

Some verification beyond CI being green here:

  • 30 back-to-back runs in a clean Ubuntu 24.04 container, no flakiness.
  • Breaking the HTTP/<hostname> service principal on purpose makes the test
    fail with "Server not found in Kerberos database", so the test really
    exercises the handshake and can't pass by accident.
  • The kerberos job passed 3/3 times on GitHub-hosted runners in my fork.
  • Without kerberos packages and the env var the test still skips cleanly, so
    the regular test matrix is unaffected.

Unrelated notes:

  • The local backend and pbs/slurm backend jobs currently fail on
    main for reasons unrelated to this PR (missing dask-scheduler CLI with
    latest distributed; pillow sdist build without gcc in the CI containers).
    Happy to open separate issues for those.
  • continuous_integration/docker/hadoop/ is orphaned since docs/ci: declare hadoop/yarn backend not supported, stop testing #923 and could
    be removed in a follow-up.

The Kerberos authenticator test was gated on the Hadoop/YARN CI
environment removed in dask#923 and has been skipped ever since. Recreate
the coverage with a self-contained setup: an ephemeral MIT Kerberos
realm managed by k5test directly on the runner, exercising the real
client/server SPNEGO handshake against the existing authenticator code.

- tests/test_auth.py: gate the test on TEST_DASK_GATEWAY_KERBEROS and
  create the realm, HTTP service principal, and keytab in a fixture
  instead of relying on the Hadoop container's KDC
- .github/workflows/test.yaml: add a kerberos-tests job
- tests/requirements.txt: update the Kerberos testing docs
@consideRatio

Copy link
Copy Markdown
Collaborator

Thank you for adressing this, we have another ci failure on main branch - so the failures may very well be unrelated.

This PR seems very reasonable though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: no longer testing kerberos authenticator

2 participants