Install project in Dockerfile so the access CLI is on PATH#439
Merged
Conversation
The new click-based CLI is declared in setup.py via:
entry_points = {
'console_scripts': ['access = api.manage:cli'],
}
but the Dockerfile only ran 'pip install -r requirements.txt' and never
installed the project itself, so '/usr/local/bin/access' was never
created. examples/kubernetes/cron-job-*.yaml use 'command: [access,
sync]' / 'command: [access, notify]' and would fail with 'StartError
exit code 128' (OCI runtime can't exec the missing binary).
Copy setup.py into the build context and 'pip install --no-deps .' so
the console script is installed. --no-deps preserves the pinned
versions from requirements.txt as the source of truth (setup.py uses
loose constraints).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 tasks
eguerrant
approved these changes
May 11, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
After the FastAPI migration in #425 the click-based CLI is declared in
setup.pyvia:but the production
Dockerfileonly runspip install -r ./api/requirements.txtand never installs the project itself, so theaccessconsole script is never created at/usr/local/bin/access. As a result, the CronJob examples inexamples/kubernetes/cron-job-*.yaml(which usecommand: ["access", "sync"]/["access", "notify", ...]) fail at startup withStartError exit code 128— the OCI runtime can't exec a binary that isn't onPATH.This PR copies
setup.pyinto the build context and runspip install --no-deps .after the requirements install.--no-depspreserves the pinned versions inrequirements.txtas the source of truth for runtime deps (theinstall_requiresinsetup.pyuses looser constraints).Test plan
docker build --target false -t access-test:local .succeeds locally; pip buildsaccess-2.0-py3-none-any.whlfrom the in-treesetup.pyand installs it cleanly with--no-deps.which accessreturns/usr/local/bin/accessandaccess --helplists the full click command tree (fix-role-memberships,fix-unmanaged-groups,import-from-okta,init,init-builtin-apps,notify,sync,sync-app-group-memberships). Subcommand help (access sync --help,access notify --help) shows the expected flags including--sync-group-memberships-authoritatively,--owner, and--role-owner.CMDis unchanged, sogunicorn ... api.asgi:appcontinues to launch the web app exactly as before.examples/kubernetes/cron-job-*.yamlCronJobs runs to completion against the rebuilt image (consumer-side verification; not exercised here).