|
1 | 1 | .PHONY: schemas tests test_setup main_tests schemathesis_tests collect_coverage style_checks pre_commit_checks run download_avro check_avro avro_models update_avro kind_cluster install_amaltheas all |
2 | 2 |
|
3 | | -AMALTHEA_JS_VERSION ?= 0.11.0 |
4 | | -AMALTHEA_SESSIONS_VERSION ?= 0.0.1-new-operator-chart |
| 3 | +AMALTHEA_JS_VERSION ?= 0.12.2 |
| 4 | +AMALTHEA_SESSIONS_VERSION ?= 0.0.9-new-operator-chart |
5 | 5 | codegen_params = --input-file-type openapi --output-model-type pydantic_v2.BaseModel --use-double-quotes --target-python-version 3.12 --collapse-root-models --field-constraints --strict-nullable --set-default-enum-member --openapi-scopes schemas paths parameters --set-default-enum-member --use-one-literal-as-default --use-default |
6 | 6 |
|
7 | 7 | define test_apispec_up_to_date |
@@ -43,7 +43,18 @@ components/renku_data_services/data_connectors/apispec.py: components/renku_data |
43 | 43 |
|
44 | 44 | ##@ Apispec |
45 | 45 |
|
46 | | -schemas: components/renku_data_services/crc/apispec.py components/renku_data_services/storage/apispec.py components/renku_data_services/users/apispec.py components/renku_data_services/project/apispec.py components/renku_data_services/namespace/apispec.py components/renku_data_services/secrets/apispec.py components/renku_data_services/connected_services/apispec.py components/renku_data_services/repositories/apispec.py components/renku_data_services/notebooks/apispec.py components/renku_data_services/platform/apispec.py components/renku_data_services/data_connectors/apispec.py ## Generate pydantic classes from apispec yaml files |
| 46 | +schemas: components/renku_data_services/crc/apispec.py \ |
| 47 | +components/renku_data_services/storage/apispec.py \ |
| 48 | +components/renku_data_services/users/apispec.py \ |
| 49 | +components/renku_data_services/project/apispec.py \ |
| 50 | +components/renku_data_services/session/apispec.py \ |
| 51 | +components/renku_data_services/namespace/apispec.py \ |
| 52 | +components/renku_data_services/secrets/apispec.py \ |
| 53 | +components/renku_data_services/connected_services/apispec.py \ |
| 54 | +components/renku_data_services/repositories/apispec.py \ |
| 55 | +components/renku_data_services/notebooks/apispec.py \ |
| 56 | +components/renku_data_services/platform/apispec.py \ |
| 57 | +components/renku_data_services/data_connectors/apispec.py ## Generate pydantic classes from apispec yaml files |
47 | 58 | @echo "generated classes based on ApiSpec" |
48 | 59 |
|
49 | 60 | ##@ Avro schemas |
@@ -86,6 +97,8 @@ style_checks: ## Run linting and style checks |
86 | 97 | @$(call test_apispec_up_to_date,"notebooks") |
87 | 98 | @echo "checking platform apispec is up to date" |
88 | 99 | @$(call test_apispec_up_to_date,"platform") |
| 100 | + @echo "checking session apispec is up to date" |
| 101 | + @$(call test_apispec_up_to_date,"session") |
89 | 102 | poetry run mypy |
90 | 103 | poetry run ruff format --check |
91 | 104 | poetry run ruff check . |
@@ -143,7 +156,13 @@ kind_cluster: ## Creates a kind cluster for testing |
143 | 156 | sleep 15 |
144 | 157 | kubectl wait --namespace ingress-nginx --for=condition=ready pod --selector=app.kubernetes.io/component=controller --timeout=90s |
145 | 158 |
|
146 | | -install_amaltheas: ## Installs both version of amalthea in the currently active k8s context. |
| 159 | +install_amaltheas: ## Installs both version of amalthea in the. NOTE: It uses the currently active k8s context. |
147 | 160 | helm repo add renku https://swissdatasciencecenter.github.io/helm-charts |
148 | | - helm install amalthea-js renku/amalthea --version $(AMALTHEA_JS_VERSION) |
149 | | - helm install amalthea-sessions renku/amalthea-sessions --version $(AMALTHEA_SESSIONS_VERSION) |
| 161 | + helm repo update |
| 162 | + helm upgrade --install amalthea-js renku/amalthea --version $(AMALTHEA_JS_VERSION) |
| 163 | + helm upgrade --install amalthea-sessions amalthea-sessions-0.0.9-new-operator-chart.tgz --version $(AMALTHEA_SESSIONS_VERSION) |
| 164 | + |
| 165 | +# TODO: Add the version variables from the top of the file here when the charts are fully published |
| 166 | +amalthea_schema: ## Updates generates pydantic classes from CRDs |
| 167 | + curl https://raw.githubusercontent.com/SwissDataScienceCenter/amalthea/feat-add-cloud-storage/config/crd/bases/amalthea.dev_amaltheasessions.yaml | yq '.spec.versions[0].schema.openAPIV3Schema' | poetry run datamodel-codegen --input-file-type jsonschema --output-model-type pydantic_v2.BaseModel --output components/renku_data_services/notebooks/cr_amalthea_session.py --use-double-quotes --target-python-version 3.12 --collapse-root-models --field-constraints --strict-nullable --base-class renku_data_services.notebooks.cr_base.BaseCRD --allow-extra-fields --use-default-kwarg |
| 168 | + curl https://raw.githubusercontent.com/SwissDataScienceCenter/amalthea/main/controller/crds/jupyter_server.yaml | yq '.spec.versions[0].schema.openAPIV3Schema' | poetry run datamodel-codegen --input-file-type jsonschema --output-model-type pydantic_v2.BaseModel --output components/renku_data_services/notebooks/cr_jupyter_server.py --use-double-quotes --target-python-version 3.12 --collapse-root-models --field-constraints --strict-nullable --base-class renku_data_services.notebooks.cr_base.BaseCRD --allow-extra-fields --use-default-kwarg |
0 commit comments