Skip to content
Snippets Groups Projects
Commit c933d153 authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Fixed publish bugs.

parent f717e648
No related branches found
No related tags found
1 merge request!33Merge version 0.4.0
......@@ -116,12 +116,9 @@ def upload(paths: list, create_packages, local: bool, parallel: int):
logger.info('migrated upload with result', upload_path=path, **report)
task.put([
('uploads: {:7d}', 1),
('packages: {:7d}', report.packages),
('total_source_calcs: {:7d}', report.total_source_calcs),
('total_calcs: {:7d}', report.total_calcs),
('failed_calcs: {:7d}', report.failed_calcs),
('uploads: {:5d}', 1),
('migrated_calcs: {:7d}', report.migrated_calcs),
('failed_calcs: {:7d}', report.failed_calcs),
('calcs_with_diffs: {:7d}', report.calcs_with_diffs),
('new_calcs: {:7d}', report.new_calcs),
('missing_calcs: {:7d}', report.missing_calcs)])
......
......@@ -262,12 +262,11 @@ class Calc(Base):
if dataset.doi is not None:
self._add_citation(coe_dataset_calc, dataset.doi['value'], 'INTERNAL', context)
# cause a flush to avoid future inconsistencies
# repo_db.flush()
# cause a flush to create the backdirection of the above established
# metadata-dataset_calc relation
repo_db.flush()
self.parents.append(coe_dataset_calc)
# coe_dataset_rel = CalcSet(parent_calc_id=dataset_id, children_calc_id=self.coe_calc_id)
# repo_db.add(coe_dataset_rel)
dataset.update(DataSet(coe_dataset_calc).to_popo())
......@@ -377,8 +376,7 @@ class DataSet:
return self._dataset_calc.calc_metadata.chemical_formula
def to_popo(self):
popo = utils.POPO(id=self.id, name=self.name)
if self.doi is not None:
popo.update(doi=self.doi.to_popo())
return popo
return utils.POPO(
id=self.id,
name=self.name,
doi=self.doi.to_popo() if self.doi is not None else None)
......@@ -147,7 +147,7 @@ class Upload(Base): # type: ignore
checksum=calc.calc_id,
upload=coe_upload)
repo_db.add(coe_calc)
repo_db.flush() # to avoid missing calc parent key constraint violation
coe_calc.apply_calc_with_metadata(calc, context=context)
logger.debug('added calculation, not yet committed', calc_id=coe_calc.calc_id)
......
......@@ -2,3 +2,12 @@ export NOMAD_URL=http://enc-staging-nomad.esc.rzg.mpg.de/fairdi/nomad/migration/
export NOMAD_USER=admin
export NOMAD_FILES_NOMAD_TMP_DIR=/nomad/mscheidg/migration_tmp
export NOMAD_LOGSTASH_TCPPORT=15000
export NOMAD_FILES_TMP_DIR=/scratch/nomad-fair/local/tmp
export NOMAD_FILES_OBJECT_DIR=/scratch/nomad-fair/local/objects
export NOMAD_FILES_NOMAD_TMP=/nomad/mscheidg/migration_tmp
export NOMAD_ELASTIC_PORT=19200
export NOMAD_ELASTIC_INDEX_NAME=fairdi_nomad_local
export NOMAD_MONGO_PORT=37017
export NOMAD_MONGO_DB_NAME=fairdi_nomad_local
export NOMAD_COE_REPO_DB_NAME=fairdi_nomad_local
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment