Skip to content

Commit

Permalink
fix: remove old schema workaround (#32)
Browse files Browse the repository at this point in the history
The service has been updated to the new schema, and the worker agent no
longer needs to support the older schema. This completes the work by
removing the workaround that allowed the agent to handle both old and
new at the same time.

Signed-off-by: Daniel Neilson <53624638+ddneilson@users.noreply.github.com>
Signed-off-by: Graeme McHale <gmchale@amazon.com>
  • Loading branch information
ddneilson authored and gmchale79 committed Mar 11, 2024
1 parent 8dc89a1 commit 1a0fba4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,7 @@ def from_boto(cls, environment_details_data: EnvironmentDetailsData) -> Environm
If the environment's Open Job Description schema version not unsupported
"""

# TODO - Remove from here
env_schema_version = environment_details_data["schemaVersion"]
if env_schema_version not in ("jobtemplate-2023-09", "2022-09-01"):
UnsupportedSchema(env_schema_version)
# Note: 2023-09 & 2022-09-01 are identical as far as the worker agent is concerned.
schema_version = SchemaVersion.v2023_09
# -- to here once the migration to the new schema version is complete

# TODO - Put this back in once the migration to the new schema version is complete.
# schema_version = SchemaVersion(environment_details_data["schemaVersion"])
# --
schema_version = SchemaVersion(environment_details_data["schemaVersion"])

if schema_version == SchemaVersion.v2023_09:
environment = parse_model(
Expand Down
12 changes: 1 addition & 11 deletions src/deadline_worker_agent/sessions/job_entities/job_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,17 +206,7 @@ def from_boto(cls, job_details_data: JobDetailsData) -> JobDetails:
or None
)

# TODO - Remove from here
job_schema_version = job_details_data["schemaVersion"]
if job_schema_version not in ("jobtemplate-2023-09", "2022-09-01"):
UnsupportedSchema(job_schema_version)
# Note: 2023-09 & 2022-09-01 are identical as far as the worker agent is concerned.
schema_version = SchemaVersion.v2023_09
# -- to here once the migration to the new schema version is complete

# TODO - Put this back in once the migration to the new schema version is complete.
# schema_version = SchemaVersion(job_details_data["schemaVersion"])
# --
schema_version = SchemaVersion(job_details_data["schemaVersion"])

if schema_version != SchemaVersion.v2023_09:
raise UnsupportedSchema(schema_version.value)
Expand Down
12 changes: 1 addition & 11 deletions src/deadline_worker_agent/sessions/job_entities/step_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,7 @@ def from_boto(cls, step_details_data: StepDetailsData) -> StepDetails:
If the environment's Open Job Description schema version not unsupported
"""

# TODO - Remove from here
step_schema_version = step_details_data["schemaVersion"]
if step_schema_version not in ("jobtemplate-2023-09", "2022-09-01"):
UnsupportedSchema(step_schema_version)
# Note: 2023-09 & 2022-09-01 are identical as far as the worker agent is concerned.
schema_version = SchemaVersion.v2023_09
# -- to here once the migration to the new schema version is complete

# TODO - Put this back in once the migration to the new schema version is complete.
# schema_version = SchemaVersion(environment_details_data["schemaVersion"])
# --
schema_version = SchemaVersion(step_details_data["schemaVersion"])

if schema_version == SchemaVersion.v2023_09:
step_script = parse_model(model=StepScript_2023_09, obj=step_details_data["template"])
Expand Down

0 comments on commit 1a0fba4

Please sign in to comment.