diff --git a/DETAILS.md b/DETAILS.md index 8a17263..7140d2e 100644 --- a/DETAILS.md +++ b/DETAILS.md @@ -56,7 +56,7 @@ make && sudo make install ```shell starlight-grpc run --server $STARLIGHT_PROXY_ADDRESS --socket /run/starlight-grpc/starlight-snapshotter.socket ``` -or uses systemd service in `./demo/deb-package/debian/starlight-snapshotter.service` +or uses systemd service in `./demo/deb-package/debian/starlight.service` --- diff --git a/Makefile b/Makefile index 286d05f..732cf99 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,6 @@ COMPILEDATE=$(shell date +%Y%m%d) .PHONY: build clean build-starlight-proxy build-starlight-daemon build-ctr-starlight - .SILENT: install-systemd-service ###################################################################### @@ -60,24 +59,24 @@ set-production: .PHONY: generate-changelog generate-changelog: - mkdir -p ./sandbox/starlight-snapshotter-$(VERSIONNUMBER)-$(COMPILEDATE)/debian/ 2>/dev/null | true - sh -c ./demo/deb-package/generate-changelog.sh > ./sandbox/starlight-snapshotter-$(VERSIONNUMBER)-$(COMPILEDATE)/debian/changelog + mkdir -p ./sandbox/starlight-$(VERSIONNUMBER)-$(COMPILEDATE)/debian/ 2>/dev/null | true + sh -c ./demo/deb-package/generate-changelog.sh > ./sandbox/starlight-$(VERSIONNUMBER)-$(COMPILEDATE)/debian/changelog .PHONY: create-deb-package create-deb-package: change-version-number set-production build-starlight-daemon build-ctr-starlight generate-changelog - mkdir -p ./sandbox/starlight-snapshotter-$(VERSIONNUMBER)-$(COMPILEDATE)/ 2>/dev/null | true - cp -r ./demo/deb-package/debian ./sandbox/starlight-snapshotter-$(VERSIONNUMBER)-$(COMPILEDATE)/ - mkdir -p ./sandbox/starlight-snapshotter-$(VERSIONNUMBER)-$(COMPILEDATE)/debian/starlight-snapshotter/usr/bin/ 2>/dev/null | true - cp -r ./out/* ./sandbox/starlight-snapshotter-$(VERSIONNUMBER)-$(COMPILEDATE)/debian/starlight-snapshotter/usr/bin/ - sed -i 's/Standards-Version: 0.0.0/Standards-Version: $(VERSIONNUMBER)/g' ./sandbox/starlight-snapshotter-$(VERSIONNUMBER)-$(COMPILEDATE)/debian/control - cd ./sandbox/starlight-snapshotter-$(VERSIONNUMBER)-$(COMPILEDATE) ; \ + mkdir -p ./sandbox/starlight-$(VERSIONNUMBER)-$(COMPILEDATE)/ 2>/dev/null | true + cp -r ./demo/deb-package/debian ./sandbox/starlight-$(VERSIONNUMBER)-$(COMPILEDATE)/ + mkdir -p ./sandbox/starlight-$(VERSIONNUMBER)-$(COMPILEDATE)/debian/starlight/usr/bin/ 2>/dev/null | true + cp -r ./out/* ./sandbox/starlight-$(VERSIONNUMBER)-$(COMPILEDATE)/debian/starlight/usr/bin/ + sed -i 's/Standards-Version: 0.0.0/Standards-Version: $(VERSIONNUMBER)/g' ./sandbox/starlight-$(VERSIONNUMBER)-$(COMPILEDATE)/debian/control + cd ./sandbox/starlight-$(VERSIONNUMBER)-$(COMPILEDATE) ; \ dh_systemd_enable; \ dh_systemd_start; \ dh_installdeb; \ dh_gencontrol; \ dh_md5sums; \ dh_builddeb - dpkg-deb --info ./sandbox/starlight-snapshotter_$(VERSIONNUMBER)_amd64.deb + dpkg-deb --info ./sandbox/starlight_$(VERSIONNUMBER)_amd64.deb .PHONY: update-protobuf update-protobuf: @@ -95,53 +94,53 @@ create-deb-package.amd64: create-deb-package .PHONY: create-deb-package.armv6l create-deb-package.armv6l: change-version-number set-production build-starlight-daemon build-ctr-starlight generate-changelog - mkdir -p ./sandbox/starlight-snapshotter-$(VERSIONNUMBER)-$(COMPILEDATE)/ 2>/dev/null | true - cp -r ./demo/deb-package/debian ./sandbox/starlight-snapshotter-$(VERSIONNUMBER)-$(COMPILEDATE)/ - mkdir -p ./sandbox/starlight-snapshotter-$(VERSIONNUMBER)-$(COMPILEDATE)/debian/starlight-snapshotter/usr/bin/ 2>/dev/null | true - cp -r ./out/* ./sandbox/starlight-snapshotter-$(VERSIONNUMBER)-$(COMPILEDATE)/debian/starlight-snapshotter/usr/bin/ - sed -i 's/Standards-Version: 0.0.0/Standards-Version: $(VERSIONNUMBER)/g' ./sandbox/starlight-snapshotter-$(VERSIONNUMBER)-$(COMPILEDATE)/debian/control - sed -i 's/Architecture: amd64/Architecture: armhf/g' ./sandbox/starlight-snapshotter-$(VERSIONNUMBER)-$(COMPILEDATE)/debian/control - cd ./sandbox/starlight-snapshotter-$(VERSIONNUMBER)-$(COMPILEDATE) ; \ + mkdir -p ./sandbox/starlight-$(VERSIONNUMBER)-$(COMPILEDATE)/ 2>/dev/null | true + cp -r ./demo/deb-package/debian ./sandbox/starlight-$(VERSIONNUMBER)-$(COMPILEDATE)/ + mkdir -p ./sandbox/starlight-$(VERSIONNUMBER)-$(COMPILEDATE)/debian/starlight/usr/bin/ 2>/dev/null | true + cp -r ./out/* ./sandbox/starlight-$(VERSIONNUMBER)-$(COMPILEDATE)/debian/starlight/usr/bin/ + sed -i 's/Standards-Version: 0.0.0/Standards-Version: $(VERSIONNUMBER)/g' ./sandbox/starlight-$(VERSIONNUMBER)-$(COMPILEDATE)/debian/control + sed -i 's/Architecture: amd64/Architecture: armhf/g' ./sandbox/starlight-$(VERSIONNUMBER)-$(COMPILEDATE)/debian/control + cd ./sandbox/starlight-$(VERSIONNUMBER)-$(COMPILEDATE) ; \ dh_systemd_enable; \ dh_systemd_start; \ dh_installdeb; \ dh_gencontrol; \ dh_md5sums; \ dh_builddeb - dpkg-deb --info ./sandbox/starlight-snapshotter_$(VERSIONNUMBER)_armhf.deb + dpkg-deb --info ./sandbox/starlight_$(VERSIONNUMBER)_armhf.deb .PHONY: create-deb-package.arm64 create-deb-package.arm64: change-version-number set-production build-starlight-daemon build-ctr-starlight generate-changelog - mkdir -p ./sandbox/starlight-snapshotter-$(VERSIONNUMBER)-$(COMPILEDATE)/ 2>/dev/null | true - cp -r ./demo/deb-package/debian ./sandbox/starlight-snapshotter-$(VERSIONNUMBER)-$(COMPILEDATE)/ - mkdir -p ./sandbox/starlight-snapshotter-$(VERSIONNUMBER)-$(COMPILEDATE)/debian/starlight-snapshotter/usr/bin/ 2>/dev/null | true - cp -r ./out/* ./sandbox/starlight-snapshotter-$(VERSIONNUMBER)-$(COMPILEDATE)/debian/starlight-snapshotter/usr/bin/ - sed -i 's/Standards-Version: 0.0.0/Standards-Version: $(VERSIONNUMBER)/g' ./sandbox/starlight-snapshotter-$(VERSIONNUMBER)-$(COMPILEDATE)/debian/control - sed -i 's/Architecture: amd64/Architecture: arm64/g' ./sandbox/starlight-snapshotter-$(VERSIONNUMBER)-$(COMPILEDATE)/debian/control - cd ./sandbox/starlight-snapshotter-$(VERSIONNUMBER)-$(COMPILEDATE) ; \ + mkdir -p ./sandbox/starlight-$(VERSIONNUMBER)-$(COMPILEDATE)/ 2>/dev/null | true + cp -r ./demo/deb-package/debian ./sandbox/starlight-$(VERSIONNUMBER)-$(COMPILEDATE)/ + mkdir -p ./sandbox/starlight-$(VERSIONNUMBER)-$(COMPILEDATE)/debian/starlight/usr/bin/ 2>/dev/null | true + cp -r ./out/* ./sandbox/starlight-$(VERSIONNUMBER)-$(COMPILEDATE)/debian/starlight/usr/bin/ + sed -i 's/Standards-Version: 0.0.0/Standards-Version: $(VERSIONNUMBER)/g' ./sandbox/starlight-$(VERSIONNUMBER)-$(COMPILEDATE)/debian/control + sed -i 's/Architecture: amd64/Architecture: arm64/g' ./sandbox/starlight-$(VERSIONNUMBER)-$(COMPILEDATE)/debian/control + cd ./sandbox/starlight-$(VERSIONNUMBER)-$(COMPILEDATE) ; \ dh_systemd_enable; \ dh_systemd_start; \ dh_installdeb; \ dh_gencontrol; \ dh_md5sums; \ dh_builddeb - dpkg-deb --info ./sandbox/starlight-snapshotter_$(VERSIONNUMBER)_arm64.deb + dpkg-deb --info ./sandbox/starlight_$(VERSIONNUMBER)_arm64.deb .PHONY: upload-deb-package.amd64 upload-deb-package.amd64: - curl --form uploadfile='@./sandbox/starlight-snapshotter_$(VERSIONNUMBER)_amd64.deb' $(UPLOAD_URL) - #curl -X POST -u $(APT_UPLOAD_AUTH) -F starlight-snapshotter_$(VERSIONNUMBER)_amd64.deb='@./sandbox/starlight-snapshotter_$(VERSIONNUMBER)_amd64.deb' https://repo.yuri.moe/api/files/starlight-snapshotter + curl --form uploadfile='@./sandbox/starlight_$(VERSIONNUMBER)_amd64.deb' $(UPLOAD_URL) + #curl -X POST -u $(APT_UPLOAD_AUTH) -F starlight_$(VERSIONNUMBER)_amd64.deb='@./sandbox/starlight_$(VERSIONNUMBER)_amd64.deb' https://repo.yuri.moe/api/files/starlight .PHONY: upload-deb-package.armv6l upload-deb-package.armv6l: - curl --form uploadfile='@./sandbox/starlight-snapshotter_$(VERSIONNUMBER)_armhf.deb' $(UPLOAD_URL) - #curl -X POST -u $(APT_UPLOAD_AUTH) -F starlight-snapshotter_$(VERSIONNUMBER)_armhf.deb='@./sandbox/starlight-snapshotter_$(VERSIONNUMBER)_armhf.deb' https://repo.yuri.moe/api/files/starlight-snapshotter + curl --form uploadfile='@./sandbox/starlight_$(VERSIONNUMBER)_armhf.deb' $(UPLOAD_URL) + #curl -X POST -u $(APT_UPLOAD_AUTH) -F starlight_$(VERSIONNUMBER)_armhf.deb='@./sandbox/starlight_$(VERSIONNUMBER)_armhf.deb' https://repo.yuri.moe/api/files/starlight .PHONY: upload-deb-package.amd64 upload-deb-package.arm64: - curl --form uploadfile='@./sandbox/starlight-snapshotter_$(VERSIONNUMBER)_arm64.deb' $(UPLOAD_URL) - #curl -X POST -u $(APT_UPLOAD_AUTH) -F starlight-snapshotter_$(VERSIONNUMBER)_arm64.deb='@./sandbox/starlight-snapshotter_$(VERSIONNUMBER)_arm64.deb' https://repo.yuri.moe/api/files/starlight-snapshotter + curl --form uploadfile='@./sandbox/starlight_$(VERSIONNUMBER)_arm64.deb' $(UPLOAD_URL) + #curl -X POST -u $(APT_UPLOAD_AUTH) -F starlight_$(VERSIONNUMBER)_arm64.deb='@./sandbox/starlight_$(VERSIONNUMBER)_arm64.deb' https://repo.yuri.moe/api/files/starlight ###################################################################### .PHONY: docker-buildx-multi-arch @@ -186,9 +185,9 @@ install-systemd-service: #@printf "Please enter Starlight Proxy address (example: \033[92mproxy.mc256.dev:8090\033[0m):" #@read proxy_address; \ #echo $$proxy_address; \ - #service_file=`cat './demo/deb-package/debian/starlight-snapshotter.service'`; \ + #service_file=`cat './demo/deb-package/debian/starlight.service'`; \ #echo `subst "STARLIGHT_PROXY",$(proxy_address),$(service_file)`; \ - #cp ./demo/deb-package/debian/starlight-snapshotter.service /lib/systemd/system/ + #cp ./demo/deb-package/debian/starlight.service /lib/systemd/system/ #systemctl daemon-reload docker-image: diff --git a/client/api/daemon.pb.go b/client/api/daemon.pb.go index e22f0a9..4133e5c 100644 --- a/client/api/daemon.pb.go +++ b/client/api/daemon.pb.go @@ -12,6 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +// api is the interface between the Starlight client and the CLI tool. +// use `make update-protobuf` to update the generated code. + // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.1 @@ -120,6 +123,117 @@ func (x *Version) GetVersion() string { return "" } +// Ping Test +type PingRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProxyConfig string `protobuf:"bytes,1,opt,name=proxyConfig,proto3" json:"proxyConfig,omitempty"` +} + +func (x *PingRequest) Reset() { + *x = PingRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_client_api_daemon_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PingRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PingRequest) ProtoMessage() {} + +func (x *PingRequest) ProtoReflect() protoreflect.Message { + mi := &file_client_api_daemon_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PingRequest.ProtoReflect.Descriptor instead. +func (*PingRequest) Descriptor() ([]byte, []int) { + return file_client_api_daemon_proto_rawDescGZIP(), []int{2} +} + +func (x *PingRequest) GetProxyConfig() string { + if x != nil { + return x.ProxyConfig + } + return "" +} + +type PingResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + Latency int64 `protobuf:"varint,3,opt,name=latency,proto3" json:"latency,omitempty"` +} + +func (x *PingResponse) Reset() { + *x = PingResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_client_api_daemon_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PingResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PingResponse) ProtoMessage() {} + +func (x *PingResponse) ProtoReflect() protoreflect.Message { + mi := &file_client_api_daemon_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PingResponse.ProtoReflect.Descriptor instead. +func (*PingResponse) Descriptor() ([]byte, []int) { + return file_client_api_daemon_proto_rawDescGZIP(), []int{3} +} + +func (x *PingResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *PingResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +func (x *PingResponse) GetLatency() int64 { + if x != nil { + return x.Latency + } + return 0 +} + // Add Auth type AuthRequest struct { state protoimpl.MessageState @@ -136,7 +250,7 @@ type AuthRequest struct { func (x *AuthRequest) Reset() { *x = AuthRequest{} if protoimpl.UnsafeEnabled { - mi := &file_client_api_daemon_proto_msgTypes[2] + mi := &file_client_api_daemon_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -149,7 +263,7 @@ func (x *AuthRequest) String() string { func (*AuthRequest) ProtoMessage() {} func (x *AuthRequest) ProtoReflect() protoreflect.Message { - mi := &file_client_api_daemon_proto_msgTypes[2] + mi := &file_client_api_daemon_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -162,7 +276,7 @@ func (x *AuthRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use AuthRequest.ProtoReflect.Descriptor instead. func (*AuthRequest) Descriptor() ([]byte, []int) { - return file_client_api_daemon_proto_rawDescGZIP(), []int{2} + return file_client_api_daemon_proto_rawDescGZIP(), []int{4} } func (x *AuthRequest) GetProfileName() string { @@ -212,7 +326,7 @@ type AuthResponse struct { func (x *AuthResponse) Reset() { *x = AuthResponse{} if protoimpl.UnsafeEnabled { - mi := &file_client_api_daemon_proto_msgTypes[3] + mi := &file_client_api_daemon_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -225,7 +339,7 @@ func (x *AuthResponse) String() string { func (*AuthResponse) ProtoMessage() {} func (x *AuthResponse) ProtoReflect() protoreflect.Message { - mi := &file_client_api_daemon_proto_msgTypes[3] + mi := &file_client_api_daemon_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -238,7 +352,7 @@ func (x *AuthResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use AuthResponse.ProtoReflect.Descriptor instead. func (*AuthResponse) Descriptor() ([]byte, []int) { - return file_client_api_daemon_proto_rawDescGZIP(), []int{3} + return file_client_api_daemon_proto_rawDescGZIP(), []int{5} } func (x *AuthResponse) GetSuccess() bool { @@ -255,6 +369,117 @@ func (x *AuthResponse) GetMessage() string { return "" } +// Notify Proxy +type NotifyRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Reference string `protobuf:"bytes,1,opt,name=reference,proto3" json:"reference,omitempty"` + ProxyConfig string `protobuf:"bytes,2,opt,name=proxyConfig,proto3" json:"proxyConfig,omitempty"` +} + +func (x *NotifyRequest) Reset() { + *x = NotifyRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_client_api_daemon_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NotifyRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NotifyRequest) ProtoMessage() {} + +func (x *NotifyRequest) ProtoReflect() protoreflect.Message { + mi := &file_client_api_daemon_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NotifyRequest.ProtoReflect.Descriptor instead. +func (*NotifyRequest) Descriptor() ([]byte, []int) { + return file_client_api_daemon_proto_rawDescGZIP(), []int{6} +} + +func (x *NotifyRequest) GetReference() string { + if x != nil { + return x.Reference + } + return "" +} + +func (x *NotifyRequest) GetProxyConfig() string { + if x != nil { + return x.ProxyConfig + } + return "" +} + +type NotifyResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` +} + +func (x *NotifyResponse) Reset() { + *x = NotifyResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_client_api_daemon_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NotifyResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NotifyResponse) ProtoMessage() {} + +func (x *NotifyResponse) ProtoReflect() protoreflect.Message { + mi := &file_client_api_daemon_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NotifyResponse.ProtoReflect.Descriptor instead. +func (*NotifyResponse) Descriptor() ([]byte, []int) { + return file_client_api_daemon_proto_rawDescGZIP(), []int{7} +} + +func (x *NotifyResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *NotifyResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + // Pull Image type ImageReference struct { state protoimpl.MessageState @@ -269,7 +494,7 @@ type ImageReference struct { func (x *ImageReference) Reset() { *x = ImageReference{} if protoimpl.UnsafeEnabled { - mi := &file_client_api_daemon_proto_msgTypes[4] + mi := &file_client_api_daemon_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -282,7 +507,7 @@ func (x *ImageReference) String() string { func (*ImageReference) ProtoMessage() {} func (x *ImageReference) ProtoReflect() protoreflect.Message { - mi := &file_client_api_daemon_proto_msgTypes[4] + mi := &file_client_api_daemon_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -295,7 +520,7 @@ func (x *ImageReference) ProtoReflect() protoreflect.Message { // Deprecated: Use ImageReference.ProtoReflect.Descriptor instead. func (*ImageReference) Descriptor() ([]byte, []int) { - return file_client_api_daemon_proto_rawDescGZIP(), []int{4} + return file_client_api_daemon_proto_rawDescGZIP(), []int{8} } func (x *ImageReference) GetReference() string { @@ -332,7 +557,7 @@ type ImagePullResponse struct { func (x *ImagePullResponse) Reset() { *x = ImagePullResponse{} if protoimpl.UnsafeEnabled { - mi := &file_client_api_daemon_proto_msgTypes[5] + mi := &file_client_api_daemon_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -345,7 +570,7 @@ func (x *ImagePullResponse) String() string { func (*ImagePullResponse) ProtoMessage() {} func (x *ImagePullResponse) ProtoReflect() protoreflect.Message { - mi := &file_client_api_daemon_proto_msgTypes[5] + mi := &file_client_api_daemon_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -358,7 +583,7 @@ func (x *ImagePullResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ImagePullResponse.ProtoReflect.Descriptor instead. func (*ImagePullResponse) Descriptor() ([]byte, []int) { - return file_client_api_daemon_proto_rawDescGZIP(), []int{5} + return file_client_api_daemon_proto_rawDescGZIP(), []int{9} } func (x *ImagePullResponse) GetSuccess() bool { @@ -395,7 +620,7 @@ type OptimizeRequest struct { func (x *OptimizeRequest) Reset() { *x = OptimizeRequest{} if protoimpl.UnsafeEnabled { - mi := &file_client_api_daemon_proto_msgTypes[6] + mi := &file_client_api_daemon_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -408,7 +633,7 @@ func (x *OptimizeRequest) String() string { func (*OptimizeRequest) ProtoMessage() {} func (x *OptimizeRequest) ProtoReflect() protoreflect.Message { - mi := &file_client_api_daemon_proto_msgTypes[6] + mi := &file_client_api_daemon_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -421,7 +646,7 @@ func (x *OptimizeRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use OptimizeRequest.ProtoReflect.Descriptor instead. func (*OptimizeRequest) Descriptor() ([]byte, []int) { - return file_client_api_daemon_proto_rawDescGZIP(), []int{6} + return file_client_api_daemon_proto_rawDescGZIP(), []int{10} } func (x *OptimizeRequest) GetEnable() bool { @@ -452,7 +677,7 @@ type OptimizeResponse struct { func (x *OptimizeResponse) Reset() { *x = OptimizeResponse{} if protoimpl.UnsafeEnabled { - mi := &file_client_api_daemon_proto_msgTypes[7] + mi := &file_client_api_daemon_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -465,7 +690,7 @@ func (x *OptimizeResponse) String() string { func (*OptimizeResponse) ProtoMessage() {} func (x *OptimizeResponse) ProtoReflect() protoreflect.Message { - mi := &file_client_api_daemon_proto_msgTypes[7] + mi := &file_client_api_daemon_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -478,7 +703,7 @@ func (x *OptimizeResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use OptimizeResponse.ProtoReflect.Descriptor instead. func (*OptimizeResponse) Descriptor() ([]byte, []int) { - return file_client_api_daemon_proto_rawDescGZIP(), []int{7} + return file_client_api_daemon_proto_rawDescGZIP(), []int{11} } func (x *OptimizeResponse) GetSuccess() bool { @@ -516,12 +741,13 @@ type ReportTracesRequest struct { unknownFields protoimpl.UnknownFields ProxyConfig string `protobuf:"bytes,1,opt,name=proxyConfig,proto3" json:"proxyConfig,omitempty"` + Remove bool `protobuf:"varint,2,opt,name=remove,proto3" json:"remove,omitempty"` } func (x *ReportTracesRequest) Reset() { *x = ReportTracesRequest{} if protoimpl.UnsafeEnabled { - mi := &file_client_api_daemon_proto_msgTypes[8] + mi := &file_client_api_daemon_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -534,7 +760,7 @@ func (x *ReportTracesRequest) String() string { func (*ReportTracesRequest) ProtoMessage() {} func (x *ReportTracesRequest) ProtoReflect() protoreflect.Message { - mi := &file_client_api_daemon_proto_msgTypes[8] + mi := &file_client_api_daemon_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -547,7 +773,7 @@ func (x *ReportTracesRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ReportTracesRequest.ProtoReflect.Descriptor instead. func (*ReportTracesRequest) Descriptor() ([]byte, []int) { - return file_client_api_daemon_proto_rawDescGZIP(), []int{8} + return file_client_api_daemon_proto_rawDescGZIP(), []int{12} } func (x *ReportTracesRequest) GetProxyConfig() string { @@ -557,19 +783,28 @@ func (x *ReportTracesRequest) GetProxyConfig() string { return "" } +func (x *ReportTracesRequest) GetRemove() bool { + if x != nil { + return x.Remove + } + return false +} + type ReportTracesResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` - Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + Okay map[string]string `protobuf:"bytes,3,rep,name=okay,proto3" json:"okay,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Failed map[string]string `protobuf:"bytes,4,rep,name=failed,proto3" json:"failed,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (x *ReportTracesResponse) Reset() { *x = ReportTracesResponse{} if protoimpl.UnsafeEnabled { - mi := &file_client_api_daemon_proto_msgTypes[9] + mi := &file_client_api_daemon_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -582,7 +817,7 @@ func (x *ReportTracesResponse) String() string { func (*ReportTracesResponse) ProtoMessage() {} func (x *ReportTracesResponse) ProtoReflect() protoreflect.Message { - mi := &file_client_api_daemon_proto_msgTypes[9] + mi := &file_client_api_daemon_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -595,7 +830,7 @@ func (x *ReportTracesResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ReportTracesResponse.ProtoReflect.Descriptor instead. func (*ReportTracesResponse) Descriptor() ([]byte, []int) { - return file_client_api_daemon_proto_rawDescGZIP(), []int{9} + return file_client_api_daemon_proto_rawDescGZIP(), []int{13} } func (x *ReportTracesResponse) GetSuccess() bool { @@ -612,6 +847,20 @@ func (x *ReportTracesResponse) GetMessage() string { return "" } +func (x *ReportTracesResponse) GetOkay() map[string]string { + if x != nil { + return x.Okay + } + return nil +} + +func (x *ReportTracesResponse) GetFailed() map[string]string { + if x != nil { + return x.Failed + } + return nil +} + var File_client_api_daemon_proto protoreflect.FileDescriptor var file_client_api_daemon_proto_rawDesc = []byte{ @@ -619,48 +868,91 @@ var file_client_api_daemon_proto_rawDesc = []byte{ 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x03, 0x61, 0x70, 0x69, 0x22, 0x09, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x23, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x9d, - 0x01, 0x0a, 0x0b, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, - 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, - 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, - 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x42, - 0x0a, 0x0c, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, - 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x22, 0x64, 0x0a, 0x0e, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, - 0x65, 0x6e, 0x63, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, - 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x61, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x62, 0x61, 0x73, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, - 0x78, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x65, 0x0a, 0x11, 0x49, 0x6d, 0x61, 0x67, - 0x65, 0x50, 0x75, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x2f, + 0x0a, 0x0b, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, + 0x0b, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, + 0x5c, 0x0a, 0x0c, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6c, 0x61, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6c, 0x61, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x22, 0x9d, 0x01, + 0x0a, 0x0b, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, + 0x0b, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, + 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, + 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x42, 0x0a, + 0x0c, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, + 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, + 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x22, 0x4f, 0x0a, 0x0d, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, + 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x22, 0x44, 0x0a, 0x0e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x18, + 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x64, 0x0a, 0x0e, 0x49, 0x6d, 0x61, 0x67, + 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, + 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, + 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x61, 0x73, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x62, 0x61, 0x73, 0x65, 0x12, 0x20, 0x0a, 0x0b, + 0x70, 0x72, 0x6f, 0x78, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x65, + 0x0a, 0x11, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x50, 0x75, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x18, 0x0a, + 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x62, 0x61, 0x73, 0x65, 0x49, + 0x6d, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x62, 0x61, 0x73, 0x65, + 0x49, 0x6d, 0x61, 0x67, 0x65, 0x22, 0x3f, 0x0a, 0x0f, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, + 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x22, 0xaa, 0x02, 0x0a, 0x10, 0x4f, 0x70, 0x74, 0x69, 0x6d, + 0x69, 0x7a, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, + 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, + 0x33, 0x0a, 0x04, 0x6f, 0x6b, 0x61, 0x79, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x4f, 0x6b, 0x61, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, + 0x6f, 0x6b, 0x61, 0x79, 0x12, 0x39, 0x0a, 0x06, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x18, 0x04, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6d, + 0x69, 0x7a, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x46, 0x61, 0x69, 0x6c, + 0x65, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x1a, + 0x37, 0x0a, 0x09, 0x4f, 0x6b, 0x61, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x39, 0x0a, 0x0b, 0x46, 0x61, 0x69, 0x6c, + 0x65, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x22, 0x4f, 0x0a, 0x13, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x54, 0x72, 0x61, + 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x72, + 0x6f, 0x78, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x16, 0x0a, 0x06, + 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x72, 0x65, + 0x6d, 0x6f, 0x76, 0x65, 0x22, 0xb6, 0x02, 0x0a, 0x14, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x54, + 0x72, 0x61, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x62, 0x61, 0x73, 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x62, 0x61, 0x73, 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x22, - 0x3f, 0x0a, 0x0f, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x06, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, - 0x6f, 0x75, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, - 0x22, 0xaa, 0x02, 0x0a, 0x10, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, - 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x33, 0x0a, 0x04, 0x6f, 0x6b, 0x61, - 0x79, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4f, 0x70, - 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x4f, - 0x6b, 0x61, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x6f, 0x6b, 0x61, 0x79, 0x12, 0x39, - 0x0a, 0x06, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x73, + 0x65, 0x12, 0x37, 0x0a, 0x04, 0x6f, 0x6b, 0x61, 0x79, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x23, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x54, 0x72, 0x61, 0x63, + 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x4f, 0x6b, 0x61, 0x79, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x6f, 0x6b, 0x61, 0x79, 0x12, 0x3d, 0x0a, 0x06, 0x66, 0x61, + 0x69, 0x6c, 0x65, 0x64, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x54, 0x72, 0x61, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x1a, 0x37, 0x0a, 0x09, 0x4f, 0x6b, 0x61, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, @@ -669,38 +961,36 @@ var file_client_api_daemon_proto_rawDesc = []byte{ 0x38, 0x01, 0x1a, 0x39, 0x0a, 0x0b, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x37, 0x0a, - 0x13, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x54, 0x72, 0x61, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x78, 0x79, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x4a, 0x0a, 0x14, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, - 0x54, 0x72, 0x61, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, - 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x32, 0xb0, 0x02, 0x0a, 0x06, 0x44, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x12, 0x2a, 0x0a, - 0x0a, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0c, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0c, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x00, 0x12, 0x38, 0x0a, 0x0f, 0x41, 0x64, 0x64, - 0x50, 0x72, 0x6f, 0x78, 0x79, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x10, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x12, 0x3a, 0x0a, 0x09, 0x50, 0x75, 0x6c, 0x6c, 0x49, 0x6d, 0x61, 0x67, 0x65, - 0x12, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x66, 0x65, - 0x72, 0x65, 0x6e, 0x63, 0x65, 0x1a, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6d, 0x61, 0x67, - 0x65, 0x50, 0x75, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, - 0x3d, 0x0a, 0x0c, 0x53, 0x65, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x72, 0x12, - 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4f, 0x70, 0x74, 0x69, - 0x6d, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x45, - 0x0a, 0x0c, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x54, 0x72, 0x61, 0x63, 0x65, 0x73, 0x12, 0x18, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x54, 0x72, 0x61, 0x63, 0x65, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, - 0x65, 0x70, 0x6f, 0x72, 0x74, 0x54, 0x72, 0x61, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x27, 0x5a, 0x25, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x63, 0x32, 0x35, 0x36, 0x2f, 0x73, 0x74, 0x61, 0x72, 0x6c, 0x69, - 0x67, 0x68, 0x74, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2f, 0x61, 0x70, 0x69, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x32, 0x9d, 0x03, + 0x0a, 0x06, 0x44, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x12, 0x2a, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x56, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x22, 0x00, 0x12, 0x31, 0x0a, 0x08, 0x50, 0x69, 0x6e, 0x67, 0x54, 0x65, 0x73, 0x74, + 0x12, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x38, 0x0a, 0x0f, 0x41, 0x64, 0x64, 0x50, 0x72, + 0x6f, 0x78, 0x79, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x10, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x12, 0x38, 0x0a, 0x0b, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x50, 0x72, 0x6f, 0x78, 0x79, + 0x12, 0x12, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, + 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3a, 0x0a, 0x09, 0x50, + 0x75, 0x6c, 0x6c, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, + 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x1a, 0x16, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x50, 0x75, 0x6c, 0x6c, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x0c, 0x53, 0x65, 0x74, 0x4f, 0x70, + 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x72, 0x12, 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4f, 0x70, + 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x45, 0x0a, 0x0c, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, + 0x54, 0x72, 0x61, 0x63, 0x65, 0x73, 0x12, 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x70, + 0x6f, 0x72, 0x74, 0x54, 0x72, 0x61, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x54, 0x72, 0x61, + 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x27, 0x5a, + 0x25, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x63, 0x32, 0x35, + 0x36, 0x2f, 0x73, 0x74, 0x61, 0x72, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x2f, 0x63, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x2f, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -715,39 +1005,51 @@ func file_client_api_daemon_proto_rawDescGZIP() []byte { return file_client_api_daemon_proto_rawDescData } -var file_client_api_daemon_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_client_api_daemon_proto_msgTypes = make([]protoimpl.MessageInfo, 18) var file_client_api_daemon_proto_goTypes = []interface{}{ (*Request)(nil), // 0: api.Request (*Version)(nil), // 1: api.Version - (*AuthRequest)(nil), // 2: api.AuthRequest - (*AuthResponse)(nil), // 3: api.AuthResponse - (*ImageReference)(nil), // 4: api.ImageReference - (*ImagePullResponse)(nil), // 5: api.ImagePullResponse - (*OptimizeRequest)(nil), // 6: api.OptimizeRequest - (*OptimizeResponse)(nil), // 7: api.OptimizeResponse - (*ReportTracesRequest)(nil), // 8: api.ReportTracesRequest - (*ReportTracesResponse)(nil), // 9: api.ReportTracesResponse - nil, // 10: api.OptimizeResponse.OkayEntry - nil, // 11: api.OptimizeResponse.FailedEntry + (*PingRequest)(nil), // 2: api.PingRequest + (*PingResponse)(nil), // 3: api.PingResponse + (*AuthRequest)(nil), // 4: api.AuthRequest + (*AuthResponse)(nil), // 5: api.AuthResponse + (*NotifyRequest)(nil), // 6: api.NotifyRequest + (*NotifyResponse)(nil), // 7: api.NotifyResponse + (*ImageReference)(nil), // 8: api.ImageReference + (*ImagePullResponse)(nil), // 9: api.ImagePullResponse + (*OptimizeRequest)(nil), // 10: api.OptimizeRequest + (*OptimizeResponse)(nil), // 11: api.OptimizeResponse + (*ReportTracesRequest)(nil), // 12: api.ReportTracesRequest + (*ReportTracesResponse)(nil), // 13: api.ReportTracesResponse + nil, // 14: api.OptimizeResponse.OkayEntry + nil, // 15: api.OptimizeResponse.FailedEntry + nil, // 16: api.ReportTracesResponse.OkayEntry + nil, // 17: api.ReportTracesResponse.FailedEntry } var file_client_api_daemon_proto_depIdxs = []int32{ - 10, // 0: api.OptimizeResponse.okay:type_name -> api.OptimizeResponse.OkayEntry - 11, // 1: api.OptimizeResponse.failed:type_name -> api.OptimizeResponse.FailedEntry - 0, // 2: api.Daemon.GetVersion:input_type -> api.Request - 2, // 3: api.Daemon.AddProxyProfile:input_type -> api.AuthRequest - 4, // 4: api.Daemon.PullImage:input_type -> api.ImageReference - 6, // 5: api.Daemon.SetOptimizer:input_type -> api.OptimizeRequest - 8, // 6: api.Daemon.ReportTraces:input_type -> api.ReportTracesRequest - 1, // 7: api.Daemon.GetVersion:output_type -> api.Version - 3, // 8: api.Daemon.AddProxyProfile:output_type -> api.AuthResponse - 5, // 9: api.Daemon.PullImage:output_type -> api.ImagePullResponse - 7, // 10: api.Daemon.SetOptimizer:output_type -> api.OptimizeResponse - 9, // 11: api.Daemon.ReportTraces:output_type -> api.ReportTracesResponse - 7, // [7:12] is the sub-list for method output_type - 2, // [2:7] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name + 14, // 0: api.OptimizeResponse.okay:type_name -> api.OptimizeResponse.OkayEntry + 15, // 1: api.OptimizeResponse.failed:type_name -> api.OptimizeResponse.FailedEntry + 16, // 2: api.ReportTracesResponse.okay:type_name -> api.ReportTracesResponse.OkayEntry + 17, // 3: api.ReportTracesResponse.failed:type_name -> api.ReportTracesResponse.FailedEntry + 0, // 4: api.Daemon.GetVersion:input_type -> api.Request + 2, // 5: api.Daemon.PingTest:input_type -> api.PingRequest + 4, // 6: api.Daemon.AddProxyProfile:input_type -> api.AuthRequest + 6, // 7: api.Daemon.NotifyProxy:input_type -> api.NotifyRequest + 8, // 8: api.Daemon.PullImage:input_type -> api.ImageReference + 10, // 9: api.Daemon.SetOptimizer:input_type -> api.OptimizeRequest + 12, // 10: api.Daemon.ReportTraces:input_type -> api.ReportTracesRequest + 1, // 11: api.Daemon.GetVersion:output_type -> api.Version + 3, // 12: api.Daemon.PingTest:output_type -> api.PingResponse + 5, // 13: api.Daemon.AddProxyProfile:output_type -> api.AuthResponse + 7, // 14: api.Daemon.NotifyProxy:output_type -> api.NotifyResponse + 9, // 15: api.Daemon.PullImage:output_type -> api.ImagePullResponse + 11, // 16: api.Daemon.SetOptimizer:output_type -> api.OptimizeResponse + 13, // 17: api.Daemon.ReportTraces:output_type -> api.ReportTracesResponse + 11, // [11:18] is the sub-list for method output_type + 4, // [4:11] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name } func init() { file_client_api_daemon_proto_init() } @@ -781,7 +1083,7 @@ func file_client_api_daemon_proto_init() { } } file_client_api_daemon_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AuthRequest); i { + switch v := v.(*PingRequest); i { case 0: return &v.state case 1: @@ -793,7 +1095,7 @@ func file_client_api_daemon_proto_init() { } } file_client_api_daemon_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AuthResponse); i { + switch v := v.(*PingResponse); i { case 0: return &v.state case 1: @@ -805,7 +1107,7 @@ func file_client_api_daemon_proto_init() { } } file_client_api_daemon_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ImageReference); i { + switch v := v.(*AuthRequest); i { case 0: return &v.state case 1: @@ -817,7 +1119,7 @@ func file_client_api_daemon_proto_init() { } } file_client_api_daemon_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ImagePullResponse); i { + switch v := v.(*AuthResponse); i { case 0: return &v.state case 1: @@ -829,7 +1131,7 @@ func file_client_api_daemon_proto_init() { } } file_client_api_daemon_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OptimizeRequest); i { + switch v := v.(*NotifyRequest); i { case 0: return &v.state case 1: @@ -841,7 +1143,7 @@ func file_client_api_daemon_proto_init() { } } file_client_api_daemon_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OptimizeResponse); i { + switch v := v.(*NotifyResponse); i { case 0: return &v.state case 1: @@ -853,7 +1155,7 @@ func file_client_api_daemon_proto_init() { } } file_client_api_daemon_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReportTracesRequest); i { + switch v := v.(*ImageReference); i { case 0: return &v.state case 1: @@ -865,6 +1167,54 @@ func file_client_api_daemon_proto_init() { } } file_client_api_daemon_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ImagePullResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_client_api_daemon_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OptimizeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_client_api_daemon_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OptimizeResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_client_api_daemon_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReportTracesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_client_api_daemon_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ReportTracesResponse); i { case 0: return &v.state @@ -883,7 +1233,7 @@ func file_client_api_daemon_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_client_api_daemon_proto_rawDesc, NumEnums: 0, - NumMessages: 12, + NumMessages: 18, NumExtensions: 0, NumServices: 1, }, diff --git a/client/api/daemon.proto b/client/api/daemon.proto index 68e6bc1..7dd4506 100644 --- a/client/api/daemon.proto +++ b/client/api/daemon.proto @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +// api is the interface between the Starlight client and the CLI tool. +// use `make update-protobuf` to update the generated code. syntax = "proto3"; option go_package = "github.com/mc256/starlight/client/api"; @@ -21,7 +23,9 @@ package api; // Interface exported by the server. service Daemon { rpc GetVersion(Request) returns (Version) {} + rpc PingTest(PingRequest) returns (PingResponse) {} rpc AddProxyProfile(AuthRequest) returns (AuthResponse) {} + rpc NotifyProxy(NotifyRequest) returns (NotifyResponse) {} rpc PullImage(ImageReference) returns (ImagePullResponse) {} rpc SetOptimizer(OptimizeRequest) returns (OptimizeResponse) {} rpc ReportTraces(ReportTracesRequest) returns (ReportTracesResponse) {} @@ -35,6 +39,17 @@ message Version{ string version = 1; } +// Ping Test +message PingRequest{ + string proxyConfig = 1; +} + +message PingResponse{ + bool success = 1; + string message = 2; + int64 latency = 3; +} + // Add Auth message AuthRequest { string profileName = 1; @@ -49,6 +64,18 @@ message AuthResponse { string message = 2; } +// Notify Proxy +message NotifyRequest { + string reference = 1; + string proxyConfig = 2; +} + +message NotifyResponse { + bool success = 1; + string message = 2; +} + + // Pull Image message ImageReference { string reference = 1; diff --git a/client/api/daemon_grpc.pb.go b/client/api/daemon_grpc.pb.go index f149dc1..8fe3607 100644 --- a/client/api/daemon_grpc.pb.go +++ b/client/api/daemon_grpc.pb.go @@ -23,7 +23,9 @@ const _ = grpc.SupportPackageIsVersion7 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type DaemonClient interface { GetVersion(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Version, error) + PingTest(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error) AddProxyProfile(ctx context.Context, in *AuthRequest, opts ...grpc.CallOption) (*AuthResponse, error) + NotifyProxy(ctx context.Context, in *NotifyRequest, opts ...grpc.CallOption) (*NotifyResponse, error) PullImage(ctx context.Context, in *ImageReference, opts ...grpc.CallOption) (*ImagePullResponse, error) SetOptimizer(ctx context.Context, in *OptimizeRequest, opts ...grpc.CallOption) (*OptimizeResponse, error) ReportTraces(ctx context.Context, in *ReportTracesRequest, opts ...grpc.CallOption) (*ReportTracesResponse, error) @@ -46,6 +48,15 @@ func (c *daemonClient) GetVersion(ctx context.Context, in *Request, opts ...grpc return out, nil } +func (c *daemonClient) PingTest(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error) { + out := new(PingResponse) + err := c.cc.Invoke(ctx, "/api.Daemon/PingTest", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *daemonClient) AddProxyProfile(ctx context.Context, in *AuthRequest, opts ...grpc.CallOption) (*AuthResponse, error) { out := new(AuthResponse) err := c.cc.Invoke(ctx, "/api.Daemon/AddProxyProfile", in, out, opts...) @@ -55,6 +66,15 @@ func (c *daemonClient) AddProxyProfile(ctx context.Context, in *AuthRequest, opt return out, nil } +func (c *daemonClient) NotifyProxy(ctx context.Context, in *NotifyRequest, opts ...grpc.CallOption) (*NotifyResponse, error) { + out := new(NotifyResponse) + err := c.cc.Invoke(ctx, "/api.Daemon/NotifyProxy", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *daemonClient) PullImage(ctx context.Context, in *ImageReference, opts ...grpc.CallOption) (*ImagePullResponse, error) { out := new(ImagePullResponse) err := c.cc.Invoke(ctx, "/api.Daemon/PullImage", in, out, opts...) @@ -87,7 +107,9 @@ func (c *daemonClient) ReportTraces(ctx context.Context, in *ReportTracesRequest // for forward compatibility type DaemonServer interface { GetVersion(context.Context, *Request) (*Version, error) + PingTest(context.Context, *PingRequest) (*PingResponse, error) AddProxyProfile(context.Context, *AuthRequest) (*AuthResponse, error) + NotifyProxy(context.Context, *NotifyRequest) (*NotifyResponse, error) PullImage(context.Context, *ImageReference) (*ImagePullResponse, error) SetOptimizer(context.Context, *OptimizeRequest) (*OptimizeResponse, error) ReportTraces(context.Context, *ReportTracesRequest) (*ReportTracesResponse, error) @@ -101,9 +123,15 @@ type UnimplementedDaemonServer struct { func (UnimplementedDaemonServer) GetVersion(context.Context, *Request) (*Version, error) { return nil, status.Errorf(codes.Unimplemented, "method GetVersion not implemented") } +func (UnimplementedDaemonServer) PingTest(context.Context, *PingRequest) (*PingResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PingTest not implemented") +} func (UnimplementedDaemonServer) AddProxyProfile(context.Context, *AuthRequest) (*AuthResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AddProxyProfile not implemented") } +func (UnimplementedDaemonServer) NotifyProxy(context.Context, *NotifyRequest) (*NotifyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method NotifyProxy not implemented") +} func (UnimplementedDaemonServer) PullImage(context.Context, *ImageReference) (*ImagePullResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method PullImage not implemented") } @@ -144,6 +172,24 @@ func _Daemon_GetVersion_Handler(srv interface{}, ctx context.Context, dec func(i return interceptor(ctx, in, info, handler) } +func _Daemon_PingTest_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PingRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DaemonServer).PingTest(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.Daemon/PingTest", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DaemonServer).PingTest(ctx, req.(*PingRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Daemon_AddProxyProfile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AuthRequest) if err := dec(in); err != nil { @@ -162,6 +208,24 @@ func _Daemon_AddProxyProfile_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } +func _Daemon_NotifyProxy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(NotifyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DaemonServer).NotifyProxy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.Daemon/NotifyProxy", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DaemonServer).NotifyProxy(ctx, req.(*NotifyRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Daemon_PullImage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ImageReference) if err := dec(in); err != nil { @@ -227,10 +291,18 @@ var Daemon_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetVersion", Handler: _Daemon_GetVersion_Handler, }, + { + MethodName: "PingTest", + Handler: _Daemon_PingTest_Handler, + }, { MethodName: "AddProxyProfile", Handler: _Daemon_AddProxyProfile_Handler, }, + { + MethodName: "NotifyProxy", + Handler: _Daemon_NotifyProxy_Handler, + }, { MethodName: "PullImage", Handler: _Daemon_PullImage_Handler, diff --git a/client/client.go b/client/client.go index 4583bde..7414b94 100644 --- a/client/client.go +++ b/client/client.go @@ -19,6 +19,7 @@ import ( "github.com/containerd/containerd/log" "github.com/containerd/containerd/platforms" "github.com/containerd/containerd/snapshots" + "github.com/google/go-containerregistry/pkg/name" fusefs "github.com/hanwen/go-fuse/v2/fs" pb "github.com/mc256/starlight/client/api" "github.com/mc256/starlight/client/fs" @@ -292,6 +293,37 @@ func (c *Client) storeStarlightHeader(cfgName, ref, sld string, h []byte) (err e return nil } +func (c *Client) Notify(proxyCfg string, reference name.Reference) error { + pc, _ := c.cfg.getProxy(proxyCfg) + p := proxy.NewStarlightProxy(c.ctx, pc.Protocol, pc.Address) + if pc.Username != "" { + p.SetAuth(pc.Username, pc.Password) + } + + // send message + if err := p.Notify(reference); err != nil { + return errors.Wrapf(err, "failed to notify proxy") + } + + return nil +} + +func (c *Client) Ping(proxyCfg string) (int64, string, string, error) { + pc, _ := c.cfg.getProxy(proxyCfg) + p := proxy.NewStarlightProxy(c.ctx, pc.Protocol, pc.Address) + if pc.Username != "" { + p.SetAuth(pc.Username, pc.Password) + } + + // send message + rtt, proto, url, err := p.Ping() + if err != nil { + return -1, "", "", errors.Wrapf(err, "failed to ping proxy") + } + + return rtt, proto, url, nil +} + func (c *Client) UploadTraces(proxyCfg string, tc *fs.TraceCollection) error { // connect to proxy pc, _ := c.cfg.getProxy(proxyCfg) @@ -425,21 +457,6 @@ func (c *Client) PullImage(base containerd.Image, ref, platform, proxyCfg string }) log.G(c.ctx).WithField("image", ctrImg.Name).Debugf("created image") - // send a ready signal - - /* - // for debug purpose - _ = ioutil.WriteFile("/tmp/starlight-test.json", sta, 0644) - f, err := os.OpenFile("/tmp/starlight-test.tar.gz", os.O_CREATE|os.O_WRONLY, 0644) - if err != nil { - return nil, errors.Wrapf(err, "failed to open file") - } - defer f.Close() - _, err = io.Copy(f, body) - - _, _ = config, star - */ - // keep going and download layers star.Init(c.cfg, false, manifest, imageConfig, mdd) @@ -666,7 +683,7 @@ func (c *Client) Unmount(cd, sn string) error { // InitSnapshotter initializes the snapshotter service func (c *Client) InitSnapshotter() (err error) { log.G(c.ctx). - Info("starlight snapshotter service starting") + Debug("starlight snapshotter service starting") c.snServer = grpc.NewServer() c.plugin, err = snapshotter.NewPlugin(c.ctx, c, c.cfg.Metadata) @@ -725,6 +742,12 @@ func (s *StarlightDaemonAPIServer) Version(ctx context.Context, req *pb.Request) } func (s *StarlightDaemonAPIServer) AddProxyProfile(ctx context.Context, req *pb.AuthRequest) (*pb.AuthResponse, error) { + log.G(s.client.ctx).WithFields(logrus.Fields{ + "protocol": req.Protocol, + "address": req.Address, + "username": req.Username, + }).Trace("grpc: add proxy profile") + s.client.cfg.Proxies[req.ProfileName] = &ProxyConfig{ Protocol: req.Protocol, Address: req.Address, @@ -749,6 +772,11 @@ func (s *StarlightDaemonAPIServer) AddProxyProfile(ctx context.Context, req *pb. } func (s *StarlightDaemonAPIServer) PullImage(ctx context.Context, ref *pb.ImageReference) (*pb.ImagePullResponse, error) { + log.G(s.client.ctx).WithFields(logrus.Fields{ + "base": ref.Base, + "ref": ref.Reference, + }).Trace("grpc: pull image") + base, err := s.client.FindBaseImage(ref.Base, ref.Reference) if err != nil { return &pb.ImagePullResponse{ @@ -793,6 +821,9 @@ func (s *StarlightDaemonAPIServer) PullImage(ctx context.Context, ref *pb.ImageR func (s *StarlightDaemonAPIServer) SetOptimizer(ctx context.Context, req *pb.OptimizeRequest) (*pb.OptimizeResponse, error) { okRes, failRes := make(map[string]string), make(map[string]string) + log.G(s.client.ctx).WithFields(logrus.Fields{ + "enable": req.Enable, + }).Trace("grpc: set optimizer") if req.Enable { s.client.optimizerLock.Lock() @@ -839,6 +870,10 @@ func (s *StarlightDaemonAPIServer) SetOptimizer(ctx context.Context, req *pb.Opt } func (s *StarlightDaemonAPIServer) ReportTraces(ctx context.Context, req *pb.ReportTracesRequest) (*pb.ReportTracesResponse, error) { + log.G(s.client.ctx).WithFields(logrus.Fields{ + "profile": req.ProxyConfig, + }).Trace("grpc: report") + tc, err := fs.NewTraceCollection(s.client.ctx, s.client.cfg.TracesDir) if err != nil { return &pb.ReportTracesResponse{ @@ -861,6 +896,53 @@ func (s *StarlightDaemonAPIServer) ReportTraces(ctx context.Context, req *pb.Rep }, nil } +func (s *StarlightDaemonAPIServer) NotifyProxy(ctx context.Context, req *pb.NotifyRequest) (*pb.NotifyResponse, error) { + log.G(s.client.ctx).WithFields(logrus.Fields{ + "profile": req.ProxyConfig, + }).Trace("grpc: notify") + + reference, err := name.ParseReference(req.Reference) + if err != nil { + return &pb.NotifyResponse{ + Success: false, + Message: err.Error(), + }, nil + } + + err = s.client.Notify(req.Reference, reference) + if err != nil { + return &pb.NotifyResponse{ + Success: false, + Message: err.Error(), + }, nil + } + + return &pb.NotifyResponse{ + Success: true, + Message: reference.String(), + }, nil +} + +func (s *StarlightDaemonAPIServer) PingTest(ctx context.Context, req *pb.PingRequest) (*pb.PingResponse, error) { + log.G(s.client.ctx).WithFields(logrus.Fields{ + "profile": req.ProxyConfig, + }).Trace("grpc: ping test") + + rtt, proto, server, err := s.client.Ping(req.ProxyConfig) + if err != nil { + return &pb.PingResponse{ + Success: false, + Message: err.Error(), + }, nil + } + + return &pb.PingResponse{ + Success: true, + Message: fmt.Sprintf("ok! - %s://%s", proto, server), + Latency: rtt, + }, nil +} + func newStarlightDaemonAPIServer(client *Client) *StarlightDaemonAPIServer { c := &StarlightDaemonAPIServer{client: client} return c @@ -868,7 +950,7 @@ func newStarlightDaemonAPIServer(client *Client) *StarlightDaemonAPIServer { func (c *Client) InitCLIServer() (err error) { log.G(c.ctx). - Info("starlight CLI service starting") + Debug("starlight CLI service starting") c.cliServer = grpc.NewServer() if strings.HasPrefix(c.cfg.DaemonType, "unix") { @@ -926,5 +1008,8 @@ func NewClient(ctx context.Context, cfg *Configuration) (c *Client, err error) { c.cs = c.client.ContentStore() c.operator = snapshotter.NewOperator(c.ctx, c, c.client.SnapshotService("starlight")) + // scan existing filesystems + c.operator.ScanExistingFilesystems() + return c, nil } diff --git a/client/client_test.go b/client/client_test.go index 96e7177..d704457 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -266,3 +266,16 @@ func TestClient_updateManifest(t *testing.T) { func TestPlatform(t *testing.T) { fmt.Println(platforms.DefaultString()) } + +/* + // for debug purpose + _ = ioutil.WriteFile("/tmp/starlight-test.json", sta, 0644) + f, err := os.OpenFile("/tmp/starlight-test.tar.gz", os.O_CREATE|os.O_WRONLY, 0644) + if err != nil { + return nil, errors.Wrapf(err, "failed to open file") + } + defer f.Close() + _, err = io.Copy(f, body) + + _, _ = config, star +*/ diff --git a/client/config.go b/client/config.go index bd15730..7c90de9 100644 --- a/client/config.go +++ b/client/config.go @@ -50,7 +50,8 @@ func (c *Configuration) getProxy(name string) (pc *ProxyConfig, key string) { if p, has := c.Proxies[name]; has { return p, name } - panic(fmt.Sprintf("proxy config '%s' not found", name)) + name = c.DefaultProxy + return c.Proxies[name], name } func ParseProxyStrings(v string) (name string, c *ProxyConfig, err error) { @@ -82,7 +83,7 @@ func LoadConfig(cfgPath string) (c *Configuration, p string, n bool, error error return } - p = path.Join(etcPath, "starlight_snapshotter.json") + p = path.Join(etcPath, "starlight-daemon.json") } else { p = cfgPath @@ -113,7 +114,7 @@ func (c *Configuration) SaveConfig() error { return errors.Wrapf(err, "cannot create config folder") } - p := path.Join(etcPath, "starlight_snapshotter.json") + p := path.Join(etcPath, "starlight-daemon.json") buf, _ := json.MarshalIndent(c, " ", " ") err := ioutil.WriteFile(p, buf, 0644) if err == nil { @@ -126,7 +127,7 @@ func (c *Configuration) SaveConfig() error { func NewConfig() *Configuration { uuid.EnableRandPool() return &Configuration{ - LogLevel: "debug", + LogLevel: "info", Metadata: "/var/lib/starlight/metadata.db", Socket: "/run/starlight/starlight-snapshotter.sock", DaemonType: "unix", diff --git a/client/snapshotter/operator.go b/client/snapshotter/operator.go index 75faad5..3a18331 100644 --- a/client/snapshotter/operator.go +++ b/client/snapshotter/operator.go @@ -44,12 +44,19 @@ func NewOperator(ctx context.Context, client OperatorClient, sn snapshots.Snapsh } } +// ScanExistingFilesystems scans place where the extracted file content is stored +// in case the file system has not extracted fully (without the `complete.json` file), +// we will remove the directory. func (op *Operator) ScanExistingFilesystems() { var ( err error dir1, dir2, dir3, dir4 []fs.FileInfo x1, x2, x3 bool ) + log.G(op.ctx). + WithField("root", op.client.GetFilesystemRoot()). + Debug("scanning existing filesystems") + dir1, err = ioutil.ReadDir(filepath.Join(op.client.GetFilesystemRoot(), "layers")) if err != nil { return @@ -94,11 +101,11 @@ func (op *Operator) ScanExistingFilesystems() { _ = os.RemoveAll(filepath.Join(op.client.GetFilesystemRoot(), "layers", d1.Name(), d2.Name(), d3.Name(), d4.Name(), )) - log.G(op.ctx).WithField("digest", h).Info("removed incomplete layer") + log.G(op.ctx).WithField("digest", h).Warn("removed incomplete layer") } else { x1, x2, x3 = true, true, true op.client.AddCompletedLayers(h) - log.G(op.ctx).WithField("digest", h).Info("found layer") + log.G(op.ctx).WithField("digest", h).Debug("found layer") } } } @@ -133,7 +140,7 @@ func (op *Operator) ScanSnapshots() (err error) { WithField("snapshot", info.Name). WithField("parent", info.Parent). WithField("labels", info.Labels). - Info("found snapshot") + Debug("found snapshot") return }) } diff --git a/cmd/ctr-starlight/addproxy/add_proxy.go b/cmd/ctr-starlight/addproxy/add_proxy.go index 701f107..dfa7fd4 100644 --- a/cmd/ctr-starlight/addproxy/add_proxy.go +++ b/cmd/ctr-starlight/addproxy/add_proxy.go @@ -15,6 +15,7 @@ import ( "time" ) +// addProxyProfile adds a proxy profile to the Starlight daemon configuration func addProxyProfile(client pb.DaemonClient, name, protocol, address, username, password string, quiet bool) error { ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() @@ -112,7 +113,7 @@ func Command() *cli.Command { Usage: "do not print any message unless error occurs", }, }, - ArgsUsage: "[flags] proxy-name (http|https) proxy-address [username]", + ArgsUsage: "proxy-name (http|https) proxy-address [username]", } return &cmd } diff --git a/cmd/ctr-starlight/auth/option.go b/cmd/ctr-starlight/auth/option.go deleted file mode 100644 index d2aa567..0000000 --- a/cmd/ctr-starlight/auth/option.go +++ /dev/null @@ -1,48 +0,0 @@ -/* - file created by Junlin Chen in 2022 - -*/ - -package auth - -import "github.com/urfave/cli/v2" - -var ( - CLIFlags = []cli.Flag{ - &cli.StringFlag{ - Name: "server", - Aliases: []string{"starlight-proxy"}, - Value: "starlight.yuri.moe", // public starlight proxy server - for testing only - Usage: "the starlight proxy address, report the converted image to the Starlight proxy server", - Required: false, - EnvVars: []string{"STARLIGHT_PROXY"}, - }, - &cli.BoolFlag{ - Name: "plain-http", - Aliases: []string{"insecure-proxy"}, - Usage: "use plain http connects to the remote server", - Required: false, - }, - &cli.StringFlag{ - Name: "username", - Aliases: []string{"u"}, - Usage: "username for Starlight Proxy authentication. " + - "(Starlight proxy does not provide authentication, please use a reverse proxy for authentication)", - EnvVars: []string{"STARLIGHT_USERNAME"}, - }, - &cli.StringFlag{ - Name: "password", - Aliases: []string{"p"}, - Usage: "password for Starlight Proxy authentication", - EnvVars: []string{"STARLIGHT_PASSWORD"}, - }, - } - DaemonFlag = []cli.Flag{ - &cli.StringFlag{ - Name: "config-name", - Aliases: []string{"cn"}, - Value: "default", - Usage: "the name of the config file in /etc/starlight/", - }, - } -) diff --git a/cmd/ctr-starlight/pull/options.go b/cmd/ctr-starlight/auth/options.go similarity index 97% rename from cmd/ctr-starlight/pull/options.go rename to cmd/ctr-starlight/auth/options.go index f705c5f..11006e1 100644 --- a/cmd/ctr-starlight/pull/options.go +++ b/cmd/ctr-starlight/auth/options.go @@ -3,7 +3,7 @@ */ -package pull +package auth import "github.com/urfave/cli/v2" diff --git a/cmd/ctr-starlight/convert/convert.go b/cmd/ctr-starlight/convert/convert.go index f9784de..fd6604c 100644 --- a/cmd/ctr-starlight/convert/convert.go +++ b/cmd/ctr-starlight/convert/convert.go @@ -21,18 +21,18 @@ package convert import ( "context" "errors" - "github.com/google/go-containerregistry/pkg/authn" - "github.com/google/go-containerregistry/pkg/v1/remote" - "github.com/mc256/starlight/cmd/ctr-starlight/notify" - "github.com/mc256/starlight/cmd/ctr-starlight/report" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/namespaces" + "github.com/google/go-containerregistry/pkg/authn" "github.com/google/go-containerregistry/pkg/name" + "github.com/google/go-containerregistry/pkg/v1/remote" + "github.com/mc256/starlight/cmd/ctr-starlight/auth" + "github.com/mc256/starlight/cmd/ctr-starlight/notify" "github.com/mc256/starlight/util" "github.com/urfave/cli/v2" ) +// Action - This Action does not require communicates to the Starlight daemon. func Action(ctx context.Context, c *cli.Context) error { // [flags] SourceImage StarlightImage if c.Args().Len() != 2 { @@ -93,8 +93,9 @@ func Action(ctx context.Context, c *cli.Context) error { func Command() *cli.Command { ctx := context.Background() cmd := cli.Command{ - Name: "convert", - Usage: "Convert typical container image (in .tar.gz or .tar format) to Starlight image format", + Name: "convert", + Usage: "Convert typical container image (in .tar.gz or .tar format) to Starlight image format. " + + "Credentials for private registry can be configured in $DOCKER_CONFIG.", Action: func(c *cli.Context) error { return Action(ctx, c) }, @@ -105,7 +106,7 @@ func Command() *cli.Command { // Report Flags append( - report.Flags, + auth.ProxyFlags, &cli.BoolFlag{ Name: "notify", Usage: "notify the converted image to the Starlight Proxy", diff --git a/cmd/ctr-starlight/main.go b/cmd/ctr-starlight/main.go index 29fcf3e..2157c7a 100644 --- a/cmd/ctr-starlight/main.go +++ b/cmd/ctr-starlight/main.go @@ -20,14 +20,15 @@ package main import ( "fmt" - "os" - + cmdAddProxy "github.com/mc256/starlight/cmd/ctr-starlight/addproxy" cmdConvert "github.com/mc256/starlight/cmd/ctr-starlight/convert" cmdNotify "github.com/mc256/starlight/cmd/ctr-starlight/notify" cmdOptimizer "github.com/mc256/starlight/cmd/ctr-starlight/optimizer" + cmdPing "github.com/mc256/starlight/cmd/ctr-starlight/ping" cmdPull "github.com/mc256/starlight/cmd/ctr-starlight/pull" cmdReport "github.com/mc256/starlight/cmd/ctr-starlight/report" cmdVersion "github.com/mc256/starlight/cmd/ctr-starlight/version" + "os" "github.com/mc256/starlight/util" "github.com/urfave/cli/v2" @@ -90,12 +91,14 @@ https://github.com/mc256/starlight }, } app.Commands = append([]*cli.Command{ - cmdVersion.Command(), - cmdReport.Command(), - cmdConvert.Command(), - cmdOptimizer.Command(), - cmdPull.Command(), - cmdNotify.Command(), + cmdVersion.Command(), // 1. confirm the version of starlight-daemon + cmdAddProxy.Command(), // 2. add starlight proxy to the daemon + cmdPing.Command(), // 3. ping the starlight proxy to see if it is alive + cmdConvert.Command(), // 3. convert docker image to starlight image + cmdNotify.Command(), // 4. notify the proxy that the starlight image is available + cmdOptimizer.Command(), // 5. turn on/off filesystem traces + cmdReport.Command(), // 6. upload filesystem traces to starlight proxy + cmdPull.Command(), // 7. pull starlight image }) return app diff --git a/cmd/ctr-starlight/notify/notify.go b/cmd/ctr-starlight/notify/notify.go index 6632704..d19bc36 100644 --- a/cmd/ctr-starlight/notify/notify.go +++ b/cmd/ctr-starlight/notify/notify.go @@ -8,13 +8,51 @@ package notify import ( "context" "errors" + "fmt" "github.com/containerd/containerd/log" "github.com/google/go-containerregistry/pkg/name" - "github.com/mc256/starlight/proxy" - "github.com/sirupsen/logrus" + pb "github.com/mc256/starlight/client/api" + "github.com/mc256/starlight/cmd/ctr-starlight/auth" "github.com/urfave/cli/v2" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" ) +func notify(client pb.DaemonClient, req *pb.NotifyRequest, quiet bool) { + resp, err := client.NotifyProxy(context.Background(), req) + if err != nil { + fmt.Printf("notify starlight proxy server failed: %v\n", err) + return + } + if resp.Success { + if !quiet { + fmt.Printf("notify starlight proxy server success: converted %s\n", resp.GetMessage()) + } + } else { + fmt.Printf("notify starlight proxy server failed: %v\n", resp) + } +} + +func SharedAction(ctx context.Context, c *cli.Context, reference name.Reference) (err error) { + // Dial to the daemon + address := c.String("address") + opts := grpc.WithTransportCredentials(insecure.NewCredentials()) + conn, err := grpc.Dial(address, opts) + if err != nil { + fmt.Printf("connect to starlight daemon failed: %v\n", err) + return nil + } + defer conn.Close() + + // notify + notify(pb.NewDaemonClient(conn), &pb.NotifyRequest{ + ProxyConfig: c.String("profile"), + Reference: reference.String(), + }, c.Bool("quiet")) + + return nil +} + func Action(ctx context.Context, c *cli.Context) (err error) { options := []name.Option{} @@ -32,38 +70,6 @@ func Action(ctx context.Context, c *cli.Context) (err error) { return SharedAction(ctx, c, reference) } -func SharedAction(ctx context.Context, c *cli.Context, reference name.Reference) (err error) { - protocol := "https" - if c.Bool("plain-http") { - protocol = "http" - } - - server := c.String("server") - if server == "starlight.yuri.moe" { - protocol = "https" - log.G(ctx).Warn("using public staging starlight proxy server. " + - "the public server may not have your own container image, " + - "please set your own starlight server using environment variable STARLIGHT_PROXY or --server flag") - } - - if server == "" { - log.G(ctx).Fatal("no starlight proxy server address provided") - return nil - } - - log.G(ctx).WithFields(logrus.Fields{ - "server": server, - "protocol": protocol, - }).Info("notify starlight proxy server") - - proxy := proxy.NewStarlightProxy(ctx, protocol, c.String("server")) - if err = proxy.Notify(reference); err != nil { - log.G(ctx).WithError(err).Error("failed to notify starlight proxy server") - return nil - } - return nil -} - func Command() *cli.Command { ctx := context.Background() cmd := cli.Command{ @@ -72,9 +78,7 @@ func Command() *cli.Command { Action: func(c *cli.Context) error { return Action(ctx, c) }, - Flags: append( - Flags, - ), + Flags: auth.ProxyFlags, ArgsUsage: "[flags] SourceImage StarlightImage", } return &cmd diff --git a/cmd/ctr-starlight/notify/options.go b/cmd/ctr-starlight/notify/options.go deleted file mode 100644 index 9752250..0000000 --- a/cmd/ctr-starlight/notify/options.go +++ /dev/null @@ -1,14 +0,0 @@ -/* - file created by Junlin Chen in 2022 - -*/ - -package notify - -import ( - "github.com/mc256/starlight/cmd/ctr-starlight/auth" -) - -var ( - Flags = auth.CLIFlags -) diff --git a/cmd/ctr-starlight/ping/ping.go b/cmd/ctr-starlight/ping/ping.go new file mode 100644 index 0000000..17c7ec8 --- /dev/null +++ b/cmd/ctr-starlight/ping/ping.go @@ -0,0 +1,70 @@ +/* + file created by Junlin Chen in 2022 + +*/ + +package ping + +import ( + "context" + "errors" + "fmt" + pb "github.com/mc256/starlight/client/api" + "github.com/urfave/cli/v2" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" +) + +func ping(client pb.DaemonClient, req *pb.PingRequest, quiet bool) { + resp, err := client.PingTest(context.Background(), req) + if err != nil { + fmt.Printf("network test failed: %v\n", err) + return + } + if resp.Success { + if !quiet { + fmt.Printf("ping test success: %v\nlatency: %d ms\n", resp.GetMessage(), resp.GetLatency()) + } + } else { + fmt.Printf("network test failed: %v\n", resp.GetMessage()) + } +} + +func Action(ctx context.Context, c *cli.Context) (err error) { + if c.NArg() > 1 { + return errors.New("wrong number of arguments, expected container image reference") + } + + profile := c.Args().First() + + // Dial to the daemon + address := c.String("address") + opts := grpc.WithTransportCredentials(insecure.NewCredentials()) + conn, err := grpc.Dial(address, opts) + if err != nil { + fmt.Printf("connect to starlight daemon failed: %v\n", err) + return nil + } + defer conn.Close() + + // ping + ping(pb.NewDaemonClient(conn), &pb.PingRequest{ + ProxyConfig: profile, + }, c.Bool("quiet")) + + return nil +} + +func Command() *cli.Command { + ctx := context.Background() + cmd := cli.Command{ + Name: "test", + Aliases: []string{"ping"}, + Usage: "testing network connection between starlight proxy and starlight daemon, returns HTTP RTT in ms", + Action: func(c *cli.Context) error { + return Action(ctx, c) + }, + ArgsUsage: "[proxy-profile-name]", + } + return &cmd +} diff --git a/cmd/ctr-starlight/pull/pull.go b/cmd/ctr-starlight/pull/pull.go index c96600d..b5bbd1f 100644 --- a/cmd/ctr-starlight/pull/pull.go +++ b/cmd/ctr-starlight/pull/pull.go @@ -9,6 +9,7 @@ import ( "context" "fmt" pb "github.com/mc256/starlight/client/api" + "github.com/mc256/starlight/cmd/ctr-starlight/auth" "github.com/urfave/cli/v2" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" @@ -72,7 +73,7 @@ func Command() *cli.Command { return Action(ctx, c) }, Flags: append( - ProxyFlags, + auth.ProxyFlags, ), ArgsUsage: "[flags] [BaseImage] PullImage", } diff --git a/cmd/ctr-starlight/report/options.go b/cmd/ctr-starlight/report/options.go deleted file mode 100644 index 068ac6d..0000000 --- a/cmd/ctr-starlight/report/options.go +++ /dev/null @@ -1,23 +0,0 @@ -/* - file created by Junlin Chen in 2022 - -*/ - -package report - -import ( - "github.com/mc256/starlight/cmd/ctr-starlight/auth" - "github.com/urfave/cli/v2" -) - -var ( - Flags = append([]cli.Flag{ - &cli.StringFlag{ - Name: "path", - Usage: "path the the optimizer logs", - Value: "/tmp", - DefaultText: "/tmp", - Required: false, - }, - }, auth.CLIFlags...) -) diff --git a/cmd/ctr-starlight/report/report.go b/cmd/ctr-starlight/report/report.go index 8ab74f3..50f2d40 100644 --- a/cmd/ctr-starlight/report/report.go +++ b/cmd/ctr-starlight/report/report.go @@ -22,13 +22,15 @@ import ( "context" "fmt" pb "github.com/mc256/starlight/client/api" - "github.com/mc256/starlight/cmd/ctr-starlight/pull" + "github.com/mc256/starlight/cmd/ctr-starlight/auth" "github.com/urfave/cli/v2" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" "time" ) +// report uses the daemon client to report traces, it does not report directly to the proxy +// Because it does not handle the credential and authentication of the proxy. func report(client pb.DaemonClient, req *pb.ReportTracesRequest, quiet bool) { ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() @@ -68,11 +70,11 @@ func Command() *cli.Command { ctx := context.Background() cmd := cli.Command{ Name: "report", - Usage: "Upload data collected by the optimizer back to Starlight Proxy to speed up other similar deployment", + Usage: "Report filesystem traces back to Starlight Proxy to speed up other similar deployment", Action: func(c *cli.Context) error { return Action(ctx, c) }, - Flags: pull.ProxyFlags, + Flags: auth.ProxyFlags, ArgsUsage: "", } return &cmd diff --git a/cmd/starlight-proxy/main.go b/cmd/starlight-proxy/main.go index 3f070fc..d00f563 100644 --- a/cmd/starlight-proxy/main.go +++ b/cmd/starlight-proxy/main.go @@ -192,10 +192,7 @@ func DefaultAction(context *cli.Context, cfg *proxy.Configuration) (err error) { httpServerExitDone := &sync.WaitGroup{} httpServerExitDone.Add(1) - _, err = proxy.NewServer(c, httpServerExitDone, cfg) - if err != nil { - return err - } + _, _ = proxy.NewServer(c, httpServerExitDone, cfg) wait := make(chan interface{}) <-wait diff --git a/demo/deb-package/debian/starlight-snapshotter.service b/demo/deb-package/debian/starlight.service similarity index 100% rename from demo/deb-package/debian/starlight-snapshotter.service rename to demo/deb-package/debian/starlight.service diff --git a/demo/install.sh b/demo/install.sh index 88031bb..616df1f 100755 --- a/demo/install.sh +++ b/demo/install.sh @@ -6,10 +6,10 @@ read yn_response if [[ ! $yn_response =~ ^[Yy]$ ]] then # NO - sed "s/STARLIGHT_PROXY/--plain-http --server=$proxy_address/" demo/deb-package/debian/starlight-snapshotter.service > /lib/systemd/system/starlight.service + sed "s/STARLIGHT_PROXY/--plain-http --server=$proxy_address/" demo/deb-package/debian/starlight.service > /lib/systemd/system/starlight.service else # YES - sed "s/STARLIGHT_PROXY/--server=$proxy_address/" demo/deb-package/debian/starlight-snapshotter.service > /lib/systemd/system/starlight.service + sed "s/STARLIGHT_PROXY/--server=$proxy_address/" demo/deb-package/debian/starlight.service > /lib/systemd/system/starlight.service fi printf "created systemd service file (\033[92m/lib/systemd/system/starlight.service\033[0m) \n" diff --git a/demo/starlight.service b/demo/starlight.service deleted file mode 100644 index 2bb9bfe..0000000 --- a/demo/starlight.service +++ /dev/null @@ -1,23 +0,0 @@ -[Unit] -Description=Starlight snapshotter GRPC service -Documentation=https://github.com/mc256/starlight -After=network.target local-fs.target containerd.service -Wants=containerd.service - -[Service] -ExecStart=/usr/bin/starlight-grpc run STARLIGHT_PROXY - -Type=simple -KillMode=process -Restart=always -RestartSec=5 - -LimitNPROC=infinity -LimitCORE=infinity -LimitNOFILE=infinity - -TasksMax=infinity -OOMScoreAdjust=-999 - -[Install] -WantedBy=multi-user.target \ No newline at end of file diff --git a/proxy/api.go b/proxy/api.go index ce616db..5fcf553 100644 --- a/proxy/api.go +++ b/proxy/api.go @@ -46,7 +46,7 @@ type StarlightProxy struct { auth url.Userinfo } -func (a *StarlightProxy) Ping() error { +func (a *StarlightProxy) Ping() (int64, string, string, error) { u := url.URL{ Scheme: a.protocol, Host: a.serverAddress, @@ -63,7 +63,7 @@ func (a *StarlightProxy) Ping() error { req.Header.Set("Content-Type", "application/json") resp, err := a.client.Do(req) if err != nil { - return err + return -1, "", "", err } response, err := ioutil.ReadAll(resp.Body) @@ -76,7 +76,7 @@ func (a *StarlightProxy) Ping() error { "version": version, "response": strings.TrimSpace(string(response)), }).WithError(err).Error("unknown response error") - return nil + return -1, "", "", err } if resp.StatusCode != 200 && r.Message != "Starlight Proxy" { @@ -85,16 +85,21 @@ func (a *StarlightProxy) Ping() error { "version": version, "response": strings.TrimSpace(string(response)), }).Error("server error") - return nil + return -1, "", "", err } + rtt := time.Now().Sub(t).Milliseconds() + log.G(a.ctx).WithFields(logrus.Fields{ "code": 200, "version": version, - "rtt": time.Now().Sub(t).Milliseconds(), + "rtt": rtt, "unit": "ms", + + "scheme": a.protocol, + "host": a.serverAddress, }).Info("server is okay") - return nil + return rtt, a.protocol, a.serverAddress, nil } func (a *StarlightProxy) Notify(ref name.Reference) error { diff --git a/proxy/config.go b/proxy/config.go index 0a8a11c..76fc9c3 100644 --- a/proxy/config.go +++ b/proxy/config.go @@ -94,7 +94,7 @@ func NewConfig() *Configuration { ListenPort: 8090, ListenAddress: "0.0.0.0", LogLevel: "info", - PostgresConnectionString: "postgres://starlight:password@localhost/starlight?sslmode=disable", + PostgresConnectionString: "postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable", PostgresDBSchema: "starlight", DefaultRegistry: "127.0.0.1:9000", EnableHarborScanner: false, diff --git a/proxy/extractor.go b/proxy/extractor.go index cbe3caf..73d327e 100644 --- a/proxy/extractor.go +++ b/proxy/extractor.go @@ -186,7 +186,7 @@ func (ex *Extractor) SaveToC() (res *ApiResponse, err error) { "tag": ex.ParsedTag, "hash": m.Digest.String(), "platform": pltStr, - }).Info("found image") + }).Trace("found image") // Layers layers, err := img.Layers() @@ -233,7 +233,7 @@ func (ex *Extractor) SaveToC() (res *ApiResponse, err error) { "hash": m.Digest.String(), "serial": serial, "platform": pltStr, - }).Info("saved ToC") + }).Debug("saved ToC") } diff --git a/proxy/server.go b/proxy/server.go index 1830319..731b721 100644 --- a/proxy/server.go +++ b/proxy/server.go @@ -270,6 +270,7 @@ func NewServer(ctx context.Context, wg *sync.WaitGroup, cfg *Configuration) (*Se log.G(ctx).Errorf("failed to init database: %v\n", err) return nil, err } + log.G(ctx).Debug("database initialized") // create router http.HandleFunc("/scanner", server.scanner) diff --git a/util/config.go b/util/config.go index 86fd72c..6787f01 100644 --- a/util/config.go +++ b/util/config.go @@ -92,7 +92,7 @@ func FindProjectRoot() string { // GetEtcConfigPath return a path to the configuration json func GetEtcConfigPath() string { - if production { + if production || os.Getenv("PRODUCTION") != "" { return "/etc/starlight/" } else { return filepath.Join(FindProjectRoot(), "sandbox", "etc", "starlight")