Commit 476d5beb authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Added git hash to processing metadata of calculations. #135

parent 35351df9
Pipeline #46209 failed with stages
in 15 minutes and 49 seconds
#!/bin/sh #!/bin/sh
echo log, ref, version = \'$(git log -1 --oneline)\', \'$(git describe --all)\', \'$(git describe)\' > nomad/gitinfo.py echo log, ref, version, commit = \'$(git log -1 --oneline)\', \'$(git describe --all)\', \'$(git describe)\', \'$(git rev-parse --verify HEAD)\' > nomad/gitinfo.py
\ No newline at end of file \ No newline at end of file
...@@ -21,6 +21,8 @@ import warnings ...@@ -21,6 +21,8 @@ import warnings
warnings.filterwarnings("ignore", message="numpy.dtype size changed") warnings.filterwarnings("ignore", message="numpy.dtype size changed")
warnings.filterwarnings("ignore", message="numpy.ufunc size changed") warnings.filterwarnings("ignore", message="numpy.ufunc size changed")
from nomad import gitinfo
class NomadConfig(dict): class NomadConfig(dict):
""" """
...@@ -164,6 +166,7 @@ client = NomadConfig( ...@@ -164,6 +166,7 @@ client = NomadConfig(
) )
version = '0.4.4' version = '0.4.4'
commit = gitinfo.commit
release = 'devel' release = 'devel'
domain = 'DFT' domain = 'DFT'
service = 'unknown nomad service' service = 'unknown nomad service'
......
...@@ -89,6 +89,7 @@ class CalcWithMetadata(): ...@@ -89,6 +89,7 @@ class CalcWithMetadata():
self.processed: bool = False self.processed: bool = False
self.last_processing: datetime.datetime = None self.last_processing: datetime.datetime = None
self.nomad_version: str = None self.nomad_version: str = None
self.nomad_commit: str = None
# user metadata, i.e. quantities given and editable by the user # user metadata, i.e. quantities given and editable by the user
self.with_embargo: bool = None self.with_embargo: bool = None
......
...@@ -155,6 +155,7 @@ class Calc(Proc): ...@@ -155,6 +155,7 @@ class Calc(Proc):
calc_with_metadata.published = False calc_with_metadata.published = False
calc_with_metadata.uploader = self.upload.uploader.to_popo() calc_with_metadata.uploader = self.upload.uploader.to_popo()
calc_with_metadata.nomad_version = config.version calc_with_metadata.nomad_version = config.version
calc_with_metadata.nomad_commit = config.commit
calc_with_metadata.last_processing = datetime.now() calc_with_metadata.last_processing = datetime.now()
calc_with_metadata.files = self.upload_files.calc_files(self.mainfile) calc_with_metadata.files = self.upload_files.calc_files(self.mainfile)
self.metadata = calc_with_metadata.to_dict() self.metadata = calc_with_metadata.to_dict()
......
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