Skip to content

Commit

Permalink
Qps merger (#4)
Browse files Browse the repository at this point in the history
Updated
  • Loading branch information
bnetzi authored Jun 5, 2024
1 parent b8f32f1 commit dcae610
Show file tree
Hide file tree
Showing 59 changed files with 2,520 additions and 946 deletions.
11 changes: 0 additions & 11 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,6 @@ jobs:
with:
fetch-depth: "0"

- name: The API should not change once published
run: |
if ! git diff --quiet origin/master -- pkg/apis/sparkoperator.k8s.io/v1beta1; then
echo "sparkoperator.k8s.io/v1beta1 api has changed"
false
fi
if ! git diff --quiet origin/master -- pkg/apis/sparkoperator.k8s.io/v1beta2; then
echo "sparkoperator.k8s.io/v1beta2 api has changed"
false
fi
- name: The API documentation hasn't changed
run: |
make build-api-docs
Expand Down
58 changes: 39 additions & 19 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ jobs:
build-skip-check:
runs-on: ubuntu-latest
outputs:
skip: ${{ steps.skip-check.outputs.skip }}
version: ${{ steps.skip-check.outputs.VERSION_TAG }}
image_changed: ${{ steps.skip-check.outputs.image_changed }}
chart_changed: ${{ steps.skip-check.outputs.chart_changed }}
app_version_tag: ${{ steps.skip-check.outputs.app_version_tag }}
chart_version_tag: ${{ steps.skip-check.outputs.chart_version_tag }}
steps:
- name: Checkout source code
uses: actions/checkout@v4
Expand All @@ -21,22 +23,36 @@ jobs:
- name: Check if build should be skipped
id: skip-check
run: |
VERSION_TAG=$(cat charts/spark-operator-chart/Chart.yaml | grep "appVersion: .*" | cut -c13-)
if git rev-parse -q --verify "refs/tags/$VERSION_TAG"; then
echo "Spark-Operator Docker Image Tag $VERSION_TAG already exists!"
echo "skip=true" >> "$GITHUB_OUTPUT"
else
git tag $VERSION_TAG
git push origin $VERSION_TAG
echo "Spark-Operator Docker Image new tag: $VERSION_TAG released"
echo "skip=false" >> "$GITHUB_OUTPUT"
app_version_tag=$(cat charts/spark-operator-chart/Chart.yaml | grep "appVersion: .*" | cut -c13-)
chart_version_tag=$(cat charts/spark-operator-chart/Chart.yaml | grep "version: .*" | cut -c10-)
# Initialize flags
image_changed=false
chart_changed=false
if ! git rev-parse -q --verify "refs/tags/$app_version_tag"; then
image_changed=true
git tag $app_version_tag
git push origin $app_version_tag
echo "Spark-Operator Docker Image new tag: $app_version_tag released"
fi
if ! git rev-parse -q --verify "refs/tags/spark-operator-chart-$chart_version_tag"; then
chart_changed=true
git tag spark-operator-chart-$chart_version_tag
git push origin spark-operator-chart-$chart_version_tag
echo "Spark-Operator Helm Chart new tag: spark-operator-chart-$chart_version_tag released"
fi
echo "VERSION_TAG=${VERSION_TAG}" >> "$GITHUB_OUTPUT"
echo "image_changed=${image_changed}" >> "$GITHUB_OUTPUT"
echo "chart_changed=${chart_changed}" >> "$GITHUB_OUTPUT"
echo "app_version_tag=${app_version_tag}" >> "$GITHUB_OUTPUT"
echo "chart_version_tag=${chart_version_tag}" >> "$GITHUB_OUTPUT"
release:
runs-on: ubuntu-latest
needs:
- build-skip-check
if: needs.build-skip-check.outputs.skip == 'false'
if: needs.build-skip-check.outputs.image_changed == 'true'
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -68,8 +84,8 @@ jobs:
uses: docker/login-action@v3
with:
registry: docker.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and Push Spark-Operator Docker Image to Docker Hub
id: build
uses: docker/build-push-action@v5
Expand Down Expand Up @@ -97,7 +113,7 @@ jobs:
needs:
- release
- build-skip-check
if: needs.build-skip-check.outputs.skip == 'false'
if: needs.build-skip-check.outputs.image_changed == 'true'
steps:
- name: Download digests
uses: actions/download-artifact@v4
Expand All @@ -112,7 +128,7 @@ jobs:
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY_IMAGE }}
tags: ${{ needs.build-skip-check.outputs.version }}
tags: ${{ needs.build-skip-check.outputs.app_version_tag }}
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
Expand All @@ -129,14 +145,18 @@ jobs:
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}
publish-chart:
runs-on: ubuntu-latest
if: needs.publish-image.result == 'success' || needs.publish-image.result == 'skipped'
if: needs.build-skip-check.outputs.chart_changed == 'true'
needs:
- publish-image
- build-skip-check
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Helm
uses: azure/setup-helm@v4
with:
version: v3.14.3
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
Expand Down
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ USER root
COPY --from=builder /usr/bin/spark-operator /usr/bin/
RUN apt-get update --allow-releaseinfo-change \
&& apt-get update \
&& apt-get install -y openssl curl tini \
&& apt-get install -y tini htop\
&& rm -rf /var/lib/apt/lists/*
COPY hack/gencerts.sh /usr/bin/

COPY entrypoint.sh /usr/bin/
COPY export-pprof.sh /usr/bin/

ENTRYPOINT ["/usr/bin/entrypoint.sh"]
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ build-api-docs:
-out-file /repo/docs/api-docs.md"

helm-unittest:
helm unittest charts/spark-operator-chart --strict
helm unittest charts/spark-operator-chart --strict --file "tests/**/*_test.yaml"

helm-lint:
docker run --rm --workdir /workspace --volume $(PWD):/workspace quay.io/helmpack/chart-testing:latest ct lint
docker run --rm --workdir /workspace --volume "$$(pwd):/workspace" quay.io/helmpack/chart-testing:latest ct lint

helm-docs:
docker run --rm --volume "$$(pwd):/helm-docs" -u "$(id -u)" jnorwood/helm-docs:latest
Expand Down
2 changes: 2 additions & 0 deletions OWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ approvers:
- mwielgus
- yuchaoran2011
- vara-bonthu
reviewers:
- ChenYi015
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ $ helm install my-release spark-operator/spark-operator --namespace spark-operat
This will install the Kubernetes Operator for Apache Spark into the namespace `spark-operator`. The operator by default watches and handles `SparkApplication`s in every namespaces. If you would like to limit the operator to watch and handle `SparkApplication`s in a single namespace, e.g., `default` instead, add the following option to the `helm install` command:

```
--set sparkJobNamespace=default
--set "sparkJobNamespaces={default}"
```

For configuration options available in the Helm chart, please refer to the chart's [README](charts/spark-operator-chart/README.md).
Expand Down
4 changes: 2 additions & 2 deletions charts/spark-operator-chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v2
name: spark-operator
description: A Helm chart for Spark on Kubernetes operator
version: 1.2.9
appVersion: v1beta2-1.4.3-3.5.0
version: 1.4.0
appVersion: v1beta2-1.6.0-3.5.0
keywords:
- spark
home: https://github.com/kubeflow/spark-operator
Expand Down
12 changes: 3 additions & 9 deletions charts/spark-operator-chart/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# spark-operator

![Version: 1.2.9](https://img.shields.io/badge/Version-1.2.9-informational?style=flat-square) ![AppVersion: v1beta2-1.4.3-3.5.0](https://img.shields.io/badge/AppVersion-v1beta2--1.4.3--3.5.0-informational?style=flat-square)
![Version: 1.4.0](https://img.shields.io/badge/Version-1.4.0-informational?style=flat-square) ![AppVersion: v1beta2-1.6.0-3.5.0](https://img.shields.io/badge/AppVersion-v1beta2--1.6.0--3.5.0-informational?style=flat-square)

A Helm chart for Spark on Kubernetes operator

Expand Down Expand Up @@ -126,22 +126,16 @@ See [helm uninstall](https://helm.sh/docs/helm/helm_uninstall) for command docum
| serviceAccounts.sparkoperator.create | bool | `true` | Create a service account for the operator |
| serviceAccounts.sparkoperator.name | string | `""` | Optional name for the operator service account |
| sidecars | list | `[]` | Sidecar containers |
| sparkJobNamespaces | list | `[]` | List of namespaces where to run spark jobs, operator namespace is included only when list of namespaces is empty |
| sparkJobNamespaces | list | `[""]` | List of namespaces where to run spark jobs |
| tolerations | list | `[]` | List of node taints to tolerate |
| uiService.enable | bool | `true` | Enable UI service creation for Spark application |
| volumeMounts | list | `[]` | |
| volumes | list | `[]` | |
| webhook.cleanupAnnotations | object | `{"helm.sh/hook":"pre-delete, pre-upgrade","helm.sh/hook-delete-policy":"hook-succeeded"}` | The annotations applied to the cleanup job, required for helm lifecycle hooks |
| webhook.cleanupPodLabels | object | `{}` | The podLabels applied to the pod of the cleanup job |
| webhook.cleanupResources | object | `{}` | Resources applied to cleanup job |
| webhook.enable | bool | `false` | Enable webhook server |
| webhook.initAnnotations | object | `{"helm.sh/hook":"pre-install, pre-upgrade","helm.sh/hook-weight":"50"}` | The annotations applied to init job, required to restore certs deleted by the cleanup job during upgrade |
| webhook.initPodLabels | object | `{}` | The podLabels applied to the pod of the init job |
| webhook.initResources | object | `{}` | Resources applied to init job |
| webhook.namespaceSelector | string | `""` | The webhook server will only operate on namespaces with this label, specified in the form key1=value1,key2=value2. Empty string (default) will operate on all namespaces |
| webhook.port | int | `8080` | Webhook service port |
| webhook.portName | string | `"webhook"` | Webhook container port name and service target port name |
| webhook.timeout | int | `30` | |
| webhook.timeout | int | `30` | The annotations applied to init job, required to restore certs deleted by the cleanup job during upgrade |

## Maintainers

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -917,6 +917,8 @@ spec:
x-kubernetes-int-or-string: true
type: object
type: object
restartPolicy:
type: string
securityContext:
properties:
seccompProfile:
Expand Down Expand Up @@ -1336,6 +1338,10 @@ spec:
additionalProperties:
type: string
type: object
serviceLabels:
additionalProperties:
type: string
type: object
shareProcessNamespace:
type: boolean
sidecars:
Expand Down Expand Up @@ -2744,6 +2750,8 @@ spec:
x-kubernetes-int-or-string: true
type: object
type: object
restartPolicy:
type: string
securityContext:
properties:
seccompProfile:
Expand Down Expand Up @@ -3775,6 +3783,43 @@ spec:
serviceType:
type: string
type: object
driverIngressOptions:
items:
properties:
serviceAnnotations:
additionalProperties:
type: string
type: object
serviceLabels:
additionalProperties:
type: string
type: object
ingressURLFormat:
type: string
ingressAnnotations:
additionalProperties:
type: string
type: object
ingressTLS:
items:
properties:
hosts:
items:
type: string
type: array
secretName:
type: string
type: object
type: array
servicePort:
format: int32
type: integer
servicePortName:
type: string
serviceType:
type: string
type: object
type: array
sparkVersion:
type: string
timeToLiveSeconds:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,8 @@ spec:
x-kubernetes-int-or-string: true
type: object
type: object
restartPolicy:
type: string
securityContext:
properties:
seccompProfile:
Expand Down Expand Up @@ -1322,6 +1324,10 @@ spec:
additionalProperties:
type: string
type: object
serviceLabels:
additionalProperties:
type: string
type: object
shareProcessNamespace:
type: boolean
sidecars:
Expand Down Expand Up @@ -2730,6 +2736,8 @@ spec:
x-kubernetes-int-or-string: true
type: object
type: object
restartPolicy:
type: string
securityContext:
properties:
seccompProfile:
Expand Down Expand Up @@ -3763,6 +3771,43 @@ spec:
serviceType:
type: string
type: object
driverIngressOptions:
items:
properties:
serviceAnnotations:
additionalProperties:
type: string
type: object
serviceLabels:
additionalProperties:
type: string
type: object
ingressURLFormat:
type: string
ingressAnnotations:
additionalProperties:
type: string
type: object
ingressTLS:
items:
properties:
hosts:
items:
type: string
type: array
secretName:
type: string
type: object
type: array
servicePort:
format: int32
type: integer
servicePortName:
type: string
serviceType:
type: string
type: object
type: array
sparkVersion:
type: string
timeToLiveSeconds:
Expand Down
Loading

0 comments on commit dcae610

Please sign in to comment.