-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* #131 start refactoring application generation * #131 backend application template-based creation added * #131 backend application with gunicorn * #131 updated samples application with gunicorn * #132 Logging errors fixed * #131 samples application missing files * #131 samples application backend + frontend * #131 Webapp base images * #131 Webapp application generation logic and templates * #131 Sample application new files * #131 Database application generation * #132 Add cluster initialization script * #132 Move client library * #131 improve interactive generation * #132 fix base images * #132 Temporarily revert ingress proxy * #132 Workflows refactoring * #131 namespaced argo instance * #132 Reduce minimum applications requests * #132 Fix application retrieval * #132 Reduce minimum applications requests * #132 samples api link * #132 cleaning useless files * #132 Improve extract-download chmod * #132 Improve logging * #132 small improvement on application generation * #154 PR fixes
- Loading branch information
Showing
220 changed files
with
21,658 additions
and
521 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
harness: | ||
subdomain: argo | ||
secured: true | ||
name: argo-server | ||
name: argo | ||
service: | ||
port: 2746 | ||
auto: false | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
ARG REGISTRY | ||
ARG TAG=latest | ||
FROM ${REGISTRY}cloudharness-frontend-build:${TAG} as frontend | ||
|
||
ENV APP_DIR=/app | ||
|
||
WORKDIR ${APP_DIR} | ||
COPY frontend/package.json ${APP_DIR} | ||
COPY frontend/package-lock.json ${APP_DIR} | ||
RUN npm ci | ||
|
||
COPY frontend ${APP_DIR} | ||
RUN npm run build | ||
|
||
##### | ||
|
||
ARG REGISTRY | ||
ARG TAG=latest | ||
FROM ${REGISTRY}cloudharness-flask:${TAG} | ||
|
||
ENV MODULE_NAME=samples | ||
|
||
ENV WORKERS=2 | ||
ENV PORT=8080 | ||
|
||
COPY backend/requirements.txt /usr/src/app/ | ||
|
||
RUN pip3 install --no-cache-dir -r requirements.txt | ||
|
||
COPY backend/ /usr/src/app | ||
|
||
COPY --from=frontend app/dist/ /usr/src/app/www | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +0,0 @@ | ||
Temporary: we are using it to test the token generation. | ||
|
||
TODO move into neuroimaging | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
{ | ||
"packageName": "api_samples" | ||
} | ||
{"packageName": "cloudharness_cli.samples"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,3 +64,5 @@ target/ | |
|
||
#Ipython Notebook | ||
.ipynb_checkpoints | ||
|
||
www |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,5 +23,5 @@ | |
#!docs/README.md | ||
setup.py | ||
*/controllers/* | ||
*/models/* | ||
Dockerfile | ||
Dockerfile | ||
src/__main__.py |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
connexion[swagger-ui] >= 2.6.0; python_version>="3.6" | ||
# 2.3 is the last version that supports python 3.4-3.5 | ||
connexion[swagger-ui] <= 2.3.0; python_version=="3.5" or python_version=="3.4" | ||
# connexion requires werkzeug but connexion < 2.4.0 does not install werkzeug | ||
# we must peg werkzeug versions below to fix connexion | ||
# https://github.com/zalando/connexion/pull/1044 | ||
werkzeug == 0.16.1; python_version=="3.5" or python_version=="3.4" | ||
swagger-ui-bundle >= 0.0.2 | ||
python_dateutil >= 2.6.0 | ||
setuptools >= 21.0.0 |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import logging | ||
|
||
import connexion | ||
import flask | ||
from samples import encoder | ||
|
||
|
||
# setup connection app | ||
connexion_app = connexion.App(__name__, specification_dir="./openapi/", debug=True) | ||
app = connexion_app.app | ||
app.json_encoder = encoder.JSONEncoder | ||
|
||
with app.app_context(): | ||
# setup logging | ||
gunicorn_logger = logging.getLogger("gunicorn.error") | ||
app.logger.handlers = gunicorn_logger.handlers | ||
app.logger.setLevel(gunicorn_logger.level) | ||
|
||
connexion_app.add_api("openapi.yaml", arguments={"title": "samples"}, pythonic_params=True) | ||
try: | ||
# init_app can be defined to add behaviours to the wsgi app | ||
from samples import init_app | ||
init_app(app) | ||
except ImportError: | ||
pass | ||
|
||
@app.route('/', methods=['GET']) | ||
def index(): | ||
return flask.send_from_directory('../www', 'index.html') | ||
|
||
@app.route('/<path:path>') | ||
def send_webapp(path): | ||
return flask.send_from_directory('../www', path) | ||
|
||
@app.route('/static/<path:path>') | ||
def send_static(path): | ||
return flask.send_from_directory('../www/static', path) | ||
|
||
def main(): | ||
connexion_app.debug=True | ||
connexion_app.run(port=5001) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
...pi_samples/controllers/auth_controller.py → ...nd/samples/controllers/auth_controller.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
applications/samples/backend/samples/controllers/security_controller_.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from typing import List | ||
|
||
|
||
def info_from_bearerAuth(token): | ||
""" | ||
Check and retrieve authentication information from custom bearer token. | ||
Returned value will be passed in 'token_info' parameter of your operation function, if there is one. | ||
'sub' or 'uid' will be set in 'user' parameter of your operation function, if there is one. | ||
:param token Token provided by Authorization header | ||
:type token: str | ||
:return: Decoded token information or None if token is invalid | ||
:rtype: dict | None | ||
""" | ||
return {'uid': 'user_id'} | ||
|
||
|
27 changes: 27 additions & 0 deletions
27
applications/samples/backend/samples/controllers/test_controller.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import connexion | ||
import six | ||
|
||
from samples import util | ||
|
||
|
||
def error(): # noqa: E501 | ||
"""test sentry is working | ||
# noqa: E501 | ||
:rtype: str | ||
""" | ||
raise Exception("The error we supposed to find here") | ||
|
||
|
||
def ping(): # noqa: E501 | ||
"""test the application is up | ||
# noqa: E501 | ||
:rtype: str | ||
""" | ||
import time | ||
return time.time() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ons/samples/server/api_samples/encoder.py → ...ations/samples/backend/samples/encoder.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# coding: utf-8 | ||
|
||
# flake8: noqa | ||
from __future__ import absolute_import | ||
# import models into model package | ||
from samples.models.inline_response202 import InlineResponse202 | ||
from samples.models.inline_response202_task import InlineResponse202Task | ||
from samples.models.valid import Valid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.