-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Watchtower charts #336
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
base: main
Are you sure you want to change the base?
Changes from 5 commits
2226284
7e89c8a
82dda3b
033a064
422b9c8
4e7e3fe
d33e2ac
b438112
0fdfd4e
9e63a33
85f14e4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,6 +17,8 @@ limitations under the License. | |
| package v2 | ||
|
|
||
| import ( | ||
| "strings" | ||
|
|
||
| corev1 "k8s.io/api/core/v1" | ||
| metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
| ) | ||
|
|
@@ -138,8 +140,63 @@ type WeightsAndBiasesSpec struct { | |
| // Networking configures how the W&B application is exposed externally. | ||
| // +optional | ||
| Networking NetworkingSpec `json:"networking,omitempty"` | ||
|
|
||
| Watchtower WatchtowerSpec `json:"watchtower,omitempty"` | ||
| } | ||
|
|
||
| type WatchtowerSpec struct { | ||
| Install *bool `json:"install,omitempty"` | ||
| Image WatchtowerImageSpec `json:"image,omitempty"` | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think all we should expose to the user is an install boolean in the wandb section called AdminConsoleEnabled or something to that effect, and the rest of these values should be derived.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In general I would like to avoid specifically adding specific reference to watchtower in the CR |
||
| BasePath string `json:"basePath,omitempty"` | ||
| AuthService string `json:"authService,omitempty"` | ||
| Resources corev1.ResourceRequirements `json:"resources,omitempty"` | ||
| ServiceAccount ManagedServiceAccountSpec `json:"serviceAccount,omitempty"` | ||
| } | ||
|
|
||
| type WatchtowerImageSpec struct { | ||
| // +optional | ||
| Repository string `json:"repository,omitempty"` | ||
| // +optional | ||
| Tag string `json:"tag,omitempty"` | ||
| // +optional | ||
| Digest string `json:"digest,omitempty"` | ||
| } | ||
|
|
||
| func (s WatchtowerSpec) ResolvedBasePath() string { | ||
| basePath := s.BasePath | ||
| if basePath == "" { | ||
| basePath = DefaultWatchtowerBasePath | ||
| } | ||
| if !strings.HasPrefix(basePath, "/") { | ||
| basePath = "/" + basePath | ||
| } | ||
| return strings.TrimSuffix(basePath, "/") | ||
| } | ||
|
|
||
| // GetImage returns an explicitly configured Watchtower image, or "" when none is | ||
| // set. Empty is the normal case. Binary shisp inside the operator's own image | ||
| func (s WatchtowerSpec) GetImage(globalImageRegistry string) string { | ||
| if s.Image.Repository == "" { | ||
| return "" | ||
| } | ||
| repository := s.Image.Repository | ||
| if globalImageRegistry != "" { | ||
| repository = globalImageRegistry + "/" + repository | ||
| } | ||
| if s.Image.Digest != "" { | ||
| return repository + "@" + s.Image.Digest | ||
| } | ||
| if s.Image.Tag != "" { | ||
| return repository + ":" + s.Image.Tag | ||
| } | ||
| return repository | ||
| } | ||
|
|
||
| const ( | ||
| DefaultWatchtowerBasePath = "/watchtower" | ||
| DefaultWatchtowerServiceAccountName = "wandb-watchtower" | ||
| ) | ||
|
|
||
| // GlobalSpec holds settings shared across every managed component. | ||
| type GlobalSpec struct { | ||
| // ImageRegistry, when set, retargets the container images to this registry. | ||
|
|
@@ -176,6 +233,10 @@ type GlobalSpec struct { | |
| Proxy *ProxySpec `json:"proxy,omitempty"` | ||
| } | ||
|
|
||
| func (w *WeightsAndBiases) WatchtowerEnabled() bool { | ||
| return w.Spec.Watchtower.Install != nil && *w.Spec.Watchtower.Install | ||
| } | ||
|
|
||
| // ProxySpec is the forward-proxy configuration under spec.global.proxy. | ||
| type ProxySpec struct { | ||
| // HTTPProxy is the proxy URL for plain HTTP egress (HTTP_PROXY/http_proxy). | ||
|
|
@@ -854,7 +915,15 @@ type WeightsAndBiasesStatus struct { | |
| // +optional | ||
| GatewayStatus *GatewayStatusSummary `json:"gatewayStatus,omitempty"` | ||
| // +optional | ||
| IngressStatus *IngressStatusSummary `json:"ingressStatus,omitempty"` | ||
| IngressStatus *IngressStatusSummary `json:"ingressStatus,omitempty"` | ||
| WatchtowerStatus *WatchtowerStatusSummary `json:"watchtowerStatus,omitempty"` | ||
| } | ||
|
|
||
| type WatchtowerStatusSummary struct { | ||
| Ready bool `json:"ready"` | ||
| URL string `json:"url,omitempty"` | ||
| Image string `json:"image,omitempty"` | ||
| AuthService string `json:"authService,omitempty"` | ||
| } | ||
|
|
||
| type GatewayStatusSummary struct { | ||
|
|
@@ -867,6 +936,7 @@ type GatewayStatusSummary struct { | |
| type IngressStatusSummary struct { | ||
| Name string `json:"name,omitempty"` | ||
| LoadBalancerIngress []corev1.LoadBalancerIngress `json:"loadBalancerIngress,omitempty"` | ||
| Ready bool `json:"ready"` | ||
| } | ||
|
|
||
| type WandbStatus struct { | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift
🧩 Analysis chain
🏁 Script executed:
Repository: wandb/operator
Length of output: 49148
🏁 Script executed:
Repository: wandb/operator
Length of output: 11914
Pin the Watchtower source by digest.
docker-buildforwards the Watchtower variables, butdocker-buildxdoes not. The Dockerfile combines independent defaults into mutable...:0.11.0references. Define one digest-backedWATCHTOWER_REF, pass it through every Docker build target, and consume it withFROM ${WATCHTOWER_REF}.📍 Affects 2 files
Makefile#L4-L8(this comment)Dockerfile#L5-L6🤖 Prompt for AI Agents