-
Notifications
You must be signed in to change notification settings - Fork 687
add the implementation of historyserver collector #4241
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
Changes from all commits
091caec
7b2acae
99fd96f
65aa6ce
0761969
ab9695b
47db5ac
95dda91
c83f5e2
f2dfa4d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -53,3 +53,5 @@ | |
|
|
||
| # Ignore generated CRD schema files | ||
| schema/ | ||
|
|
||
| **/node_modules | ||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| go 1.24.0 | ||
|
|
||
| use ./historyserver | ||
|
|
||
| use ./ray-operator | ||
|
|
||
| use . |
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| 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 . . | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would try to avoid
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid COPY on entire directories. Please only add packages containing source code required to compile binaries |
||
|
|
||
| RUN if [ "$BUILD_RAYSERVER_DASHBOARD" = "yes" ] ; then \ | ||
| /bin/bash -c "source $HOME/.nvm/nvm.sh && cd dashboard/v2.51.0/client && npm ci && npm run build" ;\ | ||
| else \ | ||
| mkdir -p dashboard/v2.51.0/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 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The historyserver is not ready in this pr. Should it be removed?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes it should
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed at KunWuLuan@7d267d9. |
||
| COPY --from=builder /historyserver/output/bin/collector /usr/local/bin/collector | ||
| COPY --from=builder /historyserver/dashboard/v2.51.0/client/build /dashboard/v2.51.0/client/build | ||
| COPY --from=builder /historyserver/dashboard/homepage /dashboard/homepage | ||
| 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 | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should the buildhistoryserver be removed because it is not ready in this pr? And so does the historyserver related content in this file.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, we need to remove all snippets related to building history server binary to keep this PR focused.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed at KunWuLuan@06175f4. |
||||||
|
|
||||||
| .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 | ||||||
|
||||||
| docker buildx build -t historyserver:laster --platform linux/amd64 . --load | |
| docker buildx build -t historyserver:latest --platform linux/amd64 . --load |
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.
Should it be the official proxy?
https://proxy.golang.org/ref: https://proxy.golang.org/
Uh oh!
There was an error while loading. Please reload this page.
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.
Nice catch, make sense!
Fixed at KunWuLuan@09697d5.