diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f9616c4c970a6e5d1d10d65c7e997b076a8f938c..6bb4eea34385844f514d7341f94e5d9397b1559e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -691,6 +691,7 @@ k8s-test-alpine: stage: test variables: PYTHONPATH: /usr/local/lib/python3.9/site-packages + KUBE_NAMESPACE: "ci-$CI_PROJECT_NAME-alpine-$CI_COMMIT_SHORT_SHA" tags: - k8srunner before_script: @@ -699,11 +700,10 @@ k8s-test-alpine: - make k8s-install-chart IS_ALPINE="-alpine" CAR_OCI_REGISTRY_HOST=${CI_REGISTRY}/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME} - make k8s-wait script: - - make k8s-test K8S_TEST_IMAGE_TO_TEST=${CI_REGISTRY}/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}/ska-tango-images-tango-itango-alpine:9.3.9 + - make k8s-test K8S_TEST_IMAGE_TO_TEST=${CI_REGISTRY}/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}/ska-tango-images-tango-itango-alpine:$(. .make/.make-release-support; RELEASE_CONTEXT_DIR=images/ska-tango-images-tango-itango-alpine setContextHelper; getVersion) after_script: - echo $CI_JOB_NAME - $CI_JOB_STAGE - make k8s-uninstall-chart - - kubectl -n $KUBE_NAMESPACE delete pods,svc,daemonsets,deployments,replicasets,statefulsets,cronjobs,jobs,ingresses,configmaps --all - make k8s-delete-namespace artifacts: name: "$CI_PROJECT_NAME-$CI_JOB_ID" @@ -719,7 +719,6 @@ k8s-test-alpine: rules: - exists: - tests/**/* - allow_failure: true scan_dependencies: extends: diff --git a/.make b/.make index aeaf7ed40aac084930270e09097022da127f0c33..aeef46bcc6c3386fd046d23978b347c21fd37e7d 160000 --- a/.make +++ b/.make @@ -1 +1 @@ -Subproject commit aeaf7ed40aac084930270e09097022da127f0c33 +Subproject commit aeef46bcc6c3386fd046d23978b347c21fd37e7d diff --git a/.release b/.release index de450897a25f0135877012985df72c05b2ee11c6..0f49b249578f2fc77100f35ea68db1b8d01fd74d 100644 --- a/.release +++ b/.release @@ -1,2 +1,2 @@ -release=0.3.12 -tag=0.3.12 +release=0.3.13 +tag=0.3.13 diff --git a/charts/ska-tango-base/Chart.yaml b/charts/ska-tango-base/Chart.yaml index cb56d89a1fe2e2538b10f8757138109e2fc48a3a..c9bdee546380718ae09a97501e1994681bfc9c96 100644 --- a/charts/ska-tango-base/Chart.yaml +++ b/charts/ska-tango-base/Chart.yaml @@ -2,9 +2,9 @@ apiVersion: v2 appVersion: 0.3.12 description: A Helm chart for deploying the TANGO base system on Kubernetes name: ska-tango-base -version: 0.3.12 +version: 0.3.13 icon: https://www.skatelescope.org/wp-content/uploads/2016/07/09545_NEW_LOGO_2014.png dependencies: - name: ska-tango-util - version: 0.3.12 + version: 0.3.13 repository: file://../ska-tango-util diff --git a/charts/ska-tango-umbrella/Chart.yaml b/charts/ska-tango-umbrella/Chart.yaml index f76bc37d2a5f09ed83f65d7579247963a8b621b7..dbcf12b60129151d77870bd22b8c527485e63695 100644 --- a/charts/ska-tango-umbrella/Chart.yaml +++ b/charts/ska-tango-umbrella/Chart.yaml @@ -6,10 +6,10 @@ version: 0.2.4 icon: https://www.skatelescope.org/wp-content/uploads/2016/07/09545_NEW_LOGO_2014.png dependencies: - name: ska-tango-base - version: 0.3.12 + version: 0.3.13 repository: file://../ska-tango-base condition: ska-tango-base.enabled,global.sub-system.ska-tango-base.enabled - name: ska-tango-util - version: 0.3.12 + version: 0.3.13 repository: file://../ska-tango-util diff --git a/charts/ska-tango-util/Chart.yaml b/charts/ska-tango-util/Chart.yaml index 313837d1fc25ed094d309ddc0d769b9ce4ff4543..8ae14044a38e29dcfeafc0383c6baadac91a49c9 100644 --- a/charts/ska-tango-util/Chart.yaml +++ b/charts/ska-tango-util/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 description: A Helm chart library of utilities for TANGO deployents name: ska-tango-util type: library -appVersion: 0.3.12 -version: 0.3.12 +appVersion: 0.3.13 +version: 0.3.13 icon: https://www.skatelescope.org/wp-content/uploads/2016/07/09545_NEW_LOGO_2014.png maintainers: - name: Matteo Di Carlo diff --git a/charts/ska-tango-util/templates/_deviceserver-pvc.yaml b/charts/ska-tango-util/templates/_deviceserver-pvc.yaml index 151bb024b8d509a144aaa14923602f14f04ea562..0ea697f96271db0e39a2a100b86e8723014132db 100644 --- a/charts/ska-tango-util/templates/_deviceserver-pvc.yaml +++ b/charts/ska-tango-util/templates/_deviceserver-pvc.yaml @@ -57,6 +57,7 @@ metadata: vol: {{ $volume_name | toString }}-admin {{ toYaml $labels | indent 4 }} name: {{ $volume_name | toString }}-admin-{{ .local.Release.Name }} + namespace: {{ .local.Release.Namespace }} {{ if $annotations }} annotations: {{ toYaml $annotations | indent 4 }} diff --git a/tests/tango_values.yaml b/tests/tango_values.yaml new file mode 100644 index 0000000000000000000000000000000000000000..0055e5f89948b64a545f849a7c47b3dd7a907bc5 --- /dev/null +++ b/tests/tango_values.yaml @@ -0,0 +1,243 @@ +# Default values for tango-base. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +# global: +# annotations: +# app.gitlab.com/app: CI_PROJECT_PATH_SLUG +# app.gitlab.com/env: CI_ENVIRONMENT_SLUG + # by setting this parameter we can disable the lower level sub-system tango-base, archiver and webjive + # sub-system: + # tango-base: + # enabled: false + # archiver: + # enabled: false + # webjive: + # enabled: false + +# tango-base: +# enabled: true + + +# Default values for tango-base. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +display: ":0" +xauthority: "~/.Xauthority" + +global: + minikube: false + exposeDatabaseDS: false + exposeAllDS: false + cluster_domain: cluster.local + tango_host: databaseds-tango-base:10000 + databaseds_port: 10000 + device_server_port: 45450 + retry: + - "--sleep=1" + - "--tries=100" + +homeDir: /home/ubuntu +system: SW-infrastructure +subsystem: ska-tango-base +telescope: SKA-mid + +labels: + app: ska-tango-images +annotations: + app.gitlab.com/app: CI_PROJECT_PATH_SLUG + app.gitlab.com/env: CI_ENVIRONMENT_SLUG + +dsconfig: + image: + registry: registry.gitlab.com/ska-telescope/ska-tango-images + image: ska-tango-images-tango-dsconfig-alpine + tag: 1.5.7 + pullPolicy: IfNotPresent + +itango: + enabled: false + component: itango-console + function: generic-tango-console + domain: interactive-testing + intent: enabling + image: + registry: registry.gitlab.com/ska-telescope/ska-tango-images + image: ska-tango-images-tango-itango-alpine + tag: 9.3.9 + pullPolicy: IfNotPresent + resources: + requests: + cpu: 100m # 00m = 0.1 CPU + memory: 128Mi # 128Mi = 0.125 GB mem + ephemeral-storage: 512Mi + limits: + cpu: 100m # 00m = 0.1 CPU + memory: 128Mi # 128Mi = 0.125 GB mem + ephemeral-storage: 512Mi + +databaseds: + component: databaseds + function: tangodb-interface + domain: tango-configuration + intent: production + image: + registry: registry.gitlab.com/ska-telescope/ska-tango-images + image: ska-tango-images-tango-cpp-alpine + tag: 9.3.13 + pullPolicy: IfNotPresent + vault: + useVault: false + secretPath: stfc + role: kube-role + resources: + requests: + cpu: 100m # 100m = 0.1 CPU + memory: 128Mi # 128Mi = 0.125 GB mem + ephemeral-storage: 512Mi + limits: + cpu: 200m # 200m = 0.2 CPU + memory: 256Mi # 256Mi = 0.25 GB mem + ephemeral-storage: 1Gi + livenessProbe: + enabled: true + initialDelaySeconds: 0 + periodSeconds: 10 + timeoutSeconds: 1 + successThreshold: 1 + failureThreshold: 3 + readinessProbe: + enabled: true + initialDelaySeconds: 0 + periodSeconds: 10 + timeoutSeconds: 1 + successThreshold: 1 + failureThreshold: 3 + +deviceServers: + tangotest: + name: tangotest + function: tango-test + domain: tango-base + command: "/usr/local/bin/TangoTest" + instances: ["test"] + depends_on: + - device: sys/database/2 + environment_variables: [] + server: + name: "TangoTest" + instances: + - name: "test" + classes: + - name: "TangoTest" + devices: + - name: "sys/tg_test/1" + image: + registry: registry.gitlab.com/ska-telescope/ska-tango-images + image: ska-tango-images-tango-java-alpine + tag: 9.3.9 + pullPolicy: IfNotPresent + resources: + requests: + cpu: 200m # 200m = 0.2 CPU + memory: 256Mi # 256Mi = 0.25 GB mem + ephemeral-storage: 1Gi + limits: + cpu: 500m # 500m = 0.5 CPU + memory: 512Mi # 512Mi = 0.5 GB mem + ephemeral-storage: 1Gi + livenessProbe: + initialDelaySeconds: 0 + periodSeconds: 10 + timeoutSeconds: 1 + successThreshold: 1 + failureThreshold: 3 + readinessProbe: + initialDelaySeconds: 0 + periodSeconds: 10 + timeoutSeconds: 1 + successThreshold: 1 + failureThreshold: 3 + +tangodb: + enabled: true + use_pv: false + component: tangodb + function: tango-device-configuration + domain: tango-configuration + intent: production + image: + registry: registry.gitlab.com/ska-telescope/ska-tango-images + image: ska-tango-images-tango-db-alpine + tag: 0.0.6 + pullPolicy: IfNotPresent + db: + rootpw: secret + db: tango + user: tango + password: tango + vault: + useVault: false + secretPath: stfc + role: kube-role + resources: + requests: + cpu: 100m # 100m = 0.1 CPU + memory: 256Mi # 256Mi = 0.25 GB mem + ephemeral-storage: 1Gi + limits: + cpu: 200m # 200m = 0.2 CPU + memory: 256Mi # 256Mi = 0.25 GB mem + ephemeral-storage: 2Gi + livenessProbe: + enabled: false + initialDelaySeconds: 10 + periodSeconds: 10 + timeoutSeconds: 1 + successThreshold: 1 + failureThreshold: 3 + readinessProbe: + enabled: false + initialDelaySeconds: 10 + periodSeconds: 10 + timeoutSeconds: 1 + successThreshold: 1 + failureThreshold: 3 + +vnc: + enabled: false + component: vnc-gui + function: generic-tango-vnc-gui + domain: interactive-testing + intent: enabling + nodeport_enabled: false + nodeport_vnc: 32081 + nodeport_novnc: 32082 + replicas: 3 + image: + registry: registry.gitlab.com/ska-telescope/ska-tango-images + image: ska-tango-images-tango-vnc + tag: 0.1.6 + pullPolicy: IfNotPresent + resources: + requests: + cpu: 100m # 100m = 0.1 CPU + memory: 256Mi # 256Mi = 0.25 GB mem + ephemeral-storage: 256Mi + limits: + cpu: 100m # 100m = 0.1 CPU + memory: 256Mi # 256Mi = 0.25 GB mem + ephemeral-storage: 256Mi + +# Configure Ingress resource that allow you to access the Tango REST API +ingress: + enabled: true + nginx: true + +nodeSelector: {} + +affinity: {} + +tolerations: [] + diff --git a/tests/unit/test_tango-commands.py b/tests/unit/test_tango-commands.py index 66b052a80cc528a39ed916cdc65b83fac553f62a..11168c45d7a8bb30ab05baced3ac85787f066f12 100644 --- a/tests/unit/test_tango-commands.py +++ b/tests/unit/test_tango-commands.py @@ -11,14 +11,14 @@ from pytest_bdd import given, scenario, then, when, parsers, scenarios scenarios('../features/tango-commands.feature') @pytest.fixture -@given(parsers.parse('a device called {device_name}')) +@given(parsers.parse('a device called {device_name}'), target_fixture="device_proxy") def device_proxy(run_context, device_name): """a device called sys/tg_test/1.""" return tango.DeviceProxy(device_name) @pytest.fixture -@when(parsers.cfparse("I call the command {command_name}({parameter:String?})", extra_types=dict(String=str))) +@when(parsers.cfparse("I call the command {command_name:String}({parameter:String?})", extra_types=dict(String=str)), target_fixture="call_command") def call_command(device_proxy,command_name, parameter): """I call the command State().""" # logging.info("Called command: {} with parameter {} for device {}".format(command_name, parameter, device_proxy.info()))