Commit 425c865e authored by Matthias's avatar Matthias
Browse files

Merge remote-tracking branch 'origin/master'

parents aacd2496 618ab211
Pipeline #25806 passed with stages
in 2 minutes and 39 seconds
......@@ -18,3 +18,6 @@ importApiUrl: 'https://import.memobase.k8s.unibas.ch'
drupalApiUrl: 'https://memobase-customer-live.outermedia.net'
topicConfigs: 'mb-di-config-prod'
topicDrupalExport: 'mb-gi-drupal-export-prod'
tfvReportingTopicName: "mb-di-reporting-prod"
tfvTopicName: "mb-di-data-transform-prod"
......@@ -18,3 +18,6 @@ importApiUrl: 'https://stage.import.memobase.k8s.unibas.ch'
drupalApiUrl: 'https://mb-wf1.memobase.unibas.ch'
topicConfigs: 'mb-di-config-stage'
topicDrupalExport: 'mb-gi-drupal-export-stage'
tfvReportingTopicName: "mb-di-reporting-stage"
tfvTopicName: "mb-di-data-transform-stage"
......@@ -16,5 +16,8 @@ importApiConfig: api-import-test-config
ingressUri: 'test.import.memobase.k8s.unibas.ch'
importApiUrl: 'https://test.import.memobase.k8s.unibas.ch'
drupalApiUrl: 'https://mb-wf1.memobase.unibas.ch'
topicConfigs: 'mb-di-config-test'
topicDrupalExport: 'mb-gi-drupal-export-test'
topicConfigs: 'mb-di-config-prod'
topicDrupalExport: 'mb-gi-drupal-export-prod'
tfvReportingTopicName: "mb-di-reporting-prod"
tfvTopicName: "mb-di-data-transform-prod"
......@@ -4,6 +4,10 @@ metadata:
name: {{ .Values.k8sGroupId }}-{{ .Values.k8sName }}-{{ .Values.k8sEnvironment}}-config
namespace: memobase
data:
TFV_KAFKA_SERVER_CONFIGS: {{ .Values.kafkaConfigs }}
TFV_SFTP_CONFIGS: {{ .Values.sftpConfigs }}
TFV_TOPIC_NAME: {{ .Values.tfvTopicName }}
TFV_REPORTING_TOPIC_NAME: {{ .Values.tfvReportingTopicName }}
IMPORT_API_URL: {{ .Values.importApiUrl }}
DRUPAL_API_URL: {{ .Values.drupalApiUrl }}
TOPIC_CONFIGS: {{ .Values.topicConfigs }}
......
......@@ -19,3 +19,6 @@ drupalApiCredentials: placeholder
sftpConfigs: placeholder
kafkaConfigs: placeholder
importApiConfig: placeholder
tfvReportingTopicName: placeholder
tfvTopicName: placeholder
......@@ -45,6 +45,10 @@ def create_app(test_config=None):
app.config['sftp_port'] = os.environ['SFTP_PORT']
app.config['sftp_user'] = os.environ['SFTP_USER']
app.config['sftp_password'] = os.environ['SFTP_PASSWORD']
app.config['tfv-kafka-configs'] = os.environ['TFV_KAFKA_SERVER_CONFIGS']
app.config['tfv-sftp-configs'] = os.environ['TFV_SFTP_CONFIGS']
app.config['tfv-topic-name'] = os.environ['TFV_TOPIC_NAME']
app.config['tfv-reporting-topic-name'] = os.environ['TFV_REPORTING_TOPIC_NAME']
app.config['SWAGGER'] = {
'title': 'Memobase Import API',
......
......@@ -6,7 +6,7 @@ GITLAB_REGISTRY="cr.gitlab.switch.ch"
TFV_REGISTRY=cr.gitlab.switch.ch/memoriav/memobase-2020/services/import-process/text-file-validation
TFV_CHART_VERSION="1.0.18-chart"
TFV_CHART_VERSION="1.0.19-chart"
helm chart pull ${TFV_REGISTRY}:${TFV_CHART_VERSION}
helm chart export ${TFV_REGISTRY}:${TFV_CHART_VERSION} -d charts/
......@@ -13,7 +13,6 @@ class ImportProcessStart(Resource):
# @swag.validate('job-parameters')
@swag_from('ImportProcessStart.yml')
def post(self, institution_id, record_set_id):
# get parameters of request-body
parser = reqparse.RequestParser()
parser.add_argument('job-parameters', type=dict)
......@@ -43,16 +42,18 @@ class ImportProcessStart(Resource):
)
# start text-file-validation
shortSessionId = hashlib.sha1(job_parameters['sessionId'].encode("UTF-8")).hexdigest()[:10]
body = {
'drupalJobUuid': job_parameters['drupalJobUuid'],
'drupalJobLogResultUuid': job_parameters['drupalJobLogResultUuid'],
'recordSetId': job_parameters['recordSetId'],
'sessionId': job_parameters['sessionId'],
'shortSessionId': shortSessionId,
'institutionId': job_parameters['institutionId'],
'isPublished': job_parameters['isPublished']
}
short_session_id = hashlib.sha1(job_parameters['sessionId'].encode("UTF-8")).hexdigest()[
:10]
body = {'drupalJobUuid': job_parameters['drupalJobUuid'],
'drupalJobLogResultUuid': job_parameters['drupalJobLogResultUuid'],
'recordSetId': job_parameters['recordSetId'],
'sessionId': job_parameters['sessionId'], 'shortSessionId': short_session_id,
'institutionId': job_parameters['institutionId'],
'isPublished': job_parameters['isPublished'],
'kafkaConfigs': current_app.config['tfv-kafka-configs'],
'sftpConfigs': current_app.config['tfv-sftp-configs'],
'topicName': current_app.config['tfv-topic-name'],
'reportingTopicName': current_app.config['tfv-reporting-topic-name']}
if 'xmlRecordTag' in job_parameters:
body['xmlRecordTag'] = job_parameters['xmlRecordTag']
......@@ -70,7 +71,7 @@ class ImportProcessStart(Resource):
helm = Helm()
response = helm.install(
chart=os.path.join(current_app.root_path, "charts", 'text-file-validation'),
name=shortSessionId + '-validation',
name=short_session_id + '-' + record_set_id + '-validation',
namespace=current_app.config['NAMESPACE'],
set_values=body,
fail_on_err=False
......
Markdown is supported
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