Commit b9649062 authored by Jonas Waeber's avatar Jonas Waeber
Browse files

Optimize some dependencies

parent 3ad999b8
Pipeline #37172 failed with stages
in 42 seconds
FROM index.docker.io/library/python:3.8-alpine FROM index.docker.io/library/python:3.8
ARG K8S_VERSION=v1.20.4 ARG K8S_VERSION=v1.20.4
ARG HELM_VERSION=v3.6.3 ARG HELM_VERSION=v3.6.3
...@@ -19,13 +19,12 @@ RUN cd /usr/bin \ ...@@ -19,13 +19,12 @@ RUN cd /usr/bin \
WORKDIR / WORKDIR /
ADD setup.py / ADD setup.py /
RUN mkdir import_api_app \ RUN mkdir import_api_app \
&& pip install -e . && pip install --no-cache-dir -e .
WORKDIR /import_api_app WORKDIR /import_api_app
ADD requirements.txt .
ADD import_api_app/pull-charts.sh . ADD import_api_app/pull-charts.sh .
RUN pip install -r requirements.txt \ RUN ./pull-charts.sh
&& ./pull-charts.sh
ADD import_api_app . ADD import_api_app .
\ No newline at end of file
...@@ -21,8 +21,6 @@ from flasgger import Swagger ...@@ -21,8 +21,6 @@ from flasgger import Swagger
from flask import send_from_directory, redirect from flask import send_from_directory, redirect
from flask.logging import default_handler from flask.logging import default_handler
from flask_restful import Api from flask_restful import Api
from kubernetes import config
from kubernetes.config import ConfigException
from import_api_app.app import app from import_api_app.app import app
from import_api_app.helpers.error import ImportApiError from import_api_app.helpers.error import ImportApiError
...@@ -37,18 +35,6 @@ from import_api_app.resources.update_record_set import UpdateRecordSet ...@@ -37,18 +35,6 @@ from import_api_app.resources.update_record_set import UpdateRecordSet
from import_api_app.resources.write_documents_reports import WriteJobResultToDrupal from import_api_app.resources.write_documents_reports import WriteJobResultToDrupal
from import_api_app.resources.write_groups_reports import WriteTypeReportToDrupal from import_api_app.resources.write_groups_reports import WriteTypeReportToDrupal
try:
# to be used when inside a kubernetes cluster
config.load_incluster_config()
except ConfigException:
try:
# use .kube directory
# for local development
config.load_kube_config()
except ConfigException:
app.logger.error('No configuration for any Kubernetes Cluster detected.')
raise ImportApiError('No configuration for any Kubernetes Cluster detected.')
environ['HELM_EXPERIMENTAL_OCI'] = '1' environ['HELM_EXPERIMENTAL_OCI'] = '1'
# If app is started via gunicorn # If app is started via gunicorn
......
Flask Flask
kubernetes
flask-restful flask-restful
flasgger flasgger
flake8 flake8
autopep8 autopep8
pytest
pre-commit pre-commit
jsonapi-requests
requests requests
kafka-python kafka-python
pysftp
pyyaml
paramiko paramiko
gunicorn gunicorn
\ No newline at end of file
...@@ -20,6 +20,12 @@ setup( ...@@ -20,6 +20,12 @@ setup(
packages=['import_api_app'], packages=['import_api_app'],
include_package_data=True, include_package_data=True,
install_requires=[ install_requires=[
'gunicorn',
'flask', 'flask',
'paramiko',
'requests',
'kafka-python',
'flask-restful',
'flasgger'
], ],
) )
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment