Merge pull request #4 from yardstick/feature/QUANT-988-solver-service-rest
QUANT-988: Solver service REST framework implementation
This commit is contained in:
commit
d11ba0bdfe
@ -9,5 +9,12 @@ RUN cd Cbc-2.9.8 && \
|
||||
./configure && \
|
||||
make && \
|
||||
make install
|
||||
RUN python -m pip install fastapi[all]
|
||||
|
||||
CMD tail -f /dev/null
|
||||
# Bundle app source
|
||||
COPY . /app
|
||||
|
||||
WORKDIR /app/app
|
||||
|
||||
# CMD tail -f /dev/null
|
||||
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "80"]
|
||||
|
27
.gitignore
vendored
27
.gitignore
vendored
@ -0,0 +1,27 @@
|
||||
|
||||
.DS_Store
|
||||
.env
|
||||
.flaskenv
|
||||
*.pyc
|
||||
*.pyo
|
||||
env/
|
||||
venv/
|
||||
.venv/
|
||||
env*
|
||||
dist/
|
||||
build/
|
||||
*.egg
|
||||
*.egg-info/
|
||||
_mailinglist
|
||||
.tox/
|
||||
.cache/
|
||||
.pytest_cache/
|
||||
.idea/
|
||||
docs/_build/
|
||||
.vscode
|
||||
|
||||
# Coverage reports
|
||||
htmlcov/
|
||||
.coverage
|
||||
.coverage.*
|
||||
*,cover
|
@ -39,10 +39,8 @@ measure-solver-logs() {
|
||||
compose "logs measure-solver"
|
||||
}
|
||||
|
||||
measure-solver-server() {
|
||||
}
|
||||
|
||||
restart-measure-solver() {
|
||||
compose "restart measure-solver"
|
||||
}
|
||||
|
||||
rails() {
|
||||
|
10
Dockerfile
10
Dockerfile
@ -9,5 +9,13 @@ RUN cd Cbc-2.9.8 && \
|
||||
./configure && \
|
||||
make && \
|
||||
make install
|
||||
RUN python -m pip install fastapi[all]
|
||||
|
||||
CMD tail -f /dev/null
|
||||
|
||||
# Bundle app source
|
||||
COPY . /app
|
||||
|
||||
WORKDIR /app/app
|
||||
|
||||
# CMD tail -f /dev/null
|
||||
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "80"]
|
||||
|
22
app/main.py
Normal file
22
app/main.py
Normal file
@ -0,0 +1,22 @@
|
||||
from fastapi import FastAPI, __version__
|
||||
|
||||
app = FastAPI()
|
||||
|
||||
@app.get("/")
|
||||
async def root():
|
||||
return {"message": "Welcome to Measures LOFT solver service. v0.1"}
|
||||
|
||||
@app.get("/healthcheck")
|
||||
async def health():
|
||||
content = {
|
||||
"maintainer": "Meazure Horizon Team",
|
||||
"git_repo": "https://github.com/yardstick/measure-solver",
|
||||
"server": "OK",
|
||||
"fastapi version": __version__,
|
||||
"app version": "0.1.0"
|
||||
}
|
||||
return content
|
||||
|
||||
@app.get('/readycheck')
|
||||
async def ready():
|
||||
return 'OK' # just means we're on air
|
@ -0,0 +1,2 @@
|
||||
override_file_placeholder:
|
||||
image: busybox
|
Loading…
x
Reference in New Issue
Block a user