Skip to content
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

Update to latest cron lib. #17

Merged
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
10 changes: 2 additions & 8 deletions cmd/daprd/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ type Options struct {
DaprBlockShutdownDuration *time.Duration
ActorsService string
RemindersService string
SchedulerAddress *string
SchedulerAddress string
DaprAPIListenAddresses string
AppHealthProbeInterval int
AppHealthProbeTimeout int
Expand All @@ -79,8 +79,6 @@ type Options struct {
AppChannelAddress string
Logger logger.Options
Metrics *metrics.Options

schedulerAddressFlag string
}

func New(origArgs []string) (*Options, error) {
Expand Down Expand Up @@ -134,7 +132,6 @@ func New(origArgs []string) (*Options, error) {
fs.StringVar(&opts.SentryAddress, "sentry-address", "", "Address for the Sentry CA service")
fs.StringVar(&opts.ControlPlaneTrustDomain, "control-plane-trust-domain", "localhost", "Trust domain of the Dapr control plane")
fs.StringVar(&opts.ControlPlaneNamespace, "control-plane-namespace", "default", "Namespace of the Dapr control plane")
fs.StringVar(&opts.schedulerAddressFlag, "scheduler-host-address", "", "Addresses for Dapr Scheduler servers")
fs.StringVar(&opts.AllowedOrigins, "allowed-origins", cors.DefaultAllowedOrigins, "Allowed HTTP origins")
fs.BoolVar(&opts.EnableProfiling, "enable-profiling", false, "Enable profiling")
fs.BoolVar(&opts.RuntimeVersion, "version", false, "Prints the runtime version")
Expand Down Expand Up @@ -166,6 +163,7 @@ func New(origArgs []string) (*Options, error) {
// --placement-host-address is a legacy (but not deprecated) flag that is translated to the actors-service flag
var placementServiceHostAddr string
fs.StringVar(&placementServiceHostAddr, "placement-host-address", "", "Addresses for Dapr Actor Placement servers (overrides actors-service)")
fs.StringVar(&opts.SchedulerAddress, "scheduler-host-address", "", "Addresses of the Scheduler service instance(s), as comma separated host:port pairs")
fs.StringVar(&opts.ActorsService, "actors-service", "", "Type and address of the actors service, in the format 'type:address'")
fs.StringVar(&opts.RemindersService, "reminders-service", "", "Type and address of the reminders service, in the format 'type:address'")

Expand Down Expand Up @@ -248,10 +246,6 @@ func New(origArgs []string) (*Options, error) {
opts.DaprBlockShutdownDuration = nil
}

if fs.Changed("scheduler-host-address") {
opts.SchedulerAddress = &opts.schedulerAddressFlag
}

return &opts, nil
}

Expand Down
33 changes: 9 additions & 24 deletions dapr/proto/runtime/v1/dapr.proto
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,11 @@ service Dapr {
// Create and schedule a job
rpc ScheduleJob(ScheduleJobRequest) returns (google.protobuf.Empty) {}

// Delete a job
rpc DeleteJob(DeleteJobRequest) returns (google.protobuf.Empty) {}

// Get a job
// Gets a scheduled job
rpc GetJob(GetJobRequest) returns (GetJobResponse) {}

// List all jobs by app
rpc ListJobs(ListJobsRequest) returns (ListJobsResponse) {}
// Delete a job
rpc DeleteJob(DeleteJobRequest) returns (google.protobuf.Empty) {}
}

// InvokeServiceRequest represents the request message for Service invocation.
Expand Down Expand Up @@ -1149,32 +1146,20 @@ message ScheduleJobRequest {
Job job = 1;
}

// DeleteJobRequest is the message to delete the job by name.
message DeleteJobRequest {
// The name of the job.
string name = 1;
}

// GetJobRequest is the message to get the job by name.
// GetJobRequest is the message to retrieve a job.
message GetJobRequest {
// The name of the job.
string name = 1;
}

// GetJobResponse is the response message to convey the job.
// GetJobResponse is the message's response for a job retrieved.
message GetJobResponse {
// The job details.
Job job = 1;
}

// ListJobsRequest is the message to list jobs by app_id.
message ListJobsRequest {
// The id of the application (app_id) for which to list jobs.
string app_id = 1;
}

// ListJobsResponse is the response message to convey the list of jobs.
message ListJobsResponse {
// List of jobs that match the request criteria.
repeated Job jobs = 1;
// DeleteJobRequest is the message to delete the job by name.
message DeleteJobRequest {
// The name of the job.
string name = 1;
}
41 changes: 17 additions & 24 deletions dapr/proto/scheduler/v1/scheduler.proto
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@ service Scheduler {
rpc ConnectHost(ConnectHostRequest) returns (ConnectHostResponse) {}
// ScheduleJob is used by the daprd sidecar to schedule a job.
rpc ScheduleJob(ScheduleJobRequest) returns (ScheduleJobResponse) {}
// Get a job
rpc GetJob(GetJobRequest) returns (GetJobResponse) {}
// DeleteJob is used by the daprd sidecar to delete a job.
rpc DeleteJob(JobRequest) returns (DeleteJobResponse) {}
// GetJob is used by the daprd sidecar to get details of a job.
rpc GetJob(JobRequest) returns (GetJobResponse) {}
// ListJobs is used by the daprd sidecar to list jobs by app_id.
rpc ListJobs(ListJobsRequest) returns (ListJobsResponse) {}
rpc DeleteJob(DeleteJobRequest) returns (DeleteJobResponse) {}
}

message ConnectHostRequest {
Expand Down Expand Up @@ -51,41 +49,36 @@ message ScheduleJobRequest {
// The job to be scheduled.
runtime.v1.Job job = 1;

// Namespace of the job
string namespace = 2;

// The metadata associated with the job.
// The sidecar will create the unique `key` for storing data in the state store and pass the generated `key` along to the scheduler service for data lookup upon ‘trigger’ time later on.
// The sidecar will also add metadata in order to know whether this job is registered for an actor. This is needed, as the routing mechanism for actors is different for the callback.
map<string,string> metadata = 3;
map<string,string> metadata = 2;
}

message ScheduleJobResponse {
// Empty as of now
}

// JobRequest is the message used by the daprd sidecar to delete or get a job.
message JobRequest {
// GetJobRequest is the message used by the daprd sidecar to delete or get a job.
message GetJobRequest {
string job_name = 1;
}

message DeleteJobResponse {
// Empty as of now
// The metadata associated with the job.
map<string,string> metadata = 2;
}

// GetJobResponse is the response message to convey the details of a job.
message GetJobResponse {
runtime.v1.Job job = 1;
}

// ListJobsRequest is the message to list jobs by app_id.
message ListJobsRequest {
// The id of the application (app_id) for which to list jobs.
string app_id = 1;
// DeleteJobRequest is the message used by the daprd sidecar to delete or get a job.
message DeleteJobRequest {
string job_name = 1;

// The metadata associated with the job.
map<string,string> metadata = 2;
}
// ListJobsResponse is the response message to convey the list of jobs.
message ListJobsResponse {
// List of jobs that match the request criteria.
repeated runtime.v1.Job jobs = 1;

message DeleteJobResponse {
// Empty as of now
}

33 changes: 0 additions & 33 deletions dapr/proto/scheduler/v1/scheduler_callback.proto

This file was deleted.

9 changes: 5 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ require (
contrib.go.opencensus.io/exporter/prometheus v0.4.2
github.com/PaesslerAG/jsonpath v0.1.1
github.com/PuerkitoBio/purell v1.2.1
github.com/Scalingo/go-etcd-cron v1.3.2
github.com/alphadose/haxmap v1.3.1
github.com/argoproj/argo-rollouts v1.4.1
github.com/cenkalti/backoff/v4 v4.2.1
github.com/cloudevents/sdk-go/v2 v2.14.0
github.com/dapr/components-contrib v1.13.0-rc.10
github.com/dapr/kit v0.13.0
github.com/diagridio/go-etcd-cron v0.0.0-20240321201514-c0f44b7f5d89
github.com/evanphx/json-patch/v5 v5.8.1
github.com/go-chi/chi/v5 v5.0.11
github.com/go-chi/cors v1.2.1
Expand Down Expand Up @@ -51,6 +51,7 @@ require (
github.com/spiffe/go-spiffe/v2 v2.1.6
github.com/stretchr/testify v1.9.0
github.com/valyala/fasthttp v1.51.0
go.etcd.io/etcd/api/v3 v3.5.12
go.etcd.io/etcd/client/v3 v3.5.12
go.etcd.io/etcd/server/v3 v3.5.11
go.mongodb.org/mongo-driver v1.12.1
Expand Down Expand Up @@ -279,7 +280,6 @@ require (
github.com/http-wasm/http-wasm-host-go v0.5.1 // indirect
github.com/huaweicloud/huaweicloud-sdk-go-obs v3.23.4+incompatible // indirect
github.com/huaweicloud/huaweicloud-sdk-go-v3 v0.1.56 // indirect
github.com/iancoleman/strcase v0.3.0 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/influxdata/influxdb-client-go/v2 v2.12.3 // indirect
Expand Down Expand Up @@ -407,7 +407,6 @@ require (
github.com/yusufpapurcu/wmi v1.2.2 // indirect
github.com/zeebo/errs v1.3.0 // indirect
go.etcd.io/bbolt v1.3.8 // indirect
go.etcd.io/etcd/api/v3 v3.5.12 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.12 // indirect
go.etcd.io/etcd/client/v2 v2.305.11 // indirect
go.etcd.io/etcd/pkg/v3 v3.5.11 // indirect
Expand Down Expand Up @@ -484,12 +483,14 @@ replace (
// check for retracted versions: go list -mod=mod -f '{{if .Retracted}}{{.}}{{end}}' -u -m all
replace github.com/microcosm-cc/bluemonday => github.com/microcosm-cc/bluemonday v1.0.24

// Needed due to a deprecated method used in functional tests
replace github.com/stretchr/testify => github.com/stretchr/testify v1.8.4

// Uncomment for local development for testing with changes in the components-contrib && kit repositories.
// Don't commit with this uncommented!
//
// replace github.com/dapr/components-contrib => ../components-contrib
// replace github.com/dapr/kit => ../kit
replace github.com/Scalingo/go-etcd-cron => github.com/cicoyle/go-etcd-cron v0.0.0-20240212132024-691d2e9fb3f1

//
// Then, run `make modtidy-all` in this repository.
Expand Down
23 changes: 3 additions & 20 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,6 @@ github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5P
github.com/chzyer/readline v1.5.0/go.mod h1:x22KAscuvRqlLoK9CsoYsmxoXZMMFVyOl86cAH8qUic=
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/chzyer/test v0.0.0-20210722231415-061457976a23/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/cicoyle/go-etcd-cron v0.0.0-20240212132024-691d2e9fb3f1 h1:u2JCV1Y2DpQ1cULuNzbz2dYl1onJ5eZBus8DWFgH28I=
github.com/cicoyle/go-etcd-cron v0.0.0-20240212132024-691d2e9fb3f1/go.mod h1:h4rx0m29dWSqSm9Oikw83ldkxyeXKH19aAlj4vagiek=
github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag=
github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I=
github.com/clbanning/mxj/v2 v2.5.5/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s=
Expand Down Expand Up @@ -467,6 +465,8 @@ github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cu
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48 h1:fRzb/w+pyskVMQ+UbP35JkH8yB7MYb4q/qhBarqZE6g=
github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA=
github.com/diagridio/go-etcd-cron v0.0.0-20240321201514-c0f44b7f5d89 h1:mcF9KZDBpLjzO6XIiV6bBg6R2VxPzf8F5RuXgwBjA08=
github.com/diagridio/go-etcd-cron v0.0.0-20240321201514-c0f44b7f5d89/go.mod h1:tRZ3z7Mr4Rp9fYdxmCB63V7zrwqtUINR6QHriC1bauw=
github.com/didip/tollbooth/v7 v7.0.1 h1:TkT4sBKoQoHQFPf7blQ54iHrZiTDnr8TceU+MulVAog=
github.com/didip/tollbooth/v7 v7.0.1/go.mod h1:VZhDSGl5bDSPj4wPsih3PFa4Uh9Ghv8hgacaTm5PRT4=
github.com/dimfeld/httptreemux v5.0.1+incompatible h1:Qj3gVcDNoOthBAqftuD596rm4wg/adLLz5xh5CmpiCA=
Expand Down Expand Up @@ -967,8 +967,6 @@ github.com/huaweicloud/huaweicloud-sdk-go-v3 v0.1.56 h1:ULzGSSe95hkOdh17NsiPV3lw
github.com/huaweicloud/huaweicloud-sdk-go-v3 v0.1.56/go.mod h1:bsqx6o47Kl4YsniIjPwuoeqiIB5Fc3JbSpB2b3o3WFQ=
github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg=
github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334/go.mod h1:SK73tn/9oHe+/Y0h39VT4UCxmurVJkR5NA7kMEAOgSE=
github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI=
github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho=
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/ianlancetaylor/demangle v0.0.0-20220319035150-800ac71e25c2/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w=
Expand Down Expand Up @@ -1555,25 +1553,11 @@ github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5J
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals=
github.com/stretchr/testify v1.7.5/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/stvp/go-udp-testing v0.0.0-20201019212854-469649b16807/go.mod h1:7jxmlfBCDBXRzr0eAQJ48XC1hBu1np4CS5+cHEYfwpc=
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
github.com/subosito/gotenv v1.4.1 h1:jyEFiXpy21Wm81FBN71l9VoMMV8H8jG+qIK3GCpY6Qs=
Expand Down Expand Up @@ -2409,7 +2393,6 @@ gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
Expand Down
Loading