New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: initial release #4
Conversation
|
README.rst
Outdated
============== | ||
====================== | ||
REANA Server | ||
====================== |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason for having additional =
? I remember that for the release checklist for Invenio we had to stick to the length of the tittle itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No reason. It's an error.
reana_server/app.py
Outdated
from flask import Flask | ||
|
||
app = Flask(__name__) | ||
app.secret_key = "hyper secret key" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤣
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
¯_(ツ)_/¯
had to change something to make it more original :D
reana_server/app.py
Outdated
|
||
--- | ||
get: | ||
summary: Ping the server. Responds with pong and HTTP 200 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Responds with pong and HTTP 200
Isn't it a bit redundant if we already document all the responses below? It will be rendered along with the responses when we do the sphinxcontrib-openapi
🙃
5622fd9
to
8661a7e
Compare
Why is |
# granted to it by virtue of its status as an Intergovernmental Organization or | ||
# submit itself to any jurisdiction. | ||
|
||
"""Flask application configuration.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want to keep this empty file?
format='%(asctime)s - %(threadName)s - %(levelname)s: %(message)s' | ||
) | ||
|
||
app.config.from_object('config') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Loading empty config? do we need it?
url='https://github.com/reanahub/reana-server', | ||
packages=['reana_server'], | ||
zip_safe=False, | ||
extras_require=extras_require, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
install_requires=install_requires,
missing
reana_server/app.py
Outdated
|
||
@app.route('/ping', methods=['GET']) | ||
def ping(): # noqa | ||
r"""Endpoint to ping the server. Responds with a pong. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we plug apispec
and sphinxcontrib-openapi
already as here reanahub/reana-job-controller#40? We will need it if we want to show API docs...
If we do so, take into account pinning Sphinx
see reanahub/reana-job-controller#43
reana_server/app.py
Outdated
Ping succeeded. | ||
examples: | ||
application/text: | ||
pong |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usually we used to return OK, see for example http://opendata.cern.ch/ping
db79f4e
to
d8e5d1d
Compare
scripts/generate_openapi_spec.py
Outdated
@click.command() | ||
@click.option('-n', '--name', default="Reana package", | ||
help='Name of package/component', envvar='REANA_PACKAGE_NAME') | ||
@click.option('-d', '--description', default="API description", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better naming suggestions for these environment variables? e.g. PACKAGE_OAPI_VERSION is not that explanatory and without checking it out or without documentation (e.g. line comments) it is immediately clear what VERSION means in this context.
docs/restapi.rst
Outdated
REST API | ||
======== | ||
|
||
The REANA Server offers a REST API for management of workflow running in REANA |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if this would be s/workflow/analyses
, or not specifying anything at all and just saying management of the REANA Cloud. Anyhow, not only workflows (understanding that analyses includes also single job/step tasks like https://github.com/reanahub/reana-demo-helloworld once we remove yadage
)
scripts/generate_openapi_spec.py
Outdated
errors='strict', lazy=False, | ||
atomic=False) as output: | ||
output.write(json.dumps(spec.to_dict(), indent=2, sort_keys=True)) | ||
output.close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can delete this since you are inside a context manager, can't you?
73c78c5
to
91f0db9
Compare
@hjhsalo Have you had a look to the Travis CI failure? |
91f0db9
to
91809bf
Compare
Dockerfile
Outdated
# granted to it by virtue of its status as an Intergovernmental Organization or | ||
# submit itself to any jurisdiction. | ||
|
||
FROM python:3.5-alpine |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Elsewhere we are using FROM python:3.5
.
It might be good to standardise on some base everywhere in order to avoid surprises, see for example why Elastic moved away from Alpine https://www.elastic.co/blog/docker-base-centos7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"It might be good to standardize on some base everywhere in order to avoid surprises"
There has been discussions about moving to Alpine in order to achieve smaller image sizes. The usage of python:3.5-alpine in reana-server is intentional. Motivation for this is to find out possible problems with the way current Dockerfile(s) of various REANA components are written.
I've seen and read the blog post in the past.
Dockerfile
Outdated
chown -R reanauser /code | ||
USER reanauser | ||
EXPOSE 5000 | ||
CMD ["python", "reana_server/app.py"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FLASK_APP=...
and flask run
?
run-tests.sh
Outdated
pydocstyle reana_server && \ | ||
isort -rc -c -df **/*.py && \ | ||
FLASK_APP=reana_server/app.py python ./scripts/generate_openapi_spec.py && \ | ||
diff temp_openapi.json docs/openapi.json && \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
diff -w
should take care of the Travis CI problem
scripts/generate_openapi_spec.py
Outdated
|
||
@click.command() | ||
@click.option('-t', '--title', | ||
help='Title of package/component exposing the API') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If people will copy/paste this code, as it were, then perhaps help=__title__
directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(And ditto for description, version, etc.)
0a54827
to
52d1ab8
Compare
* add initial documentation structure, with license authors, etc. (closes reanahub#1) * basic functionality to test client-server connection with ping Signed-off-by: Harri Hirvonsalo <harri.hirvonsalo@cern.ch>
52d1ab8
to
e57ab25
Compare
(closes docs: initial release #1)
Signed-off-by: Harri Hirvonsalo harri.hirvonsalo@cern.ch