Skip to content
Snippets Groups Projects
Unverified Commit 75809326 authored by Andrea Franchini's avatar Andrea Franchini
Browse files

rework dockerfile

parent ed8c6ef7
No related branches found
No related tags found
No related merge requests found
FROM python:3.10-bullseye
FROM python:3.11.3-buster AS requirements-stage
COPY . /opt/mc_openapi
WORKDIR /code
RUN useradd -mU mc
USER mc
ENV PATH="/home/mc/.local/bin:${PATH}"
RUN pip install --upgrade pip \
&& pip install -r /opt/mc_openapi/requirements.txt
WORKDIR /opt/mc_openapi
COPY ./requirements.txt /code/requirements.txt
ENV UVICORN_PORT=8080 \
UVICORN_HOST=0.0.0.0
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
CMD ["uvicorn", "mc_openapi.fastapi:app"]
COPY ./mc_openapi /code/mc_openapi
COPY ./tests /code/tests
CMD ["uvicorn", "mc_openapi.api:app", "--proxy-headers", "--host", "0.0.0.0", "--port", "80"]
version: '3.9'
services:
dmc:
build: .
ports:
- "8080:8080"
environment:
UVICORN_PORT: 8080
UVICORN_HOST: "0.0.0.0"
UVICORN_WORKERS: 2
......@@ -7,7 +7,7 @@ import re
from tabulate import tabulate
import uvicorn
from mc_openapi.fastapi import app
from mc_openapi.api import app
from mc_openapi.doml_mc import DOMLVersion, init_model, verify_csp_compatibility, verify_model, synthesize_model
from mc_openapi.doml_mc.domlr_parser.exceptions import RequirementException
from mc_openapi.doml_mc.mc_result import MCResult
......
File moved
openapi: 3.0.2
info:
license:
name: Apache-2.0
title: PIACERE Model Checker
version: "2.2.1"
paths:
/modelcheck:
post:
summary: Verify a DOML model
description: Send a DOML model in XMI format.
The response says whether the model satisfies the requirements,
with a description of the issue if it is not.
operationId: mc_openapi.handlers.modelcheck
requestBody:
content:
application/xml:
schema:
type: string
required: true
parameters:
- in: query
name: version
schema:
type: string
description: >
The DOML version you're currently using, written as e.g. `2.0` or `V2_0`.
If not specified, it will try to infer it by trying to parse it for each supported
DOML version, starting with the most recent.
required: false
responses:
"200":
content:
application/json:
schema:
type: object
properties:
result:
type: string
enum:
- sat
- unsat
- dontknow
description:
type: string
required:
- result
description: OK - model checking succeded
"400":
content:
application/json:
schema:
$ref: '#/components/schemas/error'
description: malformed request
"500":
content:
application/json:
schema:
$ref: '#/components/schemas/error'
description: internal error
/modelcheck_html:
post:
summary: Verify a DOML model
description: Send a DOML model in XMI format.
The response says whether the model satisfies the requirements,
with a description of the issue if it is not. The output is in HTML.
operationId: mc_openapi.handlers.modelcheck_html
requestBody:
content:
application/xml:
schema:
type: string
required: true
parameters:
- in: query
name: version
schema:
type: string
description: >
The DOML version you're currently using, written as e.g. `2.0` or `V2_0`.
If not specified, it will try to infer it by trying to parse it for each supported
DOML version, starting with the most recent.
required: false
responses:
"200":
content:
text/html:
schema:
type: string
description: OK - model checking succeded
"400":
content:
application/json:
schema:
$ref: '#/components/schemas/error'
description: malformed request
"500":
content:
application/json:
schema:
$ref: '#/components/schemas/error'
description: internal error
/csp:
post:
summary: Verify compatibility of a DOML model with a set of Cloud Service Providers.
description: Send a DOML model in XMI format and a requirement to check.
The response says whether the model can be deployed on the supported CSPs.
It produces a compatibility matrix and lists required properties for each CSP.
operationId: mc_openapi.handlers.csp
requestBody:
content:
application/xml:
schema:
type: string
required: true
parameters:
- in: query
name: version
schema:
type: string
description: >
The DOML version you're currently using, written as e.g. `2.0` or `V2_0`.
If not specified, it will try to infer it by trying to parse it for each supported
DOML version, starting with the most recent.
required: false
responses:
"200":
content:
application/json:
schema:
type: object
description: OK - CSP compatibility successfully completed.
"400":
content:
application/json:
schema:
$ref: '#/components/schemas/error'
description: malformed request
"500":
content:
application/json:
schema:
$ref: '#/components/schemas/error'
description: internal error
/csp_html:
post:
summary: Verify compatibility of a DOML model with a set of Cloud Service Providers.
description: Send a DOML model in XMI format and a requirement to check.
The response says whether the model can be deployed on the supported CSPs.
It produces a compatibility matrix and lists required properties for each CSP.
operationId: mc_openapi.handlers.csp_html
requestBody:
content:
application/xml:
schema:
type: string
required: true
parameters:
- in: query
name: version
schema:
type: string
description: >
The DOML version you're currently using, written as e.g. `2.0` or `V2_0`.
If not specified, it will try to infer it by trying to parse it for each supported
DOML version, starting with the most recent.
required: false
responses:
"200":
content:
text/html:
schema:
type: string
description: OK - CSP compatibility successfully completed.
"400":
content:
application/json:
schema:
$ref: '#/components/schemas/error'
description: malformed request
"500":
content:
application/json:
schema:
$ref: '#/components/schemas/error'
description: internal error
components:
schemas:
error:
type: object
properties:
timestamp:
type: string
format: date-time
message:
type: string
description: Error message for the user
debug_message:
type: string
description: Detailed error message for debugging purposes
required:
- timestamp
- message
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment