Skip to content

proto definitions for settings service#7023

Open
afbrock wants to merge 16 commits intov2from
adam/settings
Open

proto definitions for settings service#7023
afbrock wants to merge 16 commits intov2from
adam/settings

Conversation

@afbrock
Copy link
Copy Markdown

@afbrock afbrock commented Mar 12, 2026

Tracking issue

Why are the changes needed?

What changes were proposed in this pull request?

How was this patch tested?

Labels

Please add one or more of the following labels to categorize your PR:

  • added: For new features.
  • changed: For changes in existing functionality.
  • deprecated: For soon-to-be-removed features.
  • removed: For features being removed.
  • fixed: For any bug fixed.
  • security: In case of vulnerabilities

This is important to improve the readability of release notes.

Setup process

Screenshots

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

Docs link

@afbrock afbrock requested a review from wild-endeavor March 12, 2026 23:16
@afbrock afbrock changed the base branch from master to v2 March 13, 2026 23:47
Copy link
Copy Markdown
Contributor

@wild-endeavor wild-endeavor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

..

// TaskResourceDefaults defines default and limit resource requests for tasks.
message TaskResourceDefaults {
StringSetting min_cpu = 1;
StringSetting min_gpu = 2;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did we say we were getting rid of GPU?

StringSetting min_gpu = 2;
StringSetting min_memory = 3;
StringSetting min_storage = 4;
StringSetting limits_cpu = 5;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

limits are the max that can be specified right? can we call it a cap or a maximum? i'm worried the word limit is confusing in the context of k8s.

Also does it make sense to support GPU here @EngHabu ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure..

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so i think k8s has request/limit, I think if we want to make it match we should use that, but to me it is more intuitive to say min/max... except if we have scale down as a feature we might also start in the middle somewhere rather than at the minimum. my gut says we should say min/max because that is pretty clear, but that also isnt coming from a k8s background

TaskResourceSettings task_resource = 4;
StringListSetting labels = 5;
StringMapSetting annotations = 6;
StringMapSetting environment_variables = 7;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need a property bag here as well. i feel like that one is a generic struct @EngHabu? Or should it be property bags? dictionary of structs keyed off a string?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for "everything else" ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is only one way that really makes sense - and that is if we are making these consumable by customers or 3rd parties where we do not use or do not have control or simply cannot implement them in our control plane. Adding an 'everything else' bucket basically means that the very next change someone makes to add a setting they need to answer the question 'does this get proper proto or does it go in the bag'. and then every consumer has to ask 'did that new setting get proper proto definition, or is it in the bag, and if it is in the bag where is its name defined'. and that mental work I really want to avoid.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chatted offline... let's ignore this for now and come to it when we need to work on cluster resource controller

// StringSetting is a string-valued setting with inheritance control.
message StringSetting {
SettingState state = 1;
string value = 2;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

weren't these originally going to be a oneof? Is there a benefit to making these separate objects (StringSetting, IntSetting, etc.). I understand you did this so that you can do

StringSetting raw_data_path = 1;

and then if someone receives a StorageSettings object, they'll know that it contains a string type... just wondering if this is a useful feature - in what scenario will this be useful to know above and beyond what the original oneof block would give you?

(see the SettingValue object in the md file)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i am not that familiar with the oneofs - if someone makes a create request with a setting that is a oneof, can they put whatever type they want in there?


// IntSetting is an integer-valued setting with inheritance control.
message IntSetting {
SettingState state = 1;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should add a description to each setting also.

// Per-setting source level. Keys are dot-separated field paths
// (e.g. "run.default_queue", "task_resource.defaults.min_cpu").
// Only present for settings with state = SETTING_STATE_VALUE.
map<string, SettingScopeLevel> sources = 3;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this for again? shouldn't it already be in each setting object?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, yeah, let me change it so that it is in the settings wrapper

SettingsKey key = 1 [(buf.validate.field).required = true];

// Serialized settings blob.
string data = 2 [(buf.validate.field).string.min_len = 1];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't think we should use string data here. This is the endpoint that the SDK CLI will probably use right? The sole purpose of this endpoint is so that changes to the settings object can be handled without forcing the user to upgrade. But I think a plain string is too loose right? I think we can assume that the SDK will always have access to the base setting value objects (be it SettingValue or the collection of StringSetting, IntSetting, etc.)... given that, shouldn't this be something like map<string, oneof stringsetting...> or map<string, SettingValue>?

Also, what was the plan for map/list types? the original plan was to have them be additive. We don't need to do that - if we just force the user to copy/paste any values from higher scopes that actually makes the editing experience simpler. (search for "Map-type settings should show each scope's contribution separately" in the md file to see what i mean) Is that the plan? just make the user do it?

I know i'm referencing the original doc... don't worry about the yaml formatting part in that doc please (we'll take care of the actual yaml parts), but the information does need to be in the api responses.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the reason for it to be string data is for the comments. that may be unnecessary if we code into the sdk the comments about the level and description and which can be edited and which not, but if we wanted to add any other descriptive elements or anything like that this would allow it to be totally controlled by the back end and not the sdk.
That said, we can change it (and update) so that there is less parsing work involved by the backend.

@github-actions github-actions bot mentioned this pull request Mar 13, 2026
3 tasks
@afbrock afbrock force-pushed the adam/settings branch 3 times, most recently from d2d5872 to 32ff857 Compare March 18, 2026 18:57
AdilFayyaz and others added 16 commits March 18, 2026 13:22
* add: validation

Signed-off-by: M. Adil Fayyaz <62440954+AdilFayyaz@users.noreply.github.com>

* fix

Signed-off-by: M. Adil Fayyaz <62440954+AdilFayyaz@users.noreply.github.com>

* [V2] Add GitHub Actions workflow for Go unit tests (#6999)

Signed-off-by: Kevin Su <pingsutw@apache.org>

* add: validation

Signed-off-by: M. Adil Fayyaz <62440954+AdilFayyaz@users.noreply.github.com>

* fix

Signed-off-by: M. Adil Fayyaz <62440954+AdilFayyaz@users.noreply.github.com>

* minor fix

Signed-off-by: M. Adil Fayyaz <62440954+AdilFayyaz@users.noreply.github.com>

* fix: tests

Signed-off-by: M. Adil Fayyaz <62440954+AdilFayyaz@users.noreply.github.com>

---------

Signed-off-by: M. Adil Fayyaz <62440954+AdilFayyaz@users.noreply.github.com>
Signed-off-by: Kevin Su <pingsutw@apache.org>
Co-authored-by: Kevin Su <pingsutw@apache.org>
* Notifications IDL

Signed-off-by: Iaroslav Ciupin <iaroslav@union.ai>
* Fix Docker build for CGO-dependent sqlite3 package

The build was failing because `go-sqlite3` requires CGO, but the
Dockerfile used cross-compilation (`--platform=${BUILDPLATFORM}`) which
disables CGO. Additionally, the .dockerignore negation pattern for
`gen/go` was unreliable when the parent `gen/` directory was excluded.

- Remove cross-compilation, enable CGO_ENABLED=1 for native build
- Copy only gen/go instead of full gen directory
- Replace .dockerignore negation with explicit subdirectory exclusions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Kevin Su <pingsutw@apache.org>

* test

Signed-off-by: Kevin Su <pingsutw@apache.org>

---------

Signed-off-by: Kevin Su <pingsutw@apache.org>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Iaroslav Ciupin <iaroslav@union.ai>
…ng the /config HTTP endpoint. Add pflags-generated config files and fix import paths to use non-versioned module. (#7015)

* Add DisableConfigEndpoint option to profutils Config to allow disabling the /config HTTP endpoint. Add pflags-generated config files and fix import paths to use non-versioned module.

Signed-off-by: Haytham Abuelfutuh <haytham@afutuh.com>

* fix imports

Signed-off-by: Haytham Abuelfutuh <haytham@afutuh.com>

* Fix tests

Signed-off-by: Haytham Abuelfutuh <haytham@afutuh.com>

* Fix config registration

Signed-off-by: Haytham Abuelfutuh <haytham@afutuh.com>

* Fix unit tests

Signed-off-by: Haytham Abuelfutuh <haytham@afutuh.com>

---------

Signed-off-by: Haytham Abuelfutuh <haytham@afutuh.com>
* feat: simple state manager to store actions

Signed-off-by: machichima <nary12321@gmail.com>

* feat: run state manager record node tree

Signed-off-by: machichima <nary12321@gmail.com>

* fix: also include root action in ListActions

Signed-off-by: machichima <nary12321@gmail.com>

* fix: prevent error when create default project on startup

Signed-off-by: machichima <nary12321@gmail.com>

* feat: add watch_actions.sh test script

Signed-off-by: machichima <nary12321@gmail.com>

* fix: continue for nil enrichedAction for defense

Signed-off-by: machichima <nary12321@gmail.com>

* fix: raise error in CreateProject when already exists

Signed-off-by: machichima <nary12321@gmail.com>

---------

Signed-off-by: machichima <nary12321@gmail.com>
…ehavior (#7028)

Signed-off-by: Katrina Rogan <katroganGH@gmail.com>
Signed-off-by: M. Adil Fayyaz <62440954+AdilFayyaz@users.noreply.github.com>
Signed-off-by: Kevin Su <pingsutw@apache.org>
…7031)

* abort - add

Signed-off-by: M. Adil Fayyaz <62440954+AdilFayyaz@users.noreply.github.com>

* update

Signed-off-by: M. Adil Fayyaz <62440954+AdilFayyaz@users.noreply.github.com>

* update test

Signed-off-by: M. Adil Fayyaz <62440954+AdilFayyaz@users.noreply.github.com>

---------

Signed-off-by: M. Adil Fayyaz <62440954+AdilFayyaz@users.noreply.github.com>
…7033)

* fix problems about missing charts and kubeconfig permission

Signed-off-by: yuteng <a08h0283@gmail.com>

* make dep_build including updating helm-repo and build charts

Signed-off-by: yuteng <a08h0283@gmail.com>

* deleted unused operator

Signed-off-by: yuteng <a08h0283@gmail.com>

---------

Signed-off-by: yuteng <a08h0283@gmail.com>
* adjust notifications IDL to support notifications per phases
* drop delivery config id & rule id
* email idl adjustments

Signed-off-by: Iaroslav Ciupin <iaroslav@union.ai>
To facilitate getting logs just for a single node,
add an optional field to the ContainerSelector message.

Signed-off-by: Eugene Yakubovich <eyakubovich@gmail.com>
Signed-off-by: Barry Wu <a0987818905@gmail.com>
SettingState state = 1;

// A plain string value.
string string_value = 2;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think we also need boolean

// GetSettingsResponse contains resolved effective settings.
// Each setting's scope_level field indicates which scope provided its value.
message GetSettingsResponse {
SettingsKey key = 1;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we not just use SettingsRecord here?


// CreateSettingsResponse contains the created settings and initial version.
message CreateSettingsResponse {
SettingsKey key = 1;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this also be SettingsRecord


// UpdateSettingsResponse contains the updated settings and new version.
message UpdateSettingsResponse {
SettingsKey key = 1;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto


// UpdateSettingsRawResponse contains the stored raw settings and new version.
message UpdateSettingsRawResponse {
SettingsKey key = 1;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think message can just be empty. we can attach error details

import (
    "context"

    "google.golang.org/grpc/codes"
    "google.golang.org/grpc/status"

    "google.golang.org/genproto/googleapis/rpc/errdetails"
)

func (s *Server) CreateUser(ctx context.Context, req *pb.CreateUserRequest) (*pb.CreateUserResponse, error) {
    var violations []*errdetails.BadRequest_FieldViolation

    if req.Email == "" {
        violations = append(violations, &errdetails.BadRequest_FieldViolation{
            Field:       "email",
            Description: "email is required",
        })
    }

    if req.Age < 18 {
        violations = append(violations, &errdetails.BadRequest_FieldViolation{
            Field:       "age",
            Description: "must be at least 18",
        })
    }

    if len(violations) > 0 {
        st := status.New(codes.InvalidArgument, "validation failed")

        br := &errdetails.BadRequest{
            FieldViolations: violations,
        }

        stWithDetails, err := st.WithDetails(br)
        if err != nil {
            return nil, st.Err() // fallback
        }

        return nil, stWithDetails.Err()
    }

    return &pb.CreateUserResponse{UserId: "123"}, nil
}

upon getting a validation error, the sdk/yaml client should call the get for edit endpoint again, and show the validation error message.

Maybe upon success we return the new version, but i think that is even not needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.