Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 33 additions & 5 deletions api/v1/proteinconformationprediction_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,20 @@ import (
)

type ProteinConformationPredictionProtein struct {
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=10000
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable"
Sequence string `json:"sequence"`
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinItems=1
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable"
ID []string `json:"id"`
}

type ProteinConformationPredictionModelWeights struct {
// +kubebuilder:validation:Required
// +kubebuilder:validation:MaxLength=2048
HTTP string `json:"http"`
}

Expand All @@ -31,7 +38,12 @@ type ProteinConformationPredictionModel struct {
}

type ProteinConformationPredictionDestinationS3 struct {
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinLength=3
// +kubebuilder:validation:MaxLength=63
Bucket string `json:"bucket"`
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinLength=1
Region string `json:"region"`
}

Expand Down Expand Up @@ -59,14 +71,19 @@ type ProteinConformationPredictionJob struct {
}

type ProteinConformationPredictionSpec struct {
// +kubebuilder:validation:Required
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable"
Protein ProteinConformationPredictionProtein `json:"protein"`
Model ProteinConformationPredictionModel `json:"model,omitempty"`
Protein ProteinConformationPredictionProtein `json:"protein"`
// +kubebuilder:validation:Required
Model ProteinConformationPredictionModel `json:"model"`
// +kubebuilder:validation:Required
Destination ProteinConformationPredictionDestination `json:"destination"`
Notifications ProteinConformationPredictionNotifications `json:"notify,omitempty"`
Job ProteinConformationPredictionJob `json:"job,omitempty"`
Database string `json:"database"`
StorageClass string `json:"storageClass,omitempty"`
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinLength=1
Database string `json:"database"`
StorageClass string `json:"storageClass,omitempty"`
}

type ProteinConformationPredictionStatusPhase string
Expand All @@ -84,13 +101,24 @@ type ProteinConformationPredictionStatus struct {
Phase ProteinConformationPredictionStatusPhase `json:"phase,omitempty"`
SequencePrefix string `json:"sequencePrefix,omitempty"`
Error string `json:"error,omitempty"`
RetryCount int32 `json:"retryCount,omitempty"`
// Deprecated: use SearchRetryCount, PredictRetryCount or UploadRetryCount.
RetryCount int32 `json:"retryCount,omitempty"`
SearchRetryCount int32 `json:"searchRetryCount,omitempty"`
PredictRetryCount int32 `json:"predictRetryCount,omitempty"`
UploadRetryCount int32 `json:"uploadRetryCount,omitempty"`
LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"`
// +listType=map
// +listMapKey=type
// +patchMergeKey=type
// +patchStrategy=merge
Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
}

// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Phase",type=string,JSONPath=`.status.phase`
// +kubebuilder:printcolumn:name="Sequence",type=string,JSONPath=`.status.sequencePrefix`
// +kubebuilder:printcolumn:name="Ready",type=string,JSONPath=`.status.conditions[?(@.type=='Ready')].status`
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"

type ProteinConformationPrediction struct {
Expand Down
13 changes: 12 additions & 1 deletion api/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 14 additions & 9 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ import (
"sigs.k8s.io/controller-runtime/pkg/webhook"

datav1 "github.com/kubefold/operator/api/v1"
"github.com/kubefold/operator/internal/controller"
"github.com/kubefold/operator/internal/database"
"github.com/kubefold/operator/internal/observer"
"github.com/kubefold/operator/internal/prediction"
// +kubebuilder:scaffold:imports
)

Expand Down Expand Up @@ -221,17 +222,21 @@ func main() {
os.Exit(1)
}

if err = (&controller.ProteinDatabaseReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
}).SetupWithManager(mgr); err != nil {
databaseReconciler := database.NewReconciler(
mgr.GetClient(),
mgr.GetScheme(),
mgr.GetEventRecorderFor("proteindatabase-controller"),
)
if err = databaseReconciler.SetupWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "ProteinDatabase")
os.Exit(1)
}
if err = (&controller.ProteinConformationPredictionReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
}).SetupWithManager(mgr); err != nil {
predictionReconciler := prediction.NewReconciler(
mgr.GetClient(),
mgr.GetScheme(),
mgr.GetEventRecorderFor("proteinconformationprediction-controller"),
)
if err = predictionReconciler.SetupWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "ProteinConformationPrediction")
os.Exit(1)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ spec:
- jsonPath: .status.sequencePrefix
name: Sequence
type: string
- jsonPath: .status.conditions[?(@.type=='Ready')].status
name: Ready
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
Expand Down Expand Up @@ -48,14 +51,18 @@ spec:
spec:
properties:
database:
minLength: 1
type: string
destination:
properties:
s3:
properties:
bucket:
maxLength: 63
minLength: 3
type: string
region:
minLength: 1
type: string
required:
- bucket
Expand Down Expand Up @@ -317,6 +324,7 @@ spec:
weights:
properties:
http:
maxLength: 2048
type: string
required:
- http
Expand All @@ -340,11 +348,14 @@ spec:
id:
items:
type: string
minItems: 1
type: array
x-kubernetes-validations:
- message: Value is immutable
rule: self == oldSelf
sequence:
maxLength: 10000
minLength: 1
type: string
x-kubernetes-validations:
- message: Value is immutable
Expand All @@ -361,19 +372,93 @@ spec:
required:
- database
- destination
- model
- protein
type: object
status:
properties:
conditions:
items:
description: Condition contains details for one aspect of the current
state of this API Resource.
properties:
lastTransitionTime:
description: |-
lastTransitionTime is the last time the condition transitioned from one status to another.
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
format: date-time
type: string
message:
description: |-
message is a human readable message indicating details about the transition.
This may be an empty string.
maxLength: 32768
type: string
observedGeneration:
description: |-
observedGeneration represents the .metadata.generation that the condition was set based upon.
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
with respect to the current state of the instance.
format: int64
minimum: 0
type: integer
reason:
description: |-
reason contains a programmatic identifier indicating the reason for the condition's last transition.
Producers of specific condition types may define expected values and meanings for this field,
and whether the values are considered a guaranteed API.
The value should be a CamelCase string.
This field may not be empty.
maxLength: 1024
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
type: string
status:
description: status of the condition, one of True, False, Unknown.
enum:
- "True"
- "False"
- Unknown
type: string
type:
description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
required:
- lastTransitionTime
- message
- reason
- status
- type
type: object
type: array
x-kubernetes-list-map-keys:
- type
x-kubernetes-list-type: map
error:
type: string
lastTransitionTime:
format: date-time
type: string
phase:
type: string
predictRetryCount:
format: int32
type: integer
retryCount:
description: 'Deprecated: use SearchRetryCount, PredictRetryCount
or UploadRetryCount.'
format: int32
type: integer
searchRetryCount:
format: int32
type: integer
sequencePrefix:
type: string
uploadRetryCount:
format: int32
type: integer
type: object
type: object
served: true
Expand Down
Loading
Loading