fix(infra): consolidate MinIO training secret, put output PVC under G… - #38
Merged
Conversation
…itOps Two secrets were carrying MinIO credentials for the same purpose in deephorizon-ml: minio-ml (ml-team, referenced by the ML squad's Job manifests) and minio-ml-credentials (ml-trainer, referenced by our runbook template). Carrying one credential under two names guarantees that a rotation misses one of them. - Runbook and example Job now use minio-ml with access_key/secret_key, matching the naming the ML squad's manifests already expect. - The user is ml-trainer, not ml-team. ml-team is an account people also use directly; when its password rotates, training Jobs would break silently with nothing tying the failure to the change. Service identity is kept separate from human identity so the two rotate independently. The runbook now states this and includes the three-way MinIO check (read allowed, write denied, out-of-scope denied). - training-outputs-pvc moves into GitOps as infra/k8s/ml-training/, tracked by a new apps/ml-training.yaml Application. It was applied by hand and would not survive a cluster rebuild. The PVC carries Prune=false: deleting it would take out the intermediate state of a running training run. - Training Jobs deliberately stay out of GitOps. Each run is ad-hoc with its own name and hyperparameters; handing them to Argo CD would recreate finished runs or prune a run in progress. Documented in both the Application manifest and the runbook. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
fix(infra): consolidate MinIO training secret, put output PVC under GitOps
Cause
Two secrets in
deephorizon-mlwere carrying MinIO credentials for the samepurpose:
minio-ml(userml-team, referenced by the ML squad's Jobmanifests) and
minio-ml-credentials(userml-trainer, referenced by ourrunbook template). Carrying one credential under two names guarantees a
rotation eventually misses one.
The user mattered more than the name.
ml-teamis an account people also usedirectly with
mc/boto3; it is on the rotation list. The day its passwordchanges, every training Job breaks — with nothing in the failure tying it back
to the rotation.
Separately,
training-outputs-pvchad been applied by hand and existednowhere in Git, so it would not survive a cluster rebuild.
Changes
minio-mlwithaccess_key/secret_key, matching the naming the ML squad's manifestsalready use. Adopting their names rather than ours means fewer places change.
ml-trainer— a read-only account (ml-readpolicy)opened solely for training. The runbook now explains why service identity is
kept separate from human identity, and includes the three-way MinIO check
(read allowed, write denied, out-of-scope denied) from
DEVOPS.mdAdd UNet encoder and decoder blocks #8.training-outputs-pvcmoves intoinfra/k8s/ml-training/, tracked by a newapps/ml-training.yamlApplication. The PVC carriesargocd.argoproj.io/sync-options: Prune=false— deleting it would take outthe intermediate state of a run in progress.
its own name and hyperparameters; handing them to Argo CD would recreate
finished runs or prune one still going. This is now stated in both the
Application manifest and the runbook.
Testing
ml-trainerverified against MinIO with the three-way check before the secretwas switched. A 100-epoch baseline run is currently training on the L40S using
these credentials — GPU at 100%, 7.7 GiB VRAM.
The PVC spec is copied verbatim from what is already applied in the cluster, so
Argo CD adopts the existing object rather than replacing it.
Note for whoever merges
ml/featureThat branch predates the technology-based manifest reorganisation and still
carries
infra/k8s/ml/kustomization.yaml, which listsnamespace.yaml,postgres.yaml, andmlflow.yaml. Merging it as-is resurrectsinfra/k8s/ml/alongside the currentinfra/k8s/mlflow/andinfra/k8s/postgresql/mlflow/— a second, stale copy of the MLflow andPostgres definitions. No Application points there, so nothing applies it
automatically, but anyone running
kubectl apply -k infra/k8s/ml/wouldoverwrite the live MLflow with the old version. That directory should be
deleted on
ml/featurebefore the merge.