Skip to content

Commit e87fbfa

Browse files
authored
Merge branch 'main' into expose-metrics-endpoint
2 parents cb5f178 + ab92337 commit e87fbfa

File tree

14 files changed

+494
-491
lines changed

14 files changed

+494
-491
lines changed

.github/workflows/mcad-CI.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Set up Go
2727
uses: actions/setup-go@v3
2828
with:
29-
go-version: 1.18.10
29+
go-version: 1.19.10
3030

3131
- name: Build
3232
run:

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ services:
1313
- docker
1414

1515
go:
16-
- "1.18.10"
16+
- "1.19.10"
1717

1818
go_import_path: github.com/project-codeflare/multi-cluster-app-dispatcher
1919

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM registry.access.redhat.com/ubi8/go-toolset:1.18.10-1 AS BUILDER
1+
FROM registry.access.redhat.com/ubi8/go-toolset:1.19.10-10 AS BUILDER
22
ARG GO_BUILD_ARGS
33
WORKDIR /workdir
44
USER root

cmd/kar-controllers/app/options/options.go

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ package options
3232

3333
import (
3434
"flag"
35-
klog "k8s.io/klog/v2"
3635
"os"
3736
"strconv"
3837
"strings"
@@ -51,10 +50,10 @@ type ServerOption struct {
5150
BackoffTime int // Number of seconds a job will go away for, if it can not be scheduled. Default is 20.
5251
// Head of line job will not be bumped away for at least HeadOfLineHoldingTime seconds by higher priority jobs.
5352
// Default setting to 0 disables this mechanism.
54-
HeadOfLineHoldingTime int
55-
QuotaEnabled bool // Controller is to evaluate quota per request
56-
QuotaRestURL string
57-
HealthProbeListenAddr string
53+
HeadOfLineHoldingTime int
54+
QuotaEnabled bool // Controller is to evaluate quota per request
55+
QuotaRestURL string
56+
HealthProbeListenAddr string
5857
DispatchResourceReservationTimeout int64
5958
MetricsListenAddr string
6059
}
@@ -79,15 +78,13 @@ func (s *ServerOption) AddFlags(fs *flag.FlagSet) {
7978
fs.BoolVar(&s.Preemption, "preemption", s.Preemption, "Set controller to allow preemption if set to true. Note: when set to true, the Kubernetes Scheduler must be configured to enable preemption. Default is false.")
8079
fs.IntVar(&s.BackoffTime, "backofftime", s.BackoffTime, "Number of seconds a job will go away for, if it can not be scheduled. Default is 20.")
8180
fs.IntVar(&s.HeadOfLineHoldingTime, "headoflineholdingtime", s.HeadOfLineHoldingTime, "Number of seconds a job can stay at the Head Of Line without being bumped. Default is 0.")
82-
fs.BoolVar(&s.QuotaEnabled,"quotaEnabled", s.QuotaEnabled,"Enable quota policy evaluation. Default is false.")
81+
fs.BoolVar(&s.QuotaEnabled, "quotaEnabled", s.QuotaEnabled, "Enable quota policy evaluation. Default is false.")
8382
fs.StringVar(&s.QuotaRestURL, "quotaURL", s.QuotaRestURL, "URL for ReST quota management. Default is none.")
8483
fs.IntVar(&s.SecurePort, "secure-port", 6443, "The port on which to serve secured, authenticated access for metrics.")
8584
fs.StringVar(&s.HealthProbeListenAddr, "healthProbeListenAddr", ":8081", "Listen address for health probes. Defaults to ':8081'")
8685
// using port 8083 for metrics as 8082 is used by `custom-metrics-apiserver`
8786
fs.StringVar(&s.MetricsListenAddr, "metricsListenAddr", ":8083", "Listen address for metrics. Defaults to ':8083'")
8887
fs.Int64Var(&s.DispatchResourceReservationTimeout, "dispatchResourceReservationTimeout", s.DispatchResourceReservationTimeout, "Resource reservation timeout for pods to be created once AppWrapper is dispatched, in millisecond. Defaults to '300000', 5 minutes")
89-
flag.Parse()
90-
klog.V(4).Infof("[AddFlags] Controller configuration: %#v", s)
9188
}
9289

9390
func (s *ServerOption) loadDefaultsFromEnvVars() {
@@ -151,7 +148,3 @@ func (s *ServerOption) loadDefaultsFromEnvVars() {
151148
}
152149
}
153150
}
154-
155-
func (s *ServerOption) CheckOptionOrDie() {
156-
157-
}

cmd/kar-controllers/main.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,23 @@ package main
3333
import (
3434
"flag"
3535
"fmt"
36+
"os"
37+
38+
"k8s.io/klog/v2"
3639

3740
"github.com/project-codeflare/multi-cluster-app-dispatcher/cmd/kar-controllers/app"
3841
"github.com/project-codeflare/multi-cluster-app-dispatcher/cmd/kar-controllers/app/options"
3942
"k8s.io/apiserver/pkg/server"
4043

41-
"os"
4244
)
4345

4446
func main() {
45-
//flag.Parse()
46-
4747
s := options.NewServerOption()
48-
s.AddFlags(flag.CommandLine)
4948

50-
// flag.InitFlags()
51-
s.CheckOptionOrDie()
49+
flagSet := flag.CommandLine
50+
klog.InitFlags(flagSet)
51+
s.AddFlags(flagSet)
52+
flag.Parse()
5253

5354
ctx := server.SetupSignalContext()
5455

doc/build/build.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ $
3636
3737
To build the controller and to run the end to end tests locally you will need to have the following software installed:
3838
39-
* `Go` (version 1.18)
39+
* `Go` (version 1.19)
4040
* `kind` (version 0.18)
4141
* `kubectl`
4242
* `helm` - version 3.0 or later

go.mod

Lines changed: 85 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,116 @@
11
module github.com/project-codeflare/multi-cluster-app-dispatcher
22

3-
go 1.18
3+
go 1.19
44

55
require (
66
github.com/eapache/go-resiliency v1.3.0
77
github.com/emicklei/go-restful v2.16.0+incompatible
88
github.com/gogo/protobuf v1.3.2
9-
github.com/golang/protobuf v1.4.3
9+
github.com/golang/protobuf v1.5.3
1010
github.com/hashicorp/go-multierror v1.1.1
11-
github.com/kubernetes-sigs/custom-metrics-apiserver v0.0.0-20210311094424-0ca2b1909cdc
1211
github.com/onsi/ginkgo v1.11.0
13-
github.com/onsi/gomega v1.7.0
14-
github.com/prometheus/client_golang v1.11.1
15-
github.com/prometheus/client_model v0.2.0
16-
github.com/spf13/pflag v1.0.5
17-
github.com/stretchr/testify v1.6.1
18-
k8s.io/api v0.20.0
19-
k8s.io/apiextensions-apiserver v0.20.0
20-
k8s.io/apimachinery v0.20.5
21-
k8s.io/apiserver v0.20.0
22-
k8s.io/client-go v0.20.0
23-
k8s.io/component-base v0.20.0
24-
k8s.io/gengo v0.0.0-20210203185629-de9496dff47b
25-
k8s.io/klog/v2 v2.4.0
26-
k8s.io/metrics v0.20.0
27-
sigs.k8s.io/yaml v1.2.0
12+
github.com/onsi/gomega v1.27.4
13+
github.com/prometheus/client_golang v1.14.0
14+
github.com/prometheus/client_model v0.3.0
15+
github.com/stretchr/testify v1.8.2
16+
k8s.io/api v0.26.2
17+
k8s.io/apiextensions-apiserver v0.25.1
18+
k8s.io/apimachinery v0.26.2
19+
k8s.io/apiserver v0.26.2
20+
k8s.io/client-go v0.26.2
21+
k8s.io/component-base v0.26.2
22+
k8s.io/klog/v2 v2.90.1
23+
k8s.io/metrics v0.26.2
24+
sigs.k8s.io/custom-metrics-apiserver v0.0.0
2825
)
2926

27+
replace sigs.k8s.io/custom-metrics-apiserver => sigs.k8s.io/custom-metrics-apiserver v1.25.1-0.20230306170449-63d8c93851f3
28+
3029
require (
31-
cloud.google.com/go v0.54.0 // indirect
32-
github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46 // indirect
33-
github.com/PuerkitoBio/purell v1.1.1 // indirect
34-
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
30+
github.com/NYTimes/gziphandler v1.1.1 // indirect
31+
github.com/antlr/antlr4/runtime/Go/antlr v1.4.10 // indirect
3532
github.com/beorn7/perks v1.0.1 // indirect
36-
github.com/blang/semver v3.5.1+incompatible // indirect
37-
github.com/cespare/xxhash/v2 v2.1.1 // indirect
33+
github.com/blang/semver/v4 v4.0.0 // indirect
34+
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
35+
github.com/cespare/xxhash/v2 v2.1.2 // indirect
3836
github.com/coreos/go-semver v0.3.0 // indirect
39-
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e // indirect
40-
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f // indirect
37+
github.com/coreos/go-systemd/v22 v22.3.2 // indirect
4138
github.com/davecgh/go-spew v1.1.1 // indirect
42-
github.com/emicklei/go-restful-swagger12 v0.0.0-20201014110547-68ccff494617 // indirect
43-
github.com/evanphx/json-patch v4.9.0+incompatible // indirect
44-
github.com/go-logr/logr v0.2.0 // indirect
45-
github.com/go-openapi/jsonpointer v0.19.5 // indirect
46-
github.com/go-openapi/jsonreference v0.19.5 // indirect
47-
github.com/go-openapi/spec v0.20.0 // indirect
48-
github.com/go-openapi/swag v0.19.12 // indirect
49-
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
50-
github.com/google/go-cmp v0.5.5 // indirect
39+
github.com/emicklei/go-restful/v3 v3.10.1 // indirect
40+
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
41+
github.com/felixge/httpsnoop v1.0.3 // indirect
42+
github.com/fsnotify/fsnotify v1.6.0 // indirect
43+
github.com/go-logr/logr v1.2.3 // indirect
44+
github.com/go-logr/stdr v1.2.2 // indirect
45+
github.com/go-openapi/jsonpointer v0.19.6 // indirect
46+
github.com/go-openapi/jsonreference v0.20.1 // indirect
47+
github.com/go-openapi/swag v0.22.3 // indirect
48+
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
49+
github.com/google/cel-go v0.12.6 // indirect
50+
github.com/google/gnostic v0.6.9 // indirect
51+
github.com/google/go-cmp v0.5.9 // indirect
5152
github.com/google/gofuzz v1.1.0 // indirect
53+
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
5254
github.com/google/uuid v1.1.2 // indirect
53-
github.com/googleapis/gnostic v0.4.1 // indirect
5455
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
56+
github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 // indirect
5557
github.com/hashicorp/errwrap v1.0.0 // indirect
56-
github.com/hashicorp/golang-lru v0.5.1 // indirect
5758
github.com/hpcloud/tail v1.0.0 // indirect
58-
github.com/imdario/mergo v0.3.5 // indirect
59+
github.com/imdario/mergo v0.3.6 // indirect
60+
github.com/inconshreveable/mousetrap v1.0.1 // indirect
5961
github.com/josharian/intern v1.0.0 // indirect
60-
github.com/json-iterator/go v1.1.11 // indirect
61-
github.com/mailru/easyjson v0.7.6 // indirect
62-
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
62+
github.com/json-iterator/go v1.1.12 // indirect
63+
github.com/mailru/easyjson v0.7.7 // indirect
64+
github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect
6365
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
64-
github.com/modern-go/reflect2 v1.0.1 // indirect
66+
github.com/modern-go/reflect2 v1.0.2 // indirect
6567
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
6668
github.com/pkg/errors v0.9.1 // indirect
6769
github.com/pmezard/go-difflib v1.0.0 // indirect
68-
github.com/prometheus/common v0.26.0 // indirect
69-
github.com/prometheus/procfs v0.6.0 // indirect
70-
go.etcd.io/etcd v0.5.0-alpha.5.0.20200910180754-dd1b699fc489 // indirect
71-
go.uber.org/atomic v1.4.0 // indirect
72-
go.uber.org/multierr v1.1.0 // indirect
73-
go.uber.org/zap v1.10.0 // indirect
74-
golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b // indirect
75-
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
76-
golang.org/x/net v0.7.0 // indirect
77-
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d // indirect
78-
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect
79-
golang.org/x/sys v0.5.0 // indirect
80-
golang.org/x/term v0.5.0 // indirect
81-
golang.org/x/text v0.7.0 // indirect
82-
golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e // indirect
83-
golang.org/x/tools v0.1.12 // indirect
84-
google.golang.org/appengine v1.6.5 // indirect
85-
google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a // indirect
86-
google.golang.org/grpc v1.27.1 // indirect
87-
google.golang.org/protobuf v1.26.0-rc.1 // indirect
70+
github.com/prometheus/common v0.37.0 // indirect
71+
github.com/prometheus/procfs v0.8.0 // indirect
72+
github.com/spf13/cobra v1.6.0 // indirect
73+
github.com/spf13/pflag v1.0.5 // indirect
74+
github.com/stoewer/go-strcase v1.2.0 // indirect
75+
go.etcd.io/etcd/api/v3 v3.5.5 // indirect
76+
go.etcd.io/etcd/client/pkg/v3 v3.5.5 // indirect
77+
go.etcd.io/etcd/client/v3 v3.5.5 // indirect
78+
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.35.0 // indirect
79+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.35.0 // indirect
80+
go.opentelemetry.io/otel v1.10.0 // indirect
81+
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.10.0 // indirect
82+
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.10.0 // indirect
83+
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.10.0 // indirect
84+
go.opentelemetry.io/otel/metric v0.31.0 // indirect
85+
go.opentelemetry.io/otel/sdk v1.10.0 // indirect
86+
go.opentelemetry.io/otel/trace v1.10.0 // indirect
87+
go.opentelemetry.io/proto/otlp v0.19.0 // indirect
88+
go.uber.org/atomic v1.7.0 // indirect
89+
go.uber.org/multierr v1.6.0 // indirect
90+
go.uber.org/zap v1.19.0 // indirect
91+
golang.org/x/crypto v0.1.0 // indirect
92+
golang.org/x/net v0.8.0 // indirect
93+
golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect
94+
golang.org/x/sync v0.1.0 // indirect
95+
golang.org/x/sys v0.6.0 // indirect
96+
golang.org/x/term v0.6.0 // indirect
97+
golang.org/x/text v0.8.0 // indirect
98+
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect
99+
google.golang.org/appengine v1.6.7 // indirect
100+
google.golang.org/genproto v0.0.0-20220502173005-c8bf987b8c21 // indirect
101+
google.golang.org/grpc v1.49.0 // indirect
102+
google.golang.org/protobuf v1.28.1 // indirect
88103
gopkg.in/fsnotify.v1 v1.4.7 // indirect
89104
gopkg.in/inf.v0 v0.9.1 // indirect
90105
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
91106
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
92107
gopkg.in/yaml.v2 v2.4.0 // indirect
93-
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect
94-
k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7 // indirect
95-
k8s.io/utils v0.0.0-20201110183641-67b214c5f920 // indirect
96-
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.14 // indirect
97-
sigs.k8s.io/structured-merge-diff/v4 v4.0.2 // indirect
108+
gopkg.in/yaml.v3 v3.0.1 // indirect
109+
k8s.io/kms v0.26.2 // indirect
110+
k8s.io/kube-openapi v0.0.0-20230303024457-afdc3dddf62d // indirect
111+
k8s.io/utils v0.0.0-20230220204549-a5ecb0141aa5 // indirect
112+
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.35 // indirect
113+
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
114+
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
115+
sigs.k8s.io/yaml v1.3.0 // indirect
98116
)

0 commit comments

Comments
 (0)