profile
viewpoint
Stephen Day stevvooe San Francisco

issue commentcontainerd/project

Add non-core project "ttrpc-rust" to containerd organization

One more thing I noticed: the package names in the example are all “grpc”. See https://github.com/alipay/ttrpc-rust/blob/master/example/protocols/protos/oci.proto#L9. The package names should be more descriptive about what is in the package. These might be from the upstream project, so you’ll have to work that out there.

teawater

comment created time in 8 days

issue commentcontainerd/project

Add non-core project "ttrpc-rust" to containerd organization

This mostly looks good. For now, we should make it clear that the Go implementation is the primary one if there are protocol incompatibilities, since we don’t have a wire spec.

There are a few things that need to be fixed:

  1. https://github.com/alipay/ttrpc-rust/blob/master/src/ttrpc.proto#L26 Should not copy paste the status and code definitions. These need to be pulled from their upstreams. Weird things can happen with the metadata if we don’t because the package names don’t match.
  2. https://github.com/alipay/ttrpc-rust/blob/master/src/ttrpc.proto needs to reference the request type from the go project or we need to make a proto file for both projects to draw from. A small note referencing the go project is sufficient for now.
  3. The example in https://github.com/alipay/ttrpc-rust/blob/master/example/protocols/protos/oci.proto#L19 needs to follow protobuf naming conventions, which means snakecase. Use the json_name field option to get the json output to match the oci spec.

Glad to see another language implementation!

teawater

comment created time in 8 days

PR opened cruise-automation/rbacsync

all: update copyright to Cruise LLC

Signed-off-by: Stephen Day stephen.day@getcruise.com

+30 -30

0 comment

27 changed files

pr created time in 3 months

create barnchcruise-automation/rbacsync

branch : update-copyright

created branch time in 3 months

pull request commentcruise-automation/rbacsync

add custom metrics for RBACSync

@mllu thanks for the contribution! Looks pretty good. I have a few nits on naming. Also, let’s have @mattlandis take a peek.

mllu

comment created time in 3 months

Pull request review commentcruise-automation/rbacsync

add custom metrics for RBACSync

+package metrics++import (+	"github.com/prometheus/client_golang/prometheus"+	"github.com/prometheus/client_golang/prometheus/promauto"+)++var (+	// Metrics for Controller+	RBACSyncConfigStatus = promauto.NewGaugeVec(prometheus.GaugeOpts{+		Name: "rbacsync_config_status",+		Help: "The number of RBACSyncConfigs and RBACSyncClusterConfigs and the status of the processed config",+	}, []string{"kind", "status"})+	RBACSyncBindingStatus = promauto.NewGaugeVec(prometheus.GaugeOpts{+		Name: "rbacsync_binding_status",+		Help: "The number of RoleBindings and ClusterRoleBIndings configured by the controller and their statuses",+	}, []string{"kind", "status"})++	// Metrics for Mapper/GSuite+	RBACSyncGsuiteClientCreationStatus = promauto.NewCounter(prometheus.CounterOpts{+		Name: "rbacsync_gsuite_client_creation_status",+		Help: "Total number of the status of gsuite client creations",+	})+	RBACSyncGsuiteMembersStatus = promauto.NewCounterVec(prometheus.CounterOpts{+		Name: "rbacsync_gsuite_members_status",+		Help: "Total number of the status of calls to gsuite with labels for state",+	}, []string{"status"})+	RBACSyncGsuiteMembersLatency = promauto.NewHistogram(prometheus.HistogramOpts{+		Name: "rbacsync_gsuite_members_latency",

Prometheus best practice here would to have this suffixed with duration_seconds.

mllu

comment created time in 3 months

Pull request review commentcruise-automation/rbacsync

add custom metrics for RBACSync

 import ( 	"k8s.io/client-go/tools/cache" 	"k8s.io/client-go/tools/record" 	"k8s.io/client-go/util/workqueue"+	"k8s.io/klog"  	rbacsyncv1alpha "github.com/cruise-automation/rbacsync/pkg/apis/rbacsync/v1alpha" 	clientset "github.com/cruise-automation/rbacsync/pkg/generated/clientset/versioned" 	rbacsyncscheme "github.com/cruise-automation/rbacsync/pkg/generated/clientset/versioned/scheme" 	informers "github.com/cruise-automation/rbacsync/pkg/generated/informers/externalversions/rbacsync/v1alpha" 	listers "github.com/cruise-automation/rbacsync/pkg/generated/listers/rbacsync/v1alpha" 	"github.com/cruise-automation/rbacsync/pkg/groups"+	"github.com/cruise-automation/rbacsync/pkg/metrics" )  const ( 	controllerAgentName = "rbacsync" ) +const (+	MetricsRBACSyncConfig        = "RBACSyncConfig"+	MetricsRBACSyncClusterConfig = "RBACSyncClusterConfig"

Could you make this consistent with the other references? ClusterRBACSyncConfig is what I think we use.

mllu

comment created time in 3 months

Pull request review commentkubernetes/kubernetes

Don't leak a go routine on panic

 func (t *timeoutHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { 	case <-after: 		postTimeoutFn() 		tw.timeout(err)++		// resultCh needs to have a reader, since the function doing+		// the work needs to send to it.+		go func() {+			res := <-resultCh

One more possible approach: try to send in the defer, fail if the listener is gone and print the utilruntime.HandleError(t) if that fails:

select {
case resultCh <- err:
default:
  utilruntime.HandleError(err)
}
lavalamp

comment created time in 4 months

Pull request review commentkubernetes/kubernetes

Don't leak a go routine on panic

 func (t *timeoutHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { 	case <-after: 		postTimeoutFn() 		tw.timeout(err)++		// resultCh needs to have a reader, since the function doing+		// the work needs to send to it.+		go func() {+			res := <-resultCh

Ok, I see. You want a panic or a stack trace if the goroutine returns later.

lavalamp

comment created time in 4 months

Pull request review commentkubernetes/kubernetes

Don't leak a go routine on panic

 func (t *timeoutHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { 	case <-after: 		postTimeoutFn() 		tw.timeout(err)++		// resultCh needs to have a reader, since the function doing+		// the work needs to send to it.+		go func() {+			res := <-resultCh

Does this need to be non-blocking? For example, res, ok := <-resultCh.

The other thing that could be done here is to have the channel be buffered to a length of 1. That way, the writer just writes and goes away if it returns and you don't need this extra goroutine.

lavalamp

comment created time in 4 months

startedkubernetes/kubernetes

started time in 4 months

issue commentopencontainers/artifacts

Clarification: manifest.config.mediaType defines artifact types

I think this encodes what we intend. At minimum, a mediaType must encode the representation of the artifact (json, protobuf, encryption, compression, etc.). We should call out that this is a many to one relationship, in that you might have multiple mediaTypes representing the same content or similarly encoded content, but their handling may differ due to the mediaType. One example is the docker and oci mediatypes for indexes. They are identical formats, handling and meaning but have different mediaTypes. Another, contrived example, might be a format that uses regular OCI layers, compatible in format, but are interpreted differently by the format.

SteveLasker

comment created time in 4 months

startedmoul/protoc-gen-gotemplate

started time in 4 months

more