diff --git a/charts/digitalhub/Chart.yaml b/charts/digitalhub/Chart.yaml index 5a10287..bfa0a03 100644 --- a/charts/digitalhub/Chart.yaml +++ b/charts/digitalhub/Chart.yaml @@ -7,7 +7,7 @@ maintainers: url: https://github.com/ffais - name: calcagiara url: https://github.com/Calcagiara -version: "0.9.0-beta3" +version: "0.9.0-beta4" appVersion: "0.9.0" dependencies: - name: apigw-operator @@ -19,7 +19,7 @@ dependencies: repository: https://helm.coder.com/v2 condition: coder.enabled - name: core - version: "0.2.18" + version: "0.2.19" repository: https://scc-digitalhub.github.io/digitalhub/ condition: core.enabled - name: kubernetes-resource-manager @@ -35,7 +35,7 @@ dependencies: repository: "https://helm.twun.io" condition: docker-registry.enabled - name: ext-postgres-operator - version: "1.2.5" + version: "1.2.6" repository: https://scc-digitalhub.github.io/digitalhub/ condition: ext-postgres-operator.enabled - name: kubeflow-pipelines diff --git a/charts/digitalhub/confs/dremio/dremio-backup.tar b/charts/digitalhub/confs/dremio/dremio-backup.tar deleted file mode 100644 index c5b6695..0000000 Binary files a/charts/digitalhub/confs/dremio/dremio-backup.tar and /dev/null differ diff --git a/charts/digitalhub/confs/tests/python-test/python-test-container.py b/charts/digitalhub/confs/tests/python-test/python-test-container.py deleted file mode 100644 index e2ba6f9..0000000 --- a/charts/digitalhub/confs/tests/python-test/python-test-container.py +++ /dev/null @@ -1,68 +0,0 @@ -import sys -import digitalhub as dh -from time import time, sleep -import os -from oauthlib.oauth2 import BackendApplicationClient -from requests_oauthlib import OAuth2Session - - -def poller(run): - - start = time() - max_time = 15 * 60 # 15 minutes - - while True: - - if (time() - start) > max_time: - raise Exception(f"Timed out waiting: run status is {run.status.state}") - - run.refresh() - - if run.status.state == "ERROR": - raise Exception(f"Something got wrong with run: {run.status.state} - {run.status.message}") - - if run.status.state == "COMPLETED": - print("Run finished.") - sys.exit(0) - - if run.status.state == "STOPPED": - print("Run stopped.") - sys.exit(1) - - sleep(5) - - -def main(): - if "CORE_CLIENT_ID" in os.environ: - # Get AAC Core Token - client_id = os.getenv("CORE_CLIENT_ID") - client_secret = os.getenv("CORE_CLIENT_SECRET") - scope = 'tenant1-core' - client = BackendApplicationClient(client_id=client_id) - oauth = OAuth2Session(client=client, scope=scope) - token = oauth.fetch_token(token_url='https://core.tenant1.digitalhub-dev.smartcommunitylab.it/auth/token', client_id=client_id, client_secret=client_secret, scope=scope) - os.environ["DHCORE_ACCESS_TOKEN"] = token["access_token"] - - # Get or create project - project = dh.get_or_create_project("project-container") - - function = project.new_function(name="build", - kind="container", - base_image="python:3.9-slim", - command="echo", - args=["hello world"]) - # Build the container - run_build = function.run(action="build", - instructions=["ls"]) - # Wait for run to finish - poller(run_build) - - # Run function - run = function.run("job") - - # Wait for run to finish - poller(run) - - -if __name__ == "__main__": - main() diff --git a/charts/digitalhub/confs/tests/python-test/python-test-dbt.py b/charts/digitalhub/confs/tests/python-test/python-test-dbt.py deleted file mode 100644 index bfdc060..0000000 --- a/charts/digitalhub/confs/tests/python-test/python-test-dbt.py +++ /dev/null @@ -1,79 +0,0 @@ -import sys -import digitalhub as dh -from time import time, sleep -import os -from oauthlib.oauth2 import BackendApplicationClient -from requests_oauthlib import OAuth2Session - - -def poller(run): - - start = time() - max_time = 15 * 60 # 15 minutes - - while True: - - if (time() - start) > max_time: - raise Exception(f"Timed out waiting: run status is {run.status.state}") - - run.refresh() - - if run.status.state == "ERROR": - raise Exception(f"Something got wrong with run: {run.status.state} - {run.status.message}") - - if run.status.state == "COMPLETED": - print("Run finished.") - sys.exit(0) - - if run.status.state == "STOPPED": - print("Run stopped.") - sys.exit(1) - - sleep(5) - - -def main(): - if "CORE_CLIENT_ID" in os.environ: - # Get AAC Core Token - client_id = os.getenv("CORE_CLIENT_ID") - client_secret = os.getenv("CORE_CLIENT_SECRET") - scope = 'tenant1-core' - client = BackendApplicationClient(client_id=client_id) - oauth = OAuth2Session(client=client, scope=scope) - token = oauth.fetch_token(token_url='https://core.tenant1.digitalhub-dev.smartcommunitylab.it/auth/token', client_id=client_id, client_secret=client_secret, scope=scope) - os.environ["DHCORE_ACCESS_TOKEN"] = token["access_token"] - - # Get or create project - project = dh.get_or_create_project("project-dbt") - - # Create new input dataitem - url = "https://gist.githubusercontent.com/kevin336/acbb2271e66c10a5b73aacf82ca82784/raw/e38afe62e088394d61ed30884dd50a6826eee0a8/employees.csv" - di = project.new_dataitem(name="employees", - kind="table", - path=url) - - # Create new function - sql = """ - WITH tab AS ( - SELECT * - FROM {{ ref('employees') }} - ) - SELECT * - FROM tab - WHERE tab."DEPARTMENT_ID" = '60' - """ - function = project.new_function(name="function-dbt", - kind="dbt", - source={"code": sql}) - - # Run function - run = function.run("transform", - inputs={"employees": di.key}, - outputs={"output_table": "department-60"}) - - # Wait for run to finish - poller(run) - - -if __name__ == "__main__": - main() diff --git a/charts/digitalhub/templates/oauth2-proxy/deployment.yaml b/charts/digitalhub/templates/oauth2-proxy/deployment.yaml index 1edd510..422d50d 100644 --- a/charts/digitalhub/templates/oauth2-proxy/deployment.yaml +++ b/charts/digitalhub/templates/oauth2-proxy/deployment.yaml @@ -37,6 +37,10 @@ spec: secretKeyRef: name: {{ $value.existingSecret.name }} key: {{ $value.existingSecret.secretKey }} + {{- if $value.resources }} + resources: + {{- toYaml $value.resources | nindent 12 }} + {{- end }} --- {{- end }} {{- end }} diff --git a/charts/digitalhub/values.yaml b/charts/digitalhub/values.yaml index a4e0cc2..bfd76db 100644 --- a/charts/digitalhub/values.yaml +++ b/charts/digitalhub/values.yaml @@ -313,6 +313,7 @@ oauth2-proxy: name: "" clientId: "" secretKey: "" + resources: {} dashboard: replicaCount: 1