feat(ci): Add bentoctl Dockerfile and build/publish workflow - #360
feat(ci): Add bentoctl Dockerfile and build/publish workflow#360nehan-p wants to merge 10 commits into
Conversation
v-rocheleau
left a comment
There was a problem hiding this comment.
Small request, otherwise looks good!
v-rocheleau
left a comment
There was a problem hiding this comment.
1 small change, otherwise lgtm!
|
LGTM! Nice work Not approving right now just because I want to wait before merging to see if we ship this with the next release. |
v-rocheleau
left a comment
There was a problem hiding this comment.
One small change request.
Testing the full pipeline now with published bentoctl images
| if e.status != 404: | ||
| raise | ||
| k8s_client.create_namespaced_secret( | ||
| namespace="default", |
There was a problem hiding this comment.
request: just realised, we need a way to specify the namespace for secrets creation via an env variable.
We can default to "default" for dev use cases, but in prod clusters the services will not be deployed in the default namespace. The ServiceAccount, ClusterRole, etc will need to be adapted to that namespace as well in a prod cluster.
I suggest we use this env var BENTO_K8S_NAMESPACE for this and use this value here.
Adds a Dockerfile and GitHub Actions workflow to build and publish
bentoctlas a Docker image, so it can be used as a k8s Job image to runbentoctl init-authfor Keycloak initialization.Dockerfile: Python 3.14 base image, installs the Docker CLI and compose plugin via Docker's official apt repo (Debian'sdocker.iopackage doesn't ship a client binary), copies inlib/and the compose files sinceconfig.pyrunsdocker compose configat import time, sets up a venv, and creates abentoctlshell aliasdev.Dockerfile: mirrorsDockerfileminus thepy_bentoctlsource copy, since dev images should have dependencies pre-built with the source mounted in as a volume for local iteration.github/workflows/build.yml: builds and smoke-tests both the main and dev images, then publishes toghcr.io/bento-platform/bentoctlviabento_build_actionon pushes/PRs tomainand published releasesinit-auth's hard dependency on a Docker daemon (fix(bentoctl): init-auth external provider #361):docker_clientis now optional inauth_helper.py,entry.pyonly builds a Docker client whenBENTOV2_USE_EXTERNAL_IDPis false, and a newBENTOV2_AUTH_CREATE_TEST_USERenv var allows test user creation to be forced on for external IdPsconfig.py: service enumeration viadocker compose configran unconditionally at import time and crashed without a full local Compose environment. Adds a newBENTO_PLATFORMenv var (docker/kubernetes) to skip this when not running under Docker ComposeTesting: Built and ran both images locally, confirming the smoke test passes with exit code 0 for each. Also rebuilt the image with the
init-authfixes and confirmedbentoctl init-authno longer crashes ondocker.from_env()ordocker compose configwhen run withBENTOV2_USE_EXTERNAL_IDP=trueandBENTO_PLATFORM=kubernetes— it proceeds into the real Keycloak auth flow and successfully reaches the point of making an authenticated request against a live Keycloak instance.Closes #359
Closes #361