Merge pull request #4 from yardstick/feature/QUANT-988-solver-service-rest

QUANT-988: Solver service REST framework implementation
This commit is contained in:
brmnjsh 2021-09-01 14:35:29 -04:00 committed by GitHub
commit d11ba0bdfe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 69 additions and 5 deletions

View File

@ -9,5 +9,12 @@ RUN cd Cbc-2.9.8 && \
./configure && \ ./configure && \
make && \ make && \
make install 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
View File

@ -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

View File

@ -39,10 +39,8 @@ measure-solver-logs() {
compose "logs measure-solver" compose "logs measure-solver"
} }
measure-solver-server() {
}
restart-measure-solver() { restart-measure-solver() {
compose "restart measure-solver"
} }
rails() { rails() {

View File

@ -9,5 +9,13 @@ RUN cd Cbc-2.9.8 && \
./configure && \ ./configure && \
make && \ make && \
make install 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
View 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

View File

@ -0,0 +1,2 @@
override_file_placeholder:
image: busybox