Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .cookiecutterrc
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ default_context:
project_slug: 'osparc-python-runner'
project_type: 'computational'
release_date: '2020'
version: '1.4.0'
version: '1.4.1'
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.4.0
1.4.1
2 changes: 1 addition & 1 deletion docker-compose-meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ services:
under OUTPUT_FOLDER/output_4 as output_4.zip", "type": "data:*/*", "fileToKeyMap":
{"output_4.zip": "output_4"}}}}'
io.simcore.type: '{"type": "computational"}'
io.simcore.version: '{"version": "1.4.0"}'
io.simcore.version: '{"version": "1.4.1"}'
org.label-schema.build-date: ${BUILD_DATE}
org.label-schema.schema-version: '1.0'
org.label-schema.vcs-ref: ${VCS_REF}
Expand Down
6 changes: 4 additions & 2 deletions metadata/metadata.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name: oSparc Python Runner
description: https://raw.githubusercontent.com/ZurichMedTech/s4l-assets/refs/heads/main/app/full/services/simcore_services_comp_osparc-python-runner.md
icon: https://raw.githubusercontent.com/ZurichMedTech/s4l-assets/main/app/icons/s4l/simcore_services_comp_osparc-python-runner.png
thumbnail: https://raw.githubusercontent.com/ZurichMedTech/s4l-assets/main/app/thumbnails/s4l/simcore_services_comp_osparc-python-runner.png
key: simcore/services/comp/osparc-python-runner
type: computational
integration-version: 1.0.0
version: 1.4.0
description: oSparc Python Runner
version: 1.4.1
contact: anderegg@itis.swiss
authors:
- name: Sylvain Anderegg
Expand Down
1 change: 1 addition & 0 deletions service.cli/run
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

#!/bin/sh
#---------------------------------------------------------------
# AUTO-GENERATED CODE, do not modify this will be overwritten!!!
Expand Down
26 changes: 18 additions & 8 deletions tests/integration/test_docker_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# pylint:disable=redefined-outer-name

import json
from copy import deepcopy
import shutil
import urllib.request
from pathlib import Path
Expand All @@ -18,7 +19,7 @@
# HELPERS
def _download_url(url: str, file: Path):
# Download the file from `url` and save it locally under `file_name`:
with urllib.request.urlopen(url) as response, file.open('wb') as out_file:
with urllib.request.urlopen(url) as response, file.open("wb") as out_file:
shutil.copyfileobj(response, out_file)
assert file.exists()

Expand All @@ -36,6 +37,7 @@ def _convert_to_simcore_labels(image_labels: Dict) -> Dict:
assert len(io_simcore_labels) > 0
return io_simcore_labels


# FIXTURES
@pytest.fixture
def osparc_service_labels_jsonschema(tmp_path) -> Dict:
Expand All @@ -44,19 +46,25 @@ def osparc_service_labels_jsonschema(tmp_path) -> Dict:
_download_url(url, file_name)
with file_name.open() as fp:
json_schema = json.load(fp)
# artifically add to legacy scheme new icon field which is optional
# NOTE: a prpoer fix is to migrate this repository to using ooil
json_schema["properties"]["icon"] = deepcopy(json_schema["properties"]["thumbnail"])
return json_schema


@pytest.fixture(scope='session')
@pytest.fixture(scope="session")
def metadata_labels(metadata_file: Path) -> Dict:
with metadata_file.open() as fp:
metadata = yaml.safe_load(fp)
return metadata


# TESTS


def test_docker_io_simcore_labels_against_files(docker_image: docker.models.images.Image, metadata_labels: Dict):
def test_docker_io_simcore_labels_against_files(
docker_image: docker.models.images.Image, metadata_labels: Dict
):
image_labels = docker_image.labels
io_simcore_labels = _convert_to_simcore_labels(image_labels)
# check files are identical
Expand All @@ -65,16 +73,18 @@ def test_docker_io_simcore_labels_against_files(docker_image: docker.models.imag
assert value == metadata_labels[key]


def test_validate_docker_io_simcore_labels(docker_image: docker.models.images.Image, osparc_service_labels_jsonschema: Dict):
def test_validate_docker_io_simcore_labels(
docker_image: docker.models.images.Image, osparc_service_labels_jsonschema: Dict
):
image_labels = docker_image.labels
# get io labels
io_simcore_labels = _convert_to_simcore_labels(image_labels)
# validate schema
try:
jsonschema.validate(io_simcore_labels,
osparc_service_labels_jsonschema)
jsonschema.validate(io_simcore_labels, osparc_service_labels_jsonschema)
except jsonschema.SchemaError:
pytest.fail("Schema {} contains errors".format(
osparc_service_labels_jsonschema))
pytest.fail(
"Schema {} contains errors".format(osparc_service_labels_jsonschema)
)
except jsonschema.ValidationError:
pytest.fail("Failed to validate docker image io labels against schema")
2 changes: 1 addition & 1 deletion versioning/service.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.4.0
current_version = 1.4.1
commit = False
message = service/kernel version: {current_version} → {new_version}
tag = False
Expand Down