-
Notifications
You must be signed in to change notification settings - Fork 624
[WIP] Add historyserver log collector #3973
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
KunWuLuan
wants to merge
4
commits into
ray-project:master
Choose a base branch
from
KunWuLuan:historyserver
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
go 1.25.1 | ||
|
||
use ./historyserver |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= | ||
github.com/fxamacker/cbor/v2 v2.9.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ= | ||
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= | ||
github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= | ||
github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= | ||
github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= | ||
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= | ||
github.com/google/gnostic-models v0.7.0/go.mod h1:whL5G0m6dmc5cPxKc5bdKdEN3UjI7OUGxBlw57miDrQ= | ||
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= | ||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= | ||
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= | ||
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= | ||
github.com/moby/spdystream v0.5.0/go.mod h1:xBAYlnt/ay+11ShkdFKNAG7LsyK/tmNBVvVOwrfMgdI= | ||
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= | ||
github.com/onsi/ginkgo/v2 v2.21.0/go.mod h1:7Du3c42kxCUegi0IImZ1wUQzMBVecgIHjR1C+NkhLQo= | ||
github.com/onsi/gomega v1.35.1/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog= | ||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= | ||
github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= | ||
github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= | ||
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= | ||
go.yaml.in/yaml/v2 v2.4.2/go.mod h1:081UH+NErpNdqlCXm3TtEran0rJZGxAYx9hb/ELlsPU= | ||
go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= | ||
golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc= | ||
golang.org/x/term v0.30.0/go.mod h1:NYYFdzHoI5wRh/h5tDMdMqCqPJZEuNqVR5xJLd/n67g= | ||
golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= | ||
google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= | ||
gopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M= | ||
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= | ||
k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= | ||
k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b/go.mod h1:UZ2yyWbFTpuhSbFhv24aGNOdoRdJZgsIObGBUaYVsts= | ||
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg= | ||
sigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY= | ||
sigs.k8s.io/structured-merge-diff/v6 v6.3.0/go.mod h1:M3W8sfWvn2HhQDIbGWj3S099YozAsymCo/wrT5ohRUE= | ||
sigs.k8s.io/yaml v1.6.0/go.mod h1:796bPqUfzR/0jLAl6XjHl3Ck7MiyVv8dbTdyT3/pMf4= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
ARG TARGETOS | ||
ARG TARGETARCH | ||
|
||
FROM --platform=$BUILDPLATFORM golang:1.25.1 as builder | ||
ENV GOPROXY=https://goproxy.cn,direct | ||
ARG BUILD_RAYSERVER_DASHBOARD | ||
|
||
RUN if [ "$BUILD_RAYSERVER_DASHBOARD" = "yes" ] ; then \ | ||
curl -o install.sh https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh && chmod +x install.sh && ./install.sh && /bin/bash -c "source $HOME/.nvm/nvm.sh && nvm install 14 && nvm use 14" ;\ | ||
else \ | ||
echo "$BUILD_RAYSERVER_DASHBOARD not yes, no need install nvm"; \ | ||
fi | ||
|
||
WORKDIR /historyserver | ||
COPY . . | ||
|
||
RUN if [ "$BUILD_RAYSERVER_DASHBOARD" = "yes" ] ; then \ | ||
/bin/bash -c "source $HOME/.nvm/nvm.sh && cd dashboard/ray/client && npm ci && npm run build" ;\ | ||
else \ | ||
mkdir -p dashboard/ray/client/build ;\ | ||
echo "do not npm run build"; \ | ||
fi | ||
|
||
RUN make build GOOS=${TARGETOS} GOARCH=${TARGETARCH} | ||
|
||
FROM ubuntu:22.04 | ||
|
||
RUN apt-get update && apt-get upgrade -y && rm -rf /var/cache/apt/ && apt-get install -y ca-certificates | ||
|
||
COPY --from=builder /historyserver/output/bin/historyserver /usr/local/bin/historyserver | ||
COPY --from=builder /historyserver/output/bin/collector /usr/local/bin/collector | ||
COPY --from=builder /historyserver/dashboard/ray/client/build /dashboard/ray/build |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
# Image URL to use all building/pushing image targets | ||
GOLANGCILINT_VERSION ?= v1.59.0 | ||
GOBIN := $(shell go env GOPATH)/bin | ||
GOBIN_GOLANGCILINT := $(GOBIN)/golangci-lint | ||
|
||
DOCKERBUILDER_INSTANCE=historyserver | ||
OUT_DIR=output | ||
BIN_DIR=$(OUT_DIR)/bin | ||
BINARY_NAME=historyserver | ||
BINARY_NAME_COLLECTOR=collector | ||
|
||
# Setting SHELL to bash allows bash commands to be executed by recipes. | ||
# Options are set to exit when a recipe line exits non-zero or a piped command fails. | ||
SHELL = /usr/bin/env bash -o pipefail | ||
BUILD_TIMESTAMP = $(shell date -u +"%Y-%m-%dT%H:%M:%SZ") | ||
COMMIT_SHORT ?= $(shell git rev-parse --short HEAD) | ||
BRANCH ?= $(shell git branch --show-current) | ||
VERSION ?= $(shell git describe --tags --long|awk -F '-' '{print $$1"."$$2"-"$$3""}') | ||
|
||
PACKAGE = gitlab.alibaba-inc.com/eml/historyserver | ||
|
||
GO_LDFLAGS := -extldflags "-static" | ||
# GO_LDFLAGS += -w -s # Drop debugging symbols. | ||
GO_LDFLAGS += -X $(PACKAGE)/pkg.Version=$(VERSION) \ | ||
-X $(PACKAGE)/pkg.CommitID=$(COMMIT_SHORT) \ | ||
-X $(PACKAGE)/pkg.BuildDate=$(BUILD_TIMESTAMP) \ | ||
-X $(PACKAGE)/pkg.Branch=$(BRANCH) | ||
GO_BUILD_FLAGS := -ldflags '$(GO_LDFLAGS)' | ||
|
||
GOOS ?= darwin | ||
GOARCH ?= amd64 | ||
|
||
.PHONY: all | ||
|
||
all: build | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -rf $(OUT_DIR) | ||
|
||
.PHONY: build | ||
build: buildcollector buildhistoryserver | ||
|
||
.PHONY: buildcollector | ||
#build: mod alllint test | ||
buildcollector: mod | ||
@echo "" | ||
@echo "go build ..." | ||
CGO_ENABLED=0 GOOS=$(GOOS) GOARCH=$(GOARCH) go build -v $(GO_BUILD_FLAGS) -o $(BIN_DIR)/$(BINARY_NAME_COLLECTOR) ./cmd/collector/main.go | ||
|
||
.PHONY: buildhistoryserver | ||
#build: mod alllint test | ||
buildhistoryserver: mod | ||
@echo "" | ||
@echo "go build ..." | ||
CGO_ENABLED=0 GOOS=$(GOOS) GOARCH=$(GOARCH) go build -v $(GO_BUILD_FLAGS) -o $(BIN_DIR)/$(BINARY_NAME) ./cmd/historyserver/main.go | ||
|
||
.PHONY: simplebuild | ||
simplebuild: | ||
@echo "" | ||
@echo "go build ..." | ||
CGO_ENABLED=0 GOOS=$(GOOS) GOARCH=$(GOARCH) go build -v $(GO_BUILD_FLAGS) -o $(BIN_DIR)/$(BINARY_NAME) | ||
|
||
.PHONY: mod | ||
mod: | ||
go mod tidy | ||
|
||
.PHONY: localimage | ||
localimage: dockerbuilder_instance | ||
docker buildx build -t historyserver:laster --platform linux/amd64 . --load | ||
|
||
.PHONY: dockerbuilder_instance | ||
dockerbuilder_instance: | ||
@docker buildx use $(DOCKERBUILDER_INSTANCE) || docker buildx create --name $(DOCKERBUILDER_INSTANCE) | ||
docker buildx use $(DOCKERBUILDER_INSTANCE) | ||
|
||
# Run tests | ||
.PHONY: test | ||
test: | ||
go test -v ./pkg/... ./cmd/... | ||
|
||
.PHONY: alllint | ||
alllint: todolist issuelint ## Run go lint against code. | ||
|
||
.PHONY: issuelint | ||
issuelint: install-golint | ||
@echo "" | ||
@echo "-------------------- show issues info, if has issuse, return error --------------------" | ||
$(GOBIN_GOLANGCILINT) run -v --print-resources-usage -c .golangci.yaml | ||
|
||
.PHONY: todolist | ||
todolist: install-golint ## Run go lint against code. | ||
@echo "" | ||
@echo "-------------------- only show TODO list info --------------------" | ||
$(GOBIN_GOLANGCILINT) run --print-resources-usage -c .golangci.info.yaml --enable-only godox | ||
@echo "" | ||
|
||
install-golint: ## check golint if not exist install golint tools | ||
ifneq ("$(wildcard $(GOBIN_GOLANGCILINT))","") | ||
ifeq ($(shell $(GOBIN_GOLANGCILINT) version --format short), $(GOLANGCILINT_VERSION)) | ||
@echo "golangci-lint version match" | ||
else | ||
@echo "golangci-lint version do not match" | ||
@{ \ | ||
set -e ;\ | ||
echo 'installing golangci-lint-$(GOLANGCILINT_VERSION)' ;\ | ||
go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCILINT_VERSION) ;\ | ||
echo 'Successfully installed' ;\ | ||
} | ||
endif | ||
else | ||
@echo "golangci-lint not exist" | ||
@{ \ | ||
set -e ;\ | ||
echo 'installing golangci-lint-$(GOLANGCILINT_VERSION)' ;\ | ||
go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCILINT_VERSION) ;\ | ||
echo 'Successfully installed' ;\ | ||
} | ||
endif | ||
|
||
|
||
|
||
# Generate manifests e.g. CRD, RBAC etc. | ||
#manifests: controller-gen | ||
# $(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases | ||
|
||
# Generate code | ||
#generate: controller-gen | ||
# $(CONTROLLER_GEN) object:headerFile=./hack/boilerplate.go.txt paths=./api/... | ||
|
||
|
||
# find or download controller-gen | ||
# download controller-gen if necessary | ||
#controller-gen: | ||
#ifeq (, $(shell which controller-gen)) | ||
# go get sigs.k8s.io/controller-tools/cmd/[email protected] | ||
#CONTROLLER_GEN=$(shell go env GOPATH)/bin/controller-gen | ||
#else | ||
#CONTROLLER_GEN=$(shell which controller-gen) | ||
#endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package runtime | ||
|
||
type RayLogCollector interface { | ||
Start(chan struct{}) | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we'd better have a new go.mod in the historyserver directory.