Skip to content

Commit c0f9a8c

Browse files
authored
Upgrade metadata (#144)
upgrading metadata and bumping version
1 parent 3183bec commit c0f9a8c

File tree

7 files changed

+27
-14
lines changed

7 files changed

+27
-14
lines changed

.cookiecutterrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ default_context:
3535
project_slug: 'osparc-python-runner'
3636
project_type: 'computational'
3737
release_date: '2020'
38-
version: '1.4.0'
38+
version: '1.4.1'

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.4.0
1+
1.4.1

docker-compose-meta.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ services:
3434
under OUTPUT_FOLDER/output_4 as output_4.zip", "type": "data:*/*", "fileToKeyMap":
3535
{"output_4.zip": "output_4"}}}}'
3636
io.simcore.type: '{"type": "computational"}'
37-
io.simcore.version: '{"version": "1.4.0"}'
37+
io.simcore.version: '{"version": "1.4.1"}'
3838
org.label-schema.build-date: ${BUILD_DATE}
3939
org.label-schema.schema-version: '1.0'
4040
org.label-schema.vcs-ref: ${VCS_REF}

metadata/metadata.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
name: oSparc Python Runner
2+
description: https://raw.githubusercontent.com/ZurichMedTech/s4l-assets/refs/heads/main/app/full/services/simcore_services_comp_osparc-python-runner.md
3+
icon: https://raw.githubusercontent.com/ZurichMedTech/s4l-assets/main/app/icons/s4l/simcore_services_comp_osparc-python-runner.png
4+
thumbnail: https://raw.githubusercontent.com/ZurichMedTech/s4l-assets/main/app/thumbnails/s4l/simcore_services_comp_osparc-python-runner.png
25
key: simcore/services/comp/osparc-python-runner
36
type: computational
47
integration-version: 1.0.0
5-
version: 1.4.0
6-
description: oSparc Python Runner
8+
version: 1.4.1
79
contact: anderegg@itis.swiss
810
authors:
911
- name: Sylvain Anderegg

service.cli/run

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
#!/bin/sh
23
#---------------------------------------------------------------
34
# AUTO-GENERATED CODE, do not modify this will be overwritten!!!

tests/integration/test_docker_image.py

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# pylint:disable=redefined-outer-name
44

55
import json
6+
from copy import deepcopy
67
import shutil
78
import urllib.request
89
from pathlib import Path
@@ -18,7 +19,7 @@
1819
# HELPERS
1920
def _download_url(url: str, file: Path):
2021
# Download the file from `url` and save it locally under `file_name`:
21-
with urllib.request.urlopen(url) as response, file.open('wb') as out_file:
22+
with urllib.request.urlopen(url) as response, file.open("wb") as out_file:
2223
shutil.copyfileobj(response, out_file)
2324
assert file.exists()
2425

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

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

4954

50-
@pytest.fixture(scope='session')
55+
@pytest.fixture(scope="session")
5156
def metadata_labels(metadata_file: Path) -> Dict:
5257
with metadata_file.open() as fp:
5358
metadata = yaml.safe_load(fp)
5459
return metadata
5560

61+
5662
# TESTS
5763

5864

59-
def test_docker_io_simcore_labels_against_files(docker_image: docker.models.images.Image, metadata_labels: Dict):
65+
def test_docker_io_simcore_labels_against_files(
66+
docker_image: docker.models.images.Image, metadata_labels: Dict
67+
):
6068
image_labels = docker_image.labels
6169
io_simcore_labels = _convert_to_simcore_labels(image_labels)
6270
# check files are identical
@@ -65,16 +73,18 @@ def test_docker_io_simcore_labels_against_files(docker_image: docker.models.imag
6573
assert value == metadata_labels[key]
6674

6775

68-
def test_validate_docker_io_simcore_labels(docker_image: docker.models.images.Image, osparc_service_labels_jsonschema: Dict):
76+
def test_validate_docker_io_simcore_labels(
77+
docker_image: docker.models.images.Image, osparc_service_labels_jsonschema: Dict
78+
):
6979
image_labels = docker_image.labels
7080
# get io labels
7181
io_simcore_labels = _convert_to_simcore_labels(image_labels)
7282
# validate schema
7383
try:
74-
jsonschema.validate(io_simcore_labels,
75-
osparc_service_labels_jsonschema)
84+
jsonschema.validate(io_simcore_labels, osparc_service_labels_jsonschema)
7685
except jsonschema.SchemaError:
77-
pytest.fail("Schema {} contains errors".format(
78-
osparc_service_labels_jsonschema))
86+
pytest.fail(
87+
"Schema {} contains errors".format(osparc_service_labels_jsonschema)
88+
)
7989
except jsonschema.ValidationError:
8090
pytest.fail("Failed to validate docker image io labels against schema")

versioning/service.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 1.4.0
2+
current_version = 1.4.1
33
commit = False
44
message = service/kernel version: {current_version} → {new_version}
55
tag = False

0 commit comments

Comments
 (0)