-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
122 additions
and
48 deletions.
There are no files selected for viewing
This file contains 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,47 @@ | ||
name: Lint and Test Charts | ||
|
||
on: [pull_request] | ||
|
||
jobs: | ||
lint-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up kubectl | ||
uses: azure/setup-kubectl@v3 | ||
|
||
- name: Set up Helm | ||
uses: azure/setup-helm@v3 | ||
with: | ||
version: v3.10.0 | ||
|
||
- name: Install bitnami repo | ||
run: helm repo add bitnami https://charts.bitnami.com/bitnami | ||
|
||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.9' | ||
check-latest: true | ||
|
||
- name: Set up chart-testing | ||
uses: helm/[email protected] | ||
|
||
- name: Run chart-testing (lint) | ||
run: ct lint --target-branch ${{ github.event.repository.default_branch }} | ||
|
||
- name: start minikube | ||
uses: medyagh/setup-minikube@latest | ||
id: minikube | ||
with: | ||
cache: true | ||
minikube-version: 1.22.0 | ||
|
||
- name: Copy and edit values.yaml | ||
run: python -m pip install ruamel.yaml kubernetes && cd byzer-lang && python ./cp_write_values_yaml.py | ||
|
||
- name: Run byzer-lang-testing (install) | ||
run: ct install --debug --chart-dirs ./byzer-lang --charts byzer-lang --helm-extra-args '--timeout 480s' |
This file contains 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
.idea/** | ||
/byzer-lang/values.yaml | ||
/byzer-notebook/values.yaml | ||
/package.sh | ||
/charts | ||
/charts | ||
byzer-lang/values.yaml |
This file was deleted.
Oops, something went wrong.
This file contains 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,54 @@ | ||
import ruamel.yaml | ||
from kubernetes import client, config | ||
import socket | ||
from urllib.parse import urlparse | ||
|
||
|
||
def get_cluster_url() -> str: | ||
config.load_kube_config() | ||
v1 = client.CoreV1Api() | ||
api_server = v1.api_client.configuration.host | ||
parse_result = urlparse(api_server) | ||
if parse_result.hostname == "127.0.0.1": | ||
host = socket.gethostbyname(socket.gethostname()) | ||
api_server = parse_result.scheme + "://" + host + ":" + str(parse_result.port) | ||
print(api_server) | ||
return api_server | ||
|
||
|
||
def rewrite_conf(conf: dict) -> dict: | ||
|
||
conf['clusterUrl'] = get_cluster_url() | ||
|
||
spark_conf = conf['spark'] | ||
spark_conf['driver.memory'] = "1024m" | ||
spark_conf['driver.cores'] = "1" | ||
spark_conf['executor.memory'] = "512m" | ||
spark_conf['kubernetes.driver.limit.cores'] = "400m" | ||
spark_conf['kubernetes.driver.request.cores'] = "400m" | ||
spark_conf['kubernetes.executor.limit.cores'] = "200m" | ||
spark_conf['kubernetes.executor.request.cores'] = "200m" | ||
|
||
byzer_conf = conf['byzer'] | ||
byzer_conf['mainJar'] = "byzer-lang-3.3.0-2.12-2.3.5.jar" | ||
|
||
image_conf = conf['image'] | ||
image_conf["repository"] = "byzer/byzer-lang-k8s-full" | ||
image_conf["tag"] = "3.3.0-2.3.5-2023-03-09" | ||
|
||
conf['fs']['cloud']['storage']['enabled'] = False | ||
conf['readinessProbe']['initialDelaySeconds'] = 120 | ||
conf['minReadySeconds'] = 120 | ||
conf['livenessProbe']['initialDelaySeconds'] = 120 | ||
|
||
return conf | ||
|
||
|
||
yaml = ruamel.yaml.YAML() | ||
yaml.preserve_quotes = True | ||
with open('values.example.yaml') as fp: | ||
data = yaml.load(fp) | ||
rewrite_conf(data) | ||
|
||
with open('values.yaml', 'w') as outfile: | ||
yaml.dump(data, outfile) |
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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