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
6 changes: 3 additions & 3 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ jobs:

- name: Start services
run: |
docker-compose pull
LOCALHOST_ADDR=localhost docker-compose up -d keycloak
FSGATEWAY_TAG=latest-dev JMS_TAG=latest-dev docker-compose pull
FSGATEWAY_TAG=latest-dev JMS_TAG=latest-dev LOCALHOST_ADDR=localhost docker-compose up -d keycloak
echo "Waiting a few sec ..."
sleep 5
LOCALHOST_ADDR=localhost docker-compose up -d
FSGATEWAY_TAG=latest-dev JMS_TAG=latest-dev LOCALHOST_ADDR=localhost docker-compose up -d
working-directory: ./rep-deployments/docker-compose

- name: Test with tox
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ jobs:

- name: Start services
run: |
docker-compose pull
LOCALHOST_ADDR=localhost docker-compose up -d keycloak
FSGATEWAY_TAG=latest-dev JMS_TAG=latest-dev docker-compose pull
FSGATEWAY_TAG=latest-dev JMS_TAG=latest-dev LOCALHOST_ADDR=localhost docker-compose up -d keycloak
echo "Waiting a few sec ..."
sleep 5
LOCALHOST_ADDR=localhost docker-compose up -d
FSGATEWAY_TAG=latest-dev JMS_TAG=latest-dev LOCALHOST_ADDR=localhost docker-compose up -d
working-directory: ./rep-deployments/docker-compose

- name: Test with tox
Expand Down
2 changes: 1 addition & 1 deletion ansys/rep/client/common/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from .base_resource import Object
from .base_schema import BaseSchema, ObjectSchema
from .base_schema import BaseSchema, ObjectSchema, ObjectSchemaWithModificationInfo
from .restricted_value import RestrictedValue
39 changes: 37 additions & 2 deletions ansys/rep/client/common/base_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,41 @@ class ObjectSchema(BaseSchema):
id = fields.String(
allow_none=True,
attribute="id",
description="Unique ID to access the resource, generated "
"internally by the server on creation.",
metadata={
"description": "Unique ID to access the resource, generated "
"internally by the server on creation."
},
)


class ObjectSchemaWithModificationInfo(ObjectSchema):

creation_time = fields.DateTime(
allow_none=True,
load_only=True,
metadata={
"description": "The date and time the resource was created.",
},
)
modification_time = fields.DateTime(
allow_none=True,
load_only=True,
metadata={
"description": "The date and time the resource was last modified.",
},
)

created_by = fields.String(
allow_none=True,
load_only=True,
metadata={
"description": "ID of the user who created the object.",
},
)
modified_by = fields.String(
allow_none=True,
load_only=True,
metadata={
"description": "ID of the user who last modified the object.",
},
)
4 changes: 2 additions & 2 deletions ansys/rep/client/jms/api/project_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from ansys.rep.client.client import Client
from ansys.rep.client.common import Object
from ansys.rep.client.exceptions import ClientError, REPError
from ansys.rep.client.exceptions import REPError
from ansys.rep.client.jms.resource import (
Algorithm,
File,
Expand Down Expand Up @@ -566,7 +566,7 @@ def _download_file(
) -> str:

if getattr(file, "hash", None) is None:
raise ClientError(f"No hash found. Failed to download file {file.name}")
log.warning(f"No hash found for file {file.name}.")

Path(target_path).mkdir(parents=True, exist_ok=True)
download_link = f"{project_api.fs_bucket_url}/{file.storage_id}"
Expand Down
24 changes: 16 additions & 8 deletions ansys/rep/client/jms/resource/algorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,18 @@ class Algorithm(Object):
----------
id : str, optional
Unique ID to access the resource, generated internally by the server on creation.
creation_time : datetime, optional
The date and time the resource was created.
modification_time : datetime, optional
The date and time the resource was last modified.
created_by : str, optional
ID of the user who created the object.
modified_by : str, optional
ID of the user who last modified the object.
name : str, optional
Name of the algorithm.
description : str, optional
Description of the algorithm.
creation_time : datetime, optional
The date and time the algorithm was created.
modification_time : datetime, optional
The date and time the algorithm was last modified.
data : str, optional
Generic string field to hold arbitrary algorithm configuration data, e.g. as JSON dictionary.
jobs : list[str]
Expand All @@ -31,18 +35,22 @@ class Meta:

def __init__(self,
id=missing,
name=missing,
description=missing,
creation_time=missing,
modification_time=missing,
created_by=missing,
modified_by=missing,
name=missing,
description=missing,
data=missing,
jobs=missing
):
self.id = id
self.name = name
self.description = description
self.creation_time = creation_time
self.modification_time = modification_time
self.created_by = created_by
self.modified_by = modified_by
self.name = name
self.description = description
self.data = data
self.jobs = jobs

Expand Down
8 changes: 8 additions & 0 deletions ansys/rep/client/jms/resource/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ class File(Object):
The date and time the file resource was created.
modification_time : datetime, optional
The date and time the file resource was last modified.
created_by : str, optional
ID of the user who created the object.
modified_by : str, optional
ID of the user who last modified the object.
format : str, optional
expiry_time : datetime, optional
File expiration time.
Expand Down Expand Up @@ -54,6 +58,8 @@ def __init__(self, src=None,
hash=missing,
creation_time=missing,
modification_time=missing,
created_by=missing,
modified_by=missing,
expiry_time=missing,
format=missing,
evaluation_path=missing,
Expand All @@ -73,6 +79,8 @@ def __init__(self, src=None,
self.hash = hash
self.creation_time = creation_time
self.modification_time = modification_time
self.created_by = created_by
self.modified_by = modified_by
self.expiry_time = expiry_time
self.format = format
self.evaluation_path = evaluation_path
Expand Down
24 changes: 16 additions & 8 deletions ansys/rep/client/jms/resource/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ class Job(Object):
----------
id : str, optional
Unique ID to access the resource, generated internally by the server on creation.
creation_time : datetime, optional
The date and time the resource was created.
modification_time : datetime, optional
The date and time the resource was last modified.
created_by : str, optional
ID of the user who created the object.
modified_by : str, optional
ID of the user who last modified the object.
name : str, optional
Name of the job.
eval_status : str
Expand All @@ -30,10 +38,6 @@ class Job(Object):
Optional name/ID of the creator of this job.
executed_level : int, optional
Execution level of the last executed task (-1 if none has been executed yet).
creation_time : datetime, optional
The date and time the job was created.
modification_time : datetime, optional
The date and time the job was last modified.
elapsed_time : float
Number of seconds it took the evaluator(s) to update the job.
host_ids : list, optional
Expand All @@ -49,6 +53,10 @@ class Meta:

def __init__(self,
id=missing,
creation_time=missing,
modification_time=missing,
created_by=missing,
modified_by=missing,
name=missing,
eval_status=missing,
job_definition_id=missing,
Expand All @@ -59,13 +67,15 @@ def __init__(self,
note=missing,
creator=missing,
executed_level=missing,
creation_time=missing,
modification_time=missing,
elapsed_time=missing,
host_ids=missing,
file_ids=missing
):
self.id = id
self.creation_time = creation_time
self.modification_time = modification_time
self.created_by = created_by
self.modified_by = modified_by
self.name = name
self.eval_status = eval_status
self.job_definition_id = job_definition_id
Expand All @@ -76,8 +86,6 @@ def __init__(self,
self.note = note
self.creator = creator
self.executed_level = executed_level
self.creation_time = creation_time
self.modification_time = modification_time
self.elapsed_time = elapsed_time
self.host_ids = host_ids
self.file_ids = file_ids
Expand Down
24 changes: 16 additions & 8 deletions ansys/rep/client/jms/resource/job_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,19 @@ class JobDefinition(Object):
----------
id : str, optional
Unique ID to access the resource, generated internally by the server on creation.
creation_time : datetime, optional
The date and time the resource was created.
modification_time : datetime, optional
The date and time the resource was last modified.
created_by : str, optional
ID of the user who created the object.
modified_by : str, optional
ID of the user who last modified the object.
name : str, optional
Name of the job definition
active : bool
Defines whether this is the active job definition in the project where evaluators will evaluate pending jobs
client_hash : str, optional
creation_time : datetime, optional
The date and time the job definition was created.
modification_time : datetime, optional
The date and time the job definition was last modified.
parameter_definition_ids : list[str]
parameter_mapping_ids : list[str]
task_definition_ids : list[str]
Expand All @@ -33,22 +37,26 @@ class Meta:

def __init__(self,
id=missing,
creation_time=missing,
modification_time=missing,
created_by=missing,
modified_by=missing,
name=missing,
active=missing,
client_hash=missing,
creation_time=missing,
modification_time=missing,
parameter_definition_ids=missing,
parameter_mapping_ids=missing,
task_definition_ids=missing,
fitness_definition=missing
):
self.id = id
self.creation_time = creation_time
self.modification_time = modification_time
self.created_by = created_by
self.modified_by = modified_by
self.name = name
self.active = active
self.client_hash = client_hash
self.creation_time = creation_time
self.modification_time = modification_time
self.parameter_definition_ids = parameter_definition_ids
self.parameter_mapping_ids = parameter_mapping_ids
self.task_definition_ids = task_definition_ids
Expand Down
Loading