Skip to content

Commit

Permalink
update kustomize for api change
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexPatrie committed Oct 17, 2024
1 parent e52fba9 commit 802f975
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 26 deletions.
30 changes: 15 additions & 15 deletions compose_api/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
GOOGLE_APPLICATION_CREDENTIALS = os.getenv("GOOGLE_APPLICATION_CREDENTIALS")

APP_TITLE = "bio-compose"
APP_VERSION = "0.1.1"
APP_VERSION = "0.1.2"
# APP_SERVERS = [
# {
# "url": "https://biochecknet.biosimulations.org",
Expand Down Expand Up @@ -213,7 +213,7 @@ async def verify_omex(
include_outputs: bool = Query(default=True, description="Whether to include the output data on which the comparison is based."),
selection_list: Optional[List[str]] = Query(default=None, description="List of observables to include in the return data."),
comparison_id: Optional[str] = Query(default=None, description="Descriptive prefix to be added to this submission's job ID."),
expected_results: Optional[UploadFile] = File(default=None, description="reports.h5 file defining the expected results to be included in the comparison."),
# expected_results: Optional[UploadFile] = File(default=None, description="reports.h5 file defining the expected results to be included in the comparison."),
rTol: Optional[float] = Query(default=None, description="Relative tolerance to use for proximity comparison."),
aTol: Optional[float] = Query(default=None, description="Absolute tolerance to use for proximity comparison.")
):
Expand All @@ -239,16 +239,16 @@ async def verify_omex(
uploaded_file_location = blob_dest

# Save uploaded reports file to Google Cloud Storage if applicable
report_fp = None
report_blob_dest = None
if expected_results:
# handle incorrect files upload
properly_formatted_report = check_upload_file_extension(expected_results, 'expected_results', '.h5')
if properly_formatted_report:
report_fp = await save_uploaded_file(expected_results, save_dest)
report_blob_dest = upload_prefix + report_fp.split("/")[-1]
upload_blob(bucket_name=BUCKET_NAME, source_file_name=report_fp, destination_blob_name=report_blob_dest)
report_location = report_blob_dest
# report_fp = None
# report_blob_dest = None
# if expected_results:
# # handle incorrect files upload
# properly_formatted_report = check_upload_file_extension(expected_results, 'expected_results', '.h5')
# if properly_formatted_report:
# report_fp = await save_uploaded_file(expected_results, save_dest)
# report_blob_dest = upload_prefix + report_fp.split("/")[-1]
# upload_blob(bucket_name=BUCKET_NAME, source_file_name=report_fp, destination_blob_name=report_blob_dest)
# report_location = report_blob_dest

pending_job_doc = await db_connector.insert_job_async(
collection_name=DatabaseCollections.PENDING_JOBS.value,
Expand All @@ -257,7 +257,7 @@ async def verify_omex(
path=uploaded_file_location,
simulators=simulators,
timestamp=_time,
expected_results=report_location,
# expected_results=report_location,
include_outputs=include_outputs,
rTol=rTol,
aTol=aTol,
Expand All @@ -266,8 +266,8 @@ async def verify_omex(

# clean up local temp files
os.remove(fp)
if report_fp:
os.remove(report_fp)
# if report_fp:
# os.remove(report_fp)

# return PendingOmexVerificationJob(**pending_job_doc)
return pending_job_doc
Expand Down
10 changes: 1 addition & 9 deletions compose_api/spec/openapi_3_1_0_generated.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
openapi: 3.1.0
info:
title: bio-compose
version: 0.1.1
version: 0.1.2
paths:
/:
get:
Expand Down Expand Up @@ -607,14 +607,6 @@ components:
format: binary
title: Uploaded File
description: OMEX/COMBINE archive containing a deterministic SBML model
expected_results:
anyOf:
- type: string
format: binary
- type: 'null'
title: Expected Results
description: reports.h5 file defining the expected results to be included
in the comparison.
type: object
required:
- uploaded_file
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ services:
build:
context: ./compose_api
dockerfile: ./Dockerfile-compose_api
image: ghcr.io/biosimulators/bio-check-compose_api:1.11.5 # .3
image: ghcr.io/biosimulators/bio-check-compose_api:1.11.6 # .3
container_name: api
environment:
- MONGO_URI=mongodb://mongodb:27017/?retryWrites=true&w=majority&appName=bio-compose
Expand Down
2 changes: 1 addition & 1 deletion kustomize/overlays/biochecknet/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace: biochecknet
# PREVIOUS (MOST CURRENTLY RELEASED) VERSIONS AS OF 10/17(SMOLDYN BUG): api: 1.11.4, worker: 1.11.6
images:
- name: ghcr.io/biosimulators/bio-check-compose_api
newTag: 1.11.5
newTag: 1.11.6
- name: ghcr.io/biosimulators/bio-check-compose_worker
newTag: 1.11.6
- name: mongo
Expand Down

0 comments on commit 802f975

Please sign in to comment.