Skip to content

Commit

Permalink
Cherry pick #2081 #2046 #2091 #2072 (#2108)
Browse files Browse the repository at this point in the history
* Update helm docs (#2081)

Signed-off-by: Carlos Sánchez Páez <karlossanpa@gmail.com>
(cherry picked from commit eca3fc8)

* Update the process to build api-docs, generate CRD manifests and code (#2046)

* Update .gitignore

Signed-off-by: Yi Chen <github@chenyicn.net>

* Update .dockerignore

Signed-off-by: Yi Chen <github@chenyicn.net>

* Update Makefile

Signed-off-by: Yi Chen <github@chenyicn.net>

* Update the process to generate api docs

Signed-off-by: Yi Chen <github@chenyicn.net>

* Update the workflow to generate api docs

Signed-off-by: Yi Chen <github@chenyicn.net>

* Use controller-gen to generate CRD and deep copy related methods

Signed-off-by: Yi Chen <github@chenyicn.net>

* Update helm chart CRDs

Signed-off-by: Yi Chen <github@chenyicn.net>

* Update workflow for building spark operator

Signed-off-by: Yi Chen <github@chenyicn.net>

* Update README.md

Signed-off-by: Yi Chen <github@chenyicn.net>

---------

Signed-off-by: Yi Chen <github@chenyicn.net>
(cherry picked from commit 779ea3d)

* Add topologySpreadConstraints (#2091)

* Update README and documentation (#2047)

* Update docs

Signed-off-by: Yi Chen <github@chenyicn.net>

* Remove docs and update README

Signed-off-by: Yi Chen <github@chenyicn.net>

* Add link to monthly community meeting

Signed-off-by: Yi Chen <github@chenyicn.net>

---------

Signed-off-by: Yi Chen <github@chenyicn.net>
Signed-off-by: jbhalodia-slack <jbhalodia@salesforce.com>

* Add PodDisruptionBudget to chart (#2078)

* Add PodDisruptionBudget to chart

Signed-off-by: Carlos Sánchez Páez <karlossanpa@gmail.com>
Signed-off-by: Carlos Sánchez Páez <sanchezpaezcarlos33@gmail.com>
Signed-off-by: Carlos Sánchez Páez <karlossanpa@gmail.com>

* PR comments

Signed-off-by: Carlos Sánchez Páez <karlossanpa@gmail.com>

---------

Signed-off-by: Carlos Sánchez Páez <karlossanpa@gmail.com>
Signed-off-by: Carlos Sánchez Páez <sanchezpaezcarlos33@gmail.com>
Signed-off-by: jbhalodia-slack <jbhalodia@salesforce.com>

* Set topologySpreadConstraints

Signed-off-by: jbhalodia-slack <jbhalodia@salesforce.com>

* Update README and increase patch version

Signed-off-by: jbhalodia-slack <jbhalodia@salesforce.com>

* Revert replicaCount change

Signed-off-by: jbhalodia-slack <jbhalodia@salesforce.com>

* Update README after master merger

Signed-off-by: jbhalodia-slack <jbhalodia@salesforce.com>

* Update README

Signed-off-by: jbhalodia-slack <jbhalodia@salesforce.com>

---------

Signed-off-by: Yi Chen <github@chenyicn.net>
Signed-off-by: jbhalodia-slack <jbhalodia@salesforce.com>
Signed-off-by: Carlos Sánchez Páez <karlossanpa@gmail.com>
Signed-off-by: Carlos Sánchez Páez <sanchezpaezcarlos33@gmail.com>
Co-authored-by: Yi Chen <github@chenyicn.net>
Co-authored-by: Carlos Sánchez Páez <karlossanpa@gmail.com>
(cherry picked from commit 4108f54)

* Use controller-runtime to reconsturct spark operator (#2072)

* Use controller-runtime to reconstruct spark operator

Signed-off-by: Yi Chen <github@chenyicn.net>

* Update helm charts

Signed-off-by: Yi Chen <github@chenyicn.net>

* Update examples

Signed-off-by: Yi Chen <github@chenyicn.net>

---------

Signed-off-by: Yi Chen <github@chenyicn.net>
(cherry picked from commit 0dc641b)

---------

Co-authored-by: Carlos Sánchez Páez <karlossanpa@gmail.com>
Co-authored-by: jbhalodia-slack <jbhalodia@salesforce.com>
  • Loading branch information
3 people committed Aug 1, 2024
1 parent b8c9013 commit 9034cc4
Show file tree
Hide file tree
Showing 307 changed files with 66,667 additions and 36,053 deletions.
32 changes: 31 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,31 @@
vendor
.github/
.idea/
.vscode/
bin/
charts/
docs/
config/
examples/
hack/
manifest/
spark-docker/
sparkctl/
test/
vendor/
.dockerignore
.DS_Store
.gitignore
.gitlab-ci.yaml
.golangci.yaml
.pre-commit-config.yaml
ADOPTERS.md
CODE_OF_CONDUCT.md
codecov.ymal
CONTRIBUTING.md
cover.out
Dockerfile
LICENSE
OWNERS
PROJECT
README.md
test.sh
18 changes: 11 additions & 7 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ jobs:
with:
fetch-depth: "0"

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: The API documentation hasn't changed
run: |
make build-api-docs
Expand All @@ -42,7 +47,7 @@ jobs:

- name: build sparkctl
run: |
make all
make build-sparkctl
build-spark-operator:
runs-on: ubuntu-latest
Expand All @@ -57,18 +62,17 @@ jobs:
with:
go-version-file: "go.mod"

- name: Run gofmt check
run: make fmt-check
- name: Run go fmt check
run: make go-fmt

- name: Run static analysis
run: make static-analysis
- name: Run go vet
run: make go-vet

- name: Run unit tests
run: make unit-test

- name: Build Spark-Operator Docker Image
run: |
docker build -t docker.io/kubeflow/spark-operator:latest .
run: make docker-build IMAGE_TAG=latest

- name: Check changes in resources used in docker file
run: |
Expand Down
12 changes: 7 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
.vscode/
bin/
vendor/
spark-operator
.idea/
**/*.iml
cover.out
sparkctl/sparkctl
spark-on-k8s-operator
sparkctl/sparkctl-linux-amd64
sparkctl/sparkctl-darwin-amd64
**/*.iml

# Various IDEs
.idea/
.vscode/
39 changes: 39 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
run:
deadline: 5m

linters:
enable:
- revive
- gci
- depguard
- godot
- testifylint
- unconvert

issues:
exclude-rules:
# Disable errcheck linter for test files.
- path: _test.go
linters:
- errcheck

linters-settings:
gci:
sections:
- standard
- default
- prefix(github.com/kubeflow/spark-operator)
depguard:
Main:
files:
- $all
- "!$test"
listMode: Lax
deny:
reflect: Please don't use reflect package
Test:
files:
- $test
listMode: Lax
deny:
reflect: Please don't use reflect package
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ repos:
# Make the tool search for charts only under the `charts` directory
- --chart-search-root=charts
- --template-files=README.md.gotmpl
- --sort-values-order=file
25 changes: 9 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,26 @@

ARG SPARK_IMAGE=spark:3.5.0

FROM golang:1.22-alpine as builder
FROM golang:1.22.5 AS builder

WORKDIR /workspace

# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
# Cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN go mod download
COPY . .

# Copy the go source code
COPY main.go main.go
COPY pkg/ pkg/

# Build
ARG TARGETARCH
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} GO111MODULE=on go build -a -o /usr/bin/spark-operator main.go

RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} GO111MODULE=on make build-operator

FROM ${SPARK_IMAGE}

USER root
COPY --from=builder /usr/bin/spark-operator /usr/bin/
RUN apt-get update --allow-releaseinfo-change \
&& apt-get update \

RUN apt-get update \
&& apt-get install -y tini \
&& rm -rf /var/lib/apt/lists/*

COPY --from=builder /workspace/bin/spark-operator /usr/bin/spark-operator

COPY entrypoint.sh /usr/bin/

ENTRYPOINT ["/usr/bin/entrypoint.sh"]
Loading

0 comments on commit 9034cc4

Please sign in to comment.